-
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
Fix cache cannot reuse lazy layers #3109
Conversation
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.
Is this specific to stargz or for unpulled layers as well. Eg. cache match for merge(image(), ..)
.
Do we have a guarantee that we have connected the correct remote provider when the actual cache load would happen in this case?
Thinking out loud: not sure if a cache match on unpulled non-stargz layers is really that useful. If you need to pull the layers anyways then that's as good as a cache miss. I'm guessing that for stargz this matters because you can have a "half-pulled" layer where some of the data is present locally but you still need a remote provider for the unpulled data, is that correct @ktock? For the change itself, it seems like the main code path where The other place If there's a different way of guaranteeing the record will be loadable that's simpler then I'm all for it, the above is just my first thought looking through the code paths. |
b8387a4
to
39c8707
Compare
Thank you for taking a look at this.
Thank you for elaborating this. Yes, it's correct.
Thank you for the suggestion. Fixed the patch to pass cache opts to |
@ktock Could you also take a look at docker/buildx#1325 (comment) . Lmk if you think that is completely different. |
@tonistiigi @sipsma It seems that docker/buildx#1325 (comment) can be addressed separately from this PR. (Please see also #3229). |
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.
This does not mean thatRecords()
can be a long-running call, right? Because it looks like it is called directly from the scheduler event loop where blocking is not allowed.
@tonistiigi It seems that the call of |
e9d3c6f
to
e198844
Compare
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
e198844
to
085bd8a
Compare
CI passed, can we move this patch forward? @tonistiigi |
Fixes docker/buildx#1306
Currently, cache cannot reuse lazy layers that returns
cache.NeedsRemoteProviderError
oncacheresult.cacheResultStorage.Exist()
.This causes the issue that cache doesn't reuse lazy layers as reported in docker/buildx#1306 .
This commit tries to fix this issue by allowing
cache.NeedsRemoteProviderError
during cache lookup.