ci(docker): retry dnf install on transient mirror failures#6003
Merged
Conversation
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.
oitel
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wrap every
dnf -y install(and thednf config-manager --add-repofor the gh-cli repo) in bothdocker/rockylinux8-vcpkgDockerfileanddocker/rockylinux9-vcpkgDockerfilewith the existingscripts/retry.shhelper (3 attempts, 30s backoff). MoveCOPY scripts/retry.sh /usr/local/bin/retry.shto the top of each build/production stage so it is available before the firstdnf installruns.Motivation
Run 25045542370 job 73359583376 on PR #5998 failed in the production stage at
rockylinux8-vcpkgDockerfile:69with:Every Rocky Linux 8.10 aarch64
baseosmirror returned 404 for those specific repodata files (Bahnhof, FAU, Intermax, hostico, ctrliq GCP, ftp.sh.cvut.cz, vhosting-it, melbourne, uv.es, ...). It is the classic Rocky Linux "stale repomd" sync gap —repomd.xmladvertises checksums that mirrors have not yet picked up, and clears after a few minutes once mirrors re-sync.#5985 already wraps
./vcpkg installwith retry, but #5985 does not coverdnf install— so this failure mode runs once and exits 1 with no retry. The same Dockerfiles also do adnf-command(config-manager)+dnf -y install ghblock in the production stage that hits cli.github.com, which is wrapped here for symmetry with the same kind of one-shot CDN flake.Implementation
docker/rockylinux8-vcpkgDockerfileCOPY scripts/retry.sh /usr/local/bin/retry.shto the top of thebuildstage (before the firstdnf install).COPY scripts/retry.sh /usr/local/bin/retry.shto theproductionstage (it was previously not present in that stage at all).dnf -y install ...withretry.sh --.dnf clean allis local and stays unwrapped.docker/rockylinux9-vcpkgDockerfileThe retry helper itself (
scripts/retry.sh, added in #5985) is unchanged.