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

api/server/router/build: BuilderVersion: allow buildkit on Windows #48038

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thaJeztah
Copy link
Member

api/server/router/build: BuilderVersion: allow buildkit on Windows

Commit 7b153b9 changed the daemon to
advertise the recommended builder to use to V2 (BuildKit) for Linux
daemons, and V1 (Legacy Builder) for Windows daemons. For Linux daemons
we allowed the default to be overridden through the "features" field
in the daemon config (daemon.json), but for Windows we hard-coded it
to be V1, and no option to override.

With work in progress on implementing support for Windows in BuildKit,
we should remove this hardcoded assumption, and allow the default to
be overridden to advertise that BuildKit is supported.

Note that BuildKit on Windows is still very much a "work in progress",
and enabling it in the daemon may not even work, so users should not
try to enable this feature; a warning-level log is added to make it
visible that the feature is enabled.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah
Copy link
Member Author

I have no IDEA whatsoever if things are wired up already inside the daemon; this PR removes a gate that prevented the daemon from advertising it supports BuildKit, but I don't have a Windows machine to test on if any of that already works.

@crazy-max @tonistiigi @colinhemmings

@thaJeztah thaJeztah self-assigned this Jun 19, 2024
}

bv := types.BuilderBuildKit
// Allow the features field in the daemon config to override the
// default builder advertise.
if v, ok := features["buildkit"]; ok && !v {
bv = types.BuilderV1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't do anything on Windows, because we already overrode it above 🙈 . I'll fix that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed 😄

@vvoland vvoland modified the milestones: 27.0.0, 27.0.2, 28.0.0 Jun 21, 2024
Commit 7b153b9 changed the daemon to
advertise the recommended builder to use to V2 (BuildKit) for Linux
daemons, and V1 (Legacy Builder) for Windows daemons. For Linux daemons
we allowed the default to be overridden through the "features" field
in the daemon config (daemon.json), but for Windows we hard-coded it
to be V1, and no option to override.

With work in progress on implementing support for Windows in BuildKit,
we should remove this hardcoded assumption, and allow the default to
be overridden to advertise that BuildKit is supported.

Note that BuildKit on Windows is still very much a "work in progress",
and enabling it in the daemon may not even work, so users should not
try to enable this feature; a warning-level log is added to make it
visible that the feature is enabled.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

PTAL @tonistiigi

@thaJeztah
Copy link
Member Author

@vvoland PTAL; I think this is generally "safe" (requires the user to set these options, so no change in any defaults).

@vvoland vvoland modified the milestones: 28.0.0, 27.0.0 Jun 21, 2024
@crazy-max
Copy link
Member

crazy-max commented Jun 21, 2024

I wonder if that would break Docker Desktop users. I think we always set the buildkit feature to true 🤔

@thaJeztah
Copy link
Member Author

Hm... good one; is that same configuration used for the Windows and Linux daemon? At least we must remove that option from Docker Desktop, as it's for sure no longer needed on Linux.

@thaJeztah
Copy link
Member Author

Temporarily moving back to draft while we figure out exactly when / in what cases Docker Desktop sets buildkit to true.

Alternatively, I could add an buildkit.wcow option, but let's look at that later; in the end, this is just advertising the version to use, the client can still explicitly opt-in to using BuildKit.

@thaJeztah thaJeztah marked this pull request as draft June 21, 2024 12:35
@thaJeztah thaJeztah modified the milestones: 27.0.0, 27.0.2 Jun 21, 2024
@vvoland vvoland modified the milestones: 27.0.2, 27.0.3 Jun 26, 2024
@thaJeztah thaJeztah modified the milestones: 27.0.3, 28.0.0 Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants