modules/cluster/deployment: add option deployment.needForSpeed

This commit is contained in:
Astro 2022-11-26 00:34:41 +01:00
parent b9e42515c7
commit de9ce610e9
5 changed files with 25 additions and 5 deletions

View File

@ -11,7 +11,7 @@
hq.statistics.enable = true;
};
boot= {
boot = {
loader.grub = {
enable = true;
version = 2;
@ -49,6 +49,7 @@
"data-hoarder"
"staging-data-hoarder"
];
skyflake.nomad.client.meta."c3d2.cpuSpeed" = "4";
system.stateVersion = "21.11"; # Did you read the comment?
}

View File

@ -38,4 +38,5 @@
# deployment.microvmBaseZfsDataset = "tank/storage";
hq.statistics.enable = true;
};
skyflake.nomad.client.meta."c3d2.cpuSpeed" = "3";
}

View File

@ -35,6 +35,7 @@
deployment.microvmBaseZfsDataset = "tank/storage";
hq.statistics.enable = true;
};
skyflake.nomad.client.meta."c3d2.cpuSpeed" = "3";
# XXX: enable for zw-ev and poelzi-ha until we find a better solution
virtualisation.libvirtd = {

View File

@ -21,6 +21,16 @@
storage = mkOption {
type = types.enum [ "fast" "big" ];
default = "fast";
description = ''
Which glusterfs volume to use for persistedShares
'';
};
needForSpeed = mkOption {
type = types.bool;
default = false;
description = ''
Prefer deployment on Nomad clients with a higher c3d2.cpuSpeed
'';
};
};
}

View File

@ -77,10 +77,17 @@ in
};
skyflake = {
nomadJob.constraints = lib.optionals (config.deployment.storage == "big") [ {
attribute = "\${meta.c3d2.storage}";
value = "big";
} ];
nomadJob = {
constraints = lib.optionals (config.deployment.storage == "big") [ {
attribute = "\${meta.c3d2.storage}";
value = "big";
} ];
affinities = lib.optionals config.deployment.needForSpeed (builtins.genList (i: {
attribute = "\${meta.c3d2.cpuSpeed}";
value = toString (i + 1);
weight = 10 + i;
}) 10);
};
};
networking = {