Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
default['cluster']['shared_dir_compute'] = node['cluster']['shared_dir']
default['cluster']['shared_dir_head'] = node['cluster']['shared_dir']
default['cluster']['shared_dir_login'] = node['cluster']['shared_dir_login_nodes']
default['cluster']['shared_login_nodes_keys_sync_file'] = "#{node['cluster']['shared_dir_login_nodes']}/.login_nodes_keys_sync_file"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank yo for adding this attribute!

# Since this is a shared directory, it needs to be defined here first instead of in the dependent cookbook for slurm
default['cluster']['slurm']['install_dir'] = '/opt/slurm'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
script_dir = "#{keys_dir}/scripts"
script_path = "#{script_dir}/keys-manager.sh"

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

case node['cluster']['node_type']
when 'ComputeFleet'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@
end
cached(:node) { chef_run.node }

it "waits for cluster config version file" do
is_expected.to run_bash("Wait for synchronization file at #{SYNC_FILE} to be written for version #{CLUSTER_CONFIG_VERSION}").with(
code: "[[ \"$(cat #{SYNC_FILE})\" == \"#{CLUSTER_CONFIG_VERSION}\" ]] || exit 1",
it "Wait for sync file to exist" do
is_expected.to run_bash("Wait for synchronization file at #{SYNC_FILE} to exist").with(
code: "[[ -e #{SYNC_FILE} ]] || exit 1",
retries: 30,
retry_delay: 10,
timeout: 5
Expand Down
7 changes: 3 additions & 4 deletions cookbooks/aws-parallelcluster-shared/libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,12 @@ def write_sync_file(path)
end

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