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

Per-target exec_properties overwrites (not merges with) --remote_default_exec_properties #10252

Closed
jmillikin-stripe opened this issue Nov 16, 2019 · 5 comments
Assignees
Labels
P1 I'll work on this now. (Assignee required) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: feature request

Comments

@jmillikin-stripe
Copy link
Contributor

Description of the problem / feature request:

exec_properties is a universal target attribute documented as:

A dictionary of strings that will be added to the exec_properties of a platform selected for this target.

This doesn't seem to be working as expected when combined with --remote_default_exec_properties. Instead of merging, the default exec properties get completely ignored.

The build is not using a platform() rule (the container-image name is too dynamic to easily put in a source file), so I would have expected --remote_default_exec_properties to be used.

What operating system are you running Bazel on?

Linux

What's the output of bazel info release?

release 1.0.0

@dslomov dslomov added team-Remote-Exec Issues and PRs for the Execution (Remote) team untriaged labels Nov 25, 2019
@coeuvre coeuvre added P2 We'll consider working on this in future. (Assignee optional) type: bug and removed untriaged labels Dec 9, 2020
@brentleyjones
Copy link
Contributor

This recently bit us as well.

@coeuvre
Copy link
Member

coeuvre commented Oct 28, 2021

As described in the doc:

Set the default exec properties to be used as the remote execution platform if an execution platform does not already set exec_properties.

So the current behaviour is correct but I am not sure whether it's expected.

@jmillikin-stripe
Copy link
Contributor Author

jmillikin-stripe commented Oct 28, 2021

I read that as referring to the platform's exec_properties, not the target's exec_properties.

In other words, if a platform doesn't have exec_properties set, it will receive the value of --remote_default_exec_properties.

However, regardless of the platform's content, I expect the per-target exec_properties to be merged with it in accordance with the documentation I quoted in the first post.

Docs (in Common Definitions):

exec_properties
Dictionary of strings; optional

A dictionary of strings that will be added to the exec_properties of a platform selected for this target. See exec_properties of the platform rule.

If a key is present in both the platform and target-level properties, the value will be taken from the target.

@brentleyjones
Copy link
Contributor

Same, I read " if an execution platform does not already set exec_properties." to mean the platform set it, not a target. Regardless, like @jmillikin-stripe says, I feel the target level one should merge with either.

@coeuvre
Copy link
Member

coeuvre commented Oct 29, 2021

SGTM. I will make the fix into 5.0.

@coeuvre coeuvre added P1 I'll work on this now. (Assignee required) and removed P2 We'll consider working on this in future. (Assignee optional) labels Oct 29, 2021
@coeuvre coeuvre self-assigned this Oct 29, 2021
Wyverald pushed a commit that referenced this issue Nov 3, 2021
…_properties (#14212)

Per-target `exec_properties` was introduced by 0dc53a2 but it didn't take into account of `--remote_default_exec_properties` which provides default exec properties for the execution platform if it doesn't already set with `exec_properties`. So the per-target `exec_properties` overrides `--remote_default_exec_properties` instead of merging with them which is wrong.

Fixes #10252.

Closes #14193.

PiperOrigin-RevId: 406337649
(cherry picked from commit 3a5b360)

Co-authored-by: Chi Wang <chiwang@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants