Support percentage values in CPU/memory limit flags #2367
Labels
good first issue
Good for newcomers
th/config
Theme: Related to configuration files and settings across the project
type/enhancement
Type: New features or enhancements to existing features
Milestone
We accept command line flags to limit the resources used per job and used by all jobs. This is useful for users who want to run Bacalhau nodes on shared machines which are also providing other services.
However, these flags take absolute values only (eg 1 CPU core, 2Gb RAM). For users (like Starion) who are deploying over a wide breadth of different machines, this is problematic because on some clients 2Gb RAM might be the full amount and on others it might be a too small amount.
What would be better was if we could supply percentage values and have Bacalhau work out the correct absolute values (it already knows how to read the available cores and RAM). Then Station could just say “use no more than 50% of RAM” and be confident that this scales to all machine types.
Make the existing CLI flags able to accept values that end in a percentage % symbol and interpret these as percentage of absolute value when calculating resource limits.
The text was updated successfully, but these errors were encountered: