Skip to content

Commit

Permalink
Bump default version to 21.08.8 (#39)
Browse files Browse the repository at this point in the history
* Bump default version to 21.08.8

* Attempt to fix ordering issues
  • Loading branch information
treydock authored Jun 30, 2022
1 parent 224f6f5 commit fc8a5e1
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 69 deletions.
43 changes: 9 additions & 34 deletions manifests/common/install/source.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# @api private
class slurm::common::install::source {
$src_file = "/usr/local/src/slurm-${slurm::version}.tar.bz2"
$src_dir = "/usr/local/src/slurm-${slurm::version}"

if $slurm::osfamily == 'RedHat' {
include epel
$package_require = Yumrepo['epel']
Expand All @@ -15,7 +12,7 @@
if $package_require {
$package_require -> Package[$package]
}
Package[$package] -> Archive[$src_file]
Package[$package] -> Archive[$slurm::src_file]
}
if ($facts['os']['family'] == 'Debian') or ($facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'], '8') >= 0) {
if $slurm::source_install_manage_alternatives {
Expand All @@ -37,11 +34,11 @@
}
}

archive { $src_file:
archive { $slurm::src_file:
source => "https://download.schedmd.com/slurm/slurm-${slurm::version}.tar.bz2",
extract => true,
extract_path => '/usr/local/src',
creates => $src_dir,
creates => $slurm::src_dir,
cleanup => true,
user => 'root',
group => 'root',
Expand All @@ -57,14 +54,14 @@
$configure_flags = join($slurm::configure_flags, ' ')
$configure_command = "./configure ${base_configure_flags} ${configure_flags}"

file { "${src_dir}/puppet-install.sh":
file { "${slurm::src_dir}/puppet-install.sh":
ensure => 'file',
owner => 'root',
group => 'root',
mode => '0755',
content => join([
'#!/bin/bash',
"cd ${src_dir}",
"cd ${slurm::src_dir}",
$configure_command,
'[ $? -ne 0 ] && { rm -f $0; exit 1; }',
"make -j${facts['processors']['count']}",
Expand All @@ -75,7 +72,7 @@
'',
], "\n"),
notify => Exec['install-slurm'],
require => Archive[$src_file],
require => Archive[$slurm::src_file],
}

if $slurm::install_prefix != '/usr' {
Expand All @@ -91,36 +88,14 @@
}

exec { 'install-slurm':
path => "${src_dir}:/usr/bin:/bin:/usr/sbin:/sbin",
command => "${src_dir}/puppet-install.sh",
cwd => $src_dir,
path => "${slurm::src_dir}:/usr/bin:/bin:/usr/sbin:/sbin",
command => "${slurm::src_dir}/puppet-install.sh",
cwd => $slurm::src_dir,
refreshonly => true,
}
~> exec { 'ldconfig-slurm':
path => '/usr/bin:/bin:/usr/sbin:/sbin',
command => 'ldconfig',
refreshonly => true,
}

if $slurm::slurmd {
systemd::unit_file { 'slurmd.service':
source => "file:///${src_dir}/etc/slurmd.service",
require => Exec['install-slurm'],
notify => Service['slurmd'],
}
}
if $slurm::slurmctld {
systemd::unit_file { 'slurmctld.service':
source => "file:///${src_dir}/etc/slurmctld.service",
require => Exec['install-slurm'],
notify => Service['slurmctld'],
}
}
if $slurm::slurmdbd {
systemd::unit_file { 'slurmdbd.service':
source => "file:///${src_dir}/etc/slurmdbd.service",
require => Exec['install-slurm'],
notify => Service['slurmdbd'],
}
}
}
4 changes: 3 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
Boolean $install_pam = true,

# Source install
String $version = '21.08.4',
String $version = '21.08.8',
Array $source_dependencies = [],
Array $configure_flags = [],
Boolean $source_install_manage_alternatives = true,
Expand Down Expand Up @@ -429,6 +429,8 @@
$plugstack_conf_path = "${conf_dir}/plugstack.conf"
$job_container_conf_path = "${conf_dir}/job_container.conf"
$jwt_key_path = "${conf_dir}/jwt.key"
$src_file = "/usr/local/src/slurm-${slurm::version}.tar.bz2"
$src_dir = "/usr/local/src/slurm-${slurm::version}"

if $install_prefix in ['/usr','/usr/local'] {
$profiled_add_path = false
Expand Down
35 changes: 23 additions & 12 deletions manifests/slurmctld/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
$systemd_mounts = 'absent'
}
systemd::dropin_file { 'slurmctld-mounts.conf':
ensure => $systemd_mounts,
unit => 'slurmctld.service',
content => join(delete_undef_values([
ensure => $systemd_mounts,
unit => 'slurmctld.service',
content => join(delete_undef_values([
'# File managed by Puppet',
'[Unit]',
$slurm::state_dir_systemd,
]), "\n"),
notify => Service['slurmctld'],
notify_service => false,
notify => Service['slurmctld'],
}

if $slurm::slurmctld_restart_on_failure {
Expand All @@ -41,26 +42,36 @@
}

systemd::dropin_file { 'slurmctld-restart.conf':
ensure => $slurmctld_systemd_restart,
unit => 'slurmctld.service',
content => join([
ensure => $slurmctld_systemd_restart,
unit => 'slurmctld.service',
content => join([
'# File managed by Puppet',
'[Service]',
'Restart=on-failure',
], "\n"),
notify => Service['slurmctld'],
notify_service => false,
notify => Service['slurmctld'],
}

systemd::dropin_file { 'slurmctld-logging.conf':
ensure => $slurm::logging_systemd_override,
unit => 'slurmctld.service',
content => join([
ensure => $slurm::logging_systemd_override,
unit => 'slurmctld.service',
content => join([
'# File managed by Puppet',
'[Service]',
'StandardOutput=null',
'StandardError=null',
], "\n"),
notify => Service['slurmctld'],
notify_service => false,
notify => Service['slurmctld'],
}

if $slurm::install_method == 'source' {
systemd::unit_file { 'slurmctld.service':
source => "file:///${slurm::src_dir}/etc/slurmctld.service",
require => Exec['install-slurm'],
notify => Service['slurmctld'],
}
}

service { 'slurmctld':
Expand Down
17 changes: 13 additions & 4 deletions manifests/slurmd/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,24 @@
}

systemd::dropin_file { 'slurmd-logging.conf':
ensure => $slurm::logging_systemd_override,
unit => 'slurmd.service',
content => join([
ensure => $slurm::logging_systemd_override,
unit => 'slurmd.service',
content => join([
'# File managed by Puppet',
'[Service]',
'StandardOutput=null',
'StandardError=null',
], "\n"),
notify => Service['slurmd'],
notify_service => false,
notify => Service['slurmd'],
}

if $slurm::install_method == 'source' {
systemd::unit_file { 'slurmd.service':
source => "file:///${slurm::src_dir}/etc/slurmd.service",
require => Exec['install-slurm'],
notify => Service['slurmd'],
}
}

service { 'slurmd':
Expand Down
35 changes: 23 additions & 12 deletions manifests/slurmdbd/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
$systemd_mounts = 'absent'
}
systemd::dropin_file { 'slurmdbd-mounts.conf':
ensure => $systemd_mounts,
unit => 'slurmctld.service',
content => join(delete_undef_values([
ensure => $systemd_mounts,
unit => 'slurmctld.service',
content => join(delete_undef_values([
'# File managed by Puppet',
'[Unit]',
$slurm::slurmdbd_archive_dir_systemd,
]), "\n"),
notify => Service['slurmdbd'],
notify_service => false,
notify => Service['slurmdbd'],
}

if $slurm::slurmdbd_restart_on_failure {
Expand All @@ -41,26 +42,36 @@
}

systemd::dropin_file { 'slurmdbd-restart.conf':
ensure => $slurmdbd_systemd_restart,
unit => 'slurmdbd.service',
content => join([
ensure => $slurmdbd_systemd_restart,
unit => 'slurmdbd.service',
content => join([
'# File managed by Puppet',
'[Service]',
'Restart=on-failure',
], "\n"),
notify => Service['slurmdbd'],
notify_service => false,
notify => Service['slurmdbd'],
}

systemd::dropin_file { 'slurmdbd-logging.conf':
ensure => $slurm::logging_systemd_override,
unit => 'slurmdbd.service',
content => join([
ensure => $slurm::logging_systemd_override,
unit => 'slurmdbd.service',
content => join([
'# File managed by Puppet',
'[Service]',
'StandardOutput=null',
'StandardError=null',
], "\n"),
notify => Service['slurmdbd'],
notify_service => false,
notify => Service['slurmdbd'],
}

if $slurm::install_method == 'source' {
systemd::unit_file { 'slurmdbd.service':
source => "file:///${slurm::src_dir}/etc/slurmdbd.service",
require => Exec['install-slurm'],
notify => Service['slurmdbd'],
}
}

service { 'slurmdbd':
Expand Down
9 changes: 5 additions & 4 deletions manifests/slurmrestd/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@
}

systemd::dropin_file { 'slurmrestd-logging.conf':
ensure => $slurm::logging_systemd_override,
unit => 'slurmrestd.service',
content => join([
ensure => $slurm::logging_systemd_override,
unit => 'slurmrestd.service',
content => join([
'# File managed by Puppet',
'[Service]',
'StandardOutput=null',
'StandardError=null',
], "\n"),
notify => Service['slurmrestd'],
notify_service => false,
notify => Service['slurmrestd'],
}

systemd::unit_file { 'slurmrestd.service':
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
{
"name": "puppet/systemd",
"version_requirement": ">= 1.1.0 <4.0.0"
"version_requirement": ">= 3.1.0 <4.0.0"
},
{
"name": "puppet/archive",
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper_acceptance_setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
c.slurm_repo_baseurl = ENV['SLURM_BEAKER_repo_baseurl'] || nil

c.add_setting :slurm_version
c.slurm_version = ENV['SLURM_BEAKER_version'] || '21.08.4'
c.slurm_version = ENV['SLURM_BEAKER_version'] || '21.08.8'

if ENV['BEAKER_set'] =~ %r{cluster}
slurmctld_host = 'slurmctld'
Expand Down

0 comments on commit fc8a5e1

Please sign in to comment.