Skip to content

Commit

Permalink
Make DbdPort configurable in external slurmdbd recipes
Browse files Browse the repository at this point in the history
Do not configure DbdPort in slurmdbd.conf in case of external slurmdbd.

Move configuration of slurmdbd.service into config_slurm_accounting.rb (this is
also called by the external slurmdbd recipe).

Skip some steps in config_slurm_accounting.rb in kitchen tests.

Signed-off-by: Jacopo De Amicis <jdamicis@amazon.it>
  • Loading branch information
jdeamicis committed Feb 5, 2024
1 parent d021969 commit 219cd72
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@
end
# rubocop:enable Lint/DuplicateBranch

# TODO: move this template to a separate recipe
template '/etc/systemd/system/slurmdbd.service' do
cookbook 'aws-parallelcluster-slurm'
source 'slurm/head_node/slurmdbd.service.erb'
owner 'root'
group 'root'
mode '0644'
action :create
end

include_recipe 'aws-parallelcluster-slurm::config_head_node_directories'

include_recipe 'aws-parallelcluster-slurm::external_slurmdbd_disable_unrequired_services'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,6 @@
action :create
end

template '/etc/systemd/system/slurmdbd.service' do
source 'slurm/head_node/slurmdbd.service.erb'
owner 'root'
group 'root'
mode '0644'
action :create
end

include_recipe 'aws-parallelcluster-slurm::config_health_check'

ruby_block "Configure Slurm Accounting" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and
# limitations under the License.


template '/etc/systemd/system/slurmdbd.service' do
source 'slurm/head_node/slurmdbd.service.erb'
owner 'root'
group 'root'
mode '0644'
action :create
end

template "#{node['cluster']['slurm']['install_dir']}/etc/slurmdbd.conf" do
source 'slurm/slurmdbd.conf.erb'
owner "#{node['cluster']['slurm']['user']}"
Expand All @@ -32,6 +41,7 @@
action :create_if_missing
variables(
dbd_host: "localhost",
dbd_port: node['slurmdbd_port'],
dbd_addr: node['slurmdbd_ip'],
storage_host: node['dbms_uri'],
# TODO: expose additional CFN Parameter in template
Expand Down Expand Up @@ -65,7 +75,7 @@
user 'root'
group 'root'
command "#{node['cluster']['scripts_dir']}/slurm/update_slurm_database_password.sh"
end unless on_docker?
end unless kitchen_test?

service "slurmdbd" do
supports restart: false
Expand All @@ -81,7 +91,7 @@
command "#{node['cluster']['slurm']['install_dir']}/bin/sacctmgr show clusters -Pn"
retries node['cluster']['slurmdbd_response_retries']
retry_delay 10
end unless on_docker? || node['is_external_slurmdbd']
end unless kitchen_test? || node['is_external_slurmdbd']

bash "bootstrap slurm database" do
user 'root'
Expand Down Expand Up @@ -112,4 +122,4 @@
# This is not important for the scope of this script, so we return 0.
exit 0
BOOTSTRAP
end unless on_docker? || node['is_external_slurmdbd']
end unless kitchen_test? || node['is_external_slurmdbd']
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Do not modify.
# Please add user-specific slurmdbd configuration options in slurmdbd.conf
DbdHost=<%= @dbd_host %>
DbdPort=<%= @dbd_port %>
DbdAddr=<%= @dbd_addr %>
StorageHost=<%= @storage_host %>
StoragePort=<%= @storage_port %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
AuthType=auth/munge
LogFile=/var/log/slurmdbd.log
<% if !node['is_external_slurmdbd'] %>
DbdPort=6819
<% end %>
SlurmUser=<%= node['cluster']['slurm']['user'] %>
StorageType=accounting_storage/mysql

Expand Down

0 comments on commit 219cd72

Please sign in to comment.