From 015a7c92b29802352c16052695b7d529460a733e Mon Sep 17 00:00:00 2001 From: Fedor Chelnokov Date: Tue, 28 Apr 2026 15:08:57 +0300 Subject: [PATCH] ci(docker): retry dnf install on transient mirror failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wrap every `dnf -y install` (and `dnf config-manager --add-repo`) in both `docker/rockylinux8-vcpkgDockerfile` and `docker/rockylinux9-vcpkgDockerfile` with the existing `retry.sh` helper (3 attempts, 30s backoff). Move the `COPY scripts/retry.sh` to the top of each build/production stage so it is available before the first `dnf install` runs. Run https://github.com/MeshInspector/MeshLib/actions/runs/25045542370/job/73359583376 on PR #5998 failed in the production stage at line 69 with: Error: Failed to download metadata for repo 'baseos': repodata/...-primary.xml.gz - Cannot download, all mirrors were already tried without success repodata/...-filelists.xml.gz - Cannot download, ... repodata/...-updateinfo.xml.gz - Cannot download, ... Every Rocky Linux 8.10 (aarch64) baseos mirror returned 404 for those specific repodata files — the classic "stale repomd" sync gap that clears after a few minutes once mirrors re-sync. #5985 already wraps `./vcpkg install` with retry but does not cover `dnf install`, so this failure mode hits without retry. Same Dockerfile also has the gh-cli install RUN block that hits cli.github.com — wrapped for the same reason. --- docker/rockylinux8-vcpkgDockerfile | 18 +++++++++++------- docker/rockylinux9-vcpkgDockerfile | 16 ++++++++++------ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/docker/rockylinux8-vcpkgDockerfile b/docker/rockylinux8-vcpkgDockerfile index b096d6d8f750..8d645e6ae0a8 100644 --- a/docker/rockylinux8-vcpkgDockerfile +++ b/docker/rockylinux8-vcpkgDockerfile @@ -4,9 +4,12 @@ ARG VCPKG_TRIPLET=x64-linux-meshlib FROM rockylinux:8 AS build +COPY scripts/retry.sh /usr/local/bin/retry.sh + RUN echo "install_weak_deps=false" >> /etc/dnf/dnf.conf && \ - dnf -y install epel-release && \ - dnf -y install --enablerepo powertools \ + $(: network may flake ) \ + retry.sh -- dnf -y install epel-release && \ + retry.sh -- dnf -y install --enablerepo powertools \ git cmake gcc-toolset-11 ninja-build clang-devel \ $(: vcpkg requirements ) \ curl zip unzip tar \ @@ -43,7 +46,6 @@ RUN sed -i 's|https://ftp.gnu.org/|https://www.mirrorservice.org/sites/ftp.gnu.o COPY requirements/vcpkg-linux.txt MeshLib/requirements.txt COPY thirdparty/vcpkg/ports MeshLib/ports COPY thirdparty/vcpkg/triplets MeshLib/triplets -COPY scripts/retry.sh /usr/local/bin/retry.sh ARG VCPKG_TRIPLET ENV VCPKG_TRIPLET=$VCPKG_TRIPLET @@ -58,6 +60,7 @@ RUN ./vcpkg export --host-triplet=${VCPKG_TRIPLET} --overlay-triplets=MeshLib/tr FROM nvidia/cuda:12.0.1-devel-rockylinux8 AS production COPY --from=build /opt/vcpkg /opt/vcpkg +COPY scripts/retry.sh /usr/local/bin/retry.sh ENV MR_STATE=DOCKER_BUILD ENV MESHLIB_USE_VCPKG=ON @@ -67,7 +70,8 @@ ARG VCPKG_TRIPLET ENV VCPKG_TRIPLET=$VCPKG_TRIPLET RUN echo "install_weak_deps=false" >> /etc/dnf/dnf.conf && \ - dnf -y install --enablerepo powertools \ + $(: network may flake ) \ + retry.sh -- dnf -y install --enablerepo powertools \ git cmake gcc-toolset-11 ninja-build clang-devel \ $(: vcpkg requirements ) \ curl zip unzip tar \ @@ -81,9 +85,9 @@ RUN echo "install_weak_deps=false" >> /etc/dnf/dnf.conf && \ dnf clean all # install github-cli -RUN dnf -y install 'dnf-command(config-manager)' && \ - dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo && \ - dnf -y install gh && \ +RUN retry.sh -- dnf -y install 'dnf-command(config-manager)' && \ + retry.sh -- dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo && \ + retry.sh -- dnf -y install gh && \ dnf clean all # install aws cli diff --git a/docker/rockylinux9-vcpkgDockerfile b/docker/rockylinux9-vcpkgDockerfile index 56b364d4df70..22bd8346b175 100644 --- a/docker/rockylinux9-vcpkgDockerfile +++ b/docker/rockylinux9-vcpkgDockerfile @@ -4,8 +4,11 @@ ARG VCPKG_TRIPLET=x64-linux-meshlib FROM rockylinux:9 AS build +COPY scripts/retry.sh /usr/local/bin/retry.sh + RUN echo "install_weak_deps=false" >> /etc/dnf/dnf.conf && \ - dnf -y install --enablerepo crb \ + $(: network may flake ) \ + retry.sh -- dnf -y install --enablerepo crb \ git cmake ninja-build clang-devel \ $(: vcpkg requirements ) \ curl-minimal zip unzip tar \ @@ -32,7 +35,6 @@ RUN sed -i 's|https://ftp.gnu.org/|https://www.mirrorservice.org/sites/ftp.gnu.o COPY requirements/vcpkg-linux.txt MeshLib/requirements.txt COPY thirdparty/vcpkg/ports MeshLib/ports COPY thirdparty/vcpkg/triplets MeshLib/triplets -COPY scripts/retry.sh /usr/local/bin/retry.sh ARG VCPKG_TRIPLET ENV VCPKG_TRIPLET=$VCPKG_TRIPLET @@ -45,6 +47,7 @@ RUN ./vcpkg export --host-triplet=${VCPKG_TRIPLET} --overlay-triplets=MeshLib/tr FROM nvidia/cuda:12.0.1-devel-rockylinux9 AS production COPY --from=build /opt/vcpkg /opt/vcpkg +COPY scripts/retry.sh /usr/local/bin/retry.sh ENV MR_STATE=DOCKER_BUILD ENV MESHLIB_USE_VCPKG=ON @@ -54,7 +57,8 @@ ARG VCPKG_TRIPLET ENV VCPKG_TRIPLET=$VCPKG_TRIPLET RUN echo "install_weak_deps=false" >> /etc/dnf/dnf.conf && \ - dnf -y install --enablerepo crb \ + $(: network may flake ) \ + retry.sh -- dnf -y install --enablerepo crb \ git cmake ninja-build clang-devel \ $(: vcpkg requirements ) \ curl-minimal zip unzip tar \ @@ -68,9 +72,9 @@ RUN echo "install_weak_deps=false" >> /etc/dnf/dnf.conf && \ dnf clean all # install github-cli -RUN dnf -y install 'dnf-command(config-manager)' && \ - dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo && \ - dnf -y install gh && \ +RUN retry.sh -- dnf -y install 'dnf-command(config-manager)' && \ + retry.sh -- dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo && \ + retry.sh -- dnf -y install gh && \ dnf clean all # install aws cli