Skip to content

Commit 4479020

Browse files
authored
Merge branch 'develop' into develop
2 parents aa792be + 517e55d commit 4479020

File tree

19 files changed

+326
-11
lines changed

19 files changed

+326
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ This file is used to list changes made in each version of the AWS ParallelCluste
3939
- Upgrade CUDA Toolkit to version 12.2.2.
4040
- Use Open Source NVIDIA GPU drivers (OpenRM) as NVIDIA kernel module for Linux instead of NVIDIA closed source module.
4141
- Do not wait for static nodes in maintenance to signal CFN that the head node initialization is complete.
42-
- Upgrade EFA installer to `1.29.0`.
42+
- Upgrade EFA installer to `1.29.1`.
4343
- Efa-driver: `efa-2.6.0-1`
4444
- Efa-config: `efa-config-1.15-1`
4545
- Efa-profile: `efa-profile-1.5-1`

cookbooks/aws-parallelcluster-entrypoints/recipes/update.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,17 @@
1919
# generate the updated shared storages mapping file
2020
include_recipe 'aws-parallelcluster-environment::update_fs_mapping'
2121

22+
if node["cluster"]["node_type"] == "ComputeFleet"
23+
Chef::Log.info("Dummy log line to prove that update is triggered on compute node")
24+
return
25+
end
26+
2227
include_recipe 'aws-parallelcluster-environment::directory_service'
2328
include_recipe 'aws-parallelcluster-slurm::update' if node['cluster']['scheduler'] == 'slurm'
2429

2530
# Update node package - useful for development purposes only
2631
if is_custom_node?
2732
include_recipe 'aws-parallelcluster-computefleet::update_parallelcluster_node'
2833
end
34+
35+
sudo_access "Update Sudo Access" if node['cluster']['scheduler'] == 'slurm'

cookbooks/aws-parallelcluster-environment/resources/efa/partial/_common.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
# EFA setup: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa-start.html
1818
#
1919

20-
property :efa_version, String, default: '1.29.0'
21-
property :efa_checksum, String, default: '836655f87015547e733e7d9f7c760e4e24697f8bbc261bb5f3560abd4206bc36'
20+
property :efa_version, String, default: '1.29.1'
21+
property :efa_checksum, String, default: '178b263b8c25845b63dc93b25bcdff5870df5204ec509af26f43e8d283488744'
2222

2323
action :setup do
2424
if efa_installed? && !::File.exist?(efa_tarball)

cookbooks/aws-parallelcluster-environment/spec/unit/resources/efa_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# parallelcluster default source dir defined in attributes
44
source_dir = '/opt/parallelcluster/sources'
5-
efa_version = '1.29.0'
6-
efa_checksum = '836655f87015547e733e7d9f7c760e4e24697f8bbc261bb5f3560abd4206bc36'
5+
efa_version = '1.29.1'
6+
efa_checksum = '178b263b8c25845b63dc93b25bcdff5870df5204ec509af26f43e8d283488744'
77

88
class ConvergeEfa
99
def self.setup(chef_run)

cookbooks/aws-parallelcluster-platform/kitchen.platform-config.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,19 @@ suites:
199199
verifier:
200200
controls:
201201
- /tag:config_supervisord/
202+
- name: sudo_access
203+
run_list:
204+
- recipe[aws-parallelcluster-tests::setup]
205+
- recipe[aws-parallelcluster-tests::test_resource]
206+
verifier:
207+
controls:
208+
- /tag:config_sudo_access/
209+
attributes:
210+
resource: sudo_access:setup
211+
cluster:
212+
## Test to check if sudo access for default user is disabled (Disable Action)
213+
## The test runs with default user, it will fail to check the files content as it does not have sudo access anymore if we don't override with pcluster-admin
214+
cluster_user: 'pcluster-admin'
215+
disable_sudo_access_for_default_user: 'true'
216+
# Test to check if sudo access for default user is enabled (Enable Action)
217+
# disable_sudo_access_for_default_user: 'false'

cookbooks/aws-parallelcluster-platform/recipes/config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
include_recipe 'aws-parallelcluster-platform::openssh'
1515
include_recipe 'aws-parallelcluster-platform::sudo_config'
1616
include_recipe 'aws-parallelcluster-platform::cluster_user'
17+
sudo_access "Setup Sudo Access of Default User"
1718
include_recipe 'aws-parallelcluster-platform::networking'
1819
include_recipe 'aws-parallelcluster-platform::nvidia_config'
1920
sticky_bits 'setup sticky bits'
@@ -24,5 +25,4 @@
2425
# Supervisord configuration must be executed after DCV because dcv external authenticator is part of it
2526
include_recipe 'aws-parallelcluster-platform::supervisord_config'
2627
fetch_config 'Fetch and load cluster configs'
27-
2828
include_recipe 'aws-parallelcluster-platform::config_login' if node['cluster']['node_type'] == 'LoginNode'
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# frozen_string_literal: true
2+
#
3+
# Copyright:: 2013-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License").
6+
# You may not use this file except in compliance with the License.
7+
# A copy of the License is located at
8+
#
9+
# http://aws.amazon.com/apache2.0/
10+
#
11+
# or in the "LICENSE.txt" file accompanying this file.
12+
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied.
13+
# See the License for the specific language governing permissions and limitations under the License.
14+
15+
unified_mode true
16+
default_action :setup
17+
18+
property :user_name, String, default: node['cluster']['cluster_user']
19+
20+
action :setup do
21+
node['cluster']['disable_sudo_access_for_default_user'] == 'true' ? action_disable : action_enable
22+
end
23+
24+
action :enable do
25+
Chef::Log.info("Enabling Sudo Access for #{new_resource.user_name}")
26+
# Enable sudo access for default user
27+
template '/etc/sudoers.d/99-parallelcluster-revoke-sudo-access' do
28+
only_if { ::File.exist? "/etc/sudoers.d/99-parallelcluster-revoke-sudo-access" }
29+
source 'sudo_access/99-parallelcluster-revoke-sudo.erb'
30+
cookbook 'aws-parallelcluster-platform'
31+
action :delete
32+
end
33+
end
34+
35+
action :disable do
36+
Chef::Log.info("Disabling Sudo Access for #{new_resource.user_name}")
37+
replace_or_add "Disable Sudo Access for #{new_resource.user_name}" do
38+
path "/etc/sudoers"
39+
pattern "^#{new_resource.user_name}*"
40+
line ""
41+
remove_duplicates true
42+
replace_only true
43+
end
44+
45+
# Disable sudo access for default user
46+
template '/etc/sudoers.d/99-parallelcluster-revoke-sudo-access' do
47+
source 'sudo_access/99-parallelcluster-revoke-sudo.erb'
48+
cookbook 'aws-parallelcluster-platform'
49+
owner 'root'
50+
group 'root'
51+
mode '0600'
52+
variables(
53+
user_name: new_resource.user_name
54+
)
55+
action :create
56+
end
57+
end
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License").
6+
# You may not use this file except in compliance with the License.
7+
# A copy of the License is located at
8+
#
9+
# http://aws.amazon.com/apache2.0/
10+
#
11+
# or in the "LICENSE.txt" file accompanying this file.
12+
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied.
13+
# See the License for the specific language governing permissions and limitations under the License.
14+
15+
provides :sudo_access, platform: 'amazon', platform_version: '2'
16+
17+
use 'partial/_sudo_access_common.rb'
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# frozen_string_literal: true
2+
3+
# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License").
6+
# You may not use this file except in compliance with the License.
7+
# A copy of the License is located at
8+
#
9+
# http://aws.amazon.com/apache2.0/
10+
#
11+
# or in the "LICENSE.txt" file accompanying this file.
12+
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied.
13+
# See the License for the specific language governing permissions and limitations under the License.
14+
15+
provides :sudo_access, platform: 'centos' do |node|
16+
node['platform_version'].to_i == 7
17+
end
18+
19+
use 'partial/_sudo_access_common.rb'
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# frozen_string_literal: true
2+
3+
# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License").
6+
# You may not use this file except in compliance with the License.
7+
# A copy of the License is located at
8+
#
9+
# http://aws.amazon.com/apache2.0/
10+
#
11+
# or in the "LICENSE.txt" file accompanying this file.
12+
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied.
13+
# See the License for the specific language governing permissions and limitations under the License.
14+
15+
provides :sudo_access, platform: 'redhat' do |node|
16+
node['platform_version'].to_i == 8
17+
end
18+
19+
use 'partial/_sudo_access_common.rb'

0 commit comments

Comments
 (0)