-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Consumable system features would open up a lot of possibilities for better load balancing, especially for hydra build slaves. Examples of a consumable feature could be a CPU or a gigabyte of memory. Currently there is not really any good way to do load balancing for derivations for anything other than CPU usage, and consumable features could be a really great way to allow users to do this effectively.
It could be specified with a feature:num syntax, with the lack of the :num or :0 indicating an infinite (non-consumable) feature (i.e., what all features are right now).
Example build machines file with scratchy having 32 "mem" features (e.g., it might have 32GB of memory):
[email protected] i686-linux /home/nix/.ssh/id_scratchy_auto 8 1 kvm,mem:32
[email protected] i686-linux /home/nix/.ssh/id_scratchy_auto 8 2
[email protected] i686-linux /home/nix/.ssh/id_scratchy_auto 1 2 kvm benchmark
A derivation should likewise be able to specify how many of each consumable feature it consumes. e.g., could use this syntax:
requiredSystemFeatures = [ "kvm" "mem:4" ];
or maybe this would be better:
requiredSystemFeatures = [ "kvm" "mem" "mem" "mem" "mem" ];
This can be useful for managing any kind of specialized hardware resource exposed / accessible in the sandbox, e.g., if a sandbox-mapped device has a limited number of handles that can be opened at a time.