Skip to content

ci: fall back across Ubuntu mirrors when installing valgrind - #345

Merged
kvlonge merged 2 commits into
mainfrom
ci/apt-mirror-fallback
Nov 30, 2026
Merged

kvlonge merged 2 commits into
mainfrom
ci/apt-mirror-fallback

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Why

archive.ubuntu.com stopped answering from GitHub's runners (connection failed over IPv4, network unreachable over IPv6). The Install valgrind step points apt only at that host, so Checks, tests and replay fails before any check runs on every pull request.

Changes

  • Install valgrind tries the runner's own mirror first, then archive.ubuntu.com, then mirrors.edge.kernel.org, moving on when apt-get install finds no valgrind.
  • apt still verifies the archive's signatures on every mirror.
  • When every mirror fails, the step ends with an error annotation naming it an infrastructure failure, not a failure of the change, to be rerun once a mirror answers.

Verification

  • This pull request's own Checks, tests and replay runs the new step.
  • Rewrote a copy of deb822 sources through both fallbacks and checked the URIs. On the runner the security stanza also uses mirror+file:, so a fallback moves it to the chosen mirror, which carries noble-security too.
  • The workflow parses as YAML, the step passes bash -n, and the clutter guard passes.

archive.ubuntu.com stopped answering from the runners, so Install valgrind
failed on every attempt and Checks, tests and replay failed before any
check ran. apt now tries the runner's own mirror first, then
archive.ubuntu.com, then mirrors.edge.kernel.org, and still verifies the
archive's signatures.
When no mirror serves valgrind, the step now ends with an error annotation
saying the failure is the infrastructure's, not the change's, and that the
job should be rerun once a mirror answers.

@kvlonge kvlonge left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review of 2bfdb64 (both commits). No blocking findings.

Signatures. The fallbacks rewrite only the source URIs. Each stanza keeps its Signed-By keyring, and nothing adds trusted=yes or --allow-unauthenticated. mirrors.edge.kernel.org serves Ubuntu's own signed InRelease for noble, noble-updates, noble-security and noble-backports (checked by fetching each), so apt verifies it against the same key.

No success without valgrind. The step reaches exit 0 only after apt-get install ... valgrind returns 0. If every mirror fails, it ends with exit 1. The instruction-count guard is unchanged: make check-merge runs it, and count_instructions.rs:25-34 errors with "cannot run valgrind" when the binary is missing, so the guard cannot be skipped.

Failure message. The final ::error title=Infrastructure failure:: names all three mirrors and says the failure is infrastructure, not the change.

Source in the log. apt prints the mirror it actually used. The cancelled run for 99d44fc shows Hit:2 http://azure.archive.ubuntu.com/ubuntu noble InRelease, and every pocket was fetched from the runner's Azure mirror in 1 s.

Non-blocking:

  • A line such as echo "valgrind source: $mirror" before exit 0 would name the winning fallback in one line, so readers would not need to scan apt's Get:/Hit: lines.
  • The Verification note says the security pocket stays on security.ubuntu.com. On the runner, the image already points the security stanza at mirror+file: (actions/runner-images configure-apt-sources.sh), so a fallback moves security to the chosen mirror. Both fallback mirrors carry noble-security, so this is harmless.
  • The step runs under bash -e without pipefail. If sed failed in the rewrite pipeline, xargs would return 123 and the step would stop before trying the next mirror, without the infrastructure message. This is very unlikely, and the change only moved this existing pattern.

@kvlonge
kvlonge added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit ba4f2b4 Nov 30, 2026
12 checks passed
@kvlonge
kvlonge deleted the ci/apt-mirror-fallback branch November 30, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant