Skip to content

Commit bfbe0e5

Browse files
Carolina Lindqvistpllopis
Carolina Lindqvist
authored andcommitted
Add support for Slurm 17.11 and backwards compatibility with Slurm version < 17.11
1 parent a9b2312 commit bfbe0e5

File tree

10 files changed

+46
-27
lines changed

10 files changed

+46
-27
lines changed

README.md

-3
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ To avoid version conflicts, the following packages will be installed/replaced by
133133
```yaml
134134
- 'slurm',
135135
- 'slurm-devel',
136-
- 'slurm-munge',
137-
- 'slurm-plugins',
138136
- 'munge',
139137
- 'munge-libs',
140138
- 'munge-devel',
@@ -143,7 +141,6 @@ To avoid version conflicts, the following packages will be installed/replaced by
143141
#### On the database nodes
144142
```yaml
145143
- 'slurm-slurmdbd',
146-
- 'slurm-sql',
147144
```
148145
149146
#### On the headnodes

manifests/config.pp

+5-5
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
Hash[Enum['task','energy','network','filesystem'],Integer[0]] $job_acct_gather_frequency = {'task' => 30,'energy' => 0,'network' => 0,'filesystem' => 0},
191191
Integer[0] $acct_gather_node_freq = 0,
192192
Enum['acct_gather_energy/none','acct_gather_energy/ipmi','acct_gather_energy/rapl'] $acct_gather_energy_type = 'acct_gather_energy/none',
193-
Enum['acct_gather_infiniband/none','acct_gather_infiniband/ofed'] $acct_gather_infiniband_type = 'acct_gather_infiniband/none',
193+
Enum['acct_gather_interconnect/none','acct_gather_interconnect/ofed','acct_gather_infiniband/ofed'] $acct_gather_interconnect_type = 'acct_gather_interconnect/none',
194194
Enum['acct_gather_filesystem/none','acct_gather_filesystem/lustre'] $acct_gather_filesystem_type = 'acct_gather_filesystem/none',
195195
Enum['acct_gather_profile/none','acct_gather_profile/hdf5'] $acct_gather_profile_type = 'acct_gather_profile/none',
196196

@@ -333,11 +333,11 @@
333333
# Accounting gatherer configuration file
334334
if ('acct_gather_energy/ipmi' in $acct_gather_energy_type) or
335335
('acct_gather_profile/hdf5' in $acct_gather_profile_type) or
336-
('acct_gather_infiniband/ofed' in $acct_gather_infiniband_type) {
336+
(['acct_gather_infiniband/ofed', 'acct_gather_interconnect/ofed'] in $acct_gather_interconnect_type) {
337337
class{ '::slurm::config::acct_gather':
338-
with_energy_ipmi => ('acct_gather_energy/ipmi' in $acct_gather_energy_type),
339-
with_profile_hdf5 => ('acct_gather_profile/hdf5' in $acct_gather_profile_type),
340-
with_infiniband_ofed => ('acct_gather_infiniband/ofed' in $acct_gather_infiniband_type),
338+
with_energy_ipmi => ('acct_gather_energy/ipmi' in $acct_gather_energy_type),
339+
with_profile_hdf5 => ('acct_gather_profile/hdf5' in $acct_gather_profile_type),
340+
with_interconnect_ofed => (['acct_gather_infiniband/ofed', 'acct_gather_interconnect/ofed'] in $acct_gather_interconnect_type),
341341
}
342342

343343
$acct_gather_conf_file = ['/etc/slurm/acct_gather.conf']

manifests/config/acct_gather.pp

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# @param energy_ipmi_password Specify BMC Password.
1010
# @param profile_hdf5_dir This parameter is the path to the shared folder into which the acct_gather_profile plugin will write detailed data (usually as an HDF5 file).
1111
# @param profile_hdf5_default A comma delimited list of data types to be collected for each job submission.
12-
# @param infiniband_ofed_port This parameter represents the port number of the local Infiniband card that we are willing to monitor.
12+
# @param interconnect_ofed_port This parameter represents the port number of the local Infiniband card that we are willing to monitor.
1313
#
1414
# version 20170816
1515
#
@@ -30,8 +30,8 @@
3030
Boolean $with_profile_hdf5 = false,
3131
Optional[String] $profile_hdf5_dir = undef,
3232
String $profile_hdf5_default = 'None',
33-
Boolean $with_infiniband_ofed = false,
34-
Integer[0] $infiniband_ofed_port = 1,
33+
Boolean $with_interconnect_ofed = false,
34+
Integer[0] $interconnect_ofed_port = 1,
3535
) {
3636

3737
# AcctGather* plugin configuration

manifests/dbnode/setup.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
Array[String] $slurmdbd_packages = $slurm::params::slurmdbd_packages,
1818
) inherits slurm::params {
1919

20-
ensure_packages($slurmdbd_packages, {'ensure' => $slurm::setup::slurm_version})
20+
ensure_packages($slurm::params::slurmdbd_packages, {'ensure' => $slurm::params::slurm_version})
2121

2222
}

manifests/headnode/setup.pp

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
Array[String] $extra_packages = $slurm::params::extra_packages,
2222
) inherits slurm::params {
2323

24-
ensure_packages($extra_packages, {'ensure' => $slurm::setup::slurm_version})
24+
ensure_packages($extra_packages, {'ensure' => $slurm::params::slurm_version})
25+
ensure_packages($slurm::params::slurmctld_package, {'ensure' => $slurm::params::slurm_version})
2526

2627
file{ dirtree($slurm::config::state_save_location, $slurm::config::state_save_location) :
2728
ensure => directory,

manifests/params.pp

+23-8
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,52 @@
33
# Handles distribution-specific parameters for slurm::config, slurm::setup,
44
# workernode::setup, headnode::setup, and dbnode::setup
55
#
6-
# version 20170829
7-
#
6+
# version 20171205
7+
#
88
# Copyright (c) CERN, 2016-2017
99
# Authors: - Philippe Ganz <[email protected]>
1010
# - Carolina Lindqvist <[email protected]>
1111
# - Pablo Llopis <[email protected]>
1212
# License: GNU GPL v3 or later.
1313
#
1414

15-
class slurm::params {
15+
class slurm::params(
16+
String $slurm_version = '17.02.6',
17+
) {
1618
case $facts['os']['family'] {
1719
'RedHat': {
18-
$slurm_packages = [
20+
$slurm_packages_common = [
1921
'slurm',
2022
'slurm-devel',
21-
'slurm-munge',
22-
'slurm-plugins',
2323
]
2424
$munge_packages = [
2525
'munge',
2626
'munge-libs',
2727
'munge-devel',
2828
]
29-
$slurmdbd_packages = [
29+
$slurmdbd_packages_common = [
3030
'slurm-slurmdbd',
31-
'slurm-sql',
3231
]
3332
$extra_packages = [
3433
'slurm-perlapi',
3534
'slurm-torque',
3635
]
36+
37+
if versioncmp($slurm_version, '17.2') <= 0 {
38+
$slurm_packages_old = ['slurm-munge', 'slurm-plugins']
39+
$slurmdbd_packages_old = ['slurm-sql']
40+
$slurmd_package = []
41+
$slurmctld_package = []
42+
} else {
43+
$slurm_packages_old = []
44+
$slurmdbd_packages_old = []
45+
$slurmd_package = ['slurm-slurmd']
46+
$slurmctld_package = ['slurm-slurmctld']
47+
}
48+
49+
$slurm_packages = $slurm_packages_common + $slurm_packages_old
50+
$slurmdbd_packages = $slurmdbd_packages_common + $slurmdbd_packages_old
51+
3752
}
3853
default: {
3954
fail("OS family type ${facts['os']['family']} not supported.")

manifests/setup.pp

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#
2020

2121
class slurm::setup (
22-
String $slurm_version = '17.02.6',
2322
Integer[0] $slurm_gid = 950,
2423
Integer[0] $slurm_uid = 950,
2524
String $slurm_home_loc = '/usr/local/slurm',
@@ -32,7 +31,7 @@
3231
# SLURM
3332
################################################################################
3433

35-
ensure_packages($slurm_packages, {'ensure' => $slurm_version})
34+
ensure_packages($slurm::params::slurm_packages, {'ensure' => $slurm::params::slurm_version})
3635

3736
group{ 'slurm':
3837
ensure => present,

manifests/workernode/setup.pp

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
Array[String] $extra_packages = $slurm::params::extra_packages,
2222
) inherits slurm::params {
2323

24-
ensure_packages($extra_packages, {'ensure' => $slurm::setup::slurm_version})
24+
ensure_packages($extra_packages, {'ensure' => $slurm::params::slurm_version})
25+
ensure_packages($slurm::params::slurmd_package, {'ensure' => $slurm::params::slurm_version})
2526

2627
file{ dirtree($slurmd_spool_dir, $slurmd_spool_dir) :
2728
ensure => directory,

templates/acct_gather.conf.erb

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ ProfileHDF5Default=<%= @profile_hdf5_default %>
4646
<% end -%>
4747

4848
# Options used for AcctGatherInfinbandType/ofed
49-
<% if @with_infiniband_ofed -%>
50-
InfinibandOFEDPort=<%= @infiniband_ofed_port %>
49+
<% if @with_interconnect_ofed -%>
50+
InfinibandOFEDPort=<%= @interconnect_ofed_port %>
5151
<% else -%>
5252
#InfinibandOFEDPort=
5353
<% end %>

templates/slurm.conf.erb

+7-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,13 @@ JobAcctGatherFrequency=<%= @job_acct_gather_frequency.map{|pair| pair.join('=')}
306306
<%# -%>
307307
AcctGatherNodeFreq=<%= @acct_gather_node_freq %>
308308
AcctGatherEnergyType=<%= @acct_gather_energy_type %>
309-
AcctGatherInfinibandType=<%= @acct_gather_infiniband_type %>
309+
<% if @acct_gather_interconnect_type =="acct_gather_infiniband/ofed" -%>
310+
AcctGatherInfinibandType=<%= @acct_gather_interconnect_type %>
311+
<% elsif @acct_gather_interconnect_type == "acct_gather_interconnect/ofed" -%>
312+
AcctGatherInterconnectType=<%= @acct_gather_interconnect_type %>
313+
<% else -%>
314+
AcctGatherInterconnectType=acct_gather_interconnect/none
315+
<% end -%>
310316
AcctGatherFilesystemType=<%= @acct_gather_filesystem_type %>
311317
AcctGatherProfileType=<%= @acct_gather_profile_type %>
312318

0 commit comments

Comments
 (0)