Skip to content

[8.7.0] Make local scheduling respect exec_properties resources (#29284)#17

Open
alexeagle wants to merge 1 commit into
8.7.0-figmafrom
cherrypick-pr-29284
Open

[8.7.0] Make local scheduling respect exec_properties resources (#29284)#17
alexeagle wants to merge 1 commit into
8.7.0-figmafrom
cherrypick-pr-29284

Conversation

@alexeagle

Copy link
Copy Markdown

Summary

Cherry-picks bazelbuild#29284 onto 8.7.0-figma so local resource scheduling honors exec_properties resource hints (e.g. exec_properties = {"resources:cpu": "10"}) for all actions, not just tests via tags.

  • Adds ExecutionRequirements.parseResources() and ResourceSet.withResourceOverrides()
  • Applies resource overrides in BaseSpawn and SimpleSpawn.getLocalResources()
  • Centralizes test resource tag parsing in the spawn path (removes duplicate logic from TestTargetProperties)
  • Resolves cherry-pick conflicts in BaseSpawn.java and SimpleSpawn.java by keeping the 8.7.0 caching pattern and layering on withResourceOverrides

Fixes bazelbuild#6477, bazelbuild#19805, bazelbuild#25195, bazelbuild#25792, bazelbuild#25793.

Note: This is a behavior change (RELNOTES[inc]): exec_properties resources now affect local scheduling, and invalid/empty resource values fail the build instead of being silently ignored.

Test plan

  • bazel test //src/test/java/com/google/devtools/build/lib/actions:ActionsTests
  • bazel test //src/test/java/com/google/devtools/build/lib/rules/test:TestRulesTests --test_filter=TestTargetPropertiesTest
  • Verify local scheduling respects exec_properties = {"resources:cpu": "N"} on a representative genrule/action target

…9284)

Previously only tests supported a target level way to hint the resources
required by the target. This is done with `tags = ["resources:cpu:10"]`.
Now this syntax is supported for normal actions as well, and both normal
actions and test actions support this same format in `exec_properties`
with `exec_properties = {"resources:cpu": "10"}`, or exec_group specific
versions like: `exec_properties = {"cpp_link.resources:cpu": "10"}`.

Work towards bazelbuild#19679 (doesn't
handle a default flag currently)
Work towards bazelbuild#17368
Work towards bazelbuild#25770

Fixes bazelbuild#6477
Fixes bazelbuild#19805
Fixes bazelbuild#25195
Fixes bazelbuild#25792
Fixes bazelbuild#25793

RELNOTES[inc]: `exec_properties` now respects `resources:cpu` and `resources:memory` for local resource estimation.

Closes bazelbuild#29284.

PiperOrigin-RevId: 906919034
Change-Id: Ia9effd70a71f4e1f42021d945cdc7b1d9d52bbf6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants