Skip to content

Commit 27b1519

Browse files
committed
Fix unit tests
1 parent 0ad5a96 commit 27b1519

File tree

17 files changed

+2306
-506
lines changed

17 files changed

+2306
-506
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ aws-parallelcluster-cookbook CHANGELOG
22
======================================
33

44
This file is used to list changes made in each version of the AWS ParallelCluster cookbook.
5+
56
3.13.0
67
------
78

89
**CHANGES**
10+
- Upgrade Python to 3.12.8 (from 3.9.20).
911
- On Ubuntu 22.04, install the Nvidia driver with the same compiler version used to compile the kernel.
1012
- Upgrade `aws-cfn-bootstrap` to version 2.0-32.
1113
- Upgrade amazon-efs-utils to version 2.1.0.
@@ -16,6 +18,10 @@ This file is used to list changes made in each version of the AWS ParallelCluste
1618
- openssh-2.11.14 (from openssh-2.11.12)
1719
- yum-7.4.20 (from yum-7.4.13)
1820
- yum-epel-5.0.8 (from yum-epel-5.0.2)
21+
- Upgrade Pmix to 5.0.6 (from 5.0.3).
22+
- Upgrade ARM PL to version 24.10 (from 23.10).
23+
- Remove generation of DSA keys for login nodes as DSA, which became unsupported in OpenSSH 9.7+.
24+
- Set instance ID and instance type information in Slurm upon compute nodes launch.
1925

2026
3.12.0
2127
------

THIRD-PARTY-LICENSES.txt

Lines changed: 2237 additions & 440 deletions
Large diffs are not rendered by default.

cookbooks/aws-parallelcluster-environment/files/imds/imds-access.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,24 @@ function help() {
3232
--unset <user1,...,userN> Remove iptables rules related to IMDS for the given list of users
3333
--flush Restore default IMDS access
3434
--help Print this help message
35+
36+
Examples:
37+
38+
Allow access for USER1 and USER2, without changing other users
39+
${cmd} --allow USER1,USER2
40+
41+
Deny access for USER1 and USER2, without changing other users
42+
${cmd} --deny USER1,USER2
43+
44+
Allow access only for USER1 and USER2, removing every other user from the allowlist
45+
${cmd} --flush
46+
${cmd} --allow USER1,USER2
47+
48+
Remove rules for USER1 and USER2, without changing other users
49+
${cmd} --unset USER1,USER2
50+
51+
Remove IMDS lockdown, so that all users will be able to access IMDS
52+
${cmd} --flush
3553
EOF
3654
}
3755

cookbooks/aws-parallelcluster-environment/files/login_nodes/keys-manager.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ function create_keys() {
3838
ssh-keygen -t ecdsa -f "$FOLDER_PATH/ssh_host_ecdsa_key" -q -P ""
3939
ssh-keygen -t ed25519 -f "$FOLDER_PATH/ssh_host_ed25519_key" -q -P ""
4040
ssh-keygen -t rsa -f "$FOLDER_PATH/ssh_host_rsa_key" -q -P ""
41-
if is_ubuntu; then
42-
ssh-keygen -t dsa -f "$FOLDER_PATH/ssh_host_dsa_key" -q -P ""
43-
fi
4441
}
4542

4643
function import_keys() {
@@ -50,7 +47,6 @@ function import_keys() {
5047
cp "$FOLDER_PATH/ssh_host_ed25519"* /etc/ssh/
5148
cp "$FOLDER_PATH/ssh_host_rsa"* /etc/ssh/
5249
if is_ubuntu; then
53-
cp "$FOLDER_PATH/ssh_host_dsa"* /etc/ssh/
5450
chown root:root /etc/ssh/ssh_host_*
5551
chmod 600 /etc/ssh/ssh_host_*_key
5652
else

cookbooks/aws-parallelcluster-environment/spec/unit/recipes/cfn_bootstrap_spec.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
context "on #{platform}#{version}" do
66
cached(:cfnbootstrap_version) { '2.0-32' }
77
cached(:cfnbootstrap_package) { "aws-cfn-bootstrap-py3-#{cfnbootstrap_version}.tar.gz" }
8-
cached(:python_version) { '3.12.8' }
8+
cached(:python_version) { "#{node['cluster']['python-version']}" }
99
cached(:system_pyenv_root) { 'system_pyenv_root' }
1010
cached(:virtualenv_path) { "system_pyenv_root/versions/#{python_version}/envs/cfn_bootstrap_virtualenv" }
1111
cached(:timeout) { 1800 }
@@ -32,14 +32,6 @@
3232
)
3333
end
3434

35-
it 'installs python packages' do
36-
is_expected.to run_bash("pip install").with(
37-
user: 'root',
38-
group: 'root',
39-
cwd: "#{node['cluster']['base_dir']}"
40-
)
41-
end
42-
4335
it 'sets virtualenv path' do
4436
expect(node.default['cluster']['cfn_bootstrap_virtualenv_path']).to eq(virtualenv_path)
4537
is_expected.to write_node_attributes('dump node attributes')

cookbooks/aws-parallelcluster-environment/test/controls/login_nodes_keys_spec.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111

1212
key_types = %w(ecdsa ed25519 rsa)
1313
is_ubuntu = os_properties.ubuntu?
14-
if is_ubuntu
15-
key_types << 'dsa'
16-
end
1714

1815
control 'head_node_directory_initialized' do
1916
only_if { instance.head_node? && node['cluster']['scheduler'] != 'awsbatch' }

cookbooks/aws-parallelcluster-platform/recipes/install/cookbook_virtualenv.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
# limitations under the License.
1313

1414
virtualenv_path = cookbook_virtualenv_path
15+
pypi_s3_uri = "#{node['cluster']['artifacts_s3_url']}/dependencies/PyPi/pypi-dependencies-#{node['cluster']['python-major-minor-version']}-#{node['kernel']['machine']}.tgz"
16+
if platform?('amazon') && node['platform_version'] == "2"
17+
pypi_s3_uri = "#{node['cluster']['artifacts_s3_url']}/dependencies/PyPi/#{node['kernel']['machine']}/cookbook-dependencies.tgz"
18+
end
1519

1620
node.default['cluster']['cookbook_virtualenv_path'] = virtualenv_path
1721
node_attributes "dump node attributes"
@@ -28,7 +32,7 @@
2832
end
2933

3034
remote_file "#{node['cluster']['base_dir']}/cookbook-dependencies.tgz" do
31-
source "#{node['cluster']['artifacts_s3_url']}/dependencies/PyPi/#{node['kernel']['machine']}/cookbook-dependencies.tgz"
35+
source pypi_s3_uri
3236
mode '0644'
3337
retries 3
3438
retry_delay 5
@@ -43,8 +47,9 @@
4347
bash 'pip install' do
4448
user 'root'
4549
group 'root'
50+
cwd "#{node['cluster']['base_dir']}"
4651
code <<-REQ
47-
#{virtualenv_path}/bin/pip install -r #{cookbook_virtualenv_path}/requirements.txt
52+
#{virtualenv_path}/bin/pip install -r fail-pls
4853
if [ $? -ne 0 ]; then
4954
tar xzf cookbook-dependencies.tgz
5055
cd dependencies

cookbooks/aws-parallelcluster-platform/resources/arm_pl/partial/_arm_pl_common.rb

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@
2727
# We upload ArmPL to a ParallelCluster bucket (account for it in scope of the upgrade) and download it from there
2828
# to install ArmPL on the AMI.
2929
# We download gcc directly from gnu.org repository to install correct gcc version on the AMI.
30-
property :armpl_major_minor_version, String, default: '23.10'
30+
property :armpl_major_minor_version, String, default: '24.10'
3131
property :gcc_patch_version, String, default: '0'
3232

33-
action :arm_pl_prerequisite do
34-
# Do nothing
35-
end
36-
3733
action :setup do
3834
return unless node['conditions']['arm_pl_supported']
3935

@@ -49,10 +45,8 @@
4945
build_tools 'Prerequisite: build tools'
5046
package %w(wget bzip2)
5147

52-
action_arm_pl_prerequisite
53-
5448
armpl_version = "#{new_resource.armpl_major_minor_version}"
55-
armpl_tarball_name = "arm-performance-libraries_#{armpl_version}_#{armpl_platform}_gcc-#{gcc_major_minor_version}.tar"
49+
armpl_tarball_name = "arm-performance-libraries_#{armpl_version}_#{package_manager}_gcc.tar"
5650

5751
armpl_url = %W(
5852
#{node['cluster']['artifacts_s3_url']}
@@ -62,7 +56,7 @@
6256

6357
armpl_installer = "#{new_resource.sources_dir}/#{armpl_tarball_name}"
6458

65-
armpl_name = "arm-performance-libraries_#{armpl_version}_#{armpl_platform}"
59+
armpl_name = "arm-performance-libraries_#{armpl_version}_#{package_manager}"
6660

6761
# download ArmPL tarball
6862
remote_file armpl_installer do
@@ -89,11 +83,7 @@
8983
# create armpl module directory
9084
directory "#{modulefile_dir}/armpl"
9185

92-
armpl_license_dir = if new_resource.armpl_major_minor_version == "21.0"
93-
"/opt/arm/armpl/#{armpl_version}/arm-performance-libraries_#{new_resource.armpl_major_minor_version}_gcc-#{gcc_major_minor_version}/license_terms"
94-
else
95-
"/opt/arm/armpl/#{armpl_version}/arm-performance-libraries_#{armpl_version}_gcc-#{gcc_major_minor_version}/license_terms"
96-
end
86+
armpl_license_dir = "/opt/arm/armpl/#{armpl_version}/arm-performance-libraries_#{armpl_version}_gcc/license_terms"
9787

9888
# arm performance library modulefile configuration
9989
template "#{modulefile_dir}/armpl/#{armpl_version}" do
@@ -104,7 +94,6 @@
10494
mode '0755'
10595
variables(
10696
armpl_version: armpl_version,
107-
armpl_major_minor_version: new_resource.armpl_major_minor_version,
10897
armpl_license_dir: armpl_license_dir,
10998
gcc_major_minor_version: gcc_major_minor_version
11099
)
@@ -167,7 +156,6 @@
167156
# save ArmPL and gcc versions on the node environment so that they will be available
168157
# to dependencies (for instance, test code)
169158
# Complete versions are intentionally redundant.
170-
node.default['cluster']['armpl']['major_minor_version'] = new_resource.armpl_major_minor_version
171159
node.default['cluster']['armpl']['version'] = armpl_version
172160
node.default['cluster']['armpl']['gcc']['major_minor_version'] = gcc_major_minor_version
173161
node.default['cluster']['armpl']['gcc']['patch_version'] = new_resource.gcc_patch_version
@@ -180,4 +168,12 @@
180168
def modulefile_dir
181169
'/usr/share/Modules/modulefiles'
182170
end
171+
172+
def package_manager
173+
if platform_family?('debian')
174+
'deb'
175+
else
176+
'rpm'
177+
end
178+
end
183179
end

cookbooks/aws-parallelcluster-platform/spec/unit/recipes/awscli_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
it 'downloads awscli-bundle from s3' do
1616
is_expected.to create_remote_file('download awscli bundle from s3').with(
1717
path: "#{file_cache_path}/awscli-bundle.zip",
18-
source: 'https://s3.amazonaws.com/aws-cli/awscli-bundle.zip',
18+
source: "https://awscli.test_aws_domain/awscli-exe-linux-#{node['kernel']['machine']}.zip",
1919
retries: 5,
2020
retry_delay: 5
2121
)
@@ -31,7 +31,7 @@
3131

3232
it 'installs awscli into cookbook virtualev path' do
3333
is_expected.to run_bash('install awscli')
34-
.with_code "#{cookbook_virtualenv_path}/bin/python #{file_cache_path}/awscli/awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws"
34+
.with_code "#{file_cache_path}/awscli/aws/install -i /usr/local/aws -b /usr/local/bin"
3535
end
3636
end
3737

cookbooks/aws-parallelcluster-platform/spec/unit/resources/arm_pl_spec.rb

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def self.setup(chef_run)
1616
cached(:aws_region) { 'test_region' }
1717
cached(:aws_domain) { 'test_domain' }
1818
cached(:armpl_major_minor_version) do
19-
'23.10'
19+
'24.10'
2020
end
2121

2222
cached(:armpl_platform) do
@@ -43,11 +43,12 @@ def self.setup(chef_run)
4343
cached(:gcc_patch_version) { '0' }
4444
cached(:sources_dir) { 'sources_test_dir' }
4545
cached(:modulefile_dir) { platform == 'ubuntu' ? '/usr/share/modules/modulefiles' : '/usr/share/Modules/modulefiles' }
46+
cached(:package_manager) { platform == 'ubuntu' ? 'deb' : 'rpm' }
4647
cached(:armpl_version) { "#{armpl_major_minor_version}" }
47-
cached(:armpl_tarball_name) { "arm-performance-libraries_#{armpl_version}_#{armpl_platform}_gcc-#{gcc_major_minor_version}.tar" }
48+
cached(:armpl_tarball_name) { "arm-performance-libraries_#{armpl_version}_#{package_manager}_gcc.tar" }
4849
cached(:armpl_url) { "https://bucket.s3.amazonaws.com/archives/armpl/#{armpl_platform}/#{armpl_tarball_name}" }
4950
cached(:armpl_installer) { "#{sources_dir}/#{armpl_tarball_name}" }
50-
cached(:armpl_name) { "arm-performance-libraries_#{armpl_version}_#{armpl_platform}" }
51+
cached(:armpl_name) { "arm-performance-libraries_#{armpl_version}_#{package_manager}" }
5152
cached(:gcc_version) { "#{gcc_major_minor_version}.#{gcc_patch_version}" }
5253
cached(:gcc_url) { "https://bucket.s3.amazonaws.com/archives/dependencies/gcc/gcc-#{gcc_version}.tar.gz" }
5354
cached(:gcc_tarball) { "#{sources_dir}/gcc-#{gcc_version}.tar.gz" }
@@ -128,19 +129,14 @@ def self.setup(chef_run)
128129
end
129130

130131
it 'creates arm performance library modulefile configuration' do
131-
armpl_license_dir = if armpl_major_minor_version == "21.0"
132-
"/opt/arm/armpl/#{armpl_version}/arm-performance-libraries_#{armpl_major_minor_version}_gcc-#{gcc_major_minor_version}/license_terms"
133-
else
134-
"/opt/arm/armpl/#{armpl_version}/arm-performance-libraries_#{armpl_version}_gcc-#{gcc_major_minor_version}/license_terms"
135-
end
132+
armpl_license_dir = "/opt/arm/armpl/#{armpl_version}/arm-performance-libraries_#{armpl_version}_gcc/license_terms"
136133
is_expected.to create_template("#{modulefile_dir}/armpl/#{armpl_version}").with(
137134
source: 'arm_pl/armpl_modulefile.erb',
138135
user: 'root',
139136
group: 'root',
140137
mode: '0755',
141138
variables: {
142139
armpl_version: armpl_version,
143-
armpl_major_minor_version: armpl_major_minor_version,
144140
armpl_license_dir: armpl_license_dir,
145141
gcc_major_minor_version: gcc_major_minor_version,
146142
}
@@ -179,7 +175,6 @@ def self.setup(chef_run)
179175
end
180176

181177
it 'sets node attributes' do
182-
expect(node['cluster']['armpl']['major_minor_version']).to eq(armpl_major_minor_version)
183178
expect(node['cluster']['armpl']['version']).to eq(armpl_version)
184179
expect(node['cluster']['armpl']['gcc']['major_minor_version']).to eq(gcc_major_minor_version)
185180
expect(node['cluster']['armpl']['gcc']['patch_version']).to eq(gcc_patch_version)

0 commit comments

Comments
 (0)