tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
slurm: impl basic configuration
Arseniy Seroka
11 years ago
30e6f1b4
0b1cc3cd
+50
-19
1 changed file
expand all
collapse all
unified
split
nixos
modules
services
computing
slurm
slurm.nix
+50
-19
nixos/modules/services/computing/slurm/slurm.nix
···
8
8
# configuration file can be generated by http://slurm.schedmd.com/configurator.html
9
9
configFile = pkgs.writeText "slurm.conf"
10
10
''
11
11
-
${cfg.extraConfig}
11
11
+
${optionalString (cfg.controlMachine != null) ''controlMachine=${cfg.controlMachine}''}
12
12
+
${optionalString (cfg.controlAddr != null) ''controlAddr=${cfg.controlAddr}''}
13
13
+
${optionalString (cfg.nodeName != null) ''nodeName=${cfg.nodeName}''}
14
14
+
${optionalString (cfg.partitionName != null) ''partitionName=${cfg.partitionName}''}
15
15
+
${cfg.extraConfig}
12
16
'';
13
17
in
14
18
···
21
25
services.slurm = {
22
26
23
27
server = {
24
24
-
enable = mkOption {
25
25
-
default = false;
26
26
-
type = types.bool;
27
27
-
description = ''
28
28
-
Whether to enable slurm control daemon.
29
29
-
'';
30
30
-
};
28
28
+
enable = mkEnableOption "slurm control daemon";
31
29
32
30
};
33
31
34
32
client = {
35
35
-
enable = mkOption {
36
36
-
default = false;
37
37
-
type = types.bool;
38
38
-
description = ''
39
39
-
Whether to enable slurm client daemon.
40
40
-
'';
41
41
-
};
33
33
+
enable = mkEnableOption "slurm rlient daemon";
34
34
+
35
35
+
};
36
36
+
37
37
+
controlMachine = mkOption {
38
38
+
type = types.nullOr types.str;
39
39
+
default = null;
40
40
+
example = null;
41
41
+
description = ''
42
42
+
The short hostname of the machine where SLURM control functions are
43
43
+
executed (i.e. the name returned by the command "hostname -s", use "tux001"
44
44
+
rather than "tux001.my.com").
45
45
+
'';
46
46
+
};
47
47
+
48
48
+
controlAddr = mkOption {
49
49
+
type = types.nullOr types.str;
50
50
+
default = cfg.controlMachine;
51
51
+
example = null;
52
52
+
description = ''
53
53
+
Name that ControlMachine should be referred to in establishing a
54
54
+
communications path.
55
55
+
'';
56
56
+
};
42
57
58
58
+
nodeName = mkOption {
59
59
+
type = types.nullOr types.str;
60
60
+
default = null;
61
61
+
example = "linux[1-32] CPUs=1 State=UNKNOWN";
62
62
+
description = ''
63
63
+
Name that SLURM uses to refer to a node (or base partition for BlueGene
64
64
+
systems). Typically this would be the string that "/bin/hostname -s"
65
65
+
returns. Note that now you have to write node's parameters after the name.
66
66
+
'';
67
67
+
};
68
68
+
69
69
+
partitionName = mkOption {
70
70
+
type = types.nullOr types.str;
71
71
+
default = null;
72
72
+
example = "debug Nodes=linux[1-32] Default=YES MaxTime=INFINITE State=UP";
73
73
+
description = ''
74
74
+
Name by which the partition may be referenced. Note that now you have
75
75
+
to write patrition's parameters after the name.
76
76
+
'';
43
77
};
44
78
45
79
extraConfig = mkOption {
···
50
84
the end of the slurm configuration file.
51
85
'';
52
86
};
53
53
-
54
87
};
55
88
56
89
};
···
64
97
65
98
systemd.services.slurmd = mkIf (cfg.client.enable) {
66
99
path = with pkgs; [ slurm-llnl coreutils ];
67
67
-
100
100
+
68
101
wantedBy = [ "multi-user.target" ];
69
102
after = [ "systemd-tmpfiles-clean.service" ];
70
103
···
73
106
ExecStart = "${pkgs.slurm-llnl}/bin/slurmd -f ${configFile}";
74
107
PIDFile = "/run/slurmd.pid";
75
108
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
76
76
-
ExecStop = "${pkgs.coreutils}/bin/kill $MAINPID";
77
109
};
78
110
};
79
111
···
89
121
ExecStart = "${pkgs.slurm-llnl}/bin/slurmctld";
90
122
PIDFile = "/run/slurmctld.pid";
91
123
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
92
92
-
ExecStop = "${pkgs.coreutils}/bin/kill $MAINPID";
93
124
};
94
125
environment = { SLURM_CONF = "${configFile}"; };
95
126
};