add resource_set support to repository_ctx.execute
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the feature request:
bazel actions have a concept of resource_set that allows bazel's scheduler to know roughly how much cpu or memory an action may take and avoid overcommitting resources accordingly. This feature would be useful in repository_ctx.execute as well.
### Which category does this issue belong to?
Local Execution, Rules API
### What underlying problem are you trying to solve with this feature?
repository_rules may be used to do compute heavy tasks, e.g. invoking 3rd party build systems or package managers. These may end up using a lot of cpu or memory, so having bazel know there are limits to the parallelization possible would help avoid resource starvation scenarios that can lead to flakey builds and livelock. My company has observed such flakey builds in our production build environment, and while we've worked around it with some options that help reduce the resource intensity, we could still end up back in that situation in the future.
### Which operating system are you running Bazel on?
linux ubuntu 22.04
### What is the output of `bazel info release`?
release 6.1.0-1c2df03733503215490047c398d25fe5b5553a0e
### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.
_No response_
### What's the output of `git remote get-url origin; git rev-parse HEAD` ?
_No response_
### Have you found anything relevant by searching the web?
_No response_
### Any other information, logs, or outputs that you want to share?
_No response_
Contributor guide
Research direction
The issue names repository_ctx.execute and Bazel action resource_set, but no source files or tests. Start by tracing these two API concepts and determine how resource accounting currently works for repository rules. Done means repository_ctx.execute supports resource_set with documented behavior and coverage for the scheduling outcome.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100