Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test aws config #5961

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
53 changes: 18 additions & 35 deletions .github/actions/binary-upload/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,30 @@ inputs:
description: "Trigger Event in caller that determines whether or not to upload"
type: string
default: ''

runs:
using: composite
steps:
- name: Configure aws credentials (pytorch account)
if: ${{ inputs.trigger-event == 'schedule' || (inputs.trigger-event == 'push' && startsWith(github.event.ref, 'refs/heads/nightly')) }}
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::749337293305:role/gha_workflow_nightly_build_wheels
aws-region: us-east-1

- name: Configure aws credentials (pytorch account)
if: ${{ env.CHANNEL == 'test' && startsWith(github.event.ref, 'refs/tags/v') }}
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::749337293305:role/gha_workflow_test_build_wheels
aws-region: us-east-1

- name: Nightly or release RC
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/')) }}
shell: bash
run: |
set -ex
echo "NIGHTLY_OR_TEST=1" >> "${GITHUB_ENV}"

- name: Upload package to pytorch.org
- name: Configure aws credentials and upload
env:
AWS_WEB_IDENTITY_TOKEN_FILE: aws.web.identity.token.file
AWS_DEFAULT_REGION: us-east-1
AWS_ROLE_ARN: arn:aws:iam::308535385114:role/gha_workflow_s3_and_ecr_read_only
shell: bash
working-directory: ${{ inputs.repository }}
run: |
set -ex
set -euxo pipefail

# shellcheck disable=SC1090
source "${BUILD_ENV_FILE}"

# source "${BUILD_ENV_FILE}"
pip install awscli==1.32.18
yum install -y jq
sleep 3 # Need to have a delay to acquire this
echo "ACTIONS_ID_TOKEN_REQUEST_URL: ${ACTIONS_ID_TOKEN_REQUEST_URL}"
curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=sts.amazonaws.com" \
| jq -r '.value' > "${AWS_WEB_IDENTITY_TOKEN_FILE}"
aws sts get-caller-identity
aws s3api get-object --bucket gha-artifacts --key 4.14.336-257.562.amzn2.x86_64.tar.gz


AWS_CMD="aws s3 cp --dryrun"
if [[ "${NIGHTLY_OR_TEST:-0}" == "1" ]]; then
AWS_CMD="aws s3 cp"
fi

for pkg in dist/*; do
${AWS_CMD} "$pkg" "${PYTORCH_S3_BUCKET_PATH}" --acl public-read
done
6 changes: 6 additions & 0 deletions .github/workflows/build_wheels_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ jobs:
ref: ${{ inputs.test-infra-ref }}
path: test-infra

- name: Upload wheel
uses: ./test-infra/.github/actions/binary-upload
with:
repository: ${{ inputs.repository }}
trigger-event: ${{ inputs.trigger-event }}

- name: Install Miniforge
if: ${{ inputs.architecture == 'aarch64' }}
shell: bash -l {0}
Expand Down
Loading