Skip to content

CI: Use main Ubuntu archive instead of azure.archive.ubuntu.com - #4336

Merged
andypugh merged 1 commit into
LinuxCNC:masterfrom
grandixximo:ci-apt-mirror
Aug 4, 2026
Merged

CI: Use main Ubuntu archive instead of azure.archive.ubuntu.com#4336
andypugh merged 1 commit into
LinuxCNC:masterfrom
grandixximo:ci-apt-mirror

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

Problem

CI jobs that install build dependencies on GitHub-hosted runners occasionally stall until the 45 minute job timeout. The cause is the default apt mirror on the runners, azure.archive.ubuntu.com, which degrades to trickle speeds (tens of kB/s) for extended periods. Example: rip-rtai on #4335 spent 25 minutes downloading fonts-noto-cjk (61 MB) and was cancelled at the timeout.

This is a recurring upstream problem with the Azure mirror, reported many times in actions/runner-images (issues #7048, #12949, #675, #6913). GitHub's official response there is to use an alternative mirror.

Note that apt retries (Acquire::Retries) do not help here: the connection stays alive, it is only slow, so apt never sees an error to retry.

Fix

Switch the apt sources on the runner from azure.archive.ubuntu.com to archive.ubuntu.com before installing packages, in a small script called from install-deps.sh and from the cppcheck job (which calls apt directly). This covers all jobs that install dependencies on the GitHub-hosted Ubuntu runners. The container based package jobs are unaffected, they use Debian mirrors.

The sed handles both the traditional /etc/apt/sources.list and the deb822 format .sources files used on 24.04 runners.

Possible follow up

If we still see stalls after this (i.e. archive.ubuntu.com itself degrading from Azure), the next step would be a wrapper that runs apt under a timeout and, on expiry, rewrites the sources to a different mirror and retries. I did not include that here because it adds complexity for a failure mode we have not seen yet; the plain mirror swap removes the known offender. If stalls reappear I will implement the wrapper as a follow up.

The azure.archive.ubuntu.com apt mirror on GitHub-hosted runners
regularly degrades to trickle speeds for extended periods, stalling
package downloads until the job hits its timeout. This is a recurring
upstream problem, see actions/runner-images issues #7048 and #12949.
apt retries do not help because the connection stays alive, only slow.

Switch affected jobs to archive.ubuntu.com, which is consistently fast
from Azure.
@andypugh
andypugh merged commit bedcc57 into LinuxCNC:master Aug 4, 2026
16 checks passed
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.

2 participants