Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run-tests.yml: implement docker layer caching #996

Closed
wants to merge 3 commits into from

Conversation

hemberger
Copy link
Member

This GitHub Action caches all layers that are created after the step
where it is specified (which is why we pre-fetch some pull-only
images that we know we'll be using to run the tests).

The goal is faster CI by speeding up the build stage.

This GitHub Action caches all layers that are created after the step
where it is specified (which is why we pre-fetch some pull-only
images that we know we'll be using to run the tests).

The goal is faster CI by speeding up the build stage.
@codecov
Copy link

codecov bot commented Feb 17, 2021

Codecov Report

Merging #996 (20da9f4) into master (2ad5d65) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##             master    #996   +/-   ##
========================================
  Coverage      2.76%   2.76%           
  Complexity     4062    4062           
========================================
  Files            74      74           
  Lines         11201   11201           
========================================
  Hits            310     310           
  Misses        10891   10891           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 955f0af...20da9f4. Read the comment docs.

@hemberger
Copy link
Member Author

This seems to be reducing the build-and-test time by about 40% (~90 seconds). While this is pretty good, it's perhaps not quite enough to warrant all the extra complexity. Furthermore, there are concerns about performance degradation over time as the cache fills up with obsolete build layers (see satackey/action-docker-layer-caching#55).

For now, we'll stick with the simple, non-cached solution. But it's good to know that this works as expected should we have a more urgent need to reduce build times in the future. (It may also allow time for GitHub to provide a more "official" workflow for caching docker layers.)

First build, when the cache is empty:
image

Subsequent builds utilizing the cache:
image

@hemberger
Copy link
Member Author

There are more modern solutions to docker caching here: https://github.com/docker/build-push-action/tree/master/docs/advanced

@hemberger
Copy link
Member Author

Superseded by #1451.

@hemberger hemberger closed this Oct 13, 2022
@hemberger hemberger deleted the build-caching branch October 13, 2022 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant