From fc43806e3ceeae646ddeb9b14de76d5a375bf09e Mon Sep 17 00:00:00 2001 From: Trey Dockendorf Date: Wed, 14 Feb 2024 18:52:50 -0500 Subject: [PATCH] Support Slurm 23.11 --- README.md | 3 ++- manifests/init.pp | 8 ++++---- manifests/params.pp | 16 +++++++--------- spec/shared_examples/slurm_common_config.rb | 15 ++++++--------- spec/spec_helper_acceptance_setup.rb | 3 +-- templates/cgroup/cgroup.conf.erb | 4 +--- 6 files changed, 21 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index a067d402..b2275dc0 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Manage SLURM. ### Supported Versions of SLURM -This module is designed to work with SLURM 21.08.x, 22.05.x and 23.02.x. +This module is designed to work with SLURM 22.05.x, 23.02.x and 23.11.x. | SLURM Version | SLURM Puppet module versions | | ----------------- | -----------------------------| @@ -35,6 +35,7 @@ This module is designed to work with SLURM 21.08.x, 22.05.x and 23.02.x. | 20.11.x | 1.x | | 21.08.x & 22.05.x | 2.x | | 23.02.x | 3.x | +| 23.11.x | 4.x | ## Usage diff --git a/manifests/init.pp b/manifests/init.pp index 1f6c41e1..7d1a34d4 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -143,7 +143,6 @@ # @param slurmrestd_restart_on_failure # @param cgroup_conf_template # @param cgroup_conf_source -# @param cgroup_automount # @param cgroup_mountpoint # @param cgroup_plugin # @param cgroup_allowed_ram_space @@ -156,6 +155,7 @@ # @param cgroup_max_swap_percent # @param cgroup_memory_swappiness # @param cgroup_min_ram_space +# @param cgroup_signal_child_processes # @param slurm_sh_template # @param slurm_csh_template # @param profile_d_env_vars @@ -193,7 +193,7 @@ Boolean $install_pam = true, # Source install - String $version = '21.08.8', + String $version = '23.11.3', Array $source_dependencies = [], Array $configure_flags = [], Boolean $source_install_manage_alternatives = true, @@ -359,9 +359,8 @@ # cgroups String $cgroup_conf_template = 'slurm/cgroup/cgroup.conf.erb', Optional[String] $cgroup_conf_source = undef, - Boolean $cgroup_automount = true, Stdlib::Absolutepath $cgroup_mountpoint = '/sys/fs/cgroup', - Optional[String] $cgroup_plugin = undef, + String $cgroup_plugin = 'autodetect', Integer $cgroup_allowed_ram_space = 100, Integer $cgroup_allowed_swap_space = 0, Boolean $cgroup_constrain_cores = false, @@ -372,6 +371,7 @@ Integer $cgroup_max_swap_percent = 100, Optional[Integer[0,100]] $cgroup_memory_swappiness = undef, Integer $cgroup_min_ram_space = 30, + Boolean $cgroup_signal_child_processes = false, # profile.d String[1] $slurm_sh_template = 'slurm/profile.d/slurm.sh.erb', diff --git a/manifests/params.pp b/manifests/params.pp index 977f4033..6f50b401 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -32,7 +32,7 @@ 'CliFilterPlugins' => undef, 'CommunicationParameters' => undef, 'CompleteWait' => '0', - 'CoreSpecPlugin' => 'core_spec/none', + 'CoreSpecPlugin' => undef, 'CpuFreqDef' => undef, 'CpuFreqGovernors' => 'OnDemand,Performance,UserSpace', 'CredType' => 'cred/munge', @@ -46,8 +46,6 @@ 'EioTimeout' => '60', 'EnforcePartLimits' => 'NO', 'EpilogMsgTime' => '2000', - 'ExtSensorsFreq' => undef, - 'ExtSensorsType' => undef, 'FairShareDampeningFactor' => '1', 'FederationParameters' => undef, 'FirstJobId' => '1', @@ -63,7 +61,7 @@ 'JobAcctGatherType' => 'jobacct_gather/cgroup', 'JobAcctGatherFrequency' => 'task=30,energy=0,network=0,filesystem=0', 'JobAcctGatherParams' => undef, - 'JobCompType' => 'jobcomp/none', + 'JobCompType' => undef, 'JobContainerType' => undef, 'JobFileAppend' => undef, 'JobRequeue' => '1', @@ -107,7 +105,7 @@ 'PriorityParameters' => undef, 'PrioritySiteFactorParameters' => undef, 'PrioritySiteFactorPlugin' => 'site_factor/none', - 'PriorityType' => 'priority/basic', + 'PriorityType' => 'priority/multifactor', 'PriorityUsageResetPeriod' => 'NONE', 'PriorityWeightAge' => '0', 'PriorityWeightAssoc' => '0', @@ -138,7 +136,7 @@ 'SchedulerTimeSlice' => '30', 'SchedulerType' => 'sched/backfill', 'ScronParameters' => undef, - 'SelectType' => 'select/linear', + 'SelectType' => 'select/cons_tres', 'SelectTypeParameters' => undef, 'SlurmctldAddr' => undef, 'SlurmctldDebug' => 'info', @@ -162,15 +160,15 @@ 'SuspendRate' => '60', 'SuspendTime' => '-1', 'SuspendTimeout' => '30', - 'SwitchType' => 'switch/none', + 'SwitchType' => undef, 'TaskPlugin' => 'task/affinity,task/cgroup', 'TaskPluginParam' => undef, 'TCPTimeout' => '2', 'TmpFS' => '/tmp', 'TopologyParam' => undef, - 'TopologyPlugin' => 'topology/none', + 'TopologyPlugin' => undef, 'TrackWCKey' => undef, - 'TreeWidth' => '50', + 'TreeWidth' => '16', 'UnkillableStepProgram' => undef, 'UnkillableStepTimeout' => '60', 'UsePAM' => '0', diff --git a/spec/shared_examples/slurm_common_config.rb b/spec/shared_examples/slurm_common_config.rb index 80fade17..a7df9e25 100644 --- a/spec/shared_examples/slurm_common_config.rb +++ b/spec/shared_examples/slurm_common_config.rb @@ -31,7 +31,6 @@ 'BatchStartTimeout=10', 'ClusterName=linux', 'CompleteWait=0', - 'CoreSpecPlugin=core_spec/none', 'CpuFreqGovernors=OnDemand,Performance,UserSpace', 'CredType=cred/munge', 'DisableRootJobs=NO', @@ -50,7 +49,6 @@ 'InteractiveStepOptions="--interactive --preserve-env --pty $SHELL"', 'JobAcctGatherType=jobacct_gather/cgroup', 'JobAcctGatherFrequency=task=30,energy=0,network=0,filesystem=0', - 'JobCompType=jobcomp/none', 'JobRequeue=1', 'KillOnBadExit=0', 'KillWait=30', @@ -76,7 +74,7 @@ 'PriorityFavorSmall=NO', 'PriorityMaxAge=7-0', 'PrioritySiteFactorPlugin=site_factor/none', - 'PriorityType=priority/basic', + 'PriorityType=priority/multifactor', 'PriorityUsageResetPeriod=NONE', 'PriorityWeightAge=0', 'PriorityWeightAssoc=0', @@ -94,7 +92,7 @@ 'RoutePlugin=route/default', 'SchedulerTimeSlice=30', 'SchedulerType=sched/backfill', - 'SelectType=select/linear', + 'SelectType=select/cons_tres', 'SlurmctldDebug=info', 'SlurmctldHost=slurm', 'SlurmctldLogFile=/var/log/slurm/slurmctld.log', @@ -117,12 +115,10 @@ 'SuspendRate=60', 'SuspendTime=-1', 'SuspendTimeout=30', - 'SwitchType=switch/none', 'TaskPlugin=task/affinity,task/cgroup', 'TCPTimeout=2', 'TmpFS=/tmp', - 'TopologyPlugin=topology/none', - 'TreeWidth=50', + 'TreeWidth=16', 'UnkillableStepTimeout=60', 'UsePAM=0', 'VSizeFactor=0', @@ -172,8 +168,8 @@ it 'has cgroup.conf with valid contents' do verify_exact_file_contents(catalogue, 'slurm-cgroup.conf', [ - 'CgroupAutomount=yes', 'CgroupMountpoint=/sys/fs/cgroup', + 'CgroupPlugin=autodetect', 'AllowedRAMSpace=100', 'AllowedSwapSpace=0', 'ConstrainCores=no', @@ -182,7 +178,8 @@ 'ConstrainSwapSpace=no', 'MaxRAMPercent=100', 'MaxSwapPercent=100', - 'MinRAMSpace=30' + 'MinRAMSpace=30', + 'SignalChildrenProcesses=no' ]) end diff --git a/spec/spec_helper_acceptance_setup.rb b/spec/spec_helper_acceptance_setup.rb index 304d5c80..b7291daa 100644 --- a/spec/spec_helper_acceptance_setup.rb +++ b/spec/spec_helper_acceptance_setup.rb @@ -11,7 +11,7 @@ c.slurm_repo_baseurl = ENV['SLURM_BEAKER_repo_baseurl'] || nil c.add_setting :slurm_version - c.slurm_version = ENV['SLURM_BEAKER_version'] || '23.02.6' + c.slurm_version = ENV['SLURM_BEAKER_version'] || '23.11.3' if ENV['BEAKER_set'] =~ %r{cluster} slurmctld_host = 'slurmctld' @@ -73,7 +73,6 @@ slurm::auth_alt_types: - auth/jwt slurm::jwt_key_source: 'puppet:///modules/site_slurm/jwt.key' -slurm::cgroup_plugin: 'cgroup/v1' slurm::partitions: general: default: 'YES' diff --git a/templates/cgroup/cgroup.conf.erb b/templates/cgroup/cgroup.conf.erb index 70758bde..96013191 100644 --- a/templates/cgroup/cgroup.conf.erb +++ b/templates/cgroup/cgroup.conf.erb @@ -6,11 +6,8 @@ # See man slurm.conf and man cgroup.conf for further # information on cgroup configuration parameters #-- -CgroupAutomount=<%= scope['slurm::cgroup_automount'] ? "yes" : "no" %> CgroupMountpoint=<%= scope['slurm::cgroup_mountpoint'] %> -<%- if scope['slurm::cgroup_plugin'] -%> CgroupPlugin=<%= scope['slurm::cgroup_plugin'] %> -<%- end -%> # task/cgroup plugin AllowedRAMSpace=<%= scope['slurm::cgroup_allowed_ram_space'] %> AllowedSwapSpace=<%= scope['slurm::cgroup_allowed_swap_space'] %> @@ -24,3 +21,4 @@ MaxSwapPercent=<%= scope['slurm::cgroup_max_swap_percent'] %> MemorySwappiness=<%= scope['slurm::cgroup_memory_swappiness'] %> <%- end -%> MinRAMSpace=<%= scope['slurm::cgroup_min_ram_space'] %> +SignalChildrenProcesses=<%= scope['slurm::cgroup_signal_child_processes'] ? 'yes' : 'no' %>