Skip to content

Commit 45a38f2

Browse files
authored
[ADC] Configure certificates (#2815)
* Update yum deps for ADC * Fix cloudwatch key url domain for ADC * [ADC] Set default node package for build image command * [ADC] Configure certificates for compute fleet manager * [ADC Build Image] Source AWS_CA_BUNDLE during build * [ADC] Configure certificates for login nodes in ADC
1 parent a38b423 commit 45a38f2

File tree

10 files changed

+30
-11
lines changed

10 files changed

+30
-11
lines changed

cookbooks/aws-parallelcluster-awsbatch/recipes/install.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# limitations under the License.
1616

1717
return if platform?('redhat')
18+
return if aws_region.start_with?("us-iso")
1819

1920
include_recipe "::awsbatch_virtualenv"
2021

@@ -28,9 +29,6 @@
2829

2930
# Check whether install a custom aws-parallelcluster-awsbatch-cli package or the standard one
3031
# Install awsbatch cli into awsbatch virtual env
31-
if aws_region.start_with?("us-iso") && !node['cluster']['custom_awsbatchcli_package'].empty?
32-
node.default['cluster']['custom_awsbatchcli_package'] = "#{node['cluster']['artifacts_s3_url']}/dependencies/awsbatch/aws-parallelcluster.tgz"
33-
end
3432
if !node['cluster']['custom_awsbatchcli_package'].nil? && !node['cluster']['custom_awsbatchcli_package'].empty?
3533
# Install custom aws-parallelcluster package
3634
bash "install aws-parallelcluster-awsbatch-cli" do
@@ -45,7 +43,7 @@
4543
curl --retry 3 -L -o aws-parallelcluster.tgz ${custom_package_url}
4644
mkdir aws-parallelcluster-awsbatch-cli
4745
tar -xzf aws-parallelcluster.tgz --directory aws-parallelcluster-awsbatch-cli
48-
cd aws-parallelcluster-awsbatch-cli/*aws-parallelcluster-*
46+
cd aws-parallelcluster-awsbatch-cli/*aws-parallelcluster*
4947
5048
#{node['cluster']['awsbatch_virtualenv_path']}/bin/pip install awsbatch-cli/
5149
CLI

cookbooks/aws-parallelcluster-computefleet/recipes/install/custom_parallelcluster_node.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
rm -fr aws-parallelcluster-custom-node
5757
mkdir aws-parallelcluster-custom-node
5858
tar -xzf aws-parallelcluster-node.tgz --directory aws-parallelcluster-custom-node
59-
cd aws-parallelcluster-custom-node/*aws-parallelcluster-node-*
59+
cd aws-parallelcluster-custom-node/*aws-parallelcluster-node*
6060
pip install .
6161
deactivate
6262
NODE

cookbooks/aws-parallelcluster-computefleet/recipes/install/parallelcluster_node.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
end
3535

3636
if aws_region.start_with?("us-iso") && !is_custom_node?
37-
node.default['cluster']['custom_node_package'] = "#{node['cluster']['artifacts_s3_url']}/dependencies/node/aws-parallelcluster-node.tgz"
37+
node_package = "aws-parallelcluster-node-#{node['cluster']['parallelcluster-node-version']}.tgz"
38+
39+
node.default['cluster']['custom_node_package'] = "#{node['cluster']['s3_url']}/parallelcluster/#{node['cluster']['parallelcluster-node-version']}/node/#{node_package}"
3840
end
3941

4042
if is_custom_node?

cookbooks/aws-parallelcluster-environment/resources/cloudwatch/partial/_cloudwatch_common.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,16 @@
2727

2828
action_cloudwatch_prerequisite
2929

30+
region = node['cluster']['region']
31+
key_path = "amazoncloudwatch-agent/assets/amazon-cloudwatch-agent.gpg"
32+
cloudwatch_key_url = "https://s3.amazonaws.com/#{key_path}"
33+
if region.start_with?("us-iso")
34+
cloudwatch_key_url = "https://s3.#{aws_region}.#{aws_domain}/#{key_path}"
35+
end
36+
3037
public_key_local_path = "#{node['cluster']['sources_dir']}/amazon-cloudwatch-agent.gpg"
3138
remote_file public_key_local_path do
32-
source 'https://s3.amazonaws.com/amazoncloudwatch-agent/assets/amazon-cloudwatch-agent.gpg'
39+
source cloudwatch_key_url
3340
retries 3
3441
retry_delay 5
3542
action :create_if_missing

cookbooks/aws-parallelcluster-platform/files/isolated/iso-ca-bundle-config.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,12 @@ echo "export AWS_CA_BUNDLE=/etc/pki/${REGION}/certs/ca-bundle.pem" >> /etc/profi
1313

1414
echo "export AWS_DEFAULT_REGION=${REGION}" >> /etc/profile.d/aws-cli-default-config.sh
1515

16-
echo "Defaults env_keep += \"AWS_DEFAULT_REGION AWS_CA_BUNDLE\"" > /etc/sudoers.d/pcluster-aws-cli-envkeep
16+
echo "export REQUESTS_CA_BUNDLE=${AWS_CA_BUNDLE}" >> /etc/profile.d/aws-cli-default-config.sh
17+
18+
echo "export SSL_CERT_FILE=${AWS_CA_BUNDLE}" >> /etc/profile.d/aws-cli-default-config.sh
19+
20+
echo "Defaults env_keep += \"AWS_DEFAULT_REGION AWS_CA_BUNDLE REQUESTS_CA_BUNDLE SSL_CERT_FILE\"" > /etc/sudoers.d/pcluster-aws-cli-envkeep
21+
22+
source /etc/profile.d/aws-cli-default-config.sh
23+
24+
sudo aws configure set ca_bundle "$CA_BUNDLE"

cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_amazon2.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def default_packages
4949

5050
if aws_region.start_with?("us-iso")
5151
remote_file "epel_deps.tar.gz" do
52-
source "#{node['cluster']['artifacts_s3_url']}/dependencies/epel/rhel7/#{node['kernel']['machine']}/epel_deps.tar.gz"
52+
source "#{node['cluster']['artifacts_s3_url']}/dependencies/epel/rhel7/#{node['kernel']['machine']}/deps-v2.tar.gz"
5353
mode '0644'
5454
retries 3
5555
retry_delay 5

cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_redhat8.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def default_packages
4343
action :install_extras do
4444
if aws_region.start_with?("us-iso")
4545
remote_file "epel_deps.tar.gz" do
46-
source "#{node['cluster']['artifacts_s3_url']}/dependencies/epel/rhel8/x86_64/epel_deps.tar.gz"
46+
source "#{node['cluster']['artifacts_s3_url']}/dependencies/epel/rhel8/x86_64/deps-v2.tar.gz"
4747
mode '0644'
4848
retries 3
4949
retry_delay 5

cookbooks/aws-parallelcluster-shared/attributes/environment.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55

66
# URL for ParallelCluster Artifacts stored in public S3 buckets
77
# ['cluster']['region'] will need to be defined by image_dna.json during AMI build.
8-
default['cluster']['artifacts_s3_url'] = "https://#{node['cluster']['region']}-aws-parallelcluster.s3.#{node['cluster']['region']}.#{node['cluster']['aws_domain']}/archives"
8+
default['cluster']['s3_url'] = "https://#{node['cluster']['region']}-aws-parallelcluster.s3.#{node['cluster']['region']}.#{node['cluster']['aws_domain']}"
9+
default['cluster']['artifacts_s3_url'] = "#{node['cluster']['s3_url']}/archives"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
#!/bin/bash
2+
source /etc/profile.d/aws-cli-default-config.sh
23
sudo -u <%= node['cluster']['cluster_admin_user'] %> <%= node_virtualenv_path %>/bin/slurm_fleet_status_manager "$@"

cookbooks/aws-parallelcluster-slurm/templates/default/slurm/resume_program.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# ResumeProgram should read SLURM_RESUME_FILE within ten seconds of starting to guarantee that it still exists.
33
# ref https://slurm.schedmd.com/power_save.html#tolerance
44

5+
source /etc/profile.d/aws-cli-default-config.sh
6+
57
trap "rm -f ${SLURM_RESUME_FILE_TMP}" EXIT
68

79
SLURM_RESUME_FILE_TMP=$(mktemp)

0 commit comments

Comments
 (0)