Refactor release only changes to two step execution (#121728)

Refactor release only changes to two step execution.

1. Step ``tag-docker-images.sh`` . Tags latest docker images for current release. This step takes about 30min to complete. This step may fail due to space issues on the local host or http connection when pulling image. Hence should be rerun if failed.

2. Apply release only changes ``apply-release-changes.sh`` prepares a PR with release only changes.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/121728
Approved by: https://github.com/jeanschmidt
This commit is contained in:
atalman
2024-03-12 17:22:22 +00:00
committed by PyTorch MergeBot
parent 4e63d9065a
commit 00a53b58dd
2 changed files with 35 additions and 7 deletions

View File

@ -1,17 +1,21 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# Step 2 after branch cut is complete.
#
# Creates PR with release only changes.
#
# Prerequisite: Must be successfully authenticated in aws fbossci account.
#
# Usage (run from root of project): # Usage (run from root of project):
# DRY_RUN=disabled RELEASE_VERSION=2.2 ./scripts/release/apply-release-changes.sh # DRY_RUN=disabled ./scripts/release/apply-release-changes.sh
# #
# RELEASE_VERSION: Version of this current release # RELEASE_VERSION: Version of this current release
set -eou pipefail set -eou pipefail
# Create and Check out to Release Branch GIT_TOP_DIR=$(git rev-parse --show-toplevel)
# git checkout -b "${RELEASE_BRANCH}" RELEASE_VERSION=${RELEASE_VERSION:-$(cut -d'.' -f1-2 "${GIT_TOP_DIR}/version.txt")}
DRY_RUN=${DRY_RUN:-enabled} DRY_RUN=${DRY_RUN:-enabled}
python3 .github/scripts/tag_docker_images_for_release.py --version ${RELEASE_VERSION} --dry-run ${DRY_RUN}
# Change all GitHub Actions to reference the test-infra release branch # Change all GitHub Actions to reference the test-infra release branch
# as opposed to main. # as opposed to main.
@ -49,5 +53,5 @@ sed -i -e s#disabled-jobs.json#"disabled-jobs.json?versionId=${DISABLED_VER}"# .
sed -i -e s#slow-tests.json#"slow-tests.json?versionId=${SLOW_VER}"# tools/stats/import_test_stats.py sed -i -e s#slow-tests.json#"slow-tests.json?versionId=${SLOW_VER}"# tools/stats/import_test_stats.py
sed -i -e s#disabled-tests-condensed.json#"disabled-tests-condensed.json?versionId=${DISABLED_TESTS_VER}"# tools/stats/import_test_stats.py sed -i -e s#disabled-tests-condensed.json#"disabled-tests-condensed.json?versionId=${DISABLED_TESTS_VER}"# tools/stats/import_test_stats.py
# Optional # Optional
# git commit -m "[RELEASE-ONLY CHANGES] Branch Cut for Release {RELEASE_VERSION}" git commit -m "[RELEASE-ONLY CHANGES] Branch Cut for Release {RELEASE_VERSION}"
# git push origin "${RELEASE_BRANCH}" git push origin "${RELEASE_BRANCH}"

View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
#
# Step 1 after branch cut is complete.
#
# Tags latest docker images for release branch.
# In case of failure. The script can be rerun.
#
# Before executing this script do:
# 1. Create and Check out to Release Branch
# git checkout -b "${RELEASE_BRANCH}"
# 2. Update submodules
# git submodule update --init --recursive
#
# Usage (run from root of project):
# DRY_RUN=disabled ./scripts/release/tag_docker_images.sh
#
set -eou pipefail
GIT_TOP_DIR=$(git rev-parse --show-toplevel)
RELEASE_VERSION=${RELEASE_VERSION:-$(cut -d'.' -f1-2 "${GIT_TOP_DIR}/version.txt")}
DRY_RUN=${DRY_RUN:-enabled}
python3 .github/scripts/tag_docker_images_for_release.py --version ${RELEASE_VERSION} --dry-run ${DRY_RUN}