Skip to content

Commit f4b9aa1

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

3 files changed

Lines changed: 31 additions & 2 deletions

File tree

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

Lines changed: 14 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+
Integer[1] $all_users_limit_nofile = $::role::computing::slurm::all_users_limit_nofile,
40+
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,21 @@
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 => 'present',
170+
list => [
171+
"* soft nofile ${all_users_limit_nofile}",
172+
"* hard nofile ${all_users_limit_nofile}",
173+
],
174+
}
175+
164176
if !$enable {
165177
package::remove( ['slurm', 'slurm-slurmdbd', 'slurm-slurmctld', 'slurm-slurmd', 'munge'])
166178
}

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

Lines changed: 9 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+
Integer[1] $slurmd_limit_nofile,
56
) {
67

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

25+
# Configure systemd drop-in file to set file descriptor limits for slurmd service
26+
systemd::dropin_file { 'slurmd-90-nofile.conf':
27+
unit => 'slurmd.service',
28+
filename => '90-nofile.conf',
29+
ensure => 'present',
30+
content => "[Service]\nLimitNOFILE=${slurmd_limit_nofile}\n",
31+
}
32+
2433
include ::slurm::slurmd
2534
}

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 PAM `nofile` value for all users.
65+
#
66+
# @param slurmd_limit_nofile 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+
Integer[1] $all_users_limit_nofile = 10000,
122+
Integer[1] $slurmd_limit_nofile = 10000,
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)