Skip to content

Commit a14dbef

Browse files
committed
Add support to configure file limits for slurm module
Signed-off-by: Sanskar Bhushan <sanskar@obmondo.com>
1 parent 1ca719c commit a14dbef

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

modules/enableit/profile/manifests/computing/slurm.pp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
Boolean $hwloc_enabled = $::role::computing::slurm::hwloc_enabled,
3737
String $db_buffer_pool_size = $::role::computing::slurm::db_buffer_pool_size,
3838
String $db_log_file_size = $::role::computing::slurm::db_log_file_size,
39+
Optional[Integer[1]] $all_users_limit_nofile = $::role::computing::slurm::all_users_limit_nofile,
40+
Optional[Integer[1]] $slurmd_limit_nofile = $::role::computing::slurm::slurmd_limit_nofile,
3941
) inherits ::profile::computing {
4042
4143
# We manually install SLURM and munge packages because we're using packages
@@ -156,11 +158,27 @@
156158
})
157159

158160
class { '::profile::computing::slurm::slurmd':
159-
interface => $interface,
160-
node_cidrs => $node_cidrs,
161+
interface => $interface,
162+
node_cidrs => $node_cidrs,
163+
slurmd_limit_nofile => $slurmd_limit_nofile,
161164
}
162165
}
163166

167+
# Configure PAM file descriptor limits for all users on SLURM nodes
168+
pam::limits::fragment { 'slurm_nofile':
169+
ensure => $all_users_limit_nofile ? {
170+
undef => 'absent',
171+
default => 'present',
172+
},
173+
list => $all_users_limit_nofile ? {
174+
undef => undef,
175+
default => [
176+
"* soft nofile ${all_users_limit_nofile}",
177+
"* hard nofile ${all_users_limit_nofile}",
178+
],
179+
},
180+
}
181+
164182
if !$enable {
165183
package::remove( ['slurm', 'slurm-slurmdbd', 'slurm-slurmctld', 'slurm-slurmd', 'munge'])
166184
}

modules/enableit/profile/manifests/computing/slurm/slurmd.pp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
class profile::computing::slurm::slurmd (
33
Eit_types::SimpleString $interface,
44
Array[Eit_types::IPCIDR] $node_cidrs,
5+
Optional[Integer[1]] $slurmd_limit_nofile = undef,
56
) {
67

78
firewall_multi {
@@ -21,5 +22,18 @@
2122
;
2223
}
2324

25+
systemd::dropin_file { 'slurmd-90-nofile.conf':
26+
unit => 'slurmd.service',
27+
filename => '90-nofile.conf',
28+
ensure => $slurmd_limit_nofile ? {
29+
undef => 'absent',
30+
default => 'present',
31+
},
32+
content => $slurmd_limit_nofile ? {
33+
undef => undef,
34+
default => "[Service]\nLimitNOFILE=${slurmd_limit_nofile}\n",
35+
},
36+
}
37+
2438
include ::slurm::slurmd
2539
}

modules/enableit/role/manifests/computing/slurm.pp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
#
6262
# @param db_log_file_size Maximum size allocated for database log files.
6363
#
64+
# @param all_users_limit_nofile Optional PAM `nofile` value for all users.
65+
#
66+
# @param slurmd_limit_nofile Optional systemd `LimitNOFILE` value for slurmd service.
67+
#
6468
# @groups authentication munge_key, jwt_key, encrypt_params
6569
#
6670
# @groups daemon_control slurmctld, slurmdbd, slurmd
@@ -77,6 +81,8 @@
7781
#
7882
# @groups db db_buffer_pool_size, db_log_file_size
7983
#
84+
# @groups limits all_users_limit_nofile, slurmd_limit_nofile
85+
#
8086
# @encrypt_params munge_key, jwt_key, slurm_gateway.*.bind_password
8187
#
8288
class role::computing::slurm (
@@ -112,6 +118,8 @@
112118
Optional[Eit_types::Slurm::Policy] $slurm_policy = undef,
113119
String $db_buffer_pool_size = '256M',
114120
String $db_log_file_size = '24M',
121+
Optional[Integer[1]] $all_users_limit_nofile = undef,
122+
Optional[Integer[1]] $slurmd_limit_nofile = undef,
115123
Eit_types::Encrypt::Params $encrypt_params = ['munge_key', 'jwt_key','slurm_gateway.*.bind_password']
116124

117125
) inherits ::role::computing {

0 commit comments

Comments
 (0)