Skip to content

Let CI give up on an apt mirror that hangs - #20

Merged
stefan-azentrius merged 1 commit into
mainfrom
ci-apt-update
Nov 1, 2026
Merged

stefan-azentrius merged 1 commit into
mainfrom
ci-apt-update

Conversation

@stefan-azentrius

Copy link
Copy Markdown
Contributor

Every sudo apt-get update on the runner waits for the Ubuntu mirror until the job's time limit runs out when the mirror stops answering. On 2026-10-31 and 2026-11-01 that cancelled single jobs in Azentrius/cockpit-update-gaps, Azentrius/cockpit-host-settings and Azentrius/cockpit-image-update-monitor after 15 to 20 minutes without any output, while their sibling jobs finished the same step in seconds.

tools/apt-update.sh is the same file the add-ons use since Azentrius/cockpit-cronjobs#78 (blob 383c97c, executable):

  • It writes Acquire::http::Timeout "20", Acquire::https::Timeout "20" and Acquire::Retries "3" to /etc/apt/apt.conf.d/99-ci-timeouts, so they also apply to the apt-get install that follows.
  • It gives apt-get update -qq 150 seconds and three tries, 15 seconds apart. Each failed try gets a warning, and the step fails only after the third.

Both runner calls now use it: the tools step in test.yml and the Packages step in release.yml. Both run after the checkout, in the repository root. The apt-get calls inside the Debian container of the repository test stay as they are: the script is not there, and they go to Debian's mirror and the local test repository.

make lint checks the script with shellcheck. CI on this pull request runs the changed test step; the release step is the same two lines.

Both `sudo apt-get update` calls on the runner (the test workflow's tools
step and the release workflow's Packages step) now go through
tools/apt-update.sh, the same file as in Cron Jobs: it sets apt's
download timeouts and retries for the rest of the job and gives the
update 150 seconds and three tries.
@stefan-azentrius
stefan-azentrius merged commit 3793c87 into main Nov 1, 2026
5 checks passed
@stefan-azentrius
stefan-azentrius deleted the ci-apt-update branch November 1, 2026 00:36
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