ci: install from the runner's package lists instead of refreshing them first - #23
Merged
Merged
Conversation
…m first
The timeout added yesterday did its job on the very next run: both CI jobs
stopped after ten minutes instead of three and a half hours, and named the step.
##[error]The action 'Install build dependencies' has timed out after 10 minutes.
Which turned a mystery into a measurement. Reading that job's log, the hang is
in apt-get update and not in the install: it got through nine of roughly thirty
repositories in ten minutes and never reached cmake. Those repositories include
Microsoft's azure-cli and prod feeds and Google's Chrome feed, none of which
this project has any use for; they ship with the runner image and get queried
every time.
The image already carries package lists, and cmake 3.22.1 has been in jammy
since release. So the install now runs against those lists, and only refreshes
them if a package cannot be found:
sudo apt-get install -y cmake ||
{ sudo apt-get update && sudo apt-get install -y cmake; }
The slow path is still there for the day a list really is stale. It just is not
the path taken every time.
Applied to all four apt steps: both CI jobs, the docs social-card libraries and
the Ubuntu leg of the release matrix. The shell of each was syntax-checked, and
the timeouts from the previous change are untouched.
This should also take a bite out of the normal case, where that step was the
single most expensive thing in CI: 193 seconds of the 5 minute test job and 75
of the 3 minute GUI job, to install packages that take seconds once the lists
are not being rebuilt from thirty remote repositories.
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.
The timeout from #22 did its job on the very next run. Both jobs stopped after ten minutes instead of three and a half hours, and named the step:
That turned a mystery into a measurement.
Where it actually hangs
Reading the failing job's log: the hang is in
apt-get update, not in the install. It got through nine of roughly thirty repositories in ten minutes and never reachedcmake.Those thirty include Microsoft's
azure-cliandprodfeeds and Google's Chrome feed. This project has no use for any of them; they ship with the runner image and get queried on every run.The change
The image already carries package lists, and
cmake3.22.1 has been in jammy since release. So install from those lists, and only refresh if a package cannot be found:The slow path survives for the day a list really is stale. It simply is not the path taken every time.
Applied to all four apt steps: both CI jobs, the docs social-card libraries, and the Ubuntu leg of the release matrix.
Expected side benefit
That step was the single most expensive thing in CI:
testGUI (Linux)Installing these packages takes seconds once the lists are not being rebuilt from thirty remote repositories.
Verified
The shell of each step was syntax-checked with
bash -n, the fallback branch was exercised both ways, and the timeouts from #22 are untouched: 8 of 8 jobs still carry a ceiling.