diff --git a/.github/workflows/dependencies/dependencies.sh b/.github/workflows/dependencies/dependencies.sh index c9bb080831c..07e461f577f 100755 --- a/.github/workflows/dependencies/dependencies.sh +++ b/.github/workflows/dependencies/dependencies.sh @@ -7,6 +7,11 @@ set -eu -o pipefail +# `man apt.conf`: +# Number of retries to perform. If this is non-zero APT will retry +# failed files the given number of times. +echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries + sudo apt-get update sudo apt-get install -y --no-install-recommends\ diff --git a/.github/workflows/dependencies/dependencies_clang-tidy.sh b/.github/workflows/dependencies/dependencies_clang-tidy.sh index 3b4eb6e6db8..ed6d2f6d3b0 100755 --- a/.github/workflows/dependencies/dependencies_clang-tidy.sh +++ b/.github/workflows/dependencies/dependencies_clang-tidy.sh @@ -2,5 +2,10 @@ set -eu -o pipefail +# `man apt.conf`: +# Number of retries to perform. If this is non-zero APT will retry +# failed files the given number of times. +echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries + sudo apt-get install -y --no-install-recommends \ clang-tidy-$1 libomp-$1-dev diff --git a/.github/workflows/dependencies/dependencies_clang.sh b/.github/workflows/dependencies/dependencies_clang.sh index ea407614a95..2e96b5196d8 100755 --- a/.github/workflows/dependencies/dependencies_clang.sh +++ b/.github/workflows/dependencies/dependencies_clang.sh @@ -7,6 +7,11 @@ set -eu -o pipefail +# `man apt.conf`: +# Number of retries to perform. If this is non-zero APT will retry +# failed files the given number of times. +echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries + sudo apt-get update sudo apt-get install -y --no-install-recommends \ diff --git a/.github/workflows/dependencies/dependencies_dpcpp.sh b/.github/workflows/dependencies/dependencies_dpcpp.sh index bbd0c7fffe3..5135c438eb4 100755 --- a/.github/workflows/dependencies/dependencies_dpcpp.sh +++ b/.github/workflows/dependencies/dependencies_dpcpp.sh @@ -7,6 +7,11 @@ set -eu -o pipefail +# `man apt.conf`: +# Number of retries to perform. If this is non-zero APT will retry +# failed files the given number of times. +echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries + # Ref.: https://github.com/rscohn2/oneapi-ci # intel-basekit intel-hpckit are too large in size wget -q -O - https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB \ @@ -16,9 +21,17 @@ echo "deb https://apt.repos.intel.com/oneapi all main" \ sudo apt-get update -sudo apt-get install -y --no-install-recommends \ - build-essential \ - intel-oneapi-dpcpp-cpp-compiler \ - intel-oneapi-compiler-fortran \ - intel-oneapi-mkl-devel \ - intel-oneapi-mpi-devel +# try apt install up to five times, to avoid connection splits +status=1 +for itry in {1..5} +do + sudo apt-get install -y --no-install-recommends \ + build-essential \ + intel-oneapi-dpcpp-cpp-compiler \ + intel-oneapi-compiler-fortran \ + intel-oneapi-mkl-devel \ + intel-oneapi-mpi-devel \ + && { sudo apt-get clean; status=0; break; } \ + || { sleep 10; } +done +if [[ ${status} -ne 0 ]]; then exit 1; fi diff --git a/.github/workflows/dependencies/dependencies_gcc.sh b/.github/workflows/dependencies/dependencies_gcc.sh index a82b3f4d08a..2a576c0b52d 100755 --- a/.github/workflows/dependencies/dependencies_gcc.sh +++ b/.github/workflows/dependencies/dependencies_gcc.sh @@ -7,6 +7,11 @@ set -eu -o pipefail +# `man apt.conf`: +# Number of retries to perform. If this is non-zero APT will retry +# failed files the given number of times. +echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries + sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update diff --git a/.github/workflows/dependencies/dependencies_hip.sh b/.github/workflows/dependencies/dependencies_hip.sh index efb9b98144c..66eb5b78062 100755 --- a/.github/workflows/dependencies/dependencies_hip.sh +++ b/.github/workflows/dependencies/dependencies_hip.sh @@ -12,6 +12,10 @@ set -eu -o pipefail +# `man apt.conf`: +# Number of retries to perform. If this is non-zero APT will retry +# failed files the given number of times. +echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries # Ref.: https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#ubuntu curl -O https://repo.radeon.com/rocm/rocm.gpg.key diff --git a/.github/workflows/dependencies/dependencies_nofortran.sh b/.github/workflows/dependencies/dependencies_nofortran.sh index 61089ad8bf7..71a0cad915e 100755 --- a/.github/workflows/dependencies/dependencies_nofortran.sh +++ b/.github/workflows/dependencies/dependencies_nofortran.sh @@ -12,6 +12,11 @@ set -eu -o pipefail +# `man apt.conf`: +# Number of retries to perform. If this is non-zero APT will retry +# failed files the given number of times. +echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries + sudo apt-get update sudo apt-get install -y --no-install-recommends\ diff --git a/.github/workflows/dependencies/dependencies_nvcc11.sh b/.github/workflows/dependencies/dependencies_nvcc11.sh index a4b2f335a99..f66adf9224b 100755 --- a/.github/workflows/dependencies/dependencies_nvcc11.sh +++ b/.github/workflows/dependencies/dependencies_nvcc11.sh @@ -6,6 +6,11 @@ set -eu -o pipefail +# `man apt.conf`: +# Number of retries to perform. If this is non-zero APT will retry +# failed files the given number of times. +echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries + sudo apt-get -qqq update sudo apt-get install -y \ build-essential \ diff --git a/.github/workflows/dependencies/dependencies_nvcc12.sh b/.github/workflows/dependencies/dependencies_nvcc12.sh index 519b5fd6f7d..225fc9939f1 100755 --- a/.github/workflows/dependencies/dependencies_nvcc12.sh +++ b/.github/workflows/dependencies/dependencies_nvcc12.sh @@ -6,6 +6,11 @@ set -eu -o pipefail +# `man apt.conf`: +# Number of retries to perform. If this is non-zero APT will retry +# failed files the given number of times. +echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries + sudo apt-get -qqq update sudo apt-get install -y \ build-essential \ diff --git a/.github/workflows/dependencies/dependencies_nvhpc.sh b/.github/workflows/dependencies/dependencies_nvhpc.sh index 9e584c85498..8834089f67c 100755 --- a/.github/workflows/dependencies/dependencies_nvhpc.sh +++ b/.github/workflows/dependencies/dependencies_nvhpc.sh @@ -7,6 +7,11 @@ set -eu -o pipefail +# `man apt.conf`: +# Number of retries to perform. If this is non-zero APT will retry +# failed files the given number of times. +echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries + sudo apt-get -qqq update sudo apt-get install -y \ build-essential \ diff --git a/.github/workflows/dependencies/documentation.sh b/.github/workflows/dependencies/documentation.sh index 99696fbc606..782ca1d10f2 100755 --- a/.github/workflows/dependencies/documentation.sh +++ b/.github/workflows/dependencies/documentation.sh @@ -7,6 +7,11 @@ set -eu -o pipefail +# `man apt.conf`: +# Number of retries to perform. If this is non-zero APT will retry +# failed files the given number of times. +echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries + sudo apt-get update sudo apt-get install -y --no-install-recommends\