Skip to content
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

Don't allow duplicate cache exporters #3271

Merged
merged 2 commits into from
Nov 21, 2022

Conversation

jedevc
Copy link
Member

@jedevc jedevc commented Nov 10, 2022

⬆️ Follow-up to #3024.

Previously, we attempted to gracefully resolve duplicate cache export options, however, we should explicitly error - a client has made an error if the same options appear twice. If we really want de-duplication, then clients such as buildx should implement it there as discussed with @crazy-max and @tonistiigi.

Additionally, duplicate cache imports are modified to cause errors as well, for the same reasons as above.

cc @a-palchikov

@crazy-max
Copy link
Member

duplicate cache imports are modified to cause errors as well, for the same reasons as above.

I would tend to agree so we are aligned for both import/export but I think we should keep the current behavior for cache imports so we don't break anyone.

@jedevc jedevc force-pushed the duplicate-exporter branch from 89f85dc to f0ff957 Compare November 14, 2022 13:59
@jedevc
Copy link
Member Author

jedevc commented Nov 14, 2022

I think we should keep the current behavior for cache imports so we don't break anyone

By semver, I think the next release would allow us to change some behavior in a non-backwards compatible way? IMO, it should be alright to error on behaviour that was already broken here.

@crazy-max
Copy link
Member

By semver, I think the next release would allow us to change some behavior in a non-backwards compatible way? IMO, it should be alright to error on behaviour that was already broken here.

Yeah we are still major version zero so I guess it's fine but duplicate cache imports is still a "valid" pattern that BuildKit handles correctly whereas write operations when exporting would fail I think.

@jedevc jedevc force-pushed the duplicate-exporter branch from f0ff957 to 2d7967c Compare November 15, 2022 15:19
@jedevc
Copy link
Member Author

jedevc commented Nov 15, 2022

Have added a patch to remove the duplicate cache imports - @tonistiigi WDYT?

@jedevc jedevc force-pushed the duplicate-exporter branch from 2d7967c to fe51108 Compare November 15, 2022 16:58
solver/llbsolver/solver.go Outdated Show resolved Hide resolved
solver/llbsolver/util/util.go Outdated Show resolved Hide resolved
In adding support for multiple cache exporters, the Export call was
moved into a seperate function that merged that functionality with
inline cache. This refactor splits the inline cache metadata generation
up from the export, so we can put the exporting back directly into the
Solve function.

Signed-off-by: Justin Chadwell <me@jedevc.com>
Previously, we attempted to gracefully resolve duplicate cache export
options, however, we should explicitly error - a client has made an
error if the same options appear twice. If we really want
de-duplication, then clients such as buildx should implement it there.

Signed-off-by: Justin Chadwell <me@jedevc.com>
@jedevc jedevc force-pushed the duplicate-exporter branch from fe51108 to 621ab1c Compare November 16, 2022 12:01
@jedevc jedevc closed this Nov 16, 2022
@jedevc jedevc reopened this Nov 16, 2022
@tonistiigi tonistiigi merged commit ae9d0f5 into moby:master Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants