Skip to content

Commit

Permalink
CI: Retry Apt Repos (#3242)
Browse files Browse the repository at this point in the history
Since Intel Repos are often out-of-sync with each others for apt
packages provided (checksum errors), we try to pause and retry up to
five times to get them installed.

Also set apt retries to 3 for `apt update`.
  • Loading branch information
ax3l authored Apr 7, 2023
1 parent 7d6d87a commit 2f68f00
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/dependencies/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/dependencies/dependencies_clang-tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions .github/workflows/dependencies/dependencies_clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/dependencies/dependencies_dpcpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
5 changes: 5 additions & 0 deletions .github/workflows/dependencies/dependencies_gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/dependencies/dependencies_hip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/dependencies/dependencies_nofortran.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/dependencies/dependencies_nvcc11.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/dependencies/dependencies_nvcc12.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/dependencies/dependencies_nvhpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/dependencies/documentation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Expand Down

0 comments on commit 2f68f00

Please sign in to comment.