@@ -5,7 +5,7 @@ on: # Trigger the workflow on push or pull request, but only for the master bra
55 push :
66 branches : [master, "release/*"] # include release branches like release/1.0.x
77 release :
8- types : [created, "release/*" ]
8+ types : [created]
99
1010
1111jobs :
6161 with :
6262 user : __token__
6363 password : ${{ secrets.pypi_password }}
64+
65+ # Note: This uses an internal pip API and may not always work
66+ # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
67+ - name : Cache pip
68+ uses : actions/cache@v2
69+ with :
70+ path : ~/.cache/pip
71+ key : ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
72+ restore-keys : ${{ runner.os }}-pip-
73+
74+ - name : Install dependencies
75+ run : |
76+ pip install -r requirements.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --quiet
77+ pip install virtualenv
78+ pip install awscli
79+
80+ - name : Configure AWS credentials
81+ uses : aws-actions/configure-aws-credentials@v1
82+ with :
83+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
84+ aws-secret-access-key : ${{ secrets.AWS_SECRET_KEY_ID }}
85+ aws-region : us-east-1
86+
87+ - name : Pull files from S3
88+ run : |
89+ aws s3 cp --recursive s3://pl-public-data/legacy/checkpoints/ legacy/checkpoints/ # --acl public-read
90+ ls -l legacy/checkpoints/
91+
92+ - name : Generate checkpoint
93+ if : startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
94+ run : |
95+ virtualenv vEnv --system-site-packages
96+ source vEnv/bin/activate
97+ pip install dist/*
98+
99+ pl_ver=$(python -c "import pytorch_lightning as pl ; print(pl.__version__)" 2>&1)
100+ # generate checkpoint to this version
101+ bash legacy/generate_checkpoints.sh $pl_ver
102+
103+ deactivate
104+ rm -rf vEnv
105+
106+ - name : Push files to S3
107+ run : |
108+ aws s3 sync legacy/checkpoints/ s3://pl-public-data/legacy/checkpoints/
109+ cd legacy
110+ zip -r checkpoints.zip checkpoints
111+ aws s3 cp checkpoints.zip s3://pl-public-data/legacy/ --acl public-read
0 commit comments