Fix missing mounts in execOp cache map#2076
Merged
Merged
Conversation
A bug in cloneExecOp prevented mounts from being included in the digest computed for the execOp cache map. This could lead to an exec being wrongly cached when a different mount was used for a subsequent execution. Repro case: https://gist.github.com/aaronlehmann/cfeaefc028df8127fb85b9b5f9125f2d In this example, pass2 should generate an empty diff because the /from and /to mounts are the same busybox image. But before the fix, it uses the cached result from pass1 (with different mounts) instead. Signed-off-by: Aaron Lehmann <[email protected]>
Member
|
As discussed in slack, lets try to add compatibility check like https://github.com/moby/buildkit/pull/1965/files#diff-aaa2e0f79475db4b6234888b8ab5c1b440a68b397bc43003b832a33b1ad6cb85R111 for the default case like |
tonistiigi
reviewed
Apr 14, 2021
added 2 commits
April 14, 2021 08:53
Signed-off-by: Aaron Lehmann <[email protected]>
…ache bugfix Signed-off-by: Aaron Lehmann <[email protected]>
aaronlehmann
force-pushed
the
missing-mounts-in-cachemap
branch
from
April 14, 2021 15:53
f676dff to
61bb15a
Compare
aaronlehmann
commented
Apr 14, 2021
| op.Mounts[0].CacheOpt == nil && | ||
| op.Mounts[0].SSHOpt == nil && | ||
| op.Mounts[0].SecretOpt == nil && | ||
| op.Mounts[0].ResultID == "" { |
Collaborator
Author
There was a problem hiding this comment.
When I run a simple Dockerfile through buildkit, I see the following in op.Mounts: [{"input":0,"dest":"/","output":0}]. I confirmed that this conditional works for my test case, but please make sure the exact checks make sense.
tonistiigi
approved these changes
Apr 14, 2021
Collaborator
Author
|
@tonistiigi: Is this ready to merge? |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A bug in
cloneExecOpprevented mounts from being included in the digestcomputed for the
execOpcache map. This could lead to an exec beingwrongly cached when a different mount was used for a subsequent
execution.
Repro case:
https://gist.github.com/aaronlehmann/cfeaefc028df8127fb85b9b5f9125f2d
In this example, pass2 should generate an empty diff because the /from
and /to mounts are the same busybox image. But before the fix, it uses
the cached result from pass1 (with different mounts) instead.
Signed-off-by: Aaron Lehmann [email protected]