ci(docker): retry vcpkg install on transient download failures#5985
Open
ci(docker): retry vcpkg install on transient download failures#5985
Conversation
Wrap the vcpkg install RUN in both rockylinux8-vcpkg and
rockylinux9-vcpkg Dockerfiles with a 3-attempt for-loop and 30 s
backoff. Catches transient HTTP 502s (and similar one-shot network
blips) from github.com's source-archive endpoint when vcpkg downloads
port tarballs.
Concretely motivated by run 24927294301 / job 72999298143 on
feat/zlib-compress-stream-zlib-ng, which failed with:
error: curl operation failed with response code 502.
error: curl operation failed with response code 502.
error: Reached maximum number of attempts, won't retry download
from https://github.com/malaterre/GDCM/archive/v3.2.2.tar.gz
CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:136:
Download failed, halting portfile.
error: building gdcm:x64-linux-meshlib failed with: BUILD_FAILED
vcpkg's own download retry count is hardcoded at 3 inside the vcpkg
binary and is not exposed via env var or CLI flag. Wrapping at the
RUN-level retries the whole `./vcpkg install` invocation, which is
near-free because vcpkg's per-port build cache short-circuits any
port already installed in a previous attempt; only the failed-to-
download port is actually re-fetched on retry.
Same change applied to both rockylinux8 and rockylinux9 dockerfiles
so the two stay in lockstep.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
./vcpkg installin bothdocker/rockylinux8-vcpkgDockerfileanddocker/rockylinux9-vcpkgDockerfilewith a 3-attempt retry loop (30 s backoff). Catches transient HTTP 502s and other one-shot network blips from github.com's source-archive endpoint when vcpkg downloads port tarballs at image-build time.Motivation
Run 24927294301 job 72999298143 on PR #5959 failed with:
That's a transient response from GitHub's auto-generated
/archive/<ref>.tar.gzendpoint — github.com served two 502s in a row, vcpkg's hardcoded internal retry limit of 3 attempts was reached, and the entire image build failed. Same kind of one-shot CDN flake that #5966'swretry.actionwrapper forgha-setup-ninjasolved on the Windows side.Why a workflow-level retry rather than vcpkg-level
vcpkg's
vcpkg_download_distfileretry count is hardcoded at 3 inside the compiled vcpkg binary — there's no env var, no CLI flag, no cmake variable that exposes it. (Long-standing GitHub issue, no fix planned.)A retry loop at the Dockerfile
RUNlevel is the simplest and most effective workaround:/root/vcpkg/installed/...immediately. We pay roughly the time of one download attempt per retry, not a full clean rebuild.X_VCPKG_ASSET_SOURCESis a more strategic fix but requires bucket setup and is a much larger change. This retry loop is the targeted fix.)seanmiddleditch/gha-setup-ninjainWandalen/wretry.actionfor the same reason — a download endpoint that's mostly fine but occasionally serves a 5xx.Implementation
Same shape applied to
rockylinux9-vcpkgDockerfile(differentsourcelines for autoconf271, but the loop body and packages list expression are identical).Scope
Two files, +28 / −2. No source code changes; no behavioural change on the happy path; new behaviour visible only when
vcpkg installexits non-zero in any one of the first two attempts.Future work
A separate follow-up should plumb the same retry loop into MeshInspectorCode's
docker/rockylinux8-vcpkgDockerfileanddocker/rockylinux9-vcpkgDockerfile, which have the same exposure. Out of scope here so this PR can land focused.🤖 Generated with Claude Code