1515# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and
1616# limitations under the License.
1717
18- execute 'stop clustermgtd' do
19- command "#{ cookbook_virtualenv_path } /bin/supervisorctl stop clustermgtd"
20- not_if { ::File . exist? ( node [ 'cluster' ] [ 'previous_cluster_config_path' ] ) && !are_queues_updated? && !are_bulk_custom_slurm_settings_updated? }
21- end
22-
2318# Write the new config version to shared storage to signal compute nodes to update
2419file node [ 'cluster' ] [ 'update' ] [ 'trigger_file' ] do
2520 content node [ 'cluster' ] [ 'cluster_config_version' ]
@@ -207,17 +202,6 @@ def update_nodes_in_queue(strategy, queues)
207202 replace_only true
208203end
209204
210- ruby_block "Update Slurm Accounting" do
211- block do
212- if node [ 'cluster' ] [ 'config' ] . dig ( :Scheduling , :SlurmSettings , :Database ) . nil?
213- run_context . include_recipe "aws-parallelcluster-slurm::clear_slurm_accounting"
214- else
215- run_context . include_recipe "aws-parallelcluster-slurm::config_slurm_accounting"
216- end
217- end
218- only_if { ::File . exist? ( node [ 'cluster' ] [ 'previous_cluster_config_path' ] ) && is_slurm_database_updated? }
219- end unless on_docker?
220-
221205# Cover the following two scenarios:
222206# - a cluster without login nodes is updated to have login nodes;
223207# - a cluster with login nodes is updated to use another pool name.
@@ -242,8 +226,6 @@ def update_nodes_in_queue(strategy, queues)
242226 only_if { ::File . exist? ( node [ 'cluster' ] [ 'previous_cluster_config_path' ] ) && is_custom_munge_key_updated? }
243227end
244228
245- update_munge_head_node
246-
247229# The previous execute "generate_pcluster_slurm_configs" block resource may have overridden the slurmdbd password in
248230# slurm_parallelcluster_slurmdbd.conf with a default value, so if it has run and Slurm accounting
249231# is enabled we must pull the database password from Secrets Manager once again.
@@ -255,6 +237,24 @@ def update_nodes_in_queue(strategy, queues)
255237 only_if { !( ::File . exist? ( node [ 'cluster' ] [ 'previous_cluster_config_path' ] ) && !are_queues_updated? ) && !node [ 'cluster' ] [ 'config' ] . dig ( :Scheduling , :SlurmSettings , :Database ) . nil? }
256238end
257239
240+ execute 'stop clustermgtd' do
241+ command "#{ cookbook_virtualenv_path } /bin/supervisorctl stop clustermgtd"
242+ not_if { ::File . exist? ( node [ 'cluster' ] [ 'previous_cluster_config_path' ] ) && !are_queues_updated? && !are_bulk_custom_slurm_settings_updated? }
243+ end
244+
245+ update_munge_head_node
246+
247+ ruby_block "Update Slurm Accounting" do
248+ block do
249+ if node [ 'cluster' ] [ 'config' ] . dig ( :Scheduling , :SlurmSettings , :Database ) . nil?
250+ run_context . include_recipe "aws-parallelcluster-slurm::clear_slurm_accounting"
251+ else
252+ run_context . include_recipe "aws-parallelcluster-slurm::config_slurm_accounting"
253+ end
254+ end
255+ only_if { ::File . exist? ( node [ 'cluster' ] [ 'previous_cluster_config_path' ] ) && is_slurm_database_updated? }
256+ end unless on_docker?
257+
258258service 'slurmctld' do
259259 action :restart
260260 not_if { ::File . exist? ( node [ 'cluster' ] [ 'previous_cluster_config_path' ] ) && !are_queues_updated? && !are_bulk_custom_slurm_settings_updated? }
@@ -280,12 +280,12 @@ def update_nodes_in_queue(strategy, queues)
280280
281281chef_sleep '15'
282282
283- wait_cluster_ready if cluster_readiness_check_on_update_enabled?
284-
285283execute 'start clustermgtd' do
286284 command "#{ cookbook_virtualenv_path } /bin/supervisorctl start clustermgtd"
287285end
288286
287+ wait_cluster_ready if cluster_readiness_check_on_update_enabled?
288+
289289# The updated cfnconfig will be used by post update custom scripts
290290template "#{ node [ 'cluster' ] [ 'etc_dir' ] } /cfnconfig" do
291291 source 'init/cfnconfig.erb'
0 commit comments