From 440d8ada5ba0ebc8d698fa2dbc9d8f071bda2480 Mon Sep 17 00:00:00 2001 From: Xuanqi He Date: Tue, 26 Sep 2023 12:35:01 -0400 Subject: [PATCH] Rename SHARED_DIRECTORY to SHARED_DIRECTORY_COMPUTE. Change SlurmSettings to MungeKeySettings to adopt new change in cli --- cookbooks/aws-parallelcluster-slurm/kitchen.slurm-config.yml | 2 +- cookbooks/aws-parallelcluster-slurm/libraries/helpers.rb | 4 ++-- cookbooks/aws-parallelcluster-slurm/libraries/update.rb | 4 ++-- .../recipes/config/config_head_node.rb | 4 ++-- .../recipes/update/update_head_node.rb | 4 ++-- .../templates/default/slurm/head_node/update_munge_key.sh.erb | 4 ++-- kitchen.validate-config.yml | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cookbooks/aws-parallelcluster-slurm/kitchen.slurm-config.yml b/cookbooks/aws-parallelcluster-slurm/kitchen.slurm-config.yml index 52fbe82e3..f3862ed1c 100644 --- a/cookbooks/aws-parallelcluster-slurm/kitchen.slurm-config.yml +++ b/cookbooks/aws-parallelcluster-slurm/kitchen.slurm-config.yml @@ -189,5 +189,5 @@ suites: scheduler: 'slurm' config: DevSettings: - SlurmSettings: + MungeKeySettings: MungeKeySecretArn: null diff --git a/cookbooks/aws-parallelcluster-slurm/libraries/helpers.rb b/cookbooks/aws-parallelcluster-slurm/libraries/helpers.rb index b547bc03b..b4bf24216 100644 --- a/cookbooks/aws-parallelcluster-slurm/libraries/helpers.rb +++ b/cookbooks/aws-parallelcluster-slurm/libraries/helpers.rb @@ -78,7 +78,7 @@ def setup_munge_head_node # Generate munge key or get it's value from secrets manager munge_key_manager 'manage_munge_key' do munge_key_secret_arn lazy { - node['cluster']['config'].dig(:DevSettings, :SlurmSettings, :MungeKeySecretArn) + node['cluster']['config'].dig(:DevSettings, :MungeKeySettings, :MungeKeySecretArn) } end @@ -88,7 +88,7 @@ def setup_munge_head_node def update_munge_head_node munge_key_manager 'update_munge_key' do - munge_key_secret_arn lazy { node['cluster']['config'].dig(:DevSettings, :SlurmSettings, :MungeKeySecretArn) } + munge_key_secret_arn lazy { node['cluster']['config'].dig(:DevSettings, :MungeKeySettings, :MungeKeySecretArn) } action :update_munge_key only_if { ::File.exist?(node['cluster']['previous_cluster_config_path']) && is_custom_munge_key_updated? } end diff --git a/cookbooks/aws-parallelcluster-slurm/libraries/update.rb b/cookbooks/aws-parallelcluster-slurm/libraries/update.rb index 81204312e..154de7275 100644 --- a/cookbooks/aws-parallelcluster-slurm/libraries/update.rb +++ b/cookbooks/aws-parallelcluster-slurm/libraries/update.rb @@ -79,7 +79,7 @@ def execute_command(command, user = "root", timeout = 300, raise_on_error = true cmd.stdout.strip end -# Verify if MungeKeySecretArn in SlurmSettings section of cluster configuration has been updated +# Verify if MungeKeySecretArn in MungeKeySettings section of cluster configuration has been updated def is_custom_munge_key_updated? - config_parameter_changed?(%w(DevSettings SlurmSettings MungeKeySecretArn)) + config_parameter_changed?(%w(DevSettings MungeKeySettings MungeKeySecretArn)) end diff --git a/cookbooks/aws-parallelcluster-slurm/recipes/config/config_head_node.rb b/cookbooks/aws-parallelcluster-slurm/recipes/config/config_head_node.rb index 8e3df6ca1..322ab975f 100644 --- a/cookbooks/aws-parallelcluster-slurm/recipes/config/config_head_node.rb +++ b/cookbooks/aws-parallelcluster-slurm/recipes/config/config_head_node.rb @@ -288,11 +288,11 @@ group 'root' mode '0700' variables( - munge_key_secret_arn: lazy { node['cluster']['config'].dig(:DevSettings, :SlurmSettings, :MungeKeySecretArn) }, + munge_key_secret_arn: lazy { node['cluster']['config'].dig(:DevSettings, :MungeKeySettings, :MungeKeySecretArn) }, region: node['cluster']['region'], munge_user: node['cluster']['munge']['user'], munge_group: node['cluster']['munge']['group'], - shared_directory: node['cluster']['shared_dir'], + shared_directory_compute: node['cluster']['shared_dir'], shared_directory_login: node['cluster']['shared_dir_login'] ) end diff --git a/cookbooks/aws-parallelcluster-slurm/recipes/update/update_head_node.rb b/cookbooks/aws-parallelcluster-slurm/recipes/update/update_head_node.rb index 6876bb33f..03bd4f5f6 100644 --- a/cookbooks/aws-parallelcluster-slurm/recipes/update/update_head_node.rb +++ b/cookbooks/aws-parallelcluster-slurm/recipes/update/update_head_node.rb @@ -208,11 +208,11 @@ def update_nodes_in_queue(strategy, queues) group 'root' mode '0700' variables( - munge_key_secret_arn: lazy { node['cluster']['config'].dig(:DevSettings, :SlurmSettings, :MungeKeySecretArn) }, + munge_key_secret_arn: lazy { node['cluster']['config'].dig(:DevSettings, :MungeKeySettings, :MungeKeySecretArn) }, region: node['cluster']['region'], munge_user: node['cluster']['munge']['user'], munge_group: node['cluster']['munge']['group'], - shared_directory: node['cluster']['shared_dir'], + shared_directory_compute: node['cluster']['shared_dir'], shared_directory_login: node['cluster']['shared_dir_login'] ) only_if { ::File.exist?(node['cluster']['previous_cluster_config_path']) && is_custom_munge_key_updated? } diff --git a/cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/update_munge_key.sh.erb b/cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/update_munge_key.sh.erb index a56b7fcda..4c0715e18 100644 --- a/cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/update_munge_key.sh.erb +++ b/cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/update_munge_key.sh.erb @@ -13,7 +13,7 @@ SECRET_ARN="<%= @munge_key_secret_arn %>" REGION="<%= @region %>" MUNGE_USER="<%= @munge_user %>" MUNGE_GROUP="<%= @munge_group %>" -SHARED_DIRECTORY="<%= @shared_directory %>" +SHARED_DIRECTORY_COMPUTE="<%= @shared_directory_compute %>" SHARED_DIRECTORY_LOGIN="<%= @shared_directory_login %>" # Check compute fleet status @@ -76,7 +76,7 @@ else fi # Share munge key -SHARED_DIRECTORIES=(${SHARED_DIRECTORY} ${SHARED_DIRECTORY_LOGIN}) +SHARED_DIRECTORIES=(${SHARED_DIRECTORY_COMPUTE} ${SHARED_DIRECTORY_LOGIN}) for dir in "${SHARED_DIRECTORIES[@]}"; do echo "Sharing munge key to $dir" diff --git a/kitchen.validate-config.yml b/kitchen.validate-config.yml index 98972d0e9..265e1795b 100644 --- a/kitchen.validate-config.yml +++ b/kitchen.validate-config.yml @@ -35,7 +35,7 @@ _head_node_cluster_attributes: &_head_node_cluster_attributes slurm_ddb_table: <%= ENV['DDB_TABLE'] %> config: DevSettings: - SlurmSettings: + MungeKeySettings: MungeKeySecretArn: null _compute_node_cluster_attributes: &_compute_node_cluster_attributes