Skip to content

Commit

Permalink
Switch nightly binaries to oidc. Remove aws keys (pytorch#117416)
Browse files Browse the repository at this point in the history
  • Loading branch information
atalman authored and pytorchmergebot committed Jan 13, 2024
1 parent 22ddf91 commit 96163eb
Show file tree
Hide file tree
Showing 21 changed files with 381 additions and 246 deletions.
1 change: 1 addition & 0 deletions .github/templates/linux_binary_build_workflow.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
name: !{{ build_environment }}
{%- endblock %}


on:
push:
{%- if branches == "nightly" %}
Expand Down
5 changes: 3 additions & 2 deletions .github/templates/upload.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
{%- macro upload_binaries(config, is_windows=False, has_test=True, use_s3=True) -%}
!{{ config["build_name"] }}-upload: # Uploading
if: ${{ github.repository_owner == 'pytorch' }}
permissions:
id-token: write
contents: read
{%- if has_test %}
needs: !{{ config["build_name"] }}-test
{%- else %}
Expand All @@ -65,8 +68,6 @@
{%- endif %}
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
aws-pytorch-uploader-access-key-id: ${{ secrets.AWS_PYTORCH_UPLOADER_ACCESS_KEY_ID }}
aws-pytorch-uploader-secret-access-key: ${{ secrets.AWS_PYTORCH_UPLOADER_SECRET_ACCESS_KEY }}
conda-pytorchbot-token: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
conda-pytorchbot-token-test: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }}
uses: ./.github/workflows/_binary-upload.yml
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/_binary-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,13 @@ on:
github-token:
required: true
description: Github Token
aws-pytorch-uploader-access-key-id:
required: true
description: AWS access key id
aws-pytorch-uploader-secret-access-key:
required: true
description: AWS secret access key
conda-pytorchbot-token:
required: true
description: Conda PyTorchBot token
conda-pytorchbot-token-test:
required: true
description: Conda PyTorchBot token

jobs:
upload:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -104,6 +99,20 @@ jobs:
with:
no-sudo: true

- name: Configure AWS credentials(PyTorch account) for nightly
if: ${{ github.event_name == 'push' && 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) for RC builds
if: ${{ github.event_name == 'push' && (startsWith(github.event.ref, 'refs/tags/') && !startsWith(github.event.ref, 'refs/tags/ciflow/')) }}
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: Download Build Artifacts
id: download-artifacts
# NB: When the previous build job is skipped, there won't be any artifacts and
Expand Down Expand Up @@ -135,8 +144,6 @@ jobs:
PKG_DIR: "${{ runner.temp }}/artifacts"
UPLOAD_SUBFOLDER: "${{ env.DESIRED_CUDA }}"
# When running these on pull_request events these should be blank
AWS_ACCESS_KEY_ID: ${{ secrets.aws-pytorch-uploader-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws-pytorch-uploader-secret-access-key }}
CONDA_PYTORCHBOT_TOKEN: ${{ secrets.conda-pytorchbot-token }}
CONDA_PYTORCHBOT_TOKEN_TEST: ${{ secrets.conda-pytorchbot-token-test }}
BUILD_NAME: ${{ inputs.build_name }}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 96163eb

Please sign in to comment.