Skip to content

Commit 3edff75

Browse files
authored
Rewrite aws configure credentials without the using aws-actions/configure-aws-credentials. Use actions/checkout@v4 for manylinx 2.28 builds (#5968)
Test PR: #5961 Should resolve issue with torchao: https://github.com/pytorch/ao/actions/runs/11964124387
1 parent f60bd2e commit 3edff75

File tree

3 files changed

+38
-9
lines changed

3 files changed

+38
-9
lines changed

.github/actions/binary-upload/action.yml

+28-9
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,39 @@ inputs:
1515
runs:
1616
using: composite
1717
steps:
18+
1819
- name: Configure aws credentials (pytorch account)
1920
if: ${{ inputs.trigger-event == 'schedule' || (inputs.trigger-event == 'push' && startsWith(github.event.ref, 'refs/heads/nightly')) }}
20-
uses: aws-actions/configure-aws-credentials@v3
21-
with:
22-
role-to-assume: arn:aws:iam::749337293305:role/gha_workflow_nightly_build_wheels
23-
aws-region: us-east-1
21+
env:
22+
AWS_WEB_IDENTITY_TOKEN_FILE: aws.web.identity.token.file
23+
AWS_DEFAULT_REGION: us-east-1
24+
AWS_ROLE_ARN: arn:aws:iam::749337293305:role/gha_workflow_nightly_build_wheels
25+
shell: bash
26+
run: |
27+
set -euxo pipefail
28+
pip install awscli==1.32.18
29+
yum install -y jq
30+
sleep 3 # Need to have a delay to acquire this
31+
curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
32+
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=sts.amazonaws.com" \
33+
| jq -r '.value' > "${AWS_WEB_IDENTITY_TOKEN_FILE}"
2434
2535
- name: Configure aws credentials (pytorch account)
2636
if: ${{ env.CHANNEL == 'test' && startsWith(github.event.ref, 'refs/tags/v') }}
27-
uses: aws-actions/configure-aws-credentials@v3
28-
with:
29-
role-to-assume: arn:aws:iam::749337293305:role/gha_workflow_test_build_wheels
30-
aws-region: us-east-1
37+
env:
38+
AWS_WEB_IDENTITY_TOKEN_FILE: aws.web.identity.token.file
39+
AWS_DEFAULT_REGION: us-east-1
40+
AWS_ROLE_ARN: arn:aws:iam::749337293305:role/gha_workflow_test_build_wheels
41+
shell: bash
42+
run: |
43+
set -euxo pipefail
44+
pip install awscli==1.32.18
45+
yum install -y jq
46+
sleep 3 # Need to have a delay to acquire this
47+
curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
48+
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=sts.amazonaws.com" \
49+
| jq -r '.value' > "${AWS_WEB_IDENTITY_TOKEN_FILE}"
50+
3151
3252
- name: Nightly or release RC
3353
if: ${{ inputs.trigger-event == 'schedule' || (inputs.trigger-event == 'push' && startsWith(github.event.ref, 'refs/heads/nightly')) || (env.CHANNEL == 'test' && startsWith(github.event.ref, 'refs/tags/')) }}
@@ -44,7 +64,6 @@ runs:
4464
4565
# shellcheck disable=SC1090
4666
source "${BUILD_ENV_FILE}"
47-
4867
pip install awscli==1.32.18
4968
5069
AWS_CMD="aws s3 cp --dryrun"

.github/workflows/build_wheels_linux.yml

+9
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,16 @@ jobs:
144144
fi
145145
echo "::endgroup::"
146146
147+
- uses: actions/checkout@v4
148+
if: ${{ env.IS_MANYLINUX2_28 == 'true' }}
149+
with:
150+
# Support the use case where we need to checkout someone's fork
151+
repository: ${{ inputs.test-infra-repository }}
152+
ref: ${{ inputs.test-infra-ref }}
153+
path: test-infra
154+
147155
- uses: atalman/checkout-action@main
156+
if: ${{ env.IS_MANYLINUX2_28 == 'false' }}
148157
with:
149158
repository: ${{ inputs.test-infra-repository }}
150159
ref: ${{ inputs.test-infra-ref }}

.github/workflows/test_build_wheels_linux_with_cuda.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
paths:
66
- .github/actions/setup-binary-builds/action.yml
7+
- .github/actions/binary-upload/action.yml
78
- .github/workflows/test_build_wheels_linux.yml
89
- .github/workflows/build_wheels_linux.yml
910
- .github/workflows/generate_binary_build_matrix.yml

0 commit comments

Comments
 (0)