diff --git a/.ci/template/gh-build-iso.yml.jinja2 b/.ci/template/gh-build-iso.yml.jinja2 index 8cbe130..db74a35 100644 --- a/.ci/template/gh-build-iso.yml.jinja2 +++ b/.ci/template/gh-build-iso.yml.jinja2 @@ -54,8 +54,41 @@ jobs: .ci/configure.py {{ platform }} {{ type }} popd - # Build image - mkarchiso -v -m iso -w /_work -o /workspace/out /workspace + # Number of retries + MAX_RETRIES=5 + + # Try to build image + for ((i=1; i<=MAX_RETRIES; i++)); do + # Do not exit on error + set +e + + # Build image + mkarchiso -v -m iso -w /_work -o /workspace/out /workspace + + # Capture exit code + STATUS=$? + + # Exit on error + set -e + + # Check if build succeeded + if [ $STATUS -eq 0 ]; then + echo "Build succeeded" + break + fi + + # Print failure message and retry + echo "Build failed. Retry $i/$MAX_RETRIES" + + # Remove build directory + rm -rf /_work + done + + # Check if maximum retries were exhausted + if [ $STATUS -ne 0 ]; then + echo "Build failed after $MAX_RETRIES attempts" + exit 1 + fi - name: Create summary run: | diff --git a/.ci/template/sh-build-iso.yml.jinja2 b/.ci/template/sh-build-iso.yml.jinja2 index cb0fe62..da04d96 100644 --- a/.ci/template/sh-build-iso.yml.jinja2 +++ b/.ci/template/sh-build-iso.yml.jinja2 @@ -72,8 +72,41 @@ jobs: .ci/configure.py {{ platform }} {{ type }} popd - # Build image - mkarchiso -v -m iso -w /_work -o /workspace/out /workspace + # Number of retries + MAX_RETRIES=5 + + # Try to build image + for ((i=1; i<=MAX_RETRIES; i++)); do + # Do not exit on error + set +e + + # Build image + mkarchiso -v -m iso -w /_work -o /workspace/out /workspace + + # Capture exit code + STATUS=$? + + # Exit on error + set -e + + # Check if build succeeded + if [ $STATUS -eq 0 ]; then + echo "Build succeeded" + break + fi + + # Print failure message and retry + echo "Build failed. Retry $i/$MAX_RETRIES" + + # Remove build directory + rm -rf /_work + done + + # Check if maximum retries were exhausted + if [ $STATUS -ne 0 ]; then + echo "Build failed after $MAX_RETRIES attempts" + exit 1 + fi - name: Create summary run: | diff --git a/.github/workflows/gh-build-iso-cuda-empty.yml b/.github/workflows/gh-build-iso-cuda-empty.yml index 8a284a5..446977f 100644 --- a/.github/workflows/gh-build-iso-cuda-empty.yml +++ b/.github/workflows/gh-build-iso-cuda-empty.yml @@ -45,8 +45,41 @@ jobs: .ci/configure.py cuda empty popd - # Build image - mkarchiso -v -m iso -w /_work -o /workspace/out /workspace + # Number of retries + MAX_RETRIES=5 + + # Try to build image + for ((i=1; i<=MAX_RETRIES; i++)); do + # Do not exit on error + set +e + + # Build image + mkarchiso -v -m iso -w /_work -o /workspace/out /workspace + + # Capture exit code + STATUS=$? + + # Exit on error + set -e + + # Check if build succeeded + if [ $STATUS -eq 0 ]; then + echo "Build succeeded" + break + fi + + # Print failure message and retry + echo "Build failed. Retry $i/$MAX_RETRIES" + + # Remove build directory + rm -rf /_work + done + + # Check if maximum retries were exhausted + if [ $STATUS -ne 0 ]; then + echo "Build failed after $MAX_RETRIES attempts" + exit 1 + fi - name: Create summary run: | diff --git a/.github/workflows/gh-build-iso-cuda-gui.yml b/.github/workflows/gh-build-iso-cuda-gui.yml index f277478..e510782 100644 --- a/.github/workflows/gh-build-iso-cuda-gui.yml +++ b/.github/workflows/gh-build-iso-cuda-gui.yml @@ -47,8 +47,41 @@ jobs: .ci/configure.py cuda gui popd - # Build image - mkarchiso -v -m iso -w /_work -o /workspace/out /workspace + # Number of retries + MAX_RETRIES=5 + + # Try to build image + for ((i=1; i<=MAX_RETRIES; i++)); do + # Do not exit on error + set +e + + # Build image + mkarchiso -v -m iso -w /_work -o /workspace/out /workspace + + # Capture exit code + STATUS=$? + + # Exit on error + set -e + + # Check if build succeeded + if [ $STATUS -eq 0 ]; then + echo "Build succeeded" + break + fi + + # Print failure message and retry + echo "Build failed. Retry $i/$MAX_RETRIES" + + # Remove build directory + rm -rf /_work + done + + # Check if maximum retries were exhausted + if [ $STATUS -ne 0 ]; then + echo "Build failed after $MAX_RETRIES attempts" + exit 1 + fi - name: Create summary run: | diff --git a/.github/workflows/gh-build-iso-cuda.yml b/.github/workflows/gh-build-iso-cuda.yml index 69600f7..8879e5d 100644 --- a/.github/workflows/gh-build-iso-cuda.yml +++ b/.github/workflows/gh-build-iso-cuda.yml @@ -47,8 +47,41 @@ jobs: .ci/configure.py cuda normal popd - # Build image - mkarchiso -v -m iso -w /_work -o /workspace/out /workspace + # Number of retries + MAX_RETRIES=5 + + # Try to build image + for ((i=1; i<=MAX_RETRIES; i++)); do + # Do not exit on error + set +e + + # Build image + mkarchiso -v -m iso -w /_work -o /workspace/out /workspace + + # Capture exit code + STATUS=$? + + # Exit on error + set -e + + # Check if build succeeded + if [ $STATUS -eq 0 ]; then + echo "Build succeeded" + break + fi + + # Print failure message and retry + echo "Build failed. Retry $i/$MAX_RETRIES" + + # Remove build directory + rm -rf /_work + done + + # Check if maximum retries were exhausted + if [ $STATUS -ne 0 ]; then + echo "Build failed after $MAX_RETRIES attempts" + exit 1 + fi - name: Create summary run: | diff --git a/.github/workflows/gh-build-iso-rocm-empty.yml b/.github/workflows/gh-build-iso-rocm-empty.yml index 462268e..d581f0e 100644 --- a/.github/workflows/gh-build-iso-rocm-empty.yml +++ b/.github/workflows/gh-build-iso-rocm-empty.yml @@ -49,8 +49,41 @@ jobs: .ci/configure.py rocm empty popd - # Build image - mkarchiso -v -m iso -w /_work -o /workspace/out /workspace + # Number of retries + MAX_RETRIES=5 + + # Try to build image + for ((i=1; i<=MAX_RETRIES; i++)); do + # Do not exit on error + set +e + + # Build image + mkarchiso -v -m iso -w /_work -o /workspace/out /workspace + + # Capture exit code + STATUS=$? + + # Exit on error + set -e + + # Check if build succeeded + if [ $STATUS -eq 0 ]; then + echo "Build succeeded" + break + fi + + # Print failure message and retry + echo "Build failed. Retry $i/$MAX_RETRIES" + + # Remove build directory + rm -rf /_work + done + + # Check if maximum retries were exhausted + if [ $STATUS -ne 0 ]; then + echo "Build failed after $MAX_RETRIES attempts" + exit 1 + fi - name: Create summary run: | diff --git a/.github/workflows/sh-build-iso-rocm-gui.yml b/.github/workflows/sh-build-iso-rocm-gui.yml index a2e9704..cf50c53 100644 --- a/.github/workflows/sh-build-iso-rocm-gui.yml +++ b/.github/workflows/sh-build-iso-rocm-gui.yml @@ -66,8 +66,41 @@ jobs: .ci/configure.py rocm gui popd - # Build image - mkarchiso -v -m iso -w /_work -o /workspace/out /workspace + # Number of retries + MAX_RETRIES=5 + + # Try to build image + for ((i=1; i<=MAX_RETRIES; i++)); do + # Do not exit on error + set +e + + # Build image + mkarchiso -v -m iso -w /_work -o /workspace/out /workspace + + # Capture exit code + STATUS=$? + + # Exit on error + set -e + + # Check if build succeeded + if [ $STATUS -eq 0 ]; then + echo "Build succeeded" + break + fi + + # Print failure message and retry + echo "Build failed. Retry $i/$MAX_RETRIES" + + # Remove build directory + rm -rf /_work + done + + # Check if maximum retries were exhausted + if [ $STATUS -ne 0 ]; then + echo "Build failed after $MAX_RETRIES attempts" + exit 1 + fi - name: Create summary run: | diff --git a/.github/workflows/sh-build-iso-rocm.yml b/.github/workflows/sh-build-iso-rocm.yml index a570628..b35c249 100644 --- a/.github/workflows/sh-build-iso-rocm.yml +++ b/.github/workflows/sh-build-iso-rocm.yml @@ -66,8 +66,41 @@ jobs: .ci/configure.py rocm normal popd - # Build image - mkarchiso -v -m iso -w /_work -o /workspace/out /workspace + # Number of retries + MAX_RETRIES=5 + + # Try to build image + for ((i=1; i<=MAX_RETRIES; i++)); do + # Do not exit on error + set +e + + # Build image + mkarchiso -v -m iso -w /_work -o /workspace/out /workspace + + # Capture exit code + STATUS=$? + + # Exit on error + set -e + + # Check if build succeeded + if [ $STATUS -eq 0 ]; then + echo "Build succeeded" + break + fi + + # Print failure message and retry + echo "Build failed. Retry $i/$MAX_RETRIES" + + # Remove build directory + rm -rf /_work + done + + # Check if maximum retries were exhausted + if [ $STATUS -ne 0 ]; then + echo "Build failed after $MAX_RETRIES attempts" + exit 1 + fi - name: Create summary run: |