Skip to content

Commit

Permalink
Create slurm_external_slurmdbd.conf for external slurmdbd
Browse files Browse the repository at this point in the history
Add new Chef template to generate an include file for the
slurmdbd.conf only in case of external slurmdbd configuration.

Minor reformatting of slurmdbd.conf.erb.

Signed-off-by: Jacopo De Amicis <jdamicis@amazon.it>
  • Loading branch information
jdeamicis committed Dec 6, 2023
1 parent 6437814 commit f1ac7e9
Showing 4 changed files with 36 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -24,6 +24,23 @@
action :create_if_missing
end

template "#{node['cluster']['slurm']['install_dir']}/etc/slurm_external_slurmdbd.conf" do
source 'slurm/external_slurmdbd/slurm_external_slurmdbd.conf.erb'
owner "#{node['cluster']['slurm']['user']}"
group "#{node['cluster']['slurm']['group']}"
mode '0600'
action :create_if_missing
variables(
dbd_host: "localhost",
storage_host: node['dbms_uri'],
# TODO: expose additional CFN Parameter in template
storage_port: 3306,
storage_loc: node['dbms_database_name'],
storage_user: node['dbms_username']
)
only_if { node['is_external_slurmdbd'] }
end

file "#{node['cluster']['slurm']['install_dir']}/etc/slurm_parallelcluster_slurmdbd.conf" do
owner "#{node['cluster']['slurm']['user']}"
group "#{node['cluster']['slurm']['group']}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# slurm_external_slurmdbd.conf is managed by external configuration.
# Do not modify.
# Please add user-specific slurmdbd configuration options in slurmdbd.conf
DbdHost=<%= @dbd_host %>
StorageHost=<%= @storage_host %>
StoragePort=<%= @storage_port %>
StorageLoc=<%= @storage_loc %>
StorageUser=<%= @storage_user %>
StoragePass=dummy
Original file line number Diff line number Diff line change
@@ -10,7 +10,11 @@

set -e

<% if node['is_external_slurmdbd'] %>
SLURMDBD_CONFIG_FILE="/opt/slurm/etc/slurm_external_slurmdbd.conf"
<% else %>
SLURMDBD_CONFIG_FILE="/opt/slurm/etc/slurm_parallelcluster_slurmdbd.conf"
<% end %>
SLURMDBD_PROPERTY="StoragePass"
SECRET_ARN="<%= @secret_arn %>"
REGION="<%= @region %>"
Original file line number Diff line number Diff line change
@@ -6,11 +6,11 @@ StorageType=accounting_storage/mysql

# Conditional inclusion based on 'is_external_slurmdbd' attribute
<% if node['is_external_slurmdbd'] %>
# WARNING!!! The slurm_external_slurmdbd.conf file included below can be updated by the pcluster process.
# Please do not edit it.
include slurm_external_slurmdbd.conf
# WARNING!!! The slurm_external_slurmdbd.conf file included below can be updated by the pcluster process.
# Please do not edit it.
include slurm_external_slurmdbd.conf
<% else %>
# WARNING!!! The slurm_parallelcluster_slurmdbd.conf file included below can be updated by the pcluster process.
# Please do not edit it.
include slurm_parallelcluster_slurmdbd.conf
# WARNING!!! The slurm_parallelcluster_slurmdbd.conf file included below can be updated by the pcluster process.
# Please do not edit it.
include slurm_parallelcluster_slurmdbd.conf
<% end %>

0 comments on commit f1ac7e9

Please sign in to comment.