Skip to content

Commit ba0f43e

Browse files
committed
ci: retry artifact downloads once on transient failures
Add a local composite action (.github/actions/download-artifact-retry) that wraps actions/[email protected] with a single retry. When the first download attempt fails (e.g. "other side closed" network flakes), the action waits 15 s and tries again; the job fails only if the second attempt also fails. Apply the composite action to the 18 artifact-download steps in the four test workflows: - test-wheel-linux.yml (7 steps) - test-wheel-windows.yml (7 steps) - test-sdist-linux.yml (2 steps) - test-sdist-windows.yml (2 steps) The "prior branch" download steps use gh and are unchanged. The remaining 16 steps in build-wheel.yml, build-docs.yml, and coverage.yml can adopt the action in a follow-up.
1 parent 4c893de commit ba0f43e

5 files changed

Lines changed: 77 additions & 18 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: Download artifact (with retry)
6+
7+
description: >-
8+
Wrapper around actions/download-artifact that retries once after a short
9+
delay when the first attempt fails. Designed to absorb transient
10+
infrastructure flakes such as "other side closed" without failing the job.
11+
12+
inputs:
13+
name:
14+
description: "Name of the artifact to download"
15+
required: true
16+
path:
17+
description: "Destination path for the downloaded artifact"
18+
required: true
19+
run-id:
20+
description: "The run ID of the workflow run that uploaded the artifact"
21+
required: false
22+
default: ${{ github.run_id }}
23+
github-token:
24+
description: "Token used to download the artifact"
25+
required: false
26+
default: ${{ github.token }}
27+
retry-delay-seconds:
28+
description: "Seconds to wait between the first failure and the retry"
29+
required: false
30+
default: "15"
31+
32+
runs:
33+
using: composite
34+
steps:
35+
- name: Download artifact (attempt 1)
36+
id: attempt1
37+
continue-on-error: true
38+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
39+
with:
40+
name: ${{ inputs.name }}
41+
path: ${{ inputs.path }}
42+
run-id: ${{ inputs.run-id }}
43+
github-token: ${{ inputs.github-token }}
44+
45+
- name: Wait before retry
46+
if: ${{ steps.attempt1.outcome == 'failure' }}
47+
shell: bash --noprofile --norc -euo pipefail {0}
48+
run: |
49+
echo "::warning::Artifact download failed (attempt 1); retrying in ${{ inputs.retry-delay-seconds }}s"
50+
sleep "${{ inputs.retry-delay-seconds }}"
51+
52+
- name: Download artifact (attempt 2)
53+
if: ${{ steps.attempt1.outcome == 'failure' }}
54+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
55+
with:
56+
name: ${{ inputs.name }}
57+
path: ${{ inputs.path }}
58+
run-id: ${{ inputs.run-id }}
59+
github-token: ${{ inputs.github-token }}

‎.github/workflows/test-sdist-linux.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
6969
- name: Download cuda.pathfinder wheel
7070
if: ${{ env.BUILD_PATHFINDER != 'true' && (env.BUILD_BINDINGS == 'true' || env.BUILD_CORE == 'true') }}
71-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
71+
uses: ./.github/actions/download-artifact-retry
7272
with:
7373
name: cuda-pathfinder-wheel
7474
path: cuda_pathfinder/dist
@@ -131,7 +131,7 @@ jobs:
131131
132132
- name: Download cuda.bindings wheel
133133
if: ${{ env.BUILD_BINDINGS != 'true' && env.BUILD_CORE == 'true' }}
134-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
134+
uses: ./.github/actions/download-artifact-retry
135135
with:
136136
name: cuda-bindings-python312-cuda${{ inputs.cuda-version }}-${{ inputs.host-platform }}-${{ github.sha }}
137137
path: cuda_bindings/dist

‎.github/workflows/test-sdist-windows.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
8282
- name: Download cuda.pathfinder wheel
8383
if: ${{ env.BUILD_PATHFINDER != 'true' && (env.BUILD_BINDINGS == 'true' || env.BUILD_CORE == 'true') }}
84-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
84+
uses: ./.github/actions/download-artifact-retry
8585
with:
8686
name: cuda-pathfinder-wheel
8787
path: cuda_pathfinder/dist
@@ -122,7 +122,7 @@ jobs:
122122
123123
- name: Download cuda.bindings wheel
124124
if: ${{ env.BUILD_BINDINGS != 'true' && env.BUILD_CORE == 'true' }}
125-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
125+
uses: ./.github/actions/download-artifact-retry
126126
with:
127127
name: cuda-bindings-python312-cuda${{ inputs.cuda-version }}-${{ inputs.host-platform }}-${{ github.sha }}
128128
path: cuda_bindings/dist

‎.github/workflows/test-wheel-linux.yml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ jobs:
177177

178178
- name: Download cuda-pathfinder build artifacts
179179
if: ${{ env.TEST_PATHFINDER == 'true' || env.TEST_BINDINGS == 'true' || env.TEST_CORE == 'true' || env.TEST_PYTHON == 'true' }}
180-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
180+
uses: ./.github/actions/download-artifact-retry
181181
with:
182182
name: cuda-pathfinder-wheel
183183
path: ./cuda_pathfinder
@@ -186,7 +186,7 @@ jobs:
186186

187187
- name: Download cuda-python build artifacts
188188
if: ${{ env.TEST_PYTHON == 'true' && env.BINDINGS_SOURCE == 'main' }}
189-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
189+
uses: ./.github/actions/download-artifact-retry
190190
with:
191191
name: cuda-python-wheel
192192
path: .
@@ -196,7 +196,7 @@ jobs:
196196
- name: Download cuda.bindings build artifacts
197197
if: ${{ (env.TEST_BINDINGS == 'true' || env.TEST_CORE == 'true' || env.TEST_PYTHON == 'true') &&
198198
env.BINDINGS_SOURCE == 'main' }}
199-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
199+
uses: ./.github/actions/download-artifact-retry
200200
with:
201201
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
202202
path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
@@ -267,7 +267,7 @@ jobs:
267267
268268
- name: Download cuda.bindings Cython tests
269269
if: ${{ env.TEST_BINDINGS == 'true' && env.SKIP_CYTHON_TEST == '0' }}
270-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
270+
uses: ./.github/actions/download-artifact-retry
271271
with:
272272
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}-tests
273273
path: ${{ env.CUDA_BINDINGS_CYTHON_TESTS_DIR }}
@@ -282,7 +282,7 @@ jobs:
282282
283283
- name: Download cuda.core build artifacts
284284
if: ${{ env.TEST_CORE == 'true' }}
285-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
285+
uses: ./.github/actions/download-artifact-retry
286286
with:
287287
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
288288
path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
@@ -297,7 +297,7 @@ jobs:
297297
298298
- name: Download cuda.core Cython tests
299299
if: ${{ env.TEST_CORE == 'true' && env.SKIP_CYTHON_TEST == '0' }}
300-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
300+
uses: ./.github/actions/download-artifact-retry
301301
with:
302302
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests
303303
path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}
@@ -312,7 +312,7 @@ jobs:
312312
313313
- name: Download cuda.core test binaries
314314
if: ${{ env.TEST_CORE == 'true' }}
315-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
315+
uses: ./.github/actions/download-artifact-retry
316316
with:
317317
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-test-binaries
318318
path: ${{ env.CUDA_CORE_TEST_BINARIES_DIR }}

‎.github/workflows/test-wheel-windows.yml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ jobs:
168168

169169
- name: Download cuda-pathfinder build artifacts
170170
if: ${{ env.TEST_PATHFINDER == 'true' || env.TEST_BINDINGS == 'true' || env.TEST_CORE == 'true' || env.TEST_PYTHON == 'true' }}
171-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
171+
uses: ./.github/actions/download-artifact-retry
172172
with:
173173
name: cuda-pathfinder-wheel
174174
path: ./cuda_pathfinder
@@ -177,7 +177,7 @@ jobs:
177177

178178
- name: Download cuda-python build artifacts
179179
if: ${{ env.TEST_PYTHON == 'true' && env.BINDINGS_SOURCE == 'main' }}
180-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
180+
uses: ./.github/actions/download-artifact-retry
181181
with:
182182
name: cuda-python-wheel
183183
path: .
@@ -187,7 +187,7 @@ jobs:
187187
- name: Download cuda.bindings build artifacts
188188
if: ${{ (env.TEST_BINDINGS == 'true' || env.TEST_CORE == 'true' || env.TEST_PYTHON == 'true') &&
189189
env.BINDINGS_SOURCE == 'main' }}
190-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
190+
uses: ./.github/actions/download-artifact-retry
191191
with:
192192
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
193193
path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
@@ -249,7 +249,7 @@ jobs:
249249
250250
- name: Download cuda.bindings Cython tests
251251
if: ${{ env.TEST_BINDINGS == 'true' && env.SKIP_CYTHON_TEST == '0' }}
252-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
252+
uses: ./.github/actions/download-artifact-retry
253253
with:
254254
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}-tests
255255
path: ${{ env.CUDA_BINDINGS_CYTHON_TESTS_DIR }}
@@ -264,7 +264,7 @@ jobs:
264264
265265
- name: Download cuda.core build artifacts
266266
if: ${{ env.TEST_CORE == 'true' }}
267-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
267+
uses: ./.github/actions/download-artifact-retry
268268
with:
269269
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
270270
path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
@@ -279,7 +279,7 @@ jobs:
279279
280280
- name: Download cuda.core Cython tests
281281
if: ${{ env.TEST_CORE == 'true' && env.SKIP_CYTHON_TEST == '0' }}
282-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
282+
uses: ./.github/actions/download-artifact-retry
283283
with:
284284
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests
285285
path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}
@@ -294,7 +294,7 @@ jobs:
294294
295295
- name: Download cuda.core test binaries
296296
if: ${{ env.TEST_CORE == 'true' }}
297-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
297+
uses: ./.github/actions/download-artifact-retry
298298
with:
299299
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-test-binaries
300300
path: ${{ env.CUDA_CORE_TEST_BINARIES_DIR }}

0 commit comments

Comments
 (0)