diff --git a/.github/scripts/tag_docker_images_for_release.py b/.github/scripts/tag_docker_images_for_release.py deleted file mode 100644 index b2bf474575f6..000000000000 --- a/.github/scripts/tag_docker_images_for_release.py +++ /dev/null @@ -1,64 +0,0 @@ -import argparse -import subprocess - -import generate_binary_build_matrix - - -def tag_image( - image: str, - default_tag: str, - release_version: str, - dry_run: str, - tagged_images: dict[str, bool], -) -> None: - if image in tagged_images: - return - release_image = image.replace(f"-{default_tag}", f"-{release_version}") - print(f"Tagging {image} to {release_image} , dry_run: {dry_run}") - - if dry_run == "disabled": - subprocess.check_call(["docker", "pull", image]) - subprocess.check_call(["docker", "tag", image, release_image]) - subprocess.check_call(["docker", "push", release_image]) - tagged_images[image] = True - - -def main() -> None: - parser = argparse.ArgumentParser() - parser.add_argument( - "--version", - help="Version to tag", - type=str, - default="2.2", - ) - parser.add_argument( - "--dry-run", - help="No Runtime Error check", - type=str, - choices=["enabled", "disabled"], - default="enabled", - ) - - options = parser.parse_args() - tagged_images: dict[str, bool] = {} - platform_images = [ - generate_binary_build_matrix.WHEEL_CONTAINER_IMAGES, - generate_binary_build_matrix.LIBTORCH_CONTAINER_IMAGES, - ] - default_tag = generate_binary_build_matrix.DEFAULT_TAG - - for platform_image in platform_images: # type: ignore[attr-defined] - for arch in platform_image.keys(): # type: ignore[attr-defined] - if arch == "cpu-s390x": - continue - tag_image( - platform_image[arch], # type: ignore[index] - default_tag, - options.version, - options.dry_run, - tagged_images, - ) - - -if __name__ == "__main__": - main() diff --git a/scripts/release/README.md b/scripts/release/README.md index 5f35d4e4d771..bc32bd0cb656 100644 --- a/scripts/release/README.md +++ b/scripts/release/README.md @@ -10,8 +10,7 @@ These are a collection of scripts that are to be used for release activities. ### Order of Execution 1. Run cut-release-branch.sh to cut the release branch -2. Run tag-docker-images.sh to tag current docker images with release tag and push them to docker.io. These images will be used to build the release. -3. Run apply-release-changes.sh to apply release only changes to create a PR with release only changes similar to this [PR](https://github.com/pytorch/pytorch/pull/149056) +2. Run apply-release-changes.sh to apply release only changes to create a PR with release only changes similar to this [PR](https://github.com/pytorch/pytorch/pull/149056) #### Promoting packages diff --git a/scripts/release/tag-docker-images.sh b/scripts/release/tag-docker-images.sh deleted file mode 100644 index f2299d6c463e..000000000000 --- a/scripts/release/tag-docker-images.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/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}