add resource_set support to repository_ctx.execute
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
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.
this would still be useful. very easy to have nontrivial compute tasks in custom repository rules that end up competing for cpu & memory resources.