Release ecosystem library from test to production. #89
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release ecosystem library from test to production. | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| dryrun: | |
| required: true | |
| type: choice | |
| default: enabled | |
| options: | |
| - enabled | |
| - disabled | |
| package: | |
| description: "Domain to prepare and release" | |
| required: true | |
| type: choice | |
| default: torchvision | |
| options: | |
| - torchao | |
| - torchtune | |
| - executorch | |
| - torchvision | |
| - torchaudio | |
| - torchcodec | |
| - torchcomms | |
| - torch_tensorrt | |
| - torch_tensorrt_rtx | |
| - torchrec | |
| - fbgemm_gpu | |
| - fbgemm_gpu_genai | |
| - mslk | |
| - flash_attn_3 | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| trigger: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| environment: promote-env | |
| container: | |
| image: pytorch/almalinux-builder:cpu | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Configure aws credentials (pytorch account) | |
| uses: aws-actions/configure-aws-credentials@50ac8dd1e1b10d09dac7b8727528b91bed831ac0 # v3.0.2 | |
| with: | |
| role-to-assume: arn:aws:iam::749337293305:role/gha_workflow_promote_wheels | |
| aws-region: us-east-1 | |
| - name: Promote library to download.pytorch.org | |
| shell: bash | |
| env: | |
| PACKAGE: ${{ inputs.package || 'torchvision' }} | |
| DRY_RUN: ${{ inputs.dryrun || 'enabled' }} | |
| R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }} | |
| R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} | |
| R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} | |
| run: | | |
| set -ex | |
| cd release | |
| # Install requirements | |
| pip install awscli==1.32.18 | |
| pip install -r ../s3_management/requirements.txt | |
| promote_s3() { | |
| local package_name | |
| package_name=$1 | |
| local package_type | |
| package_type=$2 | |
| local promote_version | |
| promote_version=$3 | |
| # shellcheck disable=SC2086 | |
| echo "=-=-=-= Promoting ${package_name}'s v${promote_version} ${package_type} packages' =-=-=-=" | |
| ( | |
| set -x | |
| # shellcheck disable=SC2086 | |
| TEST_PYTORCH_PROMOTE_VERSION="${promote_version}" \ | |
| PACKAGE_NAME="${package_name}" \ | |
| PACKAGE_TYPE="${package_type}" \ | |
| TEST_WITHOUT_GIT_TAG=1 \ | |
| DRY_RUN="${DRY_RUN}" ./promote/s3_to_s3.sh | |
| ) | |
| echo | |
| } | |
| # Init release versions variables | |
| source ./release_versions.sh | |
| # Run promotion | |
| # shellcheck disable=SC2086 | |
| version="${PACKAGE^^}_VERSION" | |
| # do not upload FA3 test wheels with local date suffix | |
| if [[ "${PACKAGE}" == "flash_attn_3" ]]; then | |
| export PACKAGE_INCLUDE_SUFFIX="-*" | |
| fi | |
| # shellcheck disable=SC2086 | |
| promote_s3 ${PACKAGE} whl "${!version}" |