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

cache test image results #97

Open
turadg opened this issue Feb 8, 2024 · 0 comments
Open

cache test image results #97

turadg opened this issue Feb 8, 2024 · 0 comments

Comments

@turadg
Copy link
Member

turadg commented Feb 8, 2024

Problem to be solved

We now have caching of build layers (#2) so that the build step takes just seconds if nothign has changed. (e.g. push to main)

But the tests still takes tens of minutes to run. Some of that time is (in ascending duration):

  • building the test stage on top of the use stage
  • transferring the full image from the remote builder to the action runner
  • running the entrypoint of the test image to verify all checks pass

When the image has the same sha as a previously tested image, there's no need to do the last two steps.

Description of design

First, use caching in the action runner (perhaps https://github.com/actions/cache) to check whether a particular test image (by sha) has already been run. If it has, trust that earlier run's status.

That will shave off most of the time. A further optimization is to get the sha before loading the image, and only loading if it needs to run locally.

It may be tempting to make a "verified" image that's like test but has the test as a RUN instead of ENTRYPOINT. One downside to that is we pay for build minutes, but not test minutes. Another is that conceptually, there's no need to tag and maintain such an image because it's internal state doesn't matter.

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

No branches or pull requests

1 participant