Skip to content

Commit

Permalink
[ADC Build Image] Disable epel repo for alinux2
Browse files Browse the repository at this point in the history
  • Loading branch information
hgreebe committed Jul 1, 2024
1 parent 46daffb commit 12e0a5d
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 2 additions & 13 deletions cookbooks/aws-parallelcluster-shared/resources/install_pyenv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 12e0a5d

Please sign in to comment.