Skip to content

Commit d6e421c

Browse files
authored
Merge pull request #3254 from boutproject/cache-zenodo
ci: Cache Zenodo data, and retry on http 502, 503 errors
2 parents f51d9f1 + bbaeeaf commit d6e421c

3 files changed

Lines changed: 31 additions & 3 deletions

File tree

.github/workflows/tests.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
OMPI_MCA_rmaps_base_oversubscribe: yes
3131
PRTE_MCA_rmaps_default_mapping_policy: ":oversubscribe"
3232
MPIRUN: mpiexec -np
33+
BOUT_TEST_DOWNLOAD_FLAGS: --retry-on-http-error=502,503,504 --tries 3
3334
strategy:
3435
fail-fast: true
3536
matrix:
@@ -175,12 +176,20 @@ jobs:
175176
- uses: actions/setup-python@v6
176177
with:
177178
python-version: '3.x'
179+
cache: 'pip'
178180

179181
- name: Install pip packages
180182
run: |
181183
python -m pip install --upgrade pip setuptools
182184
python -m pip install -r requirements.txt
183185
186+
- name: Cache Zenodo test data
187+
uses: actions/cache@v4
188+
with:
189+
path: build/tests/integrated/test-fci-mpi/grid.fci.nc
190+
# If we update the test, invalidate the cache
191+
key: zenodo-data-${{ hashFiles('tests/integrated/test-fci-mpi/CMakeLists.txt') }}
192+
184193
- name: Cache SUNDIALS build
185194
uses: actions/cache@v5
186195
with:
@@ -204,10 +213,20 @@ jobs:
204213
# standard_tests
205214
timeout-minutes: 120
206215
runs-on: ubuntu-latest
216+
env:
217+
BOUT_TEST_DOWNLOAD_FLAGS: --retry-on-http-error=502,503,504 --tries 3
207218
steps:
208219
- uses: actions/checkout@v6
209220
with:
210221
submodules: true
222+
223+
- name: Cache Zenodo test data
224+
uses: actions/cache@v4
225+
with:
226+
path: build/tests/integrated/test-fci-mpi/grid.fci.nc
227+
# If we update the test, invalidate the cache
228+
key: zenodo-data-${{ hashFiles('tests/integrated/test-fci-mpi/CMakeLists.txt') }}
229+
211230
- name: Build Fedora
212231
run: ./.ci_fedora.sh setup openmpi
213232
shell: bash
@@ -217,11 +236,20 @@ jobs:
217236
timeout-minutes: 60
218237
runs-on: ubuntu-latest
219238
container: ghcr.io/ggeorgakoudis/boutdev-cuda:latest
220-
239+
env:
240+
BOUT_TEST_DOWNLOAD_FLAGS: --retry-on-http-error=502,503,504 --tries 3
221241
steps:
222242
- uses: actions/checkout@v6
223243
with:
224244
submodules: true
245+
246+
- name: Cache Zenodo test data
247+
uses: actions/cache@v4
248+
with:
249+
path: build/tests/integrated/test-fci-mpi/grid.fci.nc
250+
# If we update the test, invalidate the cache
251+
key: zenodo-data-${{ hashFiles('tests/integrated/test-fci-mpi/CMakeLists.txt') }}
252+
225253
- name: Build minimal CUDA 12.2 @ GCC9.4.0 @ Ubuntu 20.04
226254
run: |
227255
. /spack/share/spack/setup-env.sh

cmake/BOUT++functions.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ function(bout_add_integrated_or_mms_test BUILD_CHECK_TARGET TESTNAME)
208208
endif()
209209
set(output )
210210
add_custom_command(OUTPUT ${BOUT_TEST_OPTIONS_DOWNLOAD_NAME}
211-
COMMAND wget ${BOUT_TEST_OPTIONS_DOWNLOAD} -O ${BOUT_TEST_OPTIONS_DOWNLOAD_NAME}
211+
COMMAND wget ${BOUT_TEST_OPTIONS_DOWNLOAD} -O ${BOUT_TEST_OPTIONS_DOWNLOAD_NAME} $ENV{BOUT_TEST_DOWNLOAD_FLAGS}
212212
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
213213
COMMENT "Downloading ${BOUT_TEST_OPTIONS_DOWNLOAD_NAME}"
214214
)

tests/integrated/test-fci-mpi/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ bout_add_mms_test(test-fci-mpi
33
USE_RUNTEST
44
USE_DATA_BOUT_INP
55
PROCESSORS 6
6-
DOWNLOAD https://zenodo.org/record/7614499/files/W7X-conf4-36x8x128.fci.nc?download=1
6+
DOWNLOAD https://zenodo.org/records/7614499/files/W7X-conf4-36x8x128.fci.nc?download=1
77
DOWNLOAD_NAME grid.fci.nc
88
REQUIRES BOUT_HAS_PETSC
99
)

0 commit comments

Comments
 (0)