-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: don't skip unlazy without blob check #4210
Conversation
Perhaps a long shot, but I wonder if #3856 might be fixed by this or have a similar cause? |
@aaronlehmann I think it's unlikely |
14f21d1
to
dfcb140
Compare
@ktock Looks like this PR has some effect on stargz cache import tests. Could you take a look? |
@tonistiigi Thanks for notifying me. I agree with the current implementation of Example patch based on your commit is like this : ktock@2c8acb0 |
@ktock I used your commit as a base and changed it around a bit. PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM about unlazy-related codes.
Left a comment about the containerd worker's differ.
Attrs: map[string]string{ | ||
"name": name2, | ||
"push": "true", | ||
"compression-level": "9", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
containerd-rootless
test uses containerd worker + native snapshotter. In this configuration, buildkitd relies on containred's differ via containerd client that doesn't support changing the compression level. So this doesn't produce the difference for the created blob. Can we use something like non-compressed tar or zstd here so that we can make sure the same layer with different compressed blobs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ktock I ran into the compression-level directive being ignored by exporters in another context, is that behavior documented somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tonistiigi This PR seems accidentally closed? #4275 doesn't include commits of this PR so could you rebase this PR on top of #4275 ? |
d733225
to
b6b85a0
Compare
d733225 is still needed to pass CI. |
Signed-off-by: Tonis Tiigi <[email protected]>
Signed-off-by: Kohei Tokunaga <[email protected]> Signed-off-by: Tonis Tiigi <[email protected]>
b6b85a0
to
5dccc0a
Compare
@ktock Sorry, I rebased the wrong branch. |
fixes #3809
What's happening is that two builds interact with layer that has same uncompressed digest and different compressed digest. In that case we detect this and "link" the records so they will use the same snapshot and avoid duplicates. https://github.com/moby/buildkit/blob/master/cache/manager.go#L218 This means that because of lazy references the blob saved with
getBlob()
has not been pulled while snapshot exists.In the #3809 problem arises when
Filelist
is called because of the SBOM attestationbuildkit/cache/filelist.go
Lines 37 to 50 in 3d44ec2
ReaderAt
because it can't find the blob. While there is anUnlazy
step before this call to make sure we have local data, the current check only looks for the snapshot and not the blob. I guess another way to trigger this would be to try to push the second build into a different registry that doesn't already have any of the base layers.Marking as draft for now as I try to find a way to trigger this with integration test.@sipsma