Skip to content

Commit

Permalink
Deploy topology.conf unconditionally
Browse files Browse the repository at this point in the history
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
  • Loading branch information
optiz0r committed Jan 26, 2024
1 parent e478f69 commit 3aa59aa
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 46 deletions.
44 changes: 21 additions & 23 deletions manifests/common/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
36 changes: 13 additions & 23 deletions spec/shared_examples/slurm_common_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,16 @@
'UnkillableStepTimeout=60',
'UsePAM=0',
'VSizeFactor=0',
'WaitTime=0'
'WaitTime=0',

Check failure on line 129 in spec/shared_examples/slurm_common_config.rb

View workflow job for this annotation

GitHub Actions / Puppet 7 (Ruby 2.7.7)

Style/TrailingCommaInArrayLiteral: Avoid comma after the last item of an array. (https://rubystyle.guide#no-trailing-array-commas)

Check failure on line 129 in spec/shared_examples/slurm_common_config.rb

View workflow job for this annotation

GitHub Actions / Puppet 8 (Ruby 3.2.2)

Style/TrailingCommaInArrayLiteral: Avoid comma after the last item of an array. (https://rubystyle.guide#no-trailing-array-commas)
])
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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 3aa59aa

Please sign in to comment.