-
Notifications
You must be signed in to change notification settings - Fork 14
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
Multi-platform caching for buildx #981
Closed
Closed
Conversation
This file contains 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
This was referenced Feb 5, 2024
Closed
Closed
Closed
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Does the PR have any schema changes?Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
Maintainer note: consult the runbook for dealing with any breaking changes. |
blampe
force-pushed
the
unknown-inputs
branch
from
February 6, 2024 17:44
bb70dec
to
6fe24f1
Compare
blampe
force-pushed
the
multi-platform-cache
branch
2 times, most recently
from
February 9, 2024 00:25
6ffd5df
to
51fc69b
Compare
blampe
force-pushed
the
unknown-inputs
branch
2 times, most recently
from
February 10, 2024 00:45
6c5dd77
to
7b29065
Compare
blampe
force-pushed
the
multi-platform-cache
branch
from
February 10, 2024 00:45
51fc69b
to
55990b6
Compare
blampe
force-pushed
the
multi-platform-cache
branch
from
February 13, 2024 20:20
55990b6
to
98a76d1
Compare
blampe
force-pushed
the
unknown-inputs
branch
from
February 13, 2024 22:27
7b29065
to
0eb4c59
Compare
blampe
force-pushed
the
multi-platform-cache
branch
from
February 13, 2024 22:28
98a76d1
to
e777254
Compare
blampe
force-pushed
the
multi-platform-cache
branch
from
February 13, 2024 23:48
e777254
to
6c70bf9
Compare
blampe
force-pushed
the
unknown-inputs
branch
from
February 15, 2024 19:15
0eb4c59
to
a39229a
Compare
blampe
force-pushed
the
multi-platform-cache
branch
from
February 15, 2024 19:16
6c70bf9
to
993f4f2
Compare
Closed
blampe
force-pushed
the
unknown-inputs
branch
from
February 15, 2024 19:26
a39229a
to
91ed187
Compare
blampe
force-pushed
the
multi-platform-cache
branch
from
February 15, 2024 19:29
993f4f2
to
65c365b
Compare
blampe
force-pushed
the
unknown-inputs
branch
2 times, most recently
from
February 15, 2024 22:03
98a9812
to
9a85afe
Compare
blampe
force-pushed
the
multi-platform-cache
branch
from
February 15, 2024 22:06
65c365b
to
7e84223
Compare
blampe
force-pushed
the
unknown-inputs
branch
from
February 28, 2024 22:58
9a85afe
to
ec823fd
Compare
blampe
force-pushed
the
multi-platform-cache
branch
from
February 29, 2024 19:29
7e84223
to
a3aebfb
Compare
blampe
force-pushed
the
multi-platform-cache
branch
from
March 5, 2024 20:54
a3aebfb
to
faee9fa
Compare
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.
buildkit doesn't support multi-platform caches, so
--cache-to
with--platforms
can race such that only one platform is cached and subsequentoperations must re-build remaining platforms.
The recommended workaround is to perform a build without
--cache-to
, and thenperform P additional builds for each platform to push a platform-specific
cache.
We have two choices:
guidance for the user. An x86/ARM image would need 3
buildx.Image
topropertly cache itself. If/when Docker resolves
Pushing cache to "registry" cache with multi-node builder only uploads cache from one node docker/buildx#1044, users would need to clean up
their extraneous resources in order to leverage upstream's behavior. In most
cases this cleanup will simply never happen (assuming most users don't
closely follow Docker implementation details.)
user. Only one
buildx.Image
is needed. If/when Docker resolvesPushing cache to "registry" cache with multi-node builder only uploads cache from one node docker/buildx#1044 we can instead rely on upstream
behavior without any action needed from the user.
The workaround (option 1) is certainly possible with Pulumi today, however it's
awkward and I would rather not force this complexity on users who expect this
to Just Work™.
So this PR implements the second option. We detect this situation and munge the
build options such that we perform an initial build without
--cache-to
, andthen we push platform-specific caches. In the registry case we jump through
some hoops to prevent these derived cache keys from getting exposed as tag
names.