File tree Expand file tree Collapse file tree 4 files changed +10
-4
lines changed
cookbooks/aws-parallelcluster-environment
resources/cloudwatch/partial Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ This file is used to list changes made in each version of the AWS ParallelCluste
15
15
- Upgrade DCV to version 2024.0-19030.
16
16
- Remove ` berkshelf ` . All cookbooks are local and do not need ` berkshelf ` dependency management.
17
17
18
+ ** BUG FIXES**
19
+ - Fix a race condition in CloudWatch Agent startup that could cause nodes bootstrap failures.
20
+
18
21
3.13.2
19
22
------
20
23
Original file line number Diff line number Diff line change 13
13
14
14
from cloudwatch_agent_common_utils import render_jinja_template
15
15
16
- AWS_CLOUDWATCH_CFG_PATH = "/opt/aws /amazon-cloudwatch-agent/etc /amazon-cloudwatch-agent.json"
16
+ AWS_CLOUDWATCH_CFG_PATH = "/etc/parallelcluster /amazon-cloudwatch-agent/amazon-cloudwatch-agent.json"
17
17
DEFAULT_METRICS_COLLECTION_INTERVAL = 60
18
18
19
19
@@ -45,6 +45,7 @@ def gethostname():
45
45
46
46
def write_config (config ):
47
47
"""Write config to AWS_CLOUDWATCH_CFG_PATH."""
48
+ os .makedirs (os .path .dirname (AWS_CLOUDWATCH_CFG_PATH ), exist_ok = True )
48
49
with open (AWS_CLOUDWATCH_CFG_PATH , "w+" , encoding = "utf-8" ) as output_config_file :
49
50
json .dump (config , output_config_file , indent = 4 )
50
51
Original file line number Diff line number Diff line change @@ -163,6 +163,8 @@ def package_path
163
163
command "#{ cookbook_virtualenv_path } /bin/python #{ validator_script_path } "
164
164
end unless redhat_on_docker?
165
165
166
+ CW_AGENT_CONFIG_JSON = '/etc/parallelcluster/amazon-cloudwatch-agent/amazon-cloudwatch-agent.json'
167
+
166
168
execute "cloudwatch-config-creation" do
167
169
user 'root'
168
170
timeout 300
@@ -182,6 +184,6 @@ def package_path
182
184
execute "cloudwatch-agent-start" do
183
185
user 'root'
184
186
timeout 300
185
- command "/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a append-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json -s || /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json -s"
187
+ command "/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a append-config -m ec2 -c file:#{ CW_AGENT_CONFIG_JSON } -s || /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:#{ CW_AGENT_CONFIG_JSON } -s"
186
188
end unless node [ 'cluster' ] [ 'cw_logging_enabled' ] != 'true' || on_docker?
187
189
end
Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ def self.configure(chef_run)
255
255
is_expected . to run_execute ( "cloudwatch-agent-start" ) . with (
256
256
user : 'root' ,
257
257
timeout : 300 ,
258
- command : "/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a append-config -m ec2 -c file:/opt/aws /amazon-cloudwatch-agent/etc/ amazon-cloudwatch-agent.json -s || /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws /amazon-cloudwatch-agent/etc /amazon-cloudwatch-agent.json -s"
258
+ command : "/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a append-config -m ec2 -c file:/etc/parallelcluster /amazon-cloudwatch-agent/amazon-cloudwatch-agent.json -s || /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/etc/parallelcluster /amazon-cloudwatch-agent/amazon-cloudwatch-agent.json -s"
259
259
)
260
260
end
261
261
end
@@ -313,7 +313,7 @@ def self.configure(chef_run)
313
313
is_expected . to run_execute ( "cloudwatch-agent-start" ) . with (
314
314
user : 'root' ,
315
315
timeout : 300 ,
316
- command : "/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a append-config -m ec2 -c file:/opt/aws /amazon-cloudwatch-agent/etc/ amazon-cloudwatch-agent.json -s || /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws /amazon-cloudwatch-agent/etc /amazon-cloudwatch-agent.json -s"
316
+ command : "/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a append-config -m ec2 -c file:/etc/parallelcluster /amazon-cloudwatch-agent/amazon-cloudwatch-agent.json -s || /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/etc/parallelcluster /amazon-cloudwatch-agent/amazon-cloudwatch-agent.json -s"
317
317
)
318
318
end
319
319
end
You can’t perform that action at this time.
0 commit comments