Skip to content

ci: optimize Docker image loading#1037

Merged
indygreg merged 1 commit intomainfrom
gps-ci-faster-image-loading
Mar 24, 2026
Merged

ci: optimize Docker image loading#1037
indygreg merged 1 commit intomainfrom
gps-ci-faster-image-loading

Conversation

@indygreg
Copy link
Collaborator

Loading images step currently takes ~30s +- a ton of variance.

Linux CI jobs are currently taking 8-20m typically. So image builds can be up to ~6% of wall time.

I've been playing around with further increasing Depot runner sizes. That delivers a considerable wall time reduction (<5m builds possible). This increases the percentage overhead of any "CI taxes," like restoring caches and pulling/loading container images.

This commit implements a pair of optimizations to enable the image loading step to take as little as 5s:

  • We parallelize the image decompression + loading using simple & + wait shell features.
  • We filter out images that aren't needed for the current job.

The filtering isn't fully lean - we don't currently filter out images related to cross-compiling.

And we still incur overhead to download images we don't load.

Those optimizations will wait for another day.

Loading images step currently takes ~30s +- a ton of variance.

Linux CI jobs are currently taking 8-20m typically. So image builds
can be up to ~6% of wall time.

I've been playing around with further increasing Depot runner sizes.
That delivers a considerable wall time reduction (<5m builds possible).
This increases the percentage overhead of any "CI taxes," like restoring
caches and pulling/loading container images.

This commit implements a pair of optimizations to enable the image
loading step to take as little as 5s:

* We parallelize the image decompression + loading using simple
  `&` + `wait` shell features.
* We filter out images that aren't needed for the current job.

The filtering isn't fully lean - we don't currently filter out
images related to cross-compiling.

And we still incur overhead to download images we don't load.

Those optimizations will wait for another day.
@jjhelmus
Copy link
Contributor

If you are looking at speeding up CI, splitting building dependencies from cpython and then reusing the built dependencies has the potential for a good improvement. #984 has a start for Windows.

@indygreg indygreg merged commit 3fee9bd into main Mar 24, 2026
511 checks passed
@indygreg indygreg deleted the gps-ci-faster-image-loading branch March 24, 2026 14: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.

2 participants