Skip to content

Commit 11c0436

Browse files
himani2411Himani Deshpande
andauthored
[DFSM]Using .login_nodes_keys_sync_file to be used during Init and Update phase of the clusters (#2677)
Co-authored-by: Himani Deshpande <[email protected]>
1 parent d028b5e commit 11c0436

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

cookbooks/aws-parallelcluster-environment/attributes/environment.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
default['cluster']['shared_dir_compute'] = node['cluster']['shared_dir']
5656
default['cluster']['shared_dir_head'] = node['cluster']['shared_dir']
5757
default['cluster']['shared_dir_login'] = node['cluster']['shared_dir_login_nodes']
58+
default['cluster']['shared_login_nodes_keys_sync_file'] = "#{node['cluster']['shared_dir_login_nodes']}/.login_nodes_keys_sync_file"
5859
# Since this is a shared directory, it needs to be defined here first instead of in the dependent cookbook for slurm
5960
default['cluster']['slurm']['install_dir'] = '/opt/slurm'
6061

cookbooks/aws-parallelcluster-environment/recipes/config/login_nodes_keys.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
script_dir = "#{keys_dir}/scripts"
2222
script_path = "#{script_dir}/keys-manager.sh"
2323

24-
sync_file_path = "#{keys_dir}/.login_nodes_keys_sync_file"
24+
sync_file_path = "#{node['cluster']['shared_login_nodes_keys_sync_file']}"
2525

2626
case node['cluster']['node_type']
2727
when 'ComputeFleet'

cookbooks/aws-parallelcluster-environment/spec/unit/recipes/login_nodes_keys_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@
9393
end
9494
cached(:node) { chef_run.node }
9595

96-
it "waits for cluster config version file" do
97-
is_expected.to run_bash("Wait for synchronization file at #{SYNC_FILE} to be written for version #{CLUSTER_CONFIG_VERSION}").with(
98-
code: "[[ \"$(cat #{SYNC_FILE})\" == \"#{CLUSTER_CONFIG_VERSION}\" ]] || exit 1",
96+
it "Wait for sync file to exist" do
97+
is_expected.to run_bash("Wait for synchronization file at #{SYNC_FILE} to exist").with(
98+
code: "[[ -e #{SYNC_FILE} ]] || exit 1",
9999
retries: 30,
100100
retry_delay: 10,
101101
timeout: 5

cookbooks/aws-parallelcluster-shared/libraries/helpers.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,12 @@ def write_sync_file(path)
9595
end
9696

9797
def wait_sync_file(path)
98-
# Wait for a synchronization file to be written for the current cluster config version.
98+
# Wait for a synchronization file to exist.
9999
# Synchronization files are used as a synchronization point between cluster nodes
100100
# to signal that a group of actions have been completed.
101-
cluster_config_version = node["cluster"]["cluster_config_version"]
102101
# Wait for the config version file to contain the current cluster config version.
103-
bash "Wait for synchronization file at #{path} to be written for version #{cluster_config_version}" do
104-
code "[[ \"$(cat #{path})\" == \"#{cluster_config_version}\" ]] || exit 1"
102+
bash "Wait for synchronization file at #{path} to exist" do
103+
code "[[ -e #{path} ]] || exit 1"
105104
retries 30
106105
retry_delay 10
107106
timeout 5

0 commit comments

Comments
 (0)