-
Notifications
You must be signed in to change notification settings - Fork 483
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
Use controller option in bake #1680
base: master
Are you sure you want to change the base?
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.
Thank you for working on it.
c550e4c
to
6718ee5
Compare
Thanks, LGTM. |
@@ -118,6 +131,7 @@ message CommonOptions { | |||
bool Pull = 4; | |||
bool ExportPush = 5; | |||
bool ExportLoad = 6; | |||
bool Linked = 7; |
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.
Linked
is internal. I'm a bit on the fence to have it in the proto def:
Lines 93 to 94 in 4a73abf
// Linked marks this target as exclusively linked (not requested by the user). | |
Linked bool |
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.
Agreed - but based on the current usage of it, I think we need to. It's used in BuildWithResultHandler
which will be called from the controller side, while it's generated from targets before we make the controller request.
I think it's only used here?
Lines 688 to 690 in 4a73abf
if !opt.Linked && len(opt.Exports) == 0 { | |
noOutputTargets = append(noOutputTargets, name) | |
} |
I'm quite sure how else we can do it, though open to suggestions 🤔
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.
Ah right let's keep then 👍 (with a comment in the proto)
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.
Actually, I think we could get rid of it, if we could move the default outputs onto the client side of the controller (which would probably be a better design anyways).
Might be slightly tricky, since we only load the driver on the controller server (which we probably want to change anyways), so maybe worth returning to this with that refactor?
6718ee5
to
b5ab2a8
Compare
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: Justin Chadwell <[email protected]>
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: Justin Chadwell <[email protected]>
b5ab2a8
to
d4e38a0
Compare
🗒️ Marking as draft until we merge #1671.
This PR continues the move to attempt to merge the
build.Options
struct into thecontrollerapi.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 theNamedContexts
to allow containing States (by transmitting them asDefinitionOps
), and adding aLinked
field to the common options.With these changes, we can have bake generate
controllerapi.BuildOptions
, and then convert those tobuild.Options
using thecontroller/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 directly, and completely skip the
build.Options
generation step.