Skip to content

Commit c6563e2

Browse files
author
Himani Anil Deshpande
committed
Remove usage of get_compute_user_data.py from fetch_config resource
1 parent c293213 commit c6563e2

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

cookbooks/aws-parallelcluster-platform/resources/fetch_config.rb

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,6 @@
99

1010
default_action :run
1111

12-
13-
action :share_dna_files do
14-
return if on_docker?
15-
16-
Chef::Log.info("Share extra.json with all nodes")
17-
::FileUtils.cp_r('/tmp/extra.json', "#{node['cluster']['shared_dir']}/dna/extra.json",remove_destination: true)
18-
::FileUtils.cp_r('/tmp/extra.json', "#{node['cluster']['shared_dir_login_nodes']}/dna/extra.json",remove_destination: true)
19-
20-
execute "Share DNA files" do
21-
command "#{cookbook_virtualenv_path}/bin/python #{node['cluster']['scripts_dir']}/get_compute_user_data.py" \
22-
" --region #{node['cluster']['region']}"
23-
timeout 30
24-
retries 10
25-
retry_delay 90
26-
end
27-
end
28-
2912
action :run do
3013
return if on_docker?
3114
Chef::Log.debug("Called fetch_config with update (#{new_resource.update})")
@@ -36,8 +19,6 @@
3619
case node['cluster']['node_type']
3720
when 'HeadNode'
3821
if new_resource.update
39-
action_share_dna_files
40-
4122
Chef::Log.info("Backing up old configuration from (#{node['cluster']['cluster_config_path']}) to (#{node['cluster']['previous_cluster_config_path']})")
4223
::FileUtils.cp_r(node['cluster']['cluster_config_path'], node['cluster']['previous_cluster_config_path'], remove_destination: true)
4324
fetch_cluster_config(node['cluster']['cluster_config_path'])

cookbooks/aws-parallelcluster-platform/resources/fetch_dna_files.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
provides :fetch_dna_files
55
unified_mode true
66

7+
property :extra_chef_attribute_location, String, default: '/tmp/extra.json'
8+
79
default_action :share
810

911
action :share do
1012
return if on_docker?
1113
return unless node['cluster']['node_type'] == 'HeadNode'
1214

1315
Chef::Log.info("Share extra.json with ComputeFleet")
14-
::FileUtils.cp_r('/tmp/extra.json', "#{node['cluster']['shared_dir']}/dna/extra.json",remove_destination: true)
16+
::FileUtils.cp_r(new_resource.extra_chef_attribute_location, "#{node['cluster']['shared_dir']}/dna/extra.json", remove_destination: true) if ::File.exist?(new_resource.extra_chef_attribute_location)
1517

1618
execute "Share dna.json with ComputeFleet" do
1719
command "#{cookbook_virtualenv_path}/bin/python #{node['cluster']['scripts_dir']}/get_compute_user_data.py" \
@@ -20,7 +22,6 @@
2022
retries 10
2123
retry_delay 90
2224
end
23-
2425
end
2526

2627
action :cleanup do

0 commit comments

Comments
 (0)