-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Consistent resource management across actions and resource types #19679
Comments
Remove special handling of cpu and memory, and instead track them as any other resource. This has a few advantages: - Significant code clean up, keep only the logic for generic resource around - Consistent resources type (double) for all resource Relates to #19679 Closes #19839. PiperOrigin-RevId: 585926931 Change-Id: Id0d6a14e9c151c3895f55d1808b6bd66eecf98b3
Related: #10443 |
Remove special handling of cpu and memory, and instead track them as any other resource. This has a few advantages: - Significant code clean up, keep only the logic for generic resource around - Consistent resources type (double) for all resource Relates to bazelbuild#19679 Closes bazelbuild#19839. PiperOrigin-RevId: 585926931 Change-Id: Id0d6a14e9c151c3895f55d1808b6bd66eecf98b3
Remove special handling of cpu and memory, and instead track them as any other resource. This has a few advantages: - Significant code clean up, keep only the logic for generic resource around - Consistent resources type (double) for all resource Relates to #19679 Closes #19839. Commit ebe4d0d PiperOrigin-RevId: 585926931 Change-Id: Id0d6a14e9c151c3895f55d1808b6bd66eecf98b3 Co-authored-by: Alessandro Patti <ale812@yahoo.it>
This is not strictly related to this task, but just musing: I wonder if assigned resources ought to be available to an action/test as an environment variable. As an example, I am imagining us using something like |
Add `--default_test_resources=<resource>=<value(s)>` that allows setting the default resource utilization for tests. The flag follow a syntax simialar to `--local_resources=<resource>=<value>`, in that it allow assigning different resource types, and `--test_timeout=<value(s)>`, which accepts either 1 or 4 intergers to assign to all test sizes or to each individually. Relates to #19679 Closes #20839. PiperOrigin-RevId: 606233269 Change-Id: Ia53e42820ba9aa646b0600fe4e9f95f146d7b2b9
Add `--default_test_resources=<resource>=<value(s)>` that allows setting the default resource utilization for tests. The flag follow a syntax simialar to `--local_resources=<resource>=<value>`, in that it allow assigning different resource types, and `--test_timeout=<value(s)>`, which accepts either 1 or 4 intergers to assign to all test sizes or to each individually. Relates to bazelbuild#19679 Closes bazelbuild#20839. PiperOrigin-RevId: 606233269 Change-Id: Ia53e42820ba9aa646b0600fe4e9f95f146d7b2b9
Add `--default_test_resources=<resource>=<value(s)>` that allows setting the default resource utilization for tests. The flag follow a syntax simialar to `--local_resources=<resource>=<value>`, in that it allow assigning different resource types, and `--test_timeout=<value(s)>`, which accepts either 1 or 4 intergers to assign to all test sizes or to each individually. Relates to bazelbuild#19679 Closes bazelbuild#20839. PiperOrigin-RevId: 606233269 Change-Id: Ia53e42820ba9aa646b0600fe4e9f95f146d7b2b9
Add `--default_test_resources=<resource>=<value(s)>` that allows setting the default resource utilization for tests. The flag follow a syntax simialar to `--local_resources=<resource>=<value>`, in that it allow assigning different resource types, and `--test_timeout=<value(s)>`, which accepts either 1 or 4 intergers to assign to all test sizes or to each individually. Relates to #19679 Closes #20839. Commit 0c5b6e8 PiperOrigin-RevId: 606233269 Change-Id: Ia53e42820ba9aa646b0600fe4e9f95f146d7b2b9 Co-authored-by: Alessandro Patti <ale812@yahoo.it>
Remove special handling of cpu and memory, and instead track them as any other resource. This has a few advantages: - Significant code clean up, keep only the logic for generic resource around - Consistent resources type (double) for all resource Relates to bazelbuild#19679 Closes bazelbuild#19839. PiperOrigin-RevId: 585926931 Change-Id: Id0d6a14e9c151c3895f55d1808b6bd66eecf98b3
Add `--default_test_resources=<resource>=<value(s)>` that allows setting the default resource utilization for tests. The flag follow a syntax simialar to `--local_resources=<resource>=<value>`, in that it allow assigning different resource types, and `--test_timeout=<value(s)>`, which accepts either 1 or 4 intergers to assign to all test sizes or to each individually. Relates to bazelbuild#19679 Closes bazelbuild#20839. PiperOrigin-RevId: 606233269 Change-Id: Ia53e42820ba9aa646b0600fe4e9f95f146d7b2b9
Remove special handling of cpu and memory, and instead track them as any other resource. This has a few advantages: - Significant code clean up, keep only the logic for generic resource around - Consistent resources type (double) for all resource Relates to bazelbuild#19679 Closes bazelbuild#19839. PiperOrigin-RevId: 585926931 Change-Id: Id0d6a14e9c151c3895f55d1808b6bd66eecf98b3
Add `--default_test_resources=<resource>=<value(s)>` that allows setting the default resource utilization for tests. The flag follow a syntax simialar to `--local_resources=<resource>=<value>`, in that it allow assigning different resource types, and `--test_timeout=<value(s)>`, which accepts either 1 or 4 intergers to assign to all test sizes or to each individually. Relates to bazelbuild#19679 Closes bazelbuild#20839. PiperOrigin-RevId: 606233269 Change-Id: Ia53e42820ba9aa646b0600fe4e9f95f146d7b2b9
Description of the feature request:
There are several way of defining and allocating resources for bazel:
--local_cpu_resources
and--local_ram_resources
can be used to define the amount of cpu and ram available for bazel to consume. They both accept decimal values (float)--local_extra_resources
can be used to model arbitrary abstract resources, also as floatscpu:<n>
tag (or execution info) can be used to request more cpus for an action (defaults to 1)resources:<resource>:<amount>
can be used to request any amount of an arbitrary resourceI would like have fine-grained controll on all the resources types and all the actions, with an unified api, which stores all the values as doubles, something like:
resources:<resource>:<amount>
allows allocating any resource, including cpu and memory--local_resources=<resource>=<amount>
can be used to specify the amount of any resource available for bazel to use. This would includecpu
andmemory
--default_test_resources=<resource>=<small>,<medium>,<large>,<enormous>
allows setting the default allocation for test based on the test size.--default_resources=<resource>=<amount>
can be used to change the default allocation for all actionsresources:<resource>:<amount>
can be applied to any action (not test only)Which category does this issue belong to?
Local Execution
What underlying problem are you trying to solve with this feature?
In large, multi language repositories, the default values for resource allocation might not be suitable for all targets/actions. When that happens, bazel ends up over (or under) scheduling tasks, which affects performance and stability. With fine grained controll over the resource allocation, the build can be tweaked according to its needs.
Which operating system are you running Bazel on?
N/A
What is the output of
bazel info release
?release 6.3.1
If
bazel info release
returnsdevelopment 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 master; 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
The text was updated successfully, but these errors were encountered: