-
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
[s3 cache] Fix upload of downloaded layer #5597
base: master
Are you sure you want to change the base?
Conversation
2190c2f
to
f04b18a
Compare
@tonistiigi I'm not sure why buildkit need to download the layers a second time. |
If the layers exist already in the same cache location, then they should not be uploaded. It should check that the layer is already available at the target and skip it(including skip downloading it). This is how it works in the registry backend, for example, I'm not sure about s3. |
No my question was not clear (and I confirm that the s3 remote cache will not upload the layers if they already exists). To reproduce the issue #5584., we launch a build which
|
If you export cache with Another cases that you may be seeing is 1) layers remaining lazy on initial cache match because nothing accesses their contents (I don't think this is the case if you say image was loaded to docker) 2) something specific to s3 if you are seeing the same layer being downloaded again. |
@tonistiigi: Moved this side conversation here: #5598, with a full reproduction on remote cache registry. Can you review this PR? Thx |
see moby#5584. Seems this is a regression related to moby#4551, which happen when buildkit need to export a S3 layer directly from a downloaded S3 layer. With the new wrapper, there is no exception, and buildkit download and re upload them without any issue. Checksum and size of layers are identical. Signed-off-by: Bertrand Paquet <[email protected]>
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.
Can you explain this change more(or add comments)? On first look it isn't entirely obvious what the difference is between this custom Read
implementation and the io.SectionReader
it is replacing.
Is the issue that the |
see #5584.
Seems this is a regression related to #4551, which happen when buildkit need to export a S3 layer directly from a downloaded S3 layer.
With the new wrapper, there is no exception, and buildkit download and re upload them without any issue. Checksum and size of layers are identical.