Skip to content

Commit 4762e30

Browse files
Bordalantiga
authored andcommitted
fix uploading created legacy ckpts (#17840)
(cherry picked from commit ff52ed5)
1 parent 1545c7d commit 4762e30

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.github/workflows/_legacy-checkpoints.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ on:
3030
default: ''
3131
required: false
3232
type: string
33+
upload_local:
34+
description: 'When releasing, it installs local but need to upload with the actual version tag.'
35+
default: false
36+
required: false
37+
type: boolean
3338
create_pr:
3439
description: 'Create a PR to enable testing PL with a new checkpoint.'
3540
default: false
@@ -92,8 +97,12 @@ jobs:
9297
- name: Generate checkpoints
9398
working-directory: ${{ env.legacy_dir }}
9499
run: bash generate_checkpoints.sh ${{ inputs.pl_version }}
100+
- name: Rename local to actual version
101+
if: inputs.upload_local
102+
working-directory: ${{ env.legacy_dir }}
103+
run: mv checkpoints/local checkpoints/${{ steps.decide-version.outputs.pl-version }}
95104

96-
- name: Keep artifact & DryRun
105+
- name: "Determine: Keep artifact & DryRun"
97106
run: |
98107
python -c "print('KEEP_DAYS=' + str(30 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_ENV
99108
python -c "print('AWS_RUN=' + str('' if '${{inputs.push_to_s3}}' == 'true' else '--dryrun'))" >> $GITHUB_ENV

.github/workflows/release-pypi.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PyPI
1+
name: Releasing
22

33
# https://help.github.com/en/actions/reference/events-that-trigger-workflows
44
on:
@@ -188,5 +188,6 @@ jobs:
188188
uses: ./.github/workflows/_legacy-checkpoints.yml
189189
with:
190190
push_to_s3: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' }}
191+
upload_local: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' }}
191192
create_pr: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' }}
192193
secrets: inherit

tests/legacy/generate_checkpoints.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function create_and_save_checkpoint {
2929
# iterate over all arguments assuming that each argument is version
3030
for pl_ver in "$@"
3131
do
32-
printf "processing version: $pl_ver"
32+
printf "\n\n processing version: $pl_ver\n"
3333

3434
# Don't install/update anything before activating venv to avoid breaking any existing environment.
3535
python -m venv $ENV_PATH
@@ -46,7 +46,7 @@ done
4646

4747
# use the PL installed in the environment if no PL version is specified
4848
if [[ -z "$@" ]]; then
49-
printf "processing local version"
49+
printf "\n\n processing local version\n"
5050

5151
python -m pip install -r $LEGACY_PATH/requirements.txt
5252
pl_ver="local"

0 commit comments

Comments
 (0)