Skip to content

Commit 912fbfe

Browse files
committed
Update to support slurm 17.11.7
1 parent 0008dab commit 912fbfe

File tree

3 files changed

+46
-6
lines changed

3 files changed

+46
-6
lines changed

osgtest/library/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ def handler(*args, **kwargs):
5757
_el_release = None
5858

5959
SLURM_PACKAGES = ['slurm',
60-
'slurm-munge',
60+
'slurm-slurmd',
61+
'slurm-slurmctld',
6162
'slurm-perlapi',
62-
'slurm-plugins',
63-
'slurm-sql']
63+
'slurm-slurmdbd']
6464

6565
# ------------------------------------------------------------------------------
6666
# Global Functions

osgtest/tests/test_29_slurm.py

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import osgtest.library.osgunittest as osgunittest
55
import osgtest.library.service as service
66

7+
import time
8+
79
CLUSTER_NAME = 'osg_test'
810
CTLD_LOG = '/var/log/slurm/slurmctld.log'
911
SHORT_HOSTNAME = core.get_hostname().split('.')[0]
@@ -39,6 +41,21 @@
3941
StateSaveLocation=/var/spool/slurmd
4042
"""
4143

44+
SLURM_CGROUPS_CONFIG = """CgroupAutomount=yes
45+
CgroupMountpoint=/cgroup
46+
ConstrainCores=no
47+
ConstrainRAMSpace=no
48+
"""
49+
50+
SLURM_CGROUPS_DEVICE_CONFIG = """/dev/null
51+
/dev/urandom
52+
/dev/zero
53+
/dev/sda*
54+
/dev/cpu/*/*
55+
/dev/pts/*
56+
"""
57+
58+
4259
class TestStartSlurm(osgunittest.OSGTestCase):
4360

4461
def slurm_reqs(self):
@@ -52,6 +69,20 @@ def test_01_slurm_config(self):
5269
SLURM_CONFIG % {'short_hostname': SHORT_HOSTNAME, 'cluster': CLUSTER_NAME, 'ctld_log': CTLD_LOG},
5370
owner='slurm',
5471
chmod=0644)
72+
core.config['cgroup.config'] = '/etc/slurm/cgroup.conf'
73+
config = SLURM_CGROUPS_CONFIG
74+
if core.el_release() == 6:
75+
config += "\nCgroupMountpoint=/cgroup"
76+
files.write(core.config['cgroup.config'],
77+
SLURM_CGROUPS_CONFIG,
78+
owner='slurm',
79+
chmod=0644)
80+
81+
core.config['cgroup_allowed_devices_file.conf'] = '/etc/slurm/cgroup_allowed_devices_file.conf'
82+
files.write(core.config['cgroup_allowed_devices_file.conf'],
83+
SLURM_CGROUPS_DEVICE_CONFIG,
84+
owner='slurm',
85+
chmod=0644)
5586

5687
def test_02_start_slurmdbd(self):
5788
core.state['slurmdbd.started-service'] = False
@@ -88,20 +119,27 @@ def test_03_start_slurm(self):
88119
core.config['slurm.service-name'] = 'slurm'
89120
if core.el_release() == 7:
90121
core.config['slurm.service-name'] += 'd'
122+
core.config['slurm.ctld-service-name'] = 'slurmctld'
91123
core.state['%s.started-service' % core.config['slurm.service-name']] = False
92124
self.slurm_reqs()
93125
self.skip_ok_if(service.is_running(core.config['slurm.service-name']), 'slurm already running')
94126

95127
stat = core.get_stat(CTLD_LOG)
96128

97-
command = ['slurmctld']
98-
core.check_system(command, 'enable slurmctld')
99-
service.check_start(core.config['slurm.service-name'])
129+
if core.el_release() == 7:
130+
# slurmctld is handled by /etc/init.d/slurm on EL6
131+
command = ['slurmctld']
132+
core.check_system(command, 'enable slurmctld')
133+
service.check_start(core.config['slurm.service-name'])
134+
service.check_start(core.config['slurm.ctld-service-name'])
135+
else:
136+
service.check_start(core.config['slurm.service-name'])
100137

101138
core.monitor_file(CTLD_LOG,
102139
stat,
103140
'slurm_rpc_node_registration complete for %s' % SHORT_HOSTNAME,
104141
60.0)
142+
time.sleep(10)
105143
command = ['scontrol', 'update', 'nodename=%s' % SHORT_HOSTNAME, 'state=idle']
106144
core.check_system(command, 'enable slurm node')
107145

osgtest/tests/test_74_slurm.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ def test_01_stop_slurm(self):
1313
self.slurm_reqs()
1414
self.skip_ok_unless(core.state['%s.started-service' % core.config['slurm.service-name']], 'did not start slurm')
1515
service.check_stop(core.config['slurm.service-name']) # service requires config so we stop it first
16+
if core.el_release() == 7:
17+
service.check_stop(core.config['slurm.ctld-service-name'])
1618
files.restore(core.config['slurm.config'], 'slurm')
1719

1820
def test_02_stop_slurmdbd(self):

0 commit comments

Comments
 (0)