Repository navigation
Description
Problem
The Tier 2 Linux jobs that run in the stock ubuntu:26.04 container fetch every package from one source, archive.ubuntu.com over HTTP (/etc/apt/sources.list.d/ubuntu.sources). There is no other mirror to fall back to. These jobs are the build job's Install Git 📦 and Install Tier 2 Packages 📦 steps, and the runtime delta install in rust/tools/linux-validate/ci-runtime.py in the tests jobs. Jobs on the prebaked image or the Dell runner do not fetch from the archive.
On 2026-11-23 the archive was slow or unreachable from GitHub's hosted runners for hours:
- test: characterize canvas channel replacement #5142 (fork PR) failed 3 times in 3 different apt steps (run 45113911635: a 10-minute step timeout, a timeout in the unpack (ci: Install Git in the Tier 2 Linux build cannot recover after a timeout stops dpkg (no dpkg --configure -a in its retry) #5504), then
ci-runtime.pyexit 124). - ci: a timed-out Tier 2 runtime delta install retries once after dpkg recovery #5508 failed twice in
Install Git 📦; in run 45159376402apt-get updatehit its 180 s bound in all 3 attempts, so not even the index came through. - The same
ubuntu:26.04container on another network installed git from the same archive at 100 to 200 KB/s.
#5504 (#5506, #5508) makes the retries recover after a timeout, but a retry against the same slow source cannot help.
The host jobs already have a fallback: the runner image's /etc/apt/apt-mirrors.txt lists the Azure mirror (http://azure.archive.ubuntu.com/ubuntu/) and the HTTPS archive (https://archive.ubuntu.com/ubuntu/) for apt's mirror+file: method, and ci/host_apt_mirrors.py sets their order (#1269).
Proposal
- Keep the mirror URIs in one place:
ci/host_apt_mirrors.pyexports the list it recognizes (Azure and the Ubuntu archive), and a function that writes a container mirror list from it. - In the build job's container, before the first
apt-get updateinInstall Git 📦, pointubuntu.sourcesatmirror+file:/etc/apt/apt-mirrors.txt. The bootstrap list uses HTTP only (Azure, thenhttp://archive.ubuntu.com/ubuntu/): the stock image has noca-certificatesuntilInstall Git 📦installs them. The security pocket keeps its own source. - Use the same list in the containers that
ci-runtime.pystarts, so the runtime delta install can fall back too. - Keep the existing bounds:
Acquire::Retries, the 15 to 20 s transport timeouts, the 180 s command bounds and the step limits.
Open question for the PR: which mirror goes first in the container. #1269 saw slow Azure transfers on the host (run 39788036193) and put the HTTPS archive first; in the container HTTPS is only possible after the bootstrap. The PR measures both orders on hosted runners and records the result.
Tests
- RED:
ci/test_tier2_apt_cache.py(and the runtime tests) check that the container steps write the mirror list from the shared definition before the firstapt-get update, and thatubuntu.sourcesnamesmirror+file:. Today both fail. - A test in
ci/test_host_apt_mirrors.pychecks that the host recognizer and the container list use the same URIs. - A real run of the changed steps in
ubuntu:26.04: the install works through the mirror list, and with the first mirror unreachable it falls back to the second.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
vpacher commentedon Nov 23, 2026
Claiming: #5510
Decisions:
host_apt_mirrors.py(archive first) where HTTPS is possible, and Azure HTTP first for the bootstrap, where it is not. The PR measures both orders on hosted runners; if Azure is slower there too, the bootstrap puts the HTTP archive first and keeps Azure as the fallback.ci/host_apt_mirrors.py; the container steps call it, so the host and container lists cannot drift apart.Plan (one PR, after #5508 lands, since it touches the same steps): RED tests for the container mirror list and the shared URIs, then GREEN in
Install Git 📦andci-runtime.py, with a realubuntu:26.04run that blocks the first mirror.vpacher commentedon Nov 23, 2026
Plan update: a third mirror, and Azure first in the container.
Container mirror list, in order:
http://azure.archive.ubuntu.com/ubuntu/(Azure, where the hosted runners are; the runner image also lists it first)http://archive.ubuntu.com/ubuntu/(Canonical)http://mirrors.edge.kernel.org/ubuntu/(kernel.org's CDN mirror, outside both Azure and Canonical; HTTPS onceca-certificatesis installed)Packages stay signed by the archive's
Releasefiles, so a third mirror does not change what is trusted. The risk is lag: a mirror that syncs later can miss a version thatruntime-packages.txtpins, and apt then falls through to the next mirror. On 2026-11-23 all three servedresoluteandresolute-updateswith the same index date (2026-11-22 12:43 UTC). The security pocket keeps its own source. The list lives once inci/host_apt_mirrors.py, and the PR checks the fallback with the first mirror blocked.vpacher commentedon Nov 23, 2026
Correction to the plan, after a test: a
mirror+file:list does not fix the failure we saw.Test in
ubuntu:26.04(apt 3.2), first mirror a fake that accepts connections and never answers, second mirrorarchive.ubuntu.com:apt-get updateundertimeout 180Ignfrom the fake mirrorIgnfrom the fake mirrorapt falls back file by file and waits the full timeout on the dead mirror for each index file; it never marks a mirror as dead. A fake mirror that sent invalid data was left within 2 s, so the list only helps when a mirror fails fast. In run 45159376402,
apt-get updatehung in all 3 attempts.Also, the hosted runners are not always in Azure: the host Fast Gate jobs of the same day fetched from
http://us-east-2.ec2.archive.ubuntu.com(09:14Z) andhttps://archive.ubuntu.com(10:49Z). The runner image's mirror list follows the cloud.New plan: the existing retry loop points the main source at a different mirror on each attempt, so a hanging mirror costs one 180 s attempt:
/etc/apt/apt-mirrors.txt, mounted read-only into the container);archive.ubuntu.comif there is none;http://archive.ubuntu.com/ubuntu/;http://mirrors.edge.kernel.org/ubuntu/.security.ubuntu.comstays as its own source (it answered in every test).ci/host_apt_mirrors.pyholds the fallback list and the rule for the runner's mirror; a test runs the step's shell against the same fixtures, so the two cannot differ.ci-runtime.pyuses the next mirror for its one timeout retry. The PR test repeats the fake hanging mirror: attempt 1 hangs, attempt 2 passes.ci: the Tier 2 containers use another apt mirror on each attempt, the…