Skip to content

Commit 35171c1

Browse files
author
Himani Anil Deshpande
committed
Adding log for checking output
1 parent 77fdf75 commit 35171c1

File tree

1 file changed

+6
-3
lines changed
  • cookbooks/aws-parallelcluster-slurm/libraries

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ def get_static_node_count
185185
slurm_queues_section = cluster_config.dig("Scheduling", "SlurmQueues")
186186
if slurm_queues_section
187187
slurm_queues_section.each do |queue_config|
188-
queue_config.dig('ComputeResources').each do |compute_resource_config|
189-
total_min_count += compute_resource_config.dig('MinCount').to_i
188+
queue_config['ComputeResources'].each do |compute_resource_config|
189+
total_min_count += compute_resource_config['MinCount'].to_i
190190
end
191191
end
192192
end
@@ -219,11 +219,14 @@ def check_for_protected_mode(fleet_status_command) # rubocop:disable Lint/Nested
219219
"/usr/local/bin/get-compute-fleet-status.sh"
220220
)
221221

222+
total_static_node_count = get_static_node_count
223+
Chef::Log.info("Count of cluster static nodes is #{total_static_node_count}")
224+
222225
# Example output for sinfo
223226
# sinfo -h -o '%N %t'
224227
# queue-0-dy-compute-resource-g4dn-0-[1-10],queue-1-dy-compute-resource-g4dn-1-[1-10] idle~
225228
# queue-2-dy-compute-resource-g4dn-2-[1-10],queue-3-dy-compute-resource-g4dn-3-[1-10] idle
226-
until shell_out!("/bin/bash -c /usr/local/bin/is_fleet_ready.sh #{get_static_node_count}").stdout.strip.empty?
229+
until shell_out!("/bin/bash /usr/local/bin/is_fleet_ready.sh #{total_static_node_count}").stdout.strip.empty?
227230
check_for_protected_mode(fleet_status_command)
228231

229232
Chef::Log.info("Waiting for static fleet capacity provisioning")

0 commit comments

Comments
 (0)