-
Notifications
You must be signed in to change notification settings - Fork 88
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
[RB] Support configuring whether to run targets on the local vs remote runner #6755
Conversation
cli/remotebazel/remotebazel.go
Outdated
@@ -704,7 +705,7 @@ func Run(ctx context.Context, opts RunOpts, repoConfig *RepoConfig) (int, error) | |||
fetchOutputs := false | |||
runOutput := false | |||
bazelArgs := arg.GetBazelArgs(opts.Args) | |||
if len(bazelArgs) > 0 && (bazelArgs[0] == "build" || bazelArgs[0] == "run") { | |||
if *fetchRemoteOutputs && len(bazelArgs) > 0 && (bazelArgs[0] == "build" || bazelArgs[0] == "run") { |
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.
IIUC this changes the default for bazel run
from running locally to running remotely. For running webservers, running remotely isn't a great default because there's no way to access the VM network.
Should we force running locally* for now if the command is run
?
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.
I'll close this for now until we have a better idea of customer needs around this
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.
@bduffany Re-opening this. Currently I want this because it will be helpful for unit tests. But I could also see customers wanting this. For example if they're using remote bazel to build and publish a docker image, they might expect the target to run on the OS / arch / container image / with the compute resources that they've specified in their remote request
I think for a build
it makes sense to default to downloading the outputs. For a run
, I actually think it makes sense to default to running remotely, and of course there will still be the option to flip the flag. What do you think?
Currently for remote
run
s, the generated binary will not be executed remotely, and will be fetched and run locally (See here for implementation). Add a configurable flag, because for CI people may want it to be executed remotelyRelated issues: N/A