Skip to content

Commit 075a008

Browse files
committed
test: Try downloading container a couple of times before raising error
1 parent 2afb54b commit 075a008

File tree

3 files changed

+28
-29
lines changed

3 files changed

+28
-29
lines changed

.github/workflows/backend-template.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,7 @@ jobs:
135135
sudo apt install -y apptainer-suid
136136
137137
- name: Get container images for build dependencies
138-
shell: bash
139-
working-directory: devel-tools
140-
run: |
141-
apptainer pull ${{ inputs.container_name }}.sif oras://ghcr.io/colvars/devel-containers:${{ inputs.container_name }}
138+
run: devel-tools/get_container ${{ inputs.container_name }}
142139

143140
- name: Update and build ${{ inputs.backend_name }}
144141
shell: bash

.github/workflows/test-library.yml

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,7 @@ jobs:
9292
sudo apt install -y apptainer-suid
9393
9494
- name: Get container image
95-
shell: bash
96-
working-directory: devel-tools
97-
run: |
98-
apptainer pull texlive.sif oras://ghcr.io/colvars/devel-containers:texlive
95+
run: devel-tools/get_container texlive
9996

10097
- name: Checkout website repository
10198
uses: actions/checkout@v4
@@ -191,10 +188,7 @@ jobs:
191188
sudo apt install -y apptainer-suid
192189
193190
- name: Get container images for build dependencies
194-
shell: bash
195-
working-directory: devel-tools
196-
run: |
197-
apptainer pull CentOS9-devel.sif oras://ghcr.io/colvars/devel-containers:CentOS9-devel
191+
run: devel-tools/get_container CentOS9-devel
198192

199193
- name: Run build with Clang static analyser
200194
env:
@@ -252,10 +246,7 @@ jobs:
252246
sudo apt install -y apptainer-suid
253247
254248
- name: Get container images for build dependencies
255-
shell: bash
256-
working-directory: devel-tools
257-
run: |
258-
apptainer pull CentOS9-devel.sif oras://ghcr.io/colvars/devel-containers:CentOS9-devel
249+
run: devel-tools/get_container CentOS9-devel
259250

260251
- name: Build with Clang and address sanitizer
261252
env:
@@ -307,11 +298,8 @@ jobs:
307298
sudo apt update
308299
sudo apt install -y apptainer-suid
309300
310-
- name: Get container images for build environment
311-
shell: bash
312-
working-directory: devel-tools
313-
run: |
314-
apptainer pull CentOS9-devel.sif oras://ghcr.io/colvars/devel-containers:CentOS9-devel
301+
- name: Get container images for build dependencies
302+
run: devel-tools/get_container CentOS9-devel
315303

316304
- name: GCC 11, C++11 (CentOS 9)
317305
env:
@@ -447,10 +435,7 @@ jobs:
447435
sudo apt install -y apptainer-suid
448436
449437
- name: Get container images for build dependencies
450-
shell: bash
451-
working-directory: devel-tools
452-
run: |
453-
apptainer pull CentOS9-oneAPI.sif oras://ghcr.io/colvars/devel-containers:CentOS9-oneAPI
438+
run: devel-tools/get_container CentOS9-devel-oneAPI
454439

455440
- name: Intel oneAPI 2024.2, C++11
456441
shell: bash
@@ -573,10 +558,7 @@ jobs:
573558
sudo apt install -y apptainer-suid
574559
575560
- name: Get container images for build dependencies
576-
shell: bash
577-
working-directory: devel-tools
578-
run: |
579-
apptainer pull CentOS9-devel-arm64.sif oras://ghcr.io/colvars/devel-containers:CentOS9-devel-arm64
561+
run: devel-tools/get_container CentOS9-devel-arm64
580562

581563
- name: GCC 11, C++20 (CentOS 9)
582564
env:

devel-tools/get_container

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
DOWNLOAD_DIR=$(dirname $0)
4+
5+
label=$1
6+
if [ -n "${label}" ] ; then
7+
if [ ! -f "${DOWNLOAD_DIR}/${label}.sif" ] ; then
8+
echo "Downloading container image \"${label}\"..."
9+
for try in {1..3}; do
10+
apptainer pull "${DOWNLOAD_DIR}/${label}.sif" oras://ghcr.io/colvars/devel-containers:"${label}" && break
11+
retcode=$?
12+
if [ ${retcode} != 0 ] ; then
13+
echo "(download failed, retrying...)"
14+
sleep 15s
15+
fi
16+
done
17+
fi
18+
fi
19+
20+
exit ${retcode}

0 commit comments

Comments
 (0)