Closed
Conversation
5d4b713 to
1c7055c
Compare
c03f580 to
8852925
Compare
ktock
reviewed
Jun 1, 2023
ktock
reviewed
Jun 1, 2023
controller/build/build.go
Outdated
| func RunBuild(ctx context.Context, dockerCli command.Cli, in controllerapi.BuildOptions, inStream io.Reader, progress progress.Writer, generateResult bool) (*client.SolveResponse, *build.ResultContext, error) { | ||
| if in.NoCache && len(in.NoCacheFilter) > 0 { | ||
| return nil, nil, errors.Errorf("--no-cache and --no-cache-filter cannot currently be used together") | ||
| func RunBuild(ctx context.Context, dockerCli command.Cli, builderName string, in *controllerapi.BuildOptions, inStream io.Reader, progress progress.Writer, generateResult bool) (*client.SolveResponse, *build.ResultContext, error) { |
Collaborator
There was a problem hiding this comment.
Why do we need to have a separated builderName option? This looks already included in the controllerapi.BuildOptions.
Member
Author
There was a problem hiding this comment.
I was looking at passing just the list of nodes necessary to build so we don't create another builder instance. But when building multiple targets controller.BuildOptions is a map and I don't think having Builder there is right:
buildx/controller/pb/controller.proto
Line 74 in 0758a9b
I will take another look to improve this.
8852925 to
a481e15
Compare
Member
Author
This patch continues the move to attempt to merge the build.Options struct into the controllerapi.Options message. To do this, we extract all the input parameters into a dedicated message (adding the missing ones, except for the InStream parameter which will require some additional fiddling around). We also rework the NamedContexts to allow containing States (by transmitting them as DefinitionOps), and adding a Linked field to the common options. Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
With the previous changes to bring controllerapi.BuildOptions up to date with build.Options, we can have bake generate controllerapi.BuildOptions, and then convert those to build.Option using the controller/build package. This is an intermediate patch, designed to allow us to clean up some shared logic between both build and bake. The next step will be to modify bake to use the controller api, and completely skip the build.Options generation step. Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
With this change we are now passing a list of controller options to run a build and returns a map of responses and result context as bake can handle a list of targets. Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
a481e15 to
e16151f
Compare
This file contains hidden or 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
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.
Carry #1680 to handle controller options with bake and also use controller to build. This will be used in #1841 so we can pass the build reference to the result context for both build and bake efficiently.