From 12e0a5dd86eb8fb4f22a4134c4c912a729b7ec80 Mon Sep 17 00:00:00 2001 From: Helena Greebe Date: Mon, 1 Jul 2024 19:59:57 -0400 Subject: [PATCH] [ADC Build Image] Disable epel repo for alinux2 --- .../recipes/install/cfn_bootstrap.rb | 8 +++++++- .../cloudwatch/partial/_cloudwatch_common.rb | 9 ++++++++- .../resources/dcv/partial/_dcv_common.rb | 4 ++-- .../resources/install_pyenv.rb | 15 ++------------- .../package_repos/package_repos_alinux2.rb | 10 ++++++++++ 5 files changed, 29 insertions(+), 17 deletions(-) diff --git a/cookbooks/aws-parallelcluster-environment/recipes/install/cfn_bootstrap.rb b/cookbooks/aws-parallelcluster-environment/recipes/install/cfn_bootstrap.rb index 471354f0a..77d7bb05c 100644 --- a/cookbooks/aws-parallelcluster-environment/recipes/install/cfn_bootstrap.rb +++ b/cookbooks/aws-parallelcluster-environment/recipes/install/cfn_bootstrap.rb @@ -50,7 +50,13 @@ cfnbootstrap_package = "aws-cfn-bootstrap-py3-#{cfnbootstrap_version}.tar.gz" region = node['cluster']['region'] -bucket = region.start_with?('cn-') ? 's3.cn-north-1.amazonaws.com.cn/cn-north-1-aws-parallelcluster' : "s3.#{aws_region}.#{aws_domain}" +bucket = "s3.amazonaws.com" + +if region.start_with?('cn-') + bucket = 's3.cn-north-1.amazonaws.com.cn/cn-north-1-aws-parallelcluster' +elsif region.start_with?("us-iso") + bucket = "s3.#{aws_region}.#{aws_domain}" +end remote_file "/tmp/#{cfnbootstrap_package}" do source "https://#{bucket}/cloudformation-examples/#{cfnbootstrap_package}" diff --git a/cookbooks/aws-parallelcluster-environment/resources/cloudwatch/partial/_cloudwatch_common.rb b/cookbooks/aws-parallelcluster-environment/resources/cloudwatch/partial/_cloudwatch_common.rb index 09310fb70..8fc917d19 100644 --- a/cookbooks/aws-parallelcluster-environment/resources/cloudwatch/partial/_cloudwatch_common.rb +++ b/cookbooks/aws-parallelcluster-environment/resources/cloudwatch/partial/_cloudwatch_common.rb @@ -27,9 +27,16 @@ action_cloudwatch_prerequisite + region = node['cluster']['region'] + key_path = "/amazoncloudwatch-agent/assets/amazon-cloudwatch-agent.gpg" + cloudwatch_key_url = "https://s3.amazonaws.com/#{key_path}" + if region.start_with?("us-iso") + cloudwatch_key_url = "https://s3.#{aws_region}.#{aws_domain}/#{key_path}" + end + public_key_local_path = "#{node['cluster']['sources_dir']}/amazon-cloudwatch-agent.gpg" remote_file public_key_local_path do - source "https://s3.#{aws_region}.#{aws_domain}/amazoncloudwatch-agent/assets/amazon-cloudwatch-agent.gpg" + source cloudwatch_key_url retries 3 retry_delay 5 action :create_if_missing diff --git a/cookbooks/aws-parallelcluster-platform/resources/dcv/partial/_dcv_common.rb b/cookbooks/aws-parallelcluster-platform/resources/dcv/partial/_dcv_common.rb index c777305f3..388b400dd 100644 --- a/cookbooks/aws-parallelcluster-platform/resources/dcv/partial/_dcv_common.rb +++ b/cookbooks/aws-parallelcluster-platform/resources/dcv/partial/_dcv_common.rb @@ -277,11 +277,11 @@ def dcv_gpu_accel_supported? end def dcv_url - "#{node['cluster']['artifacts_s3_url']}/dependencies/dcv/#{dcv_package}.tgz" + "#{node['cluster']['artifacts_build_url']}/dcv/#{dcv_package}.tgz" end def dcv_tarball - "#{node['cluster']['artifacts_build_url']}/dcv/#{dcv_package}.tgz" + "#{node['cluster']['sources_dir']}/dcv-#{node['cluster']['dcv']['version']}.tgz" end def dcvauth_virtualenv diff --git a/cookbooks/aws-parallelcluster-shared/resources/install_pyenv.rb b/cookbooks/aws-parallelcluster-shared/resources/install_pyenv.rb index 9c09b509a..64a151b8c 100644 --- a/cookbooks/aws-parallelcluster-shared/resources/install_pyenv.rb +++ b/cookbooks/aws-parallelcluster-shared/resources/install_pyenv.rb @@ -12,11 +12,7 @@ action :run do python_version = new_resource.python_version || node['cluster']['python-version'] - python_url = "#{node['cluster']['artifacts_s3_url']}/dependencies/python/Python-#{python_version}.tgz" - - if new_resource.python_version - python_url = "https://www.python.org/ftp/python/#{python_version}/Python-#{python_version}.tgz" - end + python_url = "#{node['cluster']['artifacts_build_url']}/python/Python-#{python_version}.tgz" if new_resource.user_only raise "user property is required for resource install_pyenv when user_only is set to true" unless new_resource.user @@ -29,14 +25,6 @@ recursive true end - remote_file "#{prefix}/Python-#{python_version}.tgz" do - source python_url - mode '0644' - retries 3 - retry_delay 5 - action :create_if_missing - end - user = new_resource.user || 'root' bash "install python #{python_version}" do @@ -45,6 +33,7 @@ cwd "#{prefix}" code <<-VENV set -e + aws s3 cp #{python_url} Python-#{python_version}.tgz --region #{node['cluster']['region']} tar -xzf Python-#{python_version}.tgz cd Python-#{python_version} ./configure --prefix=#{prefix}/versions/#{python_version} diff --git a/cookbooks/aws-parallelcluster-shared/resources/package_repos/package_repos_alinux2.rb b/cookbooks/aws-parallelcluster-shared/resources/package_repos/package_repos_alinux2.rb index e6ad8b967..d8c10e3b1 100644 --- a/cookbooks/aws-parallelcluster-shared/resources/package_repos/package_repos_alinux2.rb +++ b/cookbooks/aws-parallelcluster-shared/resources/package_repos/package_repos_alinux2.rb @@ -22,6 +22,16 @@ action :setup do include_recipe 'yum' alinux_extras_topic 'epel' + if aws_region.start_with?("us-iso") + bash "Disable epel repo" do + user 'root' + group 'root' + code <<-EPEL + set -e + yum-config-manager --disable epel + EPEL + end + end end action :update do