Repository navigation
Keep CI's apt installs from waiting out a slow Ubuntu mirror - #83
Merged
Merged
Conversation
A job on #82 sat in "Install the toolchain" until it was cancelled, and so did one of this morning's AVR jobs. That one's log says what happened: apt-get update fetched its indices at 13 MB/s, then the package downloads from azure.archive.ubuntu.com crawled - cmake's 14 MB took five minutes, gcc-avr's 57 MB was still arriving thirteen minutes later when the job's timeout cancelled it. A trickling connection is not a dead one, so apt never gives up on it; across the last 60 runs the step otherwise takes 10-25 s. All six apt steps now go through .github/actions/apt-install: - the .deb files are cached, keyed by the file names --print-uris lists - which carry the versions - so an unchanged set downloads nothing and a new version in the archive is a new key by itself; - what is missing is fetched with --download-only under a timeout and retried on a new connection, and apt-get update the same way; - the install then runs from the cache with no timeout, since killing dpkg mid-unpack would break the runner rather than slow it. Tried locally against the container's mirror: --download-only into a directory of the job's own, the chown that lets the cache step read it, and a second run answering "Need to get 0 B". The GitHub side - cache restore and save inside a composite action - is first exercised by this pull request's own run.
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.
A job on #82 sat in Install the toolchain until it was cancelled, and so did one of this morning's AVR jobs.
What the log says
apt-get updatefetched its indices at 13 MB/s.azure.archive.ubuntu.comthen crawled: cmake's 14 MB took five minutes.A trickling connection is not a dead one, so apt never gives up on it. Across the last 60 runs this step otherwise took 10–25 s.
What changed
All six apt steps (two in
ci.yml, four instatic-analysis.yml) now go through.github/actions/apt-install:.debfiles are cached. The key is built from the file namesapt-get install --print-urislists, and those names carry the versions. An unchanged set downloads nothing from the mirror, and a new version in the archive produces a new key automatically. The key ignores the mirror URL, which differs between runners.--download-onlyunder a timeout (240 s, up to four attempts). Each retry uses a new connection.apt-get updategets the same treatment (120 s, three attempts), becauseci.ymlrecords that it hung once too.Tested
--download-onlyinto the job's own directory works. So does thechownthat lets the cache step read the files back. A second run reportsNeed to get 0 B.