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

[RB] Support configuring whether to run targets on the local vs remote runner #6755

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

maggie-lou
Copy link
Contributor

@maggie-lou maggie-lou commented Jun 10, 2024

Currently for remote runs, 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 remotely

Related issues: N/A

@maggie-lou maggie-lou marked this pull request as draft June 10, 2024 16:15
@maggie-lou maggie-lou marked this pull request as ready for review June 10, 2024 16:27
@@ -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") {
Copy link
Member

@bduffany bduffany Jun 10, 2024

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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?

@maggie-lou maggie-lou changed the title [RB] Support configuring whether to fetch remote outputs [RB] Support configuring whether to run targets on the local vs remote runner Jun 13, 2024
@maggie-lou maggie-lou merged commit 58f3b51 into master Jun 13, 2024
18 checks passed
@maggie-lou maggie-lou deleted the rb_local_run branch June 13, 2024 22:31
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.

3 participants