pipeline release CI (#5494)
* pipeline release CI * trigger * trigger * . * t1 * t2 * t1 * t2
This commit is contained in:
parent
0ff4c56d9b
commit
c27d4d2d9c
|
@ -10,9 +10,8 @@ on: # Trigger the workflow on push or pull request, but only for the master bra
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# based on https://github.com/pypa/gh-action-pypi-publish
|
# based on https://github.com/pypa/gh-action-pypi-publish
|
||||||
build-publish:
|
build-package:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v2
|
||||||
|
@ -28,6 +27,16 @@ jobs:
|
||||||
python setup.py sdist bdist_wheel
|
python setup.py sdist bdist_wheel
|
||||||
ls -lh dist/
|
ls -lh dist/
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: pypi-packages
|
||||||
|
path: dist
|
||||||
|
|
||||||
|
publish-package:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
needs: build-package
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
- name: Upload to release
|
- name: Upload to release
|
||||||
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
|
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
@ -62,6 +71,14 @@ jobs:
|
||||||
user: __token__
|
user: __token__
|
||||||
password: ${{ secrets.pypi_password }}
|
password: ${{ secrets.pypi_password }}
|
||||||
|
|
||||||
|
create-legacy-ckpt:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
needs: [build-package, publish-package]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.7
|
||||||
# Note: This uses an internal pip API and may not always work
|
# Note: This uses an internal pip API and may not always work
|
||||||
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
|
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
|
||||||
- name: Cache pip
|
- name: Cache pip
|
||||||
|
@ -74,7 +91,6 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install -r requirements.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --quiet
|
pip install -r requirements.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --quiet
|
||||||
pip install virtualenv
|
|
||||||
pip install awscli
|
pip install awscli
|
||||||
|
|
||||||
- name: Configure AWS credentials
|
- name: Configure AWS credentials
|
||||||
|
@ -84,25 +100,26 @@ jobs:
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_ID }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_ID }}
|
||||||
aws-region: us-east-1
|
aws-region: us-east-1
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: pypi-packages
|
||||||
|
path: dist
|
||||||
|
|
||||||
- name: Pull files from S3
|
- name: Pull files from S3
|
||||||
run: |
|
run: |
|
||||||
aws s3 cp --recursive s3://pl-public-data/legacy/checkpoints/ legacy/checkpoints/ # --acl public-read
|
aws s3 cp --recursive s3://pl-public-data/legacy/checkpoints/ legacy/checkpoints/ # --acl public-read
|
||||||
ls -l legacy/checkpoints/
|
ls -l legacy/checkpoints/
|
||||||
|
|
||||||
- name: Generate checkpoint
|
- name: Generate checkpoint
|
||||||
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
|
# if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
|
||||||
run: |
|
run: |
|
||||||
virtualenv vEnv --system-site-packages
|
ls -lh dist/
|
||||||
source vEnv/bin/activate
|
|
||||||
pip install dist/*.whl
|
pip install dist/*.whl
|
||||||
|
|
||||||
pl_ver=$(python -c "import pytorch_lightning as pl ; print(pl.__version__)" 2>&1)
|
pl_ver=$(python -c "import pytorch_lightning as pl ; print(pl.__version__)" 2>&1)
|
||||||
# generate checkpoint to this version
|
# generate checkpoint to this version
|
||||||
bash legacy/generate_checkpoints.sh $pl_ver
|
bash legacy/generate_checkpoints.sh $pl_ver
|
||||||
|
|
||||||
deactivate
|
|
||||||
rm -rf vEnv
|
|
||||||
|
|
||||||
- name: Push files to S3
|
- name: Push files to S3
|
||||||
run: |
|
run: |
|
||||||
aws s3 sync legacy/checkpoints/ s3://pl-public-data/legacy/checkpoints/
|
aws s3 sync legacy/checkpoints/ s3://pl-public-data/legacy/checkpoints/
|
||||||
|
|
Loading…
Reference in New Issue