From 3aa59aa148fcd84f0ec98afefde98cc539d2544b Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Thu, 25 Jan 2024 08:45:29 +0000 Subject: [PATCH] Deploy topology.conf unconditionally srun will fail if slurm.conf defines use of a topology plugin but topology.conf does not exist on login nodes. Previously, topology.conf was only deployed to slurmd and slurmctld nodes. ``` $ srun -c 1 -n 1 --mem 1g --pty bash srun: error: s_p_parse_file: cannot stat file /etc/slurm/topology.conf: No such file or directory, retrying in 1sec up to 60sec srun: fatal: something wrong with opening/reading /etc/slurm/topology.conf: No such file or directory ``` This change removes the conditional and deploys topology.conf to all nodes. Fixes #52 --- manifests/common/config.pp | 44 ++++++++++----------- spec/shared_examples/slurm_common_config.rb | 36 ++++++----------- 2 files changed, 34 insertions(+), 46 deletions(-) diff --git a/manifests/common/config.pp b/manifests/common/config.pp index d7c29796..2c2160bc 100644 --- a/manifests/common/config.pp +++ b/manifests/common/config.pp @@ -37,31 +37,29 @@ } if $slurm::manage_slurm_conf and ! $slurm::configless { - if $slurm::slurmd or $slurm::slurmctld { - concat { 'slurm-topology.conf': - ensure => 'present', - path => $slurm::topology_conf_path, - owner => 'root', - group => 'root', - mode => '0644', - notify => $slurm::service_notify, - } - concat::fragment { 'slurm-topology.conf-header': - target => 'slurm-topology.conf', - content => "# File managed by Puppet - DO NOT EDIT\n", - order => '00', - } - if $slurm::topology_source { - concat::fragment { 'slurm-topology.conf-source': - target => 'slurm-topology.conf', - source => $slurm::topology_source, - order => '01', - } - } - $slurm::switches.each |$name, $switch| { - slurm::switch { $name: * => $switch } + concat { 'slurm-topology.conf': + ensure => 'present', + path => $slurm::topology_conf_path, + owner => 'root', + group => 'root', + mode => '0644', + notify => $slurm::service_notify, + } + concat::fragment { 'slurm-topology.conf-header': + target => 'slurm-topology.conf', + content => "# File managed by Puppet - DO NOT EDIT\n", + order => '00', + } + if $slurm::topology_source { + concat::fragment { 'slurm-topology.conf-source': + target => 'slurm-topology.conf', + source => $slurm::topology_source, + order => '01', } } + $slurm::switches.each |$name, $switch| { + slurm::switch { $name: * => $switch } + } if $slurm::slurmd or $slurm::slurmctld { concat { 'slurm-gres.conf': diff --git a/spec/shared_examples/slurm_common_config.rb b/spec/shared_examples/slurm_common_config.rb index 80fade17..0b48d6ce 100644 --- a/spec/shared_examples/slurm_common_config.rb +++ b/spec/shared_examples/slurm_common_config.rb @@ -126,20 +126,16 @@ 'UnkillableStepTimeout=60', 'UsePAM=0', 'VSizeFactor=0', - 'WaitTime=0' + 'WaitTime=0', ]) end it do - if slurmd || slurmctld - is_expected.to contain_concat('slurm-topology.conf').with(ensure: 'present', - path: '/etc/slurm/topology.conf', - owner: 'root', - group: 'root', - mode: '0644') - else - is_expected.not_to contain_concat('slurm-topology.conf') - end + is_expected.to contain_concat('slurm-topology.conf').with(ensure: 'present', + path: '/etc/slurm/topology.conf', + owner: 'root', + group: 'root', + mode: '0644') end it do @@ -385,19 +381,15 @@ end it do - if slurmd || slurmctld - verify_exact_fragment_contents(catalogue, 'slurm-topology.conf-switch01', [ - 'SwitchName=switch01 Nodes=c01' - ]) - end + verify_exact_fragment_contents(catalogue, 'slurm-topology.conf-switch01', [ + 'SwitchName=switch01 Nodes=c01' + ]) end it do - if slurmd || slurmctld - verify_exact_fragment_contents(catalogue, 'slurm-topology.conf-switch00', [ - 'SwitchName=switch00 Switches=switch01' - ]) - end + verify_exact_fragment_contents(catalogue, 'slurm-topology.conf-switch00', [ + 'SwitchName=switch00 Switches=switch01' + ]) end end @@ -467,9 +459,7 @@ let(:param_override) { { topology_source: 'file:///path/topology.conf' } } it do - if slurmd || slurmctld - is_expected.to contain_concat__fragment('slurm-topology.conf-source').with_source('file:///path/topology.conf') - end + is_expected.to contain_concat__fragment('slurm-topology.conf-source').with_source('file:///path/topology.conf') end end