Skip to content

Commit e616cec

Browse files
authored
Add binary r2 upload step to Windows and MacOS wheel workflows (#7455)
Continuation of work of #7440
1 parent 6669936 commit e616cec

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

.github/workflows/build_wheels_macos.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,16 @@ on:
8888
description: 'Timeout for the job (in minutes)'
8989
default: 60
9090
type: number
91+
secrets:
92+
R2_ACCOUNT_ID:
93+
description: Cloudflare R2 account ID
94+
required: false
95+
R2_ACCESS_KEY_ID:
96+
description: Cloudflare R2 access key ID
97+
required: false
98+
R2_SECRET_ACCESS_KEY:
99+
description: Cloudflare R2 secret access key
100+
required: false
91101

92102
permissions:
93103
id-token: write
@@ -106,6 +116,7 @@ jobs:
106116
CU_VERSION: ${{ matrix.desired_cuda }}
107117
name: build-${{ matrix.build_name }}
108118
runs-on: ${{ inputs.runner-type }}
119+
environment: ${{(inputs.trigger-event == 'schedule' || (inputs.trigger-event == 'push' && (startsWith(github.event.ref, 'refs/heads/nightly') || startsWith(github.event.ref, 'refs/tags/v')))) && 'pytorchbot-env' || ''}}
109120
# If a build is taking longer than 60 minutes on these runners we need
110121
# to have a conversation
111122
timeout-minutes: ${{ inputs.timeout }}
@@ -273,6 +284,22 @@ jobs:
273284
build-matrix: ${{ inputs.build-matrix }}
274285
trigger-event: ${{ inputs.trigger-event }}
275286

287+
upload-r2:
288+
needs: build
289+
uses: ./.github/workflows/_binary_upload_r2.yml
290+
if: always()
291+
with:
292+
repository: ${{ inputs.repository }}
293+
ref: ${{ inputs.ref }}
294+
test-infra-repository: ${{ inputs.test-infra-repository }}
295+
test-infra-ref: ${{ inputs.test-infra-ref }}
296+
build-matrix: ${{ inputs.build-matrix }}
297+
trigger-event: ${{ inputs.trigger-event }}
298+
secrets:
299+
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
300+
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
301+
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
302+
276303
concurrency:
277304
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ inputs.repository }}-${{ github.event_name == 'workflow_dispatch' }}
278305
cancel-in-progress: true

.github/workflows/build_wheels_windows.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@ on:
8282
description: 'CPU architecture to build for'
8383
default: "x64"
8484
type: string
85+
secrets:
86+
R2_ACCOUNT_ID:
87+
description: Cloudflare R2 account ID
88+
required: false
89+
R2_ACCESS_KEY_ID:
90+
description: Cloudflare R2 access key ID
91+
required: false
92+
R2_SECRET_ACCESS_KEY:
93+
description: Cloudflare R2 secret access key
94+
required: false
8595

8696
permissions:
8797
id-token: write
@@ -101,6 +111,7 @@ jobs:
101111
UPLOAD_TO_BASE_BUCKET: ${{ matrix.upload_to_base_bucket }}
102112
name: build-${{ matrix.build_name }}
103113
runs-on: ${{ matrix.validation_runner }}
114+
environment: ${{(inputs.trigger-event == 'schedule' || (inputs.trigger-event == 'push' && (startsWith(github.event.ref, 'refs/heads/nightly') || startsWith(github.event.ref, 'refs/tags/v')))) && 'pytorchbot-env' || ''}}
104115
defaults:
105116
run:
106117
shell: bash -l {0}
@@ -391,6 +402,23 @@ jobs:
391402
trigger-event: ${{ inputs.trigger-event }}
392403
architecture: ${{ inputs.architecture }}
393404

405+
upload-r2:
406+
needs: build
407+
uses: ./.github/workflows/_binary_upload_r2.yml
408+
if: always()
409+
with:
410+
repository: ${{ inputs.repository }}
411+
ref: ${{ inputs.ref }}
412+
test-infra-repository: ${{ inputs.test-infra-repository }}
413+
test-infra-ref: ${{ inputs.test-infra-ref }}
414+
build-matrix: ${{ inputs.build-matrix }}
415+
trigger-event: ${{ inputs.trigger-event }}
416+
architecture: ${{ inputs.architecture }}
417+
secrets:
418+
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
419+
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
420+
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
421+
394422
concurrency:
395423
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ inputs.repository }}-${{ github.event_name == 'workflow_dispatch' }}
396-
cancel-in-progress: true
424+
cancel-in-progress: true

.lintrunner.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ init_command = [
8080
'types-colorama==0.4.6',
8181
'filelock==3.13.1',
8282
'junitparser==2.1.1',
83+
'pytest==8.4.2',
8384
'rich==10.9.0',
8485
'pyyaml==6.0.1',
8586
'optree==0.13.0',

0 commit comments

Comments
 (0)