From f5c81a847556a93257a63fb1a2ad1d4c58abdbc7 Mon Sep 17 00:00:00 2001 From: atalman Date: Mon, 21 Nov 2022 14:29:08 -0800 Subject: [PATCH 1/7] Pass ref:main to general worker --- .github/workflows/validate-windows-binaries.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/validate-windows-binaries.yml b/.github/workflows/validate-windows-binaries.yml index 328c7d7be..cd44dcf33 100644 --- a/.github/workflows/validate-windows-binaries.yml +++ b/.github/workflows/validate-windows-binaries.yml @@ -37,6 +37,7 @@ jobs: with: runner: ${{ matrix.validation_runner }} repository: "pytorch/builder" + ref: main job-name: ${{ matrix.build_name }} script: | set -ex From 3d4e3b77fbbe257ebc543f5233fbe156cdbedd34 Mon Sep 17 00:00:00 2001 From: atalman Date: Mon, 21 Nov 2022 15:27:07 -0800 Subject: [PATCH 2/7] Try to pass reference to workflow --- .github/workflows/validate-windows-binaries.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate-windows-binaries.yml b/.github/workflows/validate-windows-binaries.yml index cd44dcf33..4a75aa5f1 100644 --- a/.github/workflows/validate-windows-binaries.yml +++ b/.github/workflows/validate-windows-binaries.yml @@ -26,9 +26,17 @@ jobs: package-type: all os: windows channel: ${{ inputs.channel }} + get-ref: + id: branch + run: | + if [[ ${{ github.repository }} == *"builder"* ]]; then + echo "ref=${{ github.ref }}" >> $GITHUB_OUTPUT + else + echo "ref=main" >> $GITHUB_OUTPUT + fi win: - needs: generate-windows-matrix + needs: [generate-windows-matrix, get-ref] strategy: matrix: ${{ fromJson(needs.generate-windows-matrix.outputs.matrix) }} fail-fast: false @@ -37,7 +45,7 @@ jobs: with: runner: ${{ matrix.validation_runner }} repository: "pytorch/builder" - ref: main + ref: ${{ needs.get.ref.branch.ref }} job-name: ${{ matrix.build_name }} script: | set -ex From 5a9386e75fcb11abf1deb817476271ca990797ca Mon Sep 17 00:00:00 2001 From: atalman Date: Mon, 21 Nov 2022 15:27:32 -0800 Subject: [PATCH 3/7] Pass ref:main to general worker --- .github/workflows/validate-windows-binaries.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/validate-windows-binaries.yml b/.github/workflows/validate-windows-binaries.yml index 4a75aa5f1..a0e130ee7 100644 --- a/.github/workflows/validate-windows-binaries.yml +++ b/.github/workflows/validate-windows-binaries.yml @@ -29,6 +29,7 @@ jobs: get-ref: id: branch run: | + set -ex if [[ ${{ github.repository }} == *"builder"* ]]; then echo "ref=${{ github.ref }}" >> $GITHUB_OUTPUT else From 13be473f36244276613e115a8692147d52ca2829 Mon Sep 17 00:00:00 2001 From: atalman Date: Mon, 21 Nov 2022 15:39:29 -0800 Subject: [PATCH 4/7] Test --- .../workflows/validate-windows-binaries.yml | 83 +++++++++++-------- 1 file changed, 48 insertions(+), 35 deletions(-) diff --git a/.github/workflows/validate-windows-binaries.yml b/.github/workflows/validate-windows-binaries.yml index a0e130ee7..7833f4777 100644 --- a/.github/workflows/validate-windows-binaries.yml +++ b/.github/workflows/validate-windows-binaries.yml @@ -27,41 +27,54 @@ jobs: os: windows channel: ${{ inputs.channel }} get-ref: - id: branch - run: | - set -ex - if [[ ${{ github.repository }} == *"builder"* ]]; then - echo "ref=${{ github.ref }}" >> $GITHUB_OUTPUT - else - echo "ref=main" >> $GITHUB_OUTPUT - fi + steps: + - name: + id: branch + run: | + set -ex + if [[ ${{ github.repository }} == *"builder"* ]]; then + echo "ref=${{ github.ref }}" >> $GITHUB_OUTPUT + else + echo "ref=main" >> $GITHUB_OUTPUT + fi win: - needs: [generate-windows-matrix, get-ref] - strategy: - matrix: ${{ fromJson(needs.generate-windows-matrix.outputs.matrix) }} - fail-fast: false - uses: pytorch/test-infra/.github/workflows/windows_job.yml@main - name: ${{ matrix.build_name }} - with: - runner: ${{ matrix.validation_runner }} - repository: "pytorch/builder" - ref: ${{ needs.get.ref.branch.ref }} - job-name: ${{ matrix.build_name }} - script: | - set -ex - export ENV_NAME="conda-env-${{ github.run_id }}" - export GPU_ARCH_VER="${{ matrix.gpu_arch_version }}" - export GPU_ARCH_TYPE="${{ matrix.gpu_arch_type }}" - export INSTALLATION="${{ matrix.installation }}" - export CUDA_VER="${{ matrix.desired_cuda }}" + steps: + - name: Get ref branch + run: | + set -ex + if [[ ${{ github.repository }} == *"builder"* ]]; then + echo "ref=${{ github.ref }}" >> $GITHUB_OUTPUT + else + echo "ref=main" >> $GITHUB_OUTPUT + fi + id: get-ref-branch + - name: Test windows matrix + needs: generate-windows-matrix + strategy: + matrix: ${{ fromJson(needs.generate-windows-matrix.outputs.matrix) }} + fail-fast: false + uses: pytorch/test-infra/.github/workflows/windows_job.yml@main + name: ${{ matrix.build_name }} + with: + runner: ${{ matrix.validation_runner }} + repository: "pytorch/builder" + ref: ${{ steps.get-ref-branch.outputs.ref }} + job-name: ${{ matrix.build_name }} + script: | + set -ex + export ENV_NAME="conda-env-${{ github.run_id }}" + export GPU_ARCH_VER="${{ matrix.gpu_arch_version }}" + export GPU_ARCH_TYPE="${{ matrix.gpu_arch_type }}" + export INSTALLATION="${{ matrix.installation }}" + export CUDA_VER="${{ matrix.desired_cuda }}" - if [[ ${{ matrix.package_type }} == "libtorch" ]]; then - curl ${{ matrix.installation }} -o libtorch.zip - unzip libtorch.zip - else - conda create -y -n ${ENV_NAME} python=${{ matrix.python_version }} numpy pillow - conda activate ${ENV_NAME} - eval $INSTALLATION - python ./test/smoke_test/smoke_test.py - fi + if [[ ${{ matrix.package_type }} == "libtorch" ]]; then + curl ${{ matrix.installation }} -o libtorch.zip + unzip libtorch.zip + else + conda create -y -n ${ENV_NAME} python=${{ matrix.python_version }} numpy pillow + conda activate ${ENV_NAME} + eval $INSTALLATION + python ./test/smoke_test/smoke_test.py + fi From 680d3f2631eefb099e62c2ae0dcadbec2a6e5f00 Mon Sep 17 00:00:00 2001 From: atalman Date: Mon, 21 Nov 2022 15:50:08 -0800 Subject: [PATCH 5/7] Pass reference as input parameter --- .github/workflows/validate-binaries.yml | 9 ++ .../workflows/validate-windows-binaries.yml | 84 ++++++++----------- 2 files changed, 44 insertions(+), 49 deletions(-) diff --git a/.github/workflows/validate-binaries.yml b/.github/workflows/validate-binaries.yml index 6640eea03..fe320fb64 100644 --- a/.github/workflows/validate-binaries.yml +++ b/.github/workflows/validate-binaries.yml @@ -17,6 +17,10 @@ on: description: "Channel to use (nightly, test, release, all)" required: true type: string + ref: + description: 'Reference to checkout, defaults to empty' + default: "" + type: string workflow_dispatch: inputs: os: @@ -39,6 +43,10 @@ on: - nightly - test - all + ref: + description: 'Reference to checkout, defaults to empty' + default: "" + type: string jobs: win: @@ -46,6 +54,7 @@ jobs: uses: ./.github/workflows/validate-windows-binaries.yml with: channel: ${{ inputs.channel }} + ref: ref: ${{ inputs.ref || github.ref }} linux: if: inputs.os == 'linux' || inputs.os == 'all' diff --git a/.github/workflows/validate-windows-binaries.yml b/.github/workflows/validate-windows-binaries.yml index 7833f4777..bd9913823 100644 --- a/.github/workflows/validate-windows-binaries.yml +++ b/.github/workflows/validate-windows-binaries.yml @@ -7,6 +7,10 @@ on: description: "Channel to use (nightly, test, release, all)" required: true type: string + ref: + description: 'Reference to checkout, defaults to empty' + default: "" + type: string workflow_dispatch: inputs: channel: @@ -18,6 +22,10 @@ on: - nightly - test - all + ref: + description: 'Reference to checkout, defaults to empty' + default: "" + type: string jobs: generate-windows-matrix: @@ -26,55 +34,33 @@ jobs: package-type: all os: windows channel: ${{ inputs.channel }} - get-ref: - steps: - - name: - id: branch - run: | - set -ex - if [[ ${{ github.repository }} == *"builder"* ]]; then - echo "ref=${{ github.ref }}" >> $GITHUB_OUTPUT - else - echo "ref=main" >> $GITHUB_OUTPUT - fi win: - steps: - - name: Get ref branch - run: | - set -ex - if [[ ${{ github.repository }} == *"builder"* ]]; then - echo "ref=${{ github.ref }}" >> $GITHUB_OUTPUT - else - echo "ref=main" >> $GITHUB_OUTPUT - fi - id: get-ref-branch - - name: Test windows matrix - needs: generate-windows-matrix - strategy: - matrix: ${{ fromJson(needs.generate-windows-matrix.outputs.matrix) }} - fail-fast: false - uses: pytorch/test-infra/.github/workflows/windows_job.yml@main - name: ${{ matrix.build_name }} - with: - runner: ${{ matrix.validation_runner }} - repository: "pytorch/builder" - ref: ${{ steps.get-ref-branch.outputs.ref }} - job-name: ${{ matrix.build_name }} - script: | - set -ex - export ENV_NAME="conda-env-${{ github.run_id }}" - export GPU_ARCH_VER="${{ matrix.gpu_arch_version }}" - export GPU_ARCH_TYPE="${{ matrix.gpu_arch_type }}" - export INSTALLATION="${{ matrix.installation }}" - export CUDA_VER="${{ matrix.desired_cuda }}" + needs: generate-windows-matrix + strategy: + matrix: ${{ fromJson(needs.generate-windows-matrix.outputs.matrix) }} + fail-fast: false + uses: pytorch/test-infra/.github/workflows/windows_job.yml@main + name: ${{ matrix.build_name }} + with: + runner: ${{ matrix.validation_runner }} + repository: "pytorch/builder" + ref: ${{ inputs.ref || github.ref }} + job-name: ${{ matrix.build_name }} + script: | + set -ex + export ENV_NAME="conda-env-${{ github.run_id }}" + export GPU_ARCH_VER="${{ matrix.gpu_arch_version }}" + export GPU_ARCH_TYPE="${{ matrix.gpu_arch_type }}" + export INSTALLATION="${{ matrix.installation }}" + export CUDA_VER="${{ matrix.desired_cuda }}" - if [[ ${{ matrix.package_type }} == "libtorch" ]]; then - curl ${{ matrix.installation }} -o libtorch.zip - unzip libtorch.zip - else - conda create -y -n ${ENV_NAME} python=${{ matrix.python_version }} numpy pillow - conda activate ${ENV_NAME} - eval $INSTALLATION - python ./test/smoke_test/smoke_test.py - fi + if [[ ${{ matrix.package_type }} == "libtorch" ]]; then + curl ${{ matrix.installation }} -o libtorch.zip + unzip libtorch.zip + else + conda create -y -n ${ENV_NAME} python=${{ matrix.python_version }} numpy pillow + conda activate ${ENV_NAME} + eval $INSTALLATION + python ./test/smoke_test/smoke_test.py + fi From b3188faccade298ef09860af03879845cdc16589 Mon Sep 17 00:00:00 2001 From: atalman Date: Mon, 21 Nov 2022 15:57:25 -0800 Subject: [PATCH 6/7] Make new variable not required --- .github/workflows/validate-binaries.yml | 2 ++ .github/workflows/validate-windows-binaries.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/validate-binaries.yml b/.github/workflows/validate-binaries.yml index fe320fb64..201a0c1a1 100644 --- a/.github/workflows/validate-binaries.yml +++ b/.github/workflows/validate-binaries.yml @@ -20,6 +20,7 @@ on: ref: description: 'Reference to checkout, defaults to empty' default: "" + required: false type: string workflow_dispatch: inputs: @@ -46,6 +47,7 @@ on: ref: description: 'Reference to checkout, defaults to empty' default: "" + required: false type: string jobs: diff --git a/.github/workflows/validate-windows-binaries.yml b/.github/workflows/validate-windows-binaries.yml index bd9913823..7ab7bf3b2 100644 --- a/.github/workflows/validate-windows-binaries.yml +++ b/.github/workflows/validate-windows-binaries.yml @@ -10,6 +10,7 @@ on: ref: description: 'Reference to checkout, defaults to empty' default: "" + required: false type: string workflow_dispatch: inputs: @@ -25,6 +26,7 @@ on: ref: description: 'Reference to checkout, defaults to empty' default: "" + required: false type: string jobs: From 87cd2db5c033de2480a5200a08f06b98cb919952 Mon Sep 17 00:00:00 2001 From: atalman Date: Mon, 21 Nov 2022 16:00:13 -0800 Subject: [PATCH 7/7] Fix typo --- .github/workflows/validate-binaries.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-binaries.yml b/.github/workflows/validate-binaries.yml index 201a0c1a1..ed8dbe695 100644 --- a/.github/workflows/validate-binaries.yml +++ b/.github/workflows/validate-binaries.yml @@ -56,7 +56,7 @@ jobs: uses: ./.github/workflows/validate-windows-binaries.yml with: channel: ${{ inputs.channel }} - ref: ref: ${{ inputs.ref || github.ref }} + ref: ${{ inputs.ref || github.ref }} linux: if: inputs.os == 'linux' || inputs.os == 'all'