Skip to content

Commit 15110a3

Browse files
authored
Enable linux_job_v2.yml workflow for ROCm (#6104)
Relates to pytorch/ao#999 Needs pytorch/pytorch#143590
1 parent d1728a4 commit 15110a3

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

.github/workflows/linux_job_v2.yml

+31-4
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,24 @@ on:
104104
required: false
105105
default: false
106106
type: boolean
107+
permissions:
108+
id-token: write
109+
contents: read
110+
107111
jobs:
108112
job:
109113
strategy:
110114
fail-fast: false
111115
name: ${{ inputs.job-name }}
112116
env:
113117
DOCKER_IMAGE: >-
114-
${{ inputs.docker-image == 'pytorch/almalinux-builder' && format('pytorch/almalinux-builder:{0}{1}',
118+
${{ inputs.gpu-arch-type == 'rocm' && format('pytorch/manylinux2_28-builder:{0}{1}',
119+
inputs.gpu-arch-type,
120+
inputs.gpu-arch-version)
121+
|| inputs.docker-image == 'pytorch/almalinux-builder' && format('pytorch/almalinux-builder:{0}{1}',
115122
inputs.gpu-arch-type,
116123
inputs.gpu-arch-version)
117-
|| inputs.docker-image }}
124+
|| inputs.docker-image }}
118125
REPOSITORY: ${{ inputs.repository || github.repository }}
119126
# Will be blank outside of this
120127
PR_NUMBER: ${{ github.event.pull_request.number }}
@@ -157,6 +164,11 @@ jobs:
157164

158165
- name: Setup Linux
159166
uses: ./test-infra/.github/actions/setup-linux
167+
if: ${{ inputs.gpu-arch-type != 'rocm' }}
168+
169+
- name: Setup ROCM
170+
uses: pytorch/pytorch/.github/actions/setup-rocm@main
171+
if: ${{ inputs.gpu-arch-type == 'rocm' }}
160172

161173
- name: Setup SSH
162174
uses: ./test-infra/.github/actions/setup-ssh
@@ -266,15 +278,30 @@ jobs:
266278
path: ${{ env.RUNNER_TEST_RESULTS_DIR }}
267279
fail-on-empty: false
268280

281+
- name: configure aws credentials
282+
id: aws_creds
283+
if: ${{ inputs.gpu-arch-type == 'rocm' }}
284+
uses: aws-actions/configure-aws-credentials@v4
285+
with:
286+
role-to-assume: arn:aws:iam::308535385114:role/gha_workflow_s3_and_ecr_read_only
287+
aws-region: us-east-1
288+
role-duration-seconds: 18000
289+
290+
- name: Login to Amazon ECR
291+
id: login-ecr
292+
if: ${{ inputs.gpu-arch-type == 'rocm' }}
293+
continue-on-error: true
294+
uses: aws-actions/amazon-ecr-login@v2
295+
269296
- name: Chown repository directory
270-
if: always()
297+
if: ${{ inputs.gpu-arch-type != 'rocm' }}
271298
uses: ./test-infra/.github/actions/chown-directory
272299
with:
273300
directory: ${{ github.workspace }}/${{ env.repository }}
274301
ALPINE_IMAGE: ${{ startsWith(inputs.runner, 'linux.arm64') && 'arm64v8/alpine' || '308535385114.dkr.ecr.us-east-1.amazonaws.com/tool/alpine' }}
275302

276303
- name: Chown runner temp
277-
if: always()
304+
if: ${{ inputs.gpu-arch-type != 'rocm' }}
278305
uses: ./test-infra/.github/actions/chown-directory
279306
with:
280307
directory: ${{ runner.temp }}

0 commit comments

Comments
 (0)