Skip to content

Commit 3c5a8a8

Browse files
authored
Decouple pulling legacy checkpoints from existing GHA workflows and docker files (Lightning-AI#13185)
* Add pull-legacy-checkpoints action * Replace pulls with the new action and script * Simplify
1 parent de4ab1c commit 3c5a8a8

File tree

7 files changed

+17
-27
lines changed

7 files changed

+17
-27
lines changed

.actions/pull_legacy_checkpoints.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
# Run this script from the project root.
3+
URL="https://pl-public-data.s3.amazonaws.com/legacy/checkpoints.zip"
4+
mkdir -p legacy
5+
# wget is simpler but does not work on Windows
6+
python -c "from urllib.request import urlretrieve; urlretrieve('$URL', 'legacy/checkpoints.zip')"
7+
ls -l legacy/
8+
unzip -o legacy/checkpoints.zip -d legacy/
9+
ls -l legacy/checkpoints/

.azure-pipelines/gpu-tests.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ jobs:
6969
python requirements/check-avail-extras.py
7070
displayName: 'Env details'
7171
72-
- bash: |
73-
wget https://pl-public-data.s3.amazonaws.com/legacy/checkpoints.zip -P legacy/
74-
unzip -o legacy/checkpoints.zip -d legacy/
75-
ls -l legacy/checkpoints/
72+
- bash: bash .actions/pull_legacy_checkpoints.sh
7673
displayName: 'Get legacy checkpoints'
7774

7875
- bash: |

.github/workflows/ci_test-conda.yml

+2-7
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,8 @@ jobs:
5555
# sanity check
5656
python requirements/check-avail-extras.py
5757
58-
- name: Pull checkpoints from S3
59-
working-directory: ./legacy
60-
run: |
61-
# enter legacy and update checkpoints from S3
62-
curl https://pl-public-data.s3.amazonaws.com/legacy/checkpoints.zip --output checkpoints.zip
63-
unzip -o checkpoints.zip
64-
ls -l checkpoints/
58+
- name: Pull legacy checkpoints
59+
run: bash .actions/pull_legacy_checkpoints.sh
6560

6661
- name: Tests
6762
run: |

.github/workflows/ci_test-full.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,8 @@ jobs:
7676
restore-keys: |
7777
${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}-py${{ matrix.python-version }}-${{ matrix.release }}-${{ matrix.requires }}-
7878
79-
- name: Pull checkpoints from S3
80-
working-directory: ./legacy
81-
run: |
82-
# wget is simpler but does not work on Windows
83-
python -c "from urllib.request import urlretrieve ; urlretrieve('https://pl-public-data.s3.amazonaws.com/legacy/checkpoints.zip', 'checkpoints.zip')"
84-
ls -l .
85-
unzip -o checkpoints.zip
86-
ls -l checkpoints/
79+
- name: Pull legacy checkpoints
80+
run: bash .actions/pull_legacy_checkpoints.sh
8781

8882
- name: Install dependencies
8983
run: |

dockers/tpu-tests/Dockerfile

+1-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ LABEL maintainer="PyTorchLightning <https://github.com/PyTorchLightning>"
2222
COPY ./ ./pytorch-lightning/
2323

2424
# Pull the legacy checkpoints
25-
RUN cd pytorch-lightning && \
26-
wget https://pl-public-data.s3.amazonaws.com/legacy/checkpoints.zip -P legacy/ && \
27-
unzip -o legacy/checkpoints.zip -d legacy/ && \
28-
ls -l legacy/checkpoints/
25+
RUN cd pytorch-lightning && bash .actions/pull_legacy_checkpoints.sh
2926

3027
RUN \
3128
pip install -q fire && \

legacy/README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ At this moment we focus on ability running old checkpoints, so the flow here is
77
If you want to pull all saved version-checkpoints for local testing/development, call
88

99
```bash
10-
wget https://pl-public-data.s3.amazonaws.com/legacy/checkpoints.zip
11-
unzip -o checkpoints.zip
10+
bash .actions/pull_legacy_checkpoints.sh
1211
```
1312

1413
To back populate collection with past version you can use following bash:

tests/README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ pre-commit install
2222
Additionally, for testing backward compatibility with older versions of PyTorch Lightning, you also need to download all saved version-checkpoints from the public AWS storage. Run the following script to get all saved version-checkpoints:
2323

2424
```bash
25-
wget https://pl-public-data.s3.amazonaws.com/legacy/checkpoints.zip -P legacy/
26-
unzip -o legacy/checkpoints.zip -d legacy/
25+
bash .actions/pull_legacy_checkpoints.sh
2726
```
2827

2928
Note: These checkpoints are generated to set baselines for maintaining backward compatibility with legacy versions of PyTorch Lightning. Details of checkpoints for back-compatibility can be found [here](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/legacy/README.md).

0 commit comments

Comments
 (0)