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

Rework cache key generation a bit. #375

Merged
merged 2 commits into from
Oct 3, 2018

Conversation

dlorenc
Copy link
Collaborator

@dlorenc dlorenc commented Sep 29, 2018

Cache keys are now based on the previous commands, rather than the previous state
of the filesystem.

This will allow us to add some further optimizations to caching.

Still needs some tests.

@dlorenc
Copy link
Collaborator Author

dlorenc commented Sep 29, 2018

/wip

@dlorenc
Copy link
Collaborator Author

dlorenc commented Oct 1, 2018

This should be ready for a review now.

@priyawadhwa
Copy link
Collaborator

I really like the CompositeCache idea! So I was using the current state of the filesystem for Dockerfiles like this:

FROM gcr.io/google-appengine/debian9@sha256:1d6a9a6d106bd795098f60f4abb7083626354fa6735e81743c7f8cfca11259f0
RUN apt-get update && apt-get install -y make
COPY foo /foo

With this switch, if foo is changed then the entire Dockerfile will be rebuilt, even though the first RUN command may have been cached on a previous run and could still be used.

Instead of the entire source context, WDYT of adding the snapshotted files as they're added by each command? (I think that should work but not 100% sure).

@dlorenc dlorenc force-pushed the cacherework branch 2 times, most recently from d6d6fef to 6434208 Compare October 2, 2018 13:02
Cache keys are now based on the previous commands, rather than the previous state
of the filesystem.
@dlorenc dlorenc force-pushed the cacherework branch 3 times, most recently from 9bd6f5b to a20f002 Compare October 3, 2018 13:07
@dlorenc
Copy link
Collaborator Author

dlorenc commented Oct 3, 2018

Whoo, finally passing!

Copy link
Collaborator

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dlorenc dlorenc merged commit 734ffe6 into GoogleContainerTools:master Oct 3, 2018
@dlorenc dlorenc deleted the cacherework branch October 3, 2018 21:16
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.

3 participants