Skip to content

Commit 440bc97

Browse files
authored
Correctly checkout test-infra on Nova _binary_upload job (#4882)
I made a mistake in #4877 when not explicitly select `test-infra` as the repo to checkout for the GHA. When running on domains, the default repos are domains, i.e. `pytorch/vision`, and they don't have the GHA we need, namely `setup-binary-upload`. An example failure when testing on vision nightly https://github.com/pytorch/vision/actions/runs/7533535440/job/20506343331
1 parent eeb8847 commit 440bc97

File tree

5 files changed

+29
-3
lines changed

5 files changed

+29
-3
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,15 @@ runs:
5353
# and "/" is not allowed in artifact names
5454
echo "ARTIFACT_NAME=${REPOSITORY/\//_}_${REF}_${PYTHON_VERSION}_${CU_VERSION}_${ARCH}" >> "${GITHUB_ENV}"
5555
56+
# Need to checkout the target repository to run pkg-helpers
57+
- uses: actions/checkout@v3
58+
with:
59+
repository: ${{ inputs.repository }}
60+
ref: ${{ inputs.ref }}
61+
path: ${{ inputs.repository }}
62+
5663
- name: Generate env variables from pytorch_pkg_helpers
64+
working-directory: ${{ inputs.repository }}
5765
shell: bash
5866
env:
5967
REPOSITORY: ${{ inputs.repository }}
@@ -64,7 +72,7 @@ runs:
6472
run: |
6573
set -ex
6674
67-
python -m pip install tools/pkg-helpers
75+
python -m pip install ${GITHUB_WORKSPACE}/test-infra/tools/pkg-helpers
6876
6977
BUILD_ENV_FILE="${RUNNER_TEMP}/build_env_${GITHUB_RUN_ID}"
7078
python -m pytorch_pkg_helpers > "${BUILD_ENV_FILE}"

.github/workflows/_binary_upload.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ on:
1111
description: 'Reference to checkout, defaults to "nightly"'
1212
default: 'nightly'
1313
type: string
14+
test-infra-repository:
15+
description: "Test infra repository to use"
16+
default: "pytorch/test-infra"
17+
type: string
18+
test-infra-ref:
19+
description: "Test infra reference to use"
20+
default: ""
21+
type: string
1422
build-matrix:
1523
description: "Build matrix to utilize"
1624
default: ''
@@ -36,9 +44,13 @@ jobs:
3644
name: ${{ matrix.build_name }}
3745
steps:
3846
- uses: actions/checkout@v3
47+
with:
48+
repository: ${{ inputs.test-infra-repository }}
49+
ref: ${{ inputs.test-infra-ref }}
50+
path: test-infra
3951

4052
# For pytorch_pkg_helpers which we need to run to generate the artifact name and target S3 buckets
41-
- uses: ./.github/actions/setup-binary-upload
53+
- uses: ./test-infra/.github/actions/setup-binary-upload
4254
with:
4355
repository: ${{ inputs.repository }}
4456
ref: ${{ inputs.ref }}
@@ -47,7 +59,7 @@ jobs:
4759
arch: ${{ inputs.architecture }}
4860
upload-to-base-bucket: ${{ matrix.upload_to_base_bucket }}
4961

50-
- uses: ./.github/actions/set-channel
62+
- uses: ./test-infra/.github/actions/set-channel
5163

5264
- name: Download the artifact
5365
uses: actions/download-artifact@v3

.github/workflows/build_wheels_linux.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ jobs:
235235
with:
236236
repository: ${{ inputs.repository }}
237237
ref: ${{ inputs.ref }}
238+
test-infra-repository: ${{ inputs.test-infra-repository }}
239+
test-infra-ref: ${{ inputs.test-infra-ref }}
238240
build-matrix: ${{ inputs.build-matrix }}
239241
architecture: ${{ inputs.architecture }}
240242
trigger-event: ${{ inputs.trigger-event }}

.github/workflows/build_wheels_macos.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ jobs:
214214
with:
215215
repository: ${{ inputs.repository }}
216216
ref: ${{ inputs.ref }}
217+
test-infra-repository: ${{ inputs.test-infra-repository }}
218+
test-infra-ref: ${{ inputs.test-infra-ref }}
217219
build-matrix: ${{ inputs.build-matrix }}
218220
trigger-event: ${{ inputs.trigger-event }}
219221

.github/workflows/build_wheels_windows.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ jobs:
202202
with:
203203
repository: ${{ inputs.repository }}
204204
ref: ${{ inputs.ref }}
205+
test-infra-repository: ${{ inputs.test-infra-repository }}
206+
test-infra-ref: ${{ inputs.test-infra-ref }}
205207
build-matrix: ${{ inputs.build-matrix }}
206208
trigger-event: ${{ inputs.trigger-event }}
207209

0 commit comments

Comments
 (0)