-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
add unit tests for caching run and copy #888
add unit tests for caching run and copy #888
Conversation
791f8e4
to
8299292
Compare
I think I may have found a bug, which is that CachingCopy and Copy return different values for Here it will be the non caching version of the command Line 152 in bfd8562
Here it will be the caching version of the command Line 243 in bfd8562
|
8299292
to
520dd2a
Compare
After thinking about this more; I don't think it is technically a bug since CachingCopy and CachingRun commands are not pushed to the cache (since they are already there) so the cache keys produced for the caching and non-caching version may have never been intended to be the same. Where this becomes an issue are possible changes where we start using the cache key of layer A in the cache key of layer B (IE COPY --from) So probably not a bug, but perhaps unexpected. |
So this actually is a bug in the case of caching copy commands. CopyCommand and CachingCopyCommand produce a different cachekey. This means that the cache key used to look up the cached layer (in The bug becomes apparent when you have a dockerfile that contains a cached copy command followed by other commands like RUN. This is due to the fact that we continuously append the composite cache with new keys. This means that after the cached copy command, optimize and build produce different cache keys. Example below
This results in This bug is filed as #899 |
d31eff2
to
e517fe4
Compare
e517fe4
to
2aa481c
Compare
Description
Adds unit tests for caching copy and run
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Reviewer Notes
Release Notes