git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/slurm: node/partitionName option -> list

Make the node and partitionname options lists. There can be more than paratition or set of nodes. Add changes to release notes

commitd2799d1835fdfc68e2b621beff1fa951f055ae39 authorMarkus Kowalewski <markus.kowalewski@gmail.com> dateThu 25 Oct 2018, 20:34 (8 years ago) parentf51f753
3 files changed+16−13
nixos/doc/manual/release-notes/rl-1903.xml+6 nixos/modules/services/computing/slurm/slurm.nix+8−8 nixos/tests/slurm.nix+2−5
nixos/doc/manual/release-notes/rl-1903.xml+6
@@ -165,6 +165,12 @@
165165 If you want to keep slurmctld running as <literal>root</literal>, set
166166 <literal>services.slurm.user = root</literal>.
167167 </para>
168+ <para>
169+ The options <literal>services.slurm.nodeName</literal> and
170+ <literal>services.slurm.partitionName</literal> are now sets of
171+ strings to correctly reflect that fact that each of these
172+ options can occour more than once in the configuration.
173+ </para>
168174 </listitem>
169175 </itemizedlist>
170176 </section>
nixos/modules/services/computing/slurm/slurm.nix+8−8
@@ -16,8 +16,8 @@ let
1616 SlurmUser=${cfg.user}
1717 ${optionalString (cfg.controlMachine != null) ''controlMachine=${cfg.controlMachine}''}
1818 ${optionalString (cfg.controlAddr != null) ''controlAddr=${cfg.controlAddr}''}
19− ${optionalString (cfg.nodeName != null) ''nodeName=${cfg.nodeName}''}
20− ${optionalString (cfg.partitionName != null) ''partitionName=${cfg.partitionName}''}
19+ ${toString (map (x: "NodeName=${x}\n") cfg.nodeName)}
20+ ${toString (map (x: "PartitionName=${x}\n") cfg.partitionName)}
2121 PlugStackConfig=${plugStackConfig}
2222 ProctrackType=${cfg.procTrackType}
2323 ${cfg.extraConfig}
@@ -149,9 +149,9 @@ in
149149 };
150150
151151 nodeName = mkOption {
152− type = types.nullOr types.str;
153− default = null;
154− example = "linux[1-32] CPUs=1 State=UNKNOWN";
152+ type = types.listOf types.str;
153+ default = [];
154+ example = literalExample ''[ "linux[1-32] CPUs=1 State=UNKNOWN" ];'';
155155 description = ''
156156 Name that SLURM uses to refer to a node (or base partition for BlueGene
157157 systems). Typically this would be the string that "/bin/hostname -s"
@@ -160,9 +160,9 @@ in
160160 };
161161
162162 partitionName = mkOption {
163− type = types.nullOr types.str;
164− default = null;
165− example = "debug Nodes=linux[1-32] Default=YES MaxTime=INFINITE State=UP";
163+ type = types.listOf types.str;
164+ default = [];
165+ example = literalExample ''[ "debug Nodes=linux[1-32] Default=YES MaxTime=INFINITE State=UP" ];'';
166166 description = ''
167167 Name by which the partition may be referenced. Note that now you have
168168 to write the partition's parameters after the name.
nixos/tests/slurm.nix+2−5
@@ -4,11 +4,8 @@ let
44
55 slurmconfig = {
66 controlMachine = "control";
7− nodeName = ''
8− control
9− NodeName=node[1-3] CPUs=1 State=UNKNOWN
10− '';
11− partitionName = "debug Nodes=node[1-3] Default=YES MaxTime=INFINITE State=UP";
7+ nodeName = [ "node[1-3] CPUs=1 State=UNKNOWN" ];
8+ partitionName = [ "debug Nodes=node[1-3] Default=YES MaxTime=INFINITE State=UP" ];
129 extraConfig = ''
1310 AccountingStorageHost=dbd
1411 AccountingStorageType=accounting_storage/slurmdbd