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

--remote-execution global option should likely disable remote execution environments #16907

Closed
Eric-Arellano opened this issue Sep 16, 2022 · 0 comments · Fixed by #16955
Closed
Assignees

Comments

@Eric-Arellano
Copy link
Contributor

It is very useful to have the flag --remote-execution as a quick CLI toggle for RE. For example, when you're on a plane, you want to disable RE without having to rewrite all of your BUILD files to change the environment= they are set to.

I tried to implement that logic inside our rules that set up the Platform, CompleteEnvironmentVars, and ProcessConfigFromEnvironment: ca3c581. But I realized this was not a valid approach. While that commit "fixes" those 3 types to use the local environment, the env vars and executable search paths would still be coming from the remote_environment target, rather than the local_environment target, which is an error.

Instead, the fallback must live one level higher, in our rule that determines which environment name should be used via "matcher" logic:

@rule
async def resolve_environment_name(
request: EnvironmentNameRequest, environments_subsystem: EnvironmentsSubsystem
) -> EnvironmentName:

@Eric-Arellano Eric-Arellano self-assigned this Sep 16, 2022
Eric-Arellano added a commit that referenced this issue Sep 16, 2022
This solves several problems we had with remote execution:

1. You can now specify different env vars than localhost, #7735
2. You can now mix remote execution with Docker execution from #13682
3. You can have multiple configurations for the remote execution server, which is particularly useful so you can specify different Docker images to run in remote execution.

If you are not yet using the environments mechanism, then remote execution continues to be toggled via the `--remote-execution` option. Otherwise, remote execution is only used when a remote execution environment target is used. Follow up work will re-evaluate this by leveraging "environment matchers".  See #16907 for more info.

A follow up will add the `extra_platform_properties` field (#16908).
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 a pull request may close this issue.

1 participant