From c693adb893fae4f3d5b836f045889d2d9438b242 Mon Sep 17 00:00:00 2001 From: Jirka Date: Thu, 15 Jun 2023 15:13:41 +0200 Subject: [PATCH] fix uploading created legacy ckpts --- .github/workflows/_legacy-checkpoints.yml | 11 ++++++++++- .github/workflows/release-pypi.yml | 3 ++- tests/legacy/generate_checkpoints.sh | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/_legacy-checkpoints.yml b/.github/workflows/_legacy-checkpoints.yml index 93d06894ecbde..eecea11248535 100644 --- a/.github/workflows/_legacy-checkpoints.yml +++ b/.github/workflows/_legacy-checkpoints.yml @@ -30,6 +30,11 @@ on: default: '' required: false type: string + upload_local: + description: 'When releasing, it installs local but need to upload with the actual version tag.' + default: false + required: false + type: boolean create_pr: description: 'Create a PR to enable testing PL with a new checkpoint.' default: false @@ -92,8 +97,12 @@ jobs: - name: Generate checkpoints working-directory: ${{ env.legacy_dir }} run: bash generate_checkpoints.sh ${{ inputs.pl_version }} + - name: Rename local to actual version + if: inputs.upload_local + working-directory: ${{ env.legacy_dir }} + run: mv checkpoints/local checkpoints/${{ steps.decide-version.outputs.pl-version }} - - name: Keep artifact & DryRun + - name: "Determine: Keep artifact & DryRun" run: | python -c "print('KEEP_DAYS=' + str(30 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_ENV python -c "print('AWS_RUN=' + str('' if '${{inputs.push_to_s3}}' == 'true' else '--dryrun'))" >> $GITHUB_ENV diff --git a/.github/workflows/release-pypi.yml b/.github/workflows/release-pypi.yml index 8455d81eed9ad..25af1a33241fb 100644 --- a/.github/workflows/release-pypi.yml +++ b/.github/workflows/release-pypi.yml @@ -1,4 +1,4 @@ -name: PyPI +name: Releasing # https://help.github.com/en/actions/reference/events-that-trigger-workflows on: @@ -188,5 +188,6 @@ jobs: uses: ./.github/workflows/_legacy-checkpoints.yml with: push_to_s3: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' }} + upload_local: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' }} create_pr: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' }} secrets: inherit diff --git a/tests/legacy/generate_checkpoints.sh b/tests/legacy/generate_checkpoints.sh index 3091d7948fca8..fcbfcf8a50c7f 100644 --- a/tests/legacy/generate_checkpoints.sh +++ b/tests/legacy/generate_checkpoints.sh @@ -29,7 +29,7 @@ function create_and_save_checkpoint { # iterate over all arguments assuming that each argument is version for pl_ver in "$@" do - printf "processing version: $pl_ver" + printf "\n\n processing version: $pl_ver\n" # Don't install/update anything before activating venv to avoid breaking any existing environment. python -m venv $ENV_PATH @@ -46,7 +46,7 @@ done # use the PL installed in the environment if no PL version is specified if [[ -z "$@" ]]; then - printf "processing local version" + printf "\n\n processing local version\n" python -m pip install -r $LEGACY_PATH/requirements.txt pl_ver="local"