Skip to content

add resource_set support to repository_ctx.execute #23721

Open
@dgoldstein0

Description

@dgoldstein0

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3We're not considering working on this, but happy to review a PR. (No assignee)team-Local-ExecIssues and PRs for the Execution (Local) teamteam-Rules-APIAPI for writing rules/aspects: providers, runfiles, actions, artifactstype: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions