Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hehe7318 committed Oct 9, 2023
1 parent d058718 commit d4a18d4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# frozen_string_literal: true

# Copyright:: 2013-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the
# License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and
# limitations under the License.
# rubocop:disable Style/SingleArgumentDig
template "#{node['cluster']['scripts_dir']}/slurm/check_login_nodes_stopped.sh" do
source 'slurm/head_node/check_login_nodes_stopped.sh.erb'
owner 'root'
group 'root'
mode '0700'
variables(
cluster_name: node['cluster']['cluster_name'] || node['cluster']['stack_name'],
login_nodes_pool_name: lazy { node['cluster']['config'].dig(:LoginNodes, :Pools, 0, :Name) },
region: node['cluster']['region']
)
only_if do
node['cluster']['config'].dig(:LoginNodes)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# or in the "LICENSE.txt" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and
# limitations under the License.
# rubocop:disable Style/SingleArgumentDig

include_recipe 'aws-parallelcluster-slurm::config_munge_key'

Expand Down Expand Up @@ -283,20 +282,7 @@
retry_delay 2
end unless redhat_on_docker?

template "#{node['cluster']['scripts_dir']}/slurm/check_login_nodes_stopped.sh" do
source 'slurm/head_node/check_login_nodes_stopped.sh.erb'
owner 'root'
group 'root'
mode '0700'
variables(
cluster_name: node['cluster']['cluster_name'] || node['cluster']['stack_name'],
login_nodes_pool_name: lazy { node['cluster']['config'].dig(:LoginNodes, :Pools, 0, :Name) },
region: node['cluster']['region']
)
only_if do
node['cluster']['config'].dig(:LoginNodes)
end
end
include_recipe 'aws-parallelcluster-slurm::config_check_login_stopped_script'

template "#{node['cluster']['scripts_dir']}/slurm/update_munge_key.sh" do
source 'slurm/head_node/update_munge_key.sh.erb'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# or in the "LICENSE.txt" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and
# limitations under the License.
# rubocop:disable Style/SingleArgumentDig

execute 'stop clustermgtd' do
command "#{cookbook_virtualenv_path}/bin/supervisorctl stop clustermgtd"
Expand Down Expand Up @@ -203,21 +202,8 @@ def update_nodes_in_queue(strategy, queues)
end unless on_docker?

# Update check login nodes status script to update pool name
template "#{node['cluster']['scripts_dir']}/slurm/check_login_nodes_stopped.sh" do
source 'slurm/head_node/check_login_nodes_stopped.sh.erb'
owner 'root'
group 'root'
mode '0700'
variables(
cluster_name: node['cluster']['cluster_name'] || node['cluster']['stack_name'],
login_nodes_pool_name: lazy { node['cluster']['config'].dig(:LoginNodes, :Pools, 0, :Name) },
region: node['cluster']['region']
)
only_if do
node['cluster']['config'].dig(:LoginNodes) &&
::File.exist?(node['cluster']['previous_cluster_config_path']) &&
is_login_nodes_pool_name_updated?
end
if ::File.exist?(node['cluster']['previous_cluster_config_path']) && is_login_nodes_pool_name_updated?
include_recipe 'aws-parallelcluster-slurm::config_check_login_stopped_script'
end

file "#{node['cluster']['scripts_dir']}/slurm/check_login_nodes_stopped.sh" do
Expand Down

0 comments on commit d4a18d4

Please sign in to comment.