generalize node generation

This commit is contained in:
Jonas Juselius
2022-08-20 09:21:50 +02:00
parent e6acda123a
commit 259961648f

View File

@@ -116,7 +116,7 @@ let
controlMachine = "ekman"; controlMachine = "ekman";
nodeName = [ nodeName = [
"c0-[1-2] Sockets=2 CoresPerSocket=64 ThreadsPerCore=1 RealMemory=256000 TmpDisk=500000 State=UNKNOWN" "c0-[1-2] Sockets=2 CoresPerSocket=64 ThreadsPerCore=1 RealMemory=256000 TmpDisk=500000 State=UNKNOWN"
"ekman Sockets=2 CoresPerSocket=64 ThreadsPerCore=1 RealMemory=256000 TmpDisk=500000 State=UNKNOWN" "ekman Sockets=2 CoresPerSocket=64 ThreadsPerCore=2 RealMemory=256000 TmpDisk=500000 State=UNKNOWN"
]; ];
partitionName = [ partitionName = [
"batch Nodes=c0-[1-2] Default=YES MaxTime=INFINITE State=UP" "batch Nodes=c0-[1-2] Default=YES MaxTime=INFINITE State=UP"
@@ -178,16 +178,16 @@ let
}; };
fileSystems = { fileSystems = {
"/opt" = { # "/opt" = {
device = "10.255.241.81:/opt"; # device = "10.255.241.81:/opt";
fsType = "nfs"; # fsType = "nfs";
options = [ "soft" "rdma" "defaults" "vers=4.2" ]; # options = [ "soft" "rdma" "defaults" "vers=4.2" ];
}; # };
"/data" = { # "/data" = {
device = "255.241.81:/data"; # device = "255.241.81:/data";
fsType = "nfs"; # fsType = "nfs";
options = [ "soft" "rdma" "defaults" "vers=4.2" ]; # options = [ "soft" "rdma" "defaults" "vers=4.2" ];
}; # };
}; };
environment.variables = {}; environment.variables = {};
@@ -205,7 +205,7 @@ let
maxJobs = 32; maxJobs = 32;
trustedUsers = [ "@wheel" ]; trustedUsers = [ "@wheel" ];
binaryCachePublicKeys = [ binaryCachePublicKeys = [
"ekman:pka41J3q4j9ZC3dr4y+sDN9uMW0pAxoWeCkrzUlqcZs=" "ekman.local:2NsTThGkZVJtOs3NVQYjEZ4NLscXlbjqA8Fi7HnAreA="
]; ];
}; };
}; };
@@ -216,10 +216,9 @@ let
uid = 0; uid = 0;
gid = 0; gid = 0;
text = '' text = ''
10.255.241.100 10.255.241.80
10.255.241.101 10.255.241.81
10.255.241.102 '' + builtins.foldl' (a: x: a + "10.255.240.${toString x}\n") "" (builtins.genList (n: n + 100) 17);
'';
}; };
programs.ssh.knownHosts = { programs.ssh.knownHosts = {
@@ -229,9 +228,21 @@ let
]; ];
publicKeyFile = ./pubkeys/ekman.pub; publicKeyFile = ./pubkeys/ekman.pub;
}; };
c0-1 = { hostNames = [ "c0-1" "c0-1.cluster.local" "10.255.241.101" "10.255.243.11" ]; publicKeyFile = ./pubkeys/c0-1.pub; }; } // builtins.foldl' (a: x:
c0-2 = { hostNames = [ "c0-2" "c0-2.cluster.local" "10.255.241.102" "10.255.243.11" ]; publicKeyFile = ./pubkeys/c0-1.pub; }; let
n = toString x;
n' = toString (x + 100);
in a // {
"c0-${n}" = {
hostNames = [
"c0-${n}"
"c0-${n}.cluster.local"
"10.255.241.${n'}"
"10.255.243.${n'}"
];
publicKeyFile = ./pubkeys/c0-1.pub;
}; };
}) {} (builtins.genList (n: n) 16);
environment.systemPackages = [ openssh-shosts ]; environment.systemPackages = [ openssh-shosts ];