From 35f20fd154cc90f6ce039aa958c9e5ad4598ef7b Mon Sep 17 00:00:00 2001 From: Enrico Usai Date: Wed, 21 Jun 2023 14:04:14 +0200 Subject: [PATCH 01/12] Add Chef resource files for Rocky Linux Used the new utility `os-resources.py` to create new resources for rocky linux, starting from redhat8 resources. Manually modified: * efa -> Replaced RHEL with Rocky Linux in log messages * lustre -> Replaced RHEL with Rocky Linux in log messages * users --> Replaced ec2-user with rocky * os_type --> Replaced rhel with rocky * install_packages --> Removed postgresql packages Removed redhat_on_docker condition from: * stunnel * system_authentication * efa Signed-off-by: Enrico Usai --- .../resources/cloudwatch/cloudwatch_rocky8.rb | 26 +++++++ .../ec2_udev_rules/ec2_udev_rules_rocky8.rb | 27 ++++++++ .../resources/efa/efa_rocky8.rb | 42 ++++++++++++ .../resources/efs/efs_rocky8.rb | 27 ++++++++ .../ephemeral_drives_rocky8.rb | 25 +++++++ .../resources/lustre/lustre_rocky8.rb | 68 +++++++++++++++++++ .../network_service/network_service_rocky8.rb | 24 +++++++ .../resources/nfs/nfs_rocky8.rb | 37 ++++++++++ .../resources/raid/raid_rocky8.rb | 11 +++ .../system_authentication_rocky8.rb | 40 +++++++++++ .../resources/arm_pl/arm_pl_rocky8.rb | 25 +++++++ .../build_tools/build_tools_rocky8.rb | 25 +++++++ .../resources/c_states/c_states_rocky8.rb | 20 ++++++ .../resources/chrony/chrony_rocky8.rb | 29 ++++++++ .../resources/dcv/dcv_rocky8.rb | 20 ++++++ .../fabric_manager/fabric_manager_rocky8.rb | 28 ++++++++ .../resources/gdrcopy/gdrcopy_rocky8.rb | 32 +++++++++ .../install_packages_rocky8.rb | 33 +++++++++ .../resources/modules/modules_rocky8.rb | 30 ++++++++ .../nvidia_dcgm/nvidia_dcgm_rocky8.rb | 23 +++++++ .../nvidia_driver/nvidia_driver_rocky8.rb | 19 ++++++ .../nvidia_repo/nvidia_repo_rocky8.rb | 27 ++++++++ .../resources/stunnel/stunnel_rocky8.rb | 28 ++++++++ .../attributes/users_rocky8.rb | 3 + .../resources/os_type/os_type_rocky8.rb | 23 +++++++ .../package_repos/package_repos_rocky8.rb | 45 ++++++++++++ .../resources/dns_domain/dns_domain_rocky8.rb | 38 +++++++++++ .../jwt_dependencies_rocky8.rb | 15 ++++ .../resources/munge/munge_rocky8.rb | 20 ++++++ .../mysql_client/mysql_client_rocky8.rb | 20 ++++++ .../slurm_dependencies_rocky8.rb | 19 ++++++ 31 files changed, 849 insertions(+) create mode 100644 cookbooks/aws-parallelcluster-environment/resources/cloudwatch/cloudwatch_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-environment/resources/ec2_udev_rules/ec2_udev_rules_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-environment/resources/efa/efa_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-environment/resources/efs/efs_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-environment/resources/ephemeral_drives/ephemeral_drives_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-environment/resources/lustre/lustre_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-environment/resources/network_service/network_service_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-environment/resources/nfs/nfs_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-environment/resources/raid/raid_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-environment/resources/system_authentication/system_authentication_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-platform/resources/arm_pl/arm_pl_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-platform/resources/build_tools/build_tools_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-platform/resources/c_states/c_states_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-platform/resources/chrony/chrony_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-platform/resources/dcv/dcv_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-platform/resources/fabric_manager/fabric_manager_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-platform/resources/gdrcopy/gdrcopy_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-platform/resources/modules/modules_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-platform/resources/nvidia_dcgm/nvidia_dcgm_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-platform/resources/nvidia_driver/nvidia_driver_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-platform/resources/nvidia_repo/nvidia_repo_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-platform/resources/stunnel/stunnel_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-shared/attributes/users_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-shared/resources/os_type/os_type_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-shared/resources/package_repos/package_repos_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-slurm/resources/dns_domain/dns_domain_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-slurm/resources/jwt_dependencies/jwt_dependencies_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-slurm/resources/munge/munge_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-slurm/resources/mysql_client/mysql_client_rocky8.rb create mode 100644 cookbooks/aws-parallelcluster-slurm/resources/slurm_dependencies/slurm_dependencies_rocky8.rb diff --git a/cookbooks/aws-parallelcluster-environment/resources/cloudwatch/cloudwatch_rocky8.rb b/cookbooks/aws-parallelcluster-environment/resources/cloudwatch/cloudwatch_rocky8.rb new file mode 100644 index 000000000..030f2b4ed --- /dev/null +++ b/cookbooks/aws-parallelcluster-environment/resources/cloudwatch/cloudwatch_rocky8.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :cloudwatch, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_cloudwatch_common' +use 'partial/_cloudwatch_install_package_rhel' + +action_class do + def platform_url_component + node['platform'] + end +end diff --git a/cookbooks/aws-parallelcluster-environment/resources/ec2_udev_rules/ec2_udev_rules_rocky8.rb b/cookbooks/aws-parallelcluster-environment/resources/ec2_udev_rules/ec2_udev_rules_rocky8.rb new file mode 100644 index 000000000..f3c538aa1 --- /dev/null +++ b/cookbooks/aws-parallelcluster-environment/resources/ec2_udev_rules/ec2_udev_rules_rocky8.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +# +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. +provides :ec2_udev_rules, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +unified_mode true +use 'partial/_common_udev_configuration' + +default_action :setup + +action :setup do + action_create_common_udev_files + action_start_ec2blk +end diff --git a/cookbooks/aws-parallelcluster-environment/resources/efa/efa_rocky8.rb b/cookbooks/aws-parallelcluster-environment/resources/efa/efa_rocky8.rb new file mode 100644 index 000000000..cd2687862 --- /dev/null +++ b/cookbooks/aws-parallelcluster-environment/resources/efa/efa_rocky8.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :efa, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end +unified_mode true +default_action :setup + +use 'partial/_common' + +action_class do + def efa_supported? + if node['platform_version'].to_f < 8.4 + log "EFA is not supported in this Rocky Linux version #{node['platform_version']}, supported versions are >= 8.4" do + level :warn + end + false + else + true + end + end + + def conflicting_packages + %w(openmpi-devel openmpi) + end + + def prerequisites + %w(environment-modules libibverbs-utils librdmacm-utils rdma-core-devel) + end +end diff --git a/cookbooks/aws-parallelcluster-environment/resources/efs/efs_rocky8.rb b/cookbooks/aws-parallelcluster-environment/resources/efs/efs_rocky8.rb new file mode 100644 index 000000000..4bb51a9d0 --- /dev/null +++ b/cookbooks/aws-parallelcluster-environment/resources/efs/efs_rocky8.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :efs, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_get_package_version_rpm' +use 'partial/_common' +use 'partial/_redhat_based' +use 'partial/_install_from_tar' +use 'partial/_mount_umount' + +def prerequisites + %w(rpm-build make) +end diff --git a/cookbooks/aws-parallelcluster-environment/resources/ephemeral_drives/ephemeral_drives_rocky8.rb b/cookbooks/aws-parallelcluster-environment/resources/ephemeral_drives/ephemeral_drives_rocky8.rb new file mode 100644 index 000000000..1f1108a78 --- /dev/null +++ b/cookbooks/aws-parallelcluster-environment/resources/ephemeral_drives/ephemeral_drives_rocky8.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :ephemeral_drives, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_ephemeral_drives_common.rb' + +action_class do + def network_target + 'network-online.target' + end +end diff --git a/cookbooks/aws-parallelcluster-environment/resources/lustre/lustre_rocky8.rb b/cookbooks/aws-parallelcluster-environment/resources/lustre/lustre_rocky8.rb new file mode 100644 index 000000000..a9bc8539b --- /dev/null +++ b/cookbooks/aws-parallelcluster-environment/resources/lustre/lustre_rocky8.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :lustre, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end +unified_mode true + +use 'partial/_install_lustre_centos_redhat' +use 'partial/_mount_unmount' + +default_action :setup + +action :setup do + version = node['platform_version'] + if version.to_f < 8.2 + log "FSx for Lustre is not supported in this Rocky Linux version #{version}, supported versions are >= 8.2" do + level :warn + end + # rhel8 kernel 4.18.0-425.3.1.el8 has broken kABI compat https://github.com/openzfs/zfs/issues/14724 + elsif node['cluster']['kernel_release'].include? "4.18.0-425.3.1.el8" + log "FSx for Lustre is not supported in kernel version 4.18.0-425.3.1.el8 of Rocky Linux, please update the kernel version" do + level :warn + end + else + action_install_lustre + end +end + +def find_os_minor_version + os_minor_version = '' + kernel_patch_version = find_kernel_patch_version + + # kernel patch versions under 193 are prior to RHEL 8.2 + # kernel patch version number can be retrieved from https://access.redhat.com/articles/3078#RHEL8 + os_minor_version = '2' if kernel_patch_version >= '193' + os_minor_version = '3' if kernel_patch_version >= '240' + os_minor_version = '4' if kernel_patch_version >= '305' + os_minor_version = '5' if kernel_patch_version >= '348' + os_minor_version = '6' if kernel_patch_version >= '372' + os_minor_version = '7' if kernel_patch_version >= '425' + os_minor_version = '8' if kernel_patch_version >= '477' + + os_minor_version +end + +action_class do + def base_url + # https://docs.aws.amazon.com/fsx/latest/LustreGuide/install-lustre-client.html#lustre-client-rhel + "https://fsx-lustre-client-repo.s3.amazonaws.com/el/8.#{find_os_minor_version}/$basearch" + end + + def public_key + "https://fsx-lustre-client-repo-public-keys.s3.amazonaws.com/fsx-rpm-public-key.asc" + end +end diff --git a/cookbooks/aws-parallelcluster-environment/resources/network_service/network_service_rocky8.rb b/cookbooks/aws-parallelcluster-environment/resources/network_service/network_service_rocky8.rb new file mode 100644 index 000000000..c9d5e08f2 --- /dev/null +++ b/cookbooks/aws-parallelcluster-environment/resources/network_service/network_service_rocky8.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :network_service, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_network_service' +use 'partial/_network_service_redhat_based' + +def network_service_name + 'NetworkManager' +end diff --git a/cookbooks/aws-parallelcluster-environment/resources/nfs/nfs_rocky8.rb b/cookbooks/aws-parallelcluster-environment/resources/nfs/nfs_rocky8.rb new file mode 100644 index 000000000..6879a1c77 --- /dev/null +++ b/cookbooks/aws-parallelcluster-environment/resources/nfs/nfs_rocky8.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :nfs, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end +unified_mode true + +use 'partial/_install_nfs4_and_disable' +use 'partial/_configure' + +default_action :setup + +action :setup do + action_install_nfs4 + action_disable_start_at_boot +end + +action_class do + def override_server_template + edit_resource(:template, node['nfs']['config']['server_template']) do + cookbook 'nfs' + end + end +end diff --git a/cookbooks/aws-parallelcluster-environment/resources/raid/raid_rocky8.rb b/cookbooks/aws-parallelcluster-environment/resources/raid/raid_rocky8.rb new file mode 100644 index 000000000..302160810 --- /dev/null +++ b/cookbooks/aws-parallelcluster-environment/resources/raid/raid_rocky8.rb @@ -0,0 +1,11 @@ +provides :raid, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_raid_common' + +action_class do + def raid_superblock_version + '1.2' + end +end diff --git a/cookbooks/aws-parallelcluster-environment/resources/system_authentication/system_authentication_rocky8.rb b/cookbooks/aws-parallelcluster-environment/resources/system_authentication/system_authentication_rocky8.rb new file mode 100644 index 000000000..1875ba967 --- /dev/null +++ b/cookbooks/aws-parallelcluster-environment/resources/system_authentication/system_authentication_rocky8.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :system_authentication, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_system_authentication_common' + +action :configure do + # oddjobd service is required for creating homedir + service "oddjobd" do + action %i(start enable) + end unless on_docker? + + execute 'Configure Directory Service' do + user 'root' + # Tell NSS, PAM to use SSSD for system authentication and identity information + # authconfig is a compatibility tool, replaced by authselect + command "authselect select sssd with-mkhomedir" + sensitive true + end +end + +action_class do + def required_packages + %w(sssd sssd-tools sssd-ldap authselect oddjob-mkhomedir) + end +end diff --git a/cookbooks/aws-parallelcluster-platform/resources/arm_pl/arm_pl_rocky8.rb b/cookbooks/aws-parallelcluster-platform/resources/arm_pl/arm_pl_rocky8.rb new file mode 100644 index 000000000..4f401b555 --- /dev/null +++ b/cookbooks/aws-parallelcluster-platform/resources/arm_pl/arm_pl_rocky8.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :arm_pl, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_arm_pl_common.rb' + +action_class do + def armpl_platform + 'RHEL-8' + end +end diff --git a/cookbooks/aws-parallelcluster-platform/resources/build_tools/build_tools_rocky8.rb b/cookbooks/aws-parallelcluster-platform/resources/build_tools/build_tools_rocky8.rb new file mode 100644 index 000000000..ba077e3b0 --- /dev/null +++ b/cookbooks/aws-parallelcluster-platform/resources/build_tools/build_tools_rocky8.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :build_tools, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_build_tools_yum.rb' + +action_class do + def packages + %w(gcc gcc-c++ make) + end +end diff --git a/cookbooks/aws-parallelcluster-platform/resources/c_states/c_states_rocky8.rb b/cookbooks/aws-parallelcluster-platform/resources/c_states/c_states_rocky8.rb new file mode 100644 index 000000000..e9cd39bf5 --- /dev/null +++ b/cookbooks/aws-parallelcluster-platform/resources/c_states/c_states_rocky8.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :c_states, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_c_states_common' +use 'partial/_c_states_redhat_based' diff --git a/cookbooks/aws-parallelcluster-platform/resources/chrony/chrony_rocky8.rb b/cookbooks/aws-parallelcluster-platform/resources/chrony/chrony_rocky8.rb new file mode 100644 index 000000000..ba8dce65d --- /dev/null +++ b/cookbooks/aws-parallelcluster-platform/resources/chrony/chrony_rocky8.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :chrony, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_chrony_common.rb' + +action_class do + def chrony_conf_path + '/etc/chrony.conf' + end + + def chrony_service + 'chronyd' + end +end diff --git a/cookbooks/aws-parallelcluster-platform/resources/dcv/dcv_rocky8.rb b/cookbooks/aws-parallelcluster-platform/resources/dcv/dcv_rocky8.rb new file mode 100644 index 000000000..794844604 --- /dev/null +++ b/cookbooks/aws-parallelcluster-platform/resources/dcv/dcv_rocky8.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :dcv, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_dcv_common' +use 'partial/_rhel_common' diff --git a/cookbooks/aws-parallelcluster-platform/resources/fabric_manager/fabric_manager_rocky8.rb b/cookbooks/aws-parallelcluster-platform/resources/fabric_manager/fabric_manager_rocky8.rb new file mode 100644 index 000000000..576c7b40c --- /dev/null +++ b/cookbooks/aws-parallelcluster-platform/resources/fabric_manager/fabric_manager_rocky8.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :fabric_manager, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_fabric_manager_common.rb' +use 'partial/_fabric_manager_install_rhel.rb' + +def fabric_manager_package + 'nvidia-fabric-manager' +end + +def fabric_manager_version + _nvidia_driver_version +end diff --git a/cookbooks/aws-parallelcluster-platform/resources/gdrcopy/gdrcopy_rocky8.rb b/cookbooks/aws-parallelcluster-platform/resources/gdrcopy/gdrcopy_rocky8.rb new file mode 100644 index 000000000..3ac8de011 --- /dev/null +++ b/cookbooks/aws-parallelcluster-platform/resources/gdrcopy/gdrcopy_rocky8.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :gdrcopy, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_gdrcopy_common.rb' +use 'partial/_gdrcopy_common_rhel.rb' + +def gdrcopy_enabled? + nvidia_enabled? +end + +def gdrcopy_platform + '.el8' +end + +def gdrcopy_arch + arm_instance? ? 'aarch64' : 'x86_64' +end diff --git a/cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb b/cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb new file mode 100644 index 000000000..e430ee0cb --- /dev/null +++ b/cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :install_packages, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_install_packages_common.rb' +use 'partial/_install_packages_rhel_amazon.rb' + +def default_packages + # environment-modules required by EFA, Intel MPI and ARM PL + # iptables needed for IMDS setup + %w(vim ksh tcsh zsh openssl-devel ncurses-devel pam-devel net-tools openmotif-devel + libXmu-devel hwloc-devel libdb-devel tcl-devel automake autoconf pyparted libtool + httpd boost-devel redhat-lsb mlocate R atlas-devel + blas-devel libffi-devel dkms libedit-devel jq + libical-devel sendmail libxml2-devel libglvnd-devel + python2 python2-pip libgcrypt-devel libevent-devel glibc-static bind-utils + iproute NetworkManager-config-routing-rules python3 python3-pip iptables libcurl-devel yum-plugin-versionlock + coreutils moreutils curl environment-modules gcc gcc-c++ bzip2) +end diff --git a/cookbooks/aws-parallelcluster-platform/resources/modules/modules_rocky8.rb b/cookbooks/aws-parallelcluster-platform/resources/modules/modules_rocky8.rb new file mode 100644 index 000000000..26e6232df --- /dev/null +++ b/cookbooks/aws-parallelcluster-platform/resources/modules/modules_rocky8.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :modules, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_modules_common.rb' +use 'partial/_modules_yum.rb' + +action_class do + def packages + %w(environment-modules) + end + + def modulepath_config_file + '/etc/environment-modules/modulespath' + end +end diff --git a/cookbooks/aws-parallelcluster-platform/resources/nvidia_dcgm/nvidia_dcgm_rocky8.rb b/cookbooks/aws-parallelcluster-platform/resources/nvidia_dcgm/nvidia_dcgm_rocky8.rb new file mode 100644 index 000000000..3f6afed07 --- /dev/null +++ b/cookbooks/aws-parallelcluster-platform/resources/nvidia_dcgm/nvidia_dcgm_rocky8.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :nvidia_dcgm, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_nvidia_dcgm_common.rb' + +def _nvidia_dcgm_enabled + _nvidia_enabled +end diff --git a/cookbooks/aws-parallelcluster-platform/resources/nvidia_driver/nvidia_driver_rocky8.rb b/cookbooks/aws-parallelcluster-platform/resources/nvidia_driver/nvidia_driver_rocky8.rb new file mode 100644 index 000000000..85ca4be91 --- /dev/null +++ b/cookbooks/aws-parallelcluster-platform/resources/nvidia_driver/nvidia_driver_rocky8.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :nvidia_driver, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_nvidia_driver_common.rb' diff --git a/cookbooks/aws-parallelcluster-platform/resources/nvidia_repo/nvidia_repo_rocky8.rb b/cookbooks/aws-parallelcluster-platform/resources/nvidia_repo/nvidia_repo_rocky8.rb new file mode 100644 index 000000000..335c43e50 --- /dev/null +++ b/cookbooks/aws-parallelcluster-platform/resources/nvidia_repo/nvidia_repo_rocky8.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :nvidia_repo, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_nvidia_repo_common.rb' + +def platform + 'rhel8' +end + +def repository_key + 'D42D0685.pub' +end diff --git a/cookbooks/aws-parallelcluster-platform/resources/stunnel/stunnel_rocky8.rb b/cookbooks/aws-parallelcluster-platform/resources/stunnel/stunnel_rocky8.rb new file mode 100644 index 000000000..ac2ba5767 --- /dev/null +++ b/cookbooks/aws-parallelcluster-platform/resources/stunnel/stunnel_rocky8.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true +# +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :stunnel, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_common' +use 'partial/_setup' + +action_class do + def dependencies + # tcp_wrappers-devel has been deprecated in RHEL7 and deleted in RHEL8, however it is + # an optional requirement not strictly necessary for either stunnel or efs-utils + %w(openssl-devel) + end +end diff --git a/cookbooks/aws-parallelcluster-shared/attributes/users_rocky8.rb b/cookbooks/aws-parallelcluster-shared/attributes/users_rocky8.rb new file mode 100644 index 000000000..7d5dbbb58 --- /dev/null +++ b/cookbooks/aws-parallelcluster-shared/attributes/users_rocky8.rb @@ -0,0 +1,3 @@ +return unless platform?('rocky') && node['platform_version'].to_i == 8 + +default['cluster']['cluster_user'] = 'rocky' diff --git a/cookbooks/aws-parallelcluster-shared/resources/os_type/os_type_rocky8.rb b/cookbooks/aws-parallelcluster-shared/resources/os_type/os_type_rocky8.rb new file mode 100644 index 000000000..9a915707c --- /dev/null +++ b/cookbooks/aws-parallelcluster-shared/resources/os_type/os_type_rocky8.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :os_type, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_os_type_common.rb' + +def current_os + "rocky#{node['platform_version'].to_i}" +end diff --git a/cookbooks/aws-parallelcluster-shared/resources/package_repos/package_repos_rocky8.rb b/cookbooks/aws-parallelcluster-shared/resources/package_repos/package_repos_rocky8.rb new file mode 100644 index 000000000..990158e05 --- /dev/null +++ b/cookbooks/aws-parallelcluster-shared/resources/package_repos/package_repos_rocky8.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :package_repos, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end +unified_mode true + +use 'partial/_package_repos_rpm.rb' + +default_action :setup + +action :setup do + include_recipe 'yum' + include_recipe "yum-epel" + + package 'yum-utils' do + retries 3 + retry_delay 5 + end + + execute 'yum-config-manager-rhel' do + # Needed by hwloc-devel blas-devel libedit-devel and glibc-static packages + command "yum-config-manager --enable codeready-builder-for-rhel-8-rhui-rpms" + end unless on_docker? + + execute 'yum-config-manager_skip_if_unavail' do + command "yum-config-manager --setopt=\*.skip_if_unavailable=1 --save" + end +end + +action :update do + # Do nothing +end diff --git a/cookbooks/aws-parallelcluster-slurm/resources/dns_domain/dns_domain_rocky8.rb b/cookbooks/aws-parallelcluster-slurm/resources/dns_domain/dns_domain_rocky8.rb new file mode 100644 index 000000000..98c1109ef --- /dev/null +++ b/cookbooks/aws-parallelcluster-slurm/resources/dns_domain/dns_domain_rocky8.rb @@ -0,0 +1,38 @@ +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :dns_domain, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_dns_domain_common' +use 'partial/_dns_domain_redhat' + +# Configure custom dns domain (only if defined) by appending the Route53 domain created within the cluster +# ($CLUSTER_NAME.pcluster) and be listed as a "search" domain in the resolv.conf file. +action :configure do + return if on_docker? + + # On RHEL8 dhclient is not enabled by default + # Put pcluster version of NetworkManager.conf in place + # dhcp = dhclient needs to be added under [main] section to enable dhclient + # https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/considerations_in_adopting_rhel_8/networking_considerations-in-adopting-rhel-8#dhcp_plugin_networking + cookbook_file 'NetworkManager.conf' do + path '/etc/NetworkManager/NetworkManager.conf' + source 'dns_domain/NetworkManager.conf' + cookbook 'aws-parallelcluster-slurm' + user 'root' + group 'root' + mode '0644' + end + + action_update_search_domain + network_service 'Restart network service' +end diff --git a/cookbooks/aws-parallelcluster-slurm/resources/jwt_dependencies/jwt_dependencies_rocky8.rb b/cookbooks/aws-parallelcluster-slurm/resources/jwt_dependencies/jwt_dependencies_rocky8.rb new file mode 100644 index 000000000..959e4736d --- /dev/null +++ b/cookbooks/aws-parallelcluster-slurm/resources/jwt_dependencies/jwt_dependencies_rocky8.rb @@ -0,0 +1,15 @@ +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :jwt_dependencies, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_jwt_dependencies_common' diff --git a/cookbooks/aws-parallelcluster-slurm/resources/munge/munge_rocky8.rb b/cookbooks/aws-parallelcluster-slurm/resources/munge/munge_rocky8.rb new file mode 100644 index 000000000..6d8e10b91 --- /dev/null +++ b/cookbooks/aws-parallelcluster-slurm/resources/munge/munge_rocky8.rb @@ -0,0 +1,20 @@ +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :munge, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_munge_actions' +use 'partial/_munge_rhel' + +def munge_libdir + '/usr/lib64' +end diff --git a/cookbooks/aws-parallelcluster-slurm/resources/mysql_client/mysql_client_rocky8.rb b/cookbooks/aws-parallelcluster-slurm/resources/mysql_client/mysql_client_rocky8.rb new file mode 100644 index 000000000..da09f09e1 --- /dev/null +++ b/cookbooks/aws-parallelcluster-slurm/resources/mysql_client/mysql_client_rocky8.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :mysql_client, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_common' +use 'partial/_setup_rhel_based' diff --git a/cookbooks/aws-parallelcluster-slurm/resources/slurm_dependencies/slurm_dependencies_rocky8.rb b/cookbooks/aws-parallelcluster-slurm/resources/slurm_dependencies/slurm_dependencies_rocky8.rb new file mode 100644 index 000000000..a4f91a6b0 --- /dev/null +++ b/cookbooks/aws-parallelcluster-slurm/resources/slurm_dependencies/slurm_dependencies_rocky8.rb @@ -0,0 +1,19 @@ +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :slurm_dependencies, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_slurm_dependencies_common' + +def dependencies + %w(json-c-devel http-parser-devel perl-Switch lua-devel) +end From d809a9fb04434221d270293629382f73a9ab5dd7 Mon Sep 17 00:00:00 2001 From: Enrico Usai Date: Thu, 22 Jun 2023 17:57:23 +0200 Subject: [PATCH 02/12] Fix CloudWatch agent setup for Rocky Linux * platform_url_component should point to the same of rhel Signed-off-by: Enrico Usai --- .../cloudwatch/cloudwatch_agent_config.json | 33 ++++++++++++++++++- .../cloudwatch_agent_config_schema.json | 2 +- .../cloudwatch/write_cloudwatch_agent_json.py | 7 ++-- .../resources/cloudwatch/cloudwatch_rocky8.rb | 2 +- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/cookbooks/aws-parallelcluster-environment/files/cloudwatch/cloudwatch_agent_config.json b/cookbooks/aws-parallelcluster-environment/files/cloudwatch/cloudwatch_agent_config.json index 6f55abdee..e8e8c9811 100644 --- a/cookbooks/aws-parallelcluster-environment/files/cloudwatch/cloudwatch_agent_config.json +++ b/cookbooks/aws-parallelcluster-environment/files/cloudwatch/cloudwatch_agent_config.json @@ -18,7 +18,8 @@ "platforms": [ "amazon", "centos", - "redhat" + "redhat", + "rocky" ], "node_roles": [ "ComputeFleet", @@ -55,6 +56,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -74,6 +76,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -92,6 +95,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -111,6 +115,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -131,6 +136,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -151,6 +157,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -171,6 +178,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -189,6 +197,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -207,6 +216,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -225,6 +235,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -243,6 +254,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -261,6 +273,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -279,6 +292,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -297,6 +311,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -315,6 +330,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -333,6 +349,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -351,6 +368,7 @@ "amazon", "centos", "redhat", + "rocky", "ubuntu" ], "node_roles": [ @@ -369,6 +387,7 @@ "platforms": [ "centos", "redhat", + "rocky", "ubuntu", "amazon" ], @@ -392,6 +411,7 @@ "platforms": [ "centos", "redhat", + "rocky", "ubuntu", "amazon" ], @@ -418,6 +438,7 @@ "platforms": [ "centos", "redhat", + "rocky", "ubuntu", "amazon" ], @@ -444,6 +465,7 @@ "platforms": [ "centos", "redhat", + "rocky", "ubuntu", "amazon" ], @@ -472,6 +494,7 @@ "platforms": [ "centos", "redhat", + "rocky", "ubuntu", "amazon" ], @@ -496,6 +519,7 @@ "platforms": [ "centos", "redhat", + "rocky", "ubuntu", "amazon" ], @@ -520,6 +544,7 @@ "platforms": [ "centos", "redhat", + "rocky", "ubuntu", "amazon" ], @@ -544,6 +569,7 @@ "platforms": [ "centos", "redhat", + "rocky", "ubuntu", "amazon" ], @@ -568,6 +594,7 @@ "platforms": [ "centos", "redhat", + "rocky", "ubuntu", "amazon" ], @@ -592,6 +619,7 @@ "platforms": [ "centos", "redhat", + "rocky", "ubuntu", "amazon" ], @@ -615,6 +643,7 @@ "platforms": [ "centos", "redhat", + "rocky", "ubuntu", "amazon" ], @@ -633,6 +662,7 @@ "platforms": [ "centos", "redhat", + "rocky", "ubuntu", "amazon" ], @@ -651,6 +681,7 @@ "platforms": [ "centos", "redhat", + "rocky", "ubuntu", "amazon" ], diff --git a/cookbooks/aws-parallelcluster-environment/files/cloudwatch/cloudwatch_agent_config_schema.json b/cookbooks/aws-parallelcluster-environment/files/cloudwatch/cloudwatch_agent_config_schema.json index e9c073f89..2aa8a0c00 100644 --- a/cookbooks/aws-parallelcluster-environment/files/cloudwatch/cloudwatch_agent_config_schema.json +++ b/cookbooks/aws-parallelcluster-environment/files/cloudwatch/cloudwatch_agent_config_schema.json @@ -16,7 +16,7 @@ }, "platforms": { "type": "array", - "items": {"type": "string", "enum": ["amazon", "centos", "ubuntu", "redhat"]} + "items": {"type": "string", "enum": ["amazon", "centos", "ubuntu", "redhat", "rocky"]} }, "node_roles": { "type": "array", diff --git a/cookbooks/aws-parallelcluster-environment/files/cloudwatch/write_cloudwatch_agent_json.py b/cookbooks/aws-parallelcluster-environment/files/cloudwatch/write_cloudwatch_agent_json.py index affd83a89..a1c9cc586 100644 --- a/cookbooks/aws-parallelcluster-environment/files/cloudwatch/write_cloudwatch_agent_json.py +++ b/cookbooks/aws-parallelcluster-environment/files/cloudwatch/write_cloudwatch_agent_json.py @@ -20,14 +20,17 @@ def parse_args(): parser = argparse.ArgumentParser(description="Create the cloudwatch agent config file") parser.add_argument("--config", help="Path to JSON file describing logs that should be monitored", required=True) parser.add_argument( - "--platform", help="OS family of this instance", choices=["amazon", "centos", "ubuntu", "redhat"], required=True + "--platform", + help="OS family of this instance", + choices=["amazon", "centos", "ubuntu", "redhat", "rocky"], + required=True, ) parser.add_argument("--log-group", help="Name of the log group", required=True) parser.add_argument( "--node-role", required=True, choices=["HeadNode", "ComputeFleet", "LoginNode"], - help="Role this node plays in the cluster " "(i.e., is it a compute node or the head node?)", + help="Role this node plays in the cluster (i.e., is it a compute node or the head node?)", ) parser.add_argument("--scheduler", required=True, choices=["slurm", "awsbatch"], help="Scheduler") return parser.parse_args() diff --git a/cookbooks/aws-parallelcluster-environment/resources/cloudwatch/cloudwatch_rocky8.rb b/cookbooks/aws-parallelcluster-environment/resources/cloudwatch/cloudwatch_rocky8.rb index 030f2b4ed..90a89ac0f 100644 --- a/cookbooks/aws-parallelcluster-environment/resources/cloudwatch/cloudwatch_rocky8.rb +++ b/cookbooks/aws-parallelcluster-environment/resources/cloudwatch/cloudwatch_rocky8.rb @@ -21,6 +21,6 @@ action_class do def platform_url_component - node['platform'] + "redhat" end end From fa315ca43fe043c42255677b53c03588a01dc9c5 Mon Sep 17 00:00:00 2001 From: Enrico Usai Date: Fri, 23 Jun 2023 11:13:16 +0200 Subject: [PATCH 03/12] Add missing template files for Rocky Linux Copied from RedHat files Signed-off-by: Enrico Usai --- .../configure_nw_interface.sh | 53 +++++++++++++++++++ .../rocky/dns_domain/NetworkManager.conf | 52 ++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 cookbooks/aws-parallelcluster-environment/files/rocky/network_interfaces/configure_nw_interface.sh create mode 100644 cookbooks/aws-parallelcluster-slurm/files/rocky/dns_domain/NetworkManager.conf diff --git a/cookbooks/aws-parallelcluster-environment/files/rocky/network_interfaces/configure_nw_interface.sh b/cookbooks/aws-parallelcluster-environment/files/rocky/network_interfaces/configure_nw_interface.sh new file mode 100644 index 000000000..d142d8c8e --- /dev/null +++ b/cookbooks/aws-parallelcluster-environment/files/rocky/network_interfaces/configure_nw_interface.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# Configure a specific Network Interface according to the OS +# The configuration involves 3 aspects: +# - Main configuration (IP address, protocol and gateway) +# - A specific routing table, so that all traffic coming to a network interface leaves the instance using the same +# interface +# - A routing rule to make the OS use the specific routing table for this network interface + +# RedHat 8 official documentation: +# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/configuring-policy-based-routing-to-define-alternative-routes_configuring-and-managing-networking + +set -e + +if + [ -z "${DEVICE_NAME}" ] || # name of the device + [ -z "${DEVICE_NUMBER}" ] || # number of the device + [ -z "${GW_IP_ADDRESS}" ] || # gateway ip address + [ -z "${DEVICE_IP_ADDRESS}" ] || # ip address to assign to the interface + [ -z "${CIDR_PREFIX_LENGTH}" ] # the prefix length of the device IP cidr block +then + echo 'One or more environment variables missing' + exit 1 +fi + +con_name="System ${DEVICE_NAME}" +route_table="100${DEVICE_NUMBER}" +priority="100${DEVICE_NUMBER}" +metric="100${DEVICE_NUMBER}" + +# Rename connection +original_con_name=`nmcli -t -f GENERAL.CONNECTION device show ${DEVICE_NAME} | cut -f2 -d':'` +sudo nmcli connection modify "${original_con_name}" con-name "${con_name}" ifname ${DEVICE_NAME} + +configured_ip=`nmcli -t -f IP4.ADDRESS device show ${DEVICE_NAME} | cut -f2 -d':'` +if [ -z "${configured_ip}" ]; then + # Setup connection method to "manual", configure ip address and gateway, only if not already configured. + sudo nmcli connection modify "${con_name}" ipv4.method manual ipv4.addresses ${DEVICE_IP_ADDRESS}/${CIDR_PREFIX_LENGTH} ipv4.gateway ${GW_IP_ADDRESS} +fi + +# Setup routes +# This command uses the ipv4.routes parameter to add a static route to the routing table with ID ${route_table}. +# This static route for 0.0.0.0/0 uses the IP of the gateway as next hop. +sudo nmcli connection modify "${con_name}" ipv4.routes "0.0.0.0/0 ${GW_IP_ADDRESS} ${metric} table=${route_table}" + +# Setup routing rules +# The command uses the ipv4.routing-rules parameter to add a routing rule with priority ${priority} that routes +# traffic from ${DEVICE_IP_ADDRESS} to table ${route_table}. Low values have a high priority. +# The syntax in the ipv4.routing-rules parameter is the same as in an "ip rule add" command, +# except that ipv4.routing-rules always requires specifying a priority. +sudo nmcli connection modify "${con_name}" ipv4.routing-rules "priority ${priority} from ${DEVICE_IP_ADDRESS} table ${route_table}" + +# Reapply previous connection modification. +sudo nmcli device reapply ${DEVICE_NAME} diff --git a/cookbooks/aws-parallelcluster-slurm/files/rocky/dns_domain/NetworkManager.conf b/cookbooks/aws-parallelcluster-slurm/files/rocky/dns_domain/NetworkManager.conf new file mode 100644 index 000000000..64540b3c4 --- /dev/null +++ b/cookbooks/aws-parallelcluster-slurm/files/rocky/dns_domain/NetworkManager.conf @@ -0,0 +1,52 @@ +# Configuration file for NetworkManager. +# +# See "man 5 NetworkManager.conf" for details. +# +# The directories /usr/lib/NetworkManager/conf.d/ and /run/NetworkManager/conf.d/ +# can contain additional .conf snippets installed by packages. These files are +# read before NetworkManager.conf and have thus lowest priority. +# The directory /etc/NetworkManager/conf.d/ can contain additional .conf +# snippets. Those snippets are merged last and overwrite the settings from this main +# file. +# +# The files within one conf.d/ directory are read in asciibetical order. +# +# You can prevent loading a file /usr/lib/NetworkManager/conf.d/NAME.conf +# by having a file NAME.conf in either /run/NetworkManager/conf.d/ or /etc/NetworkManager/conf.d/. +# Likewise, snippets from /run can be prevented from loading by placing +# a file with the same name in /etc/NetworkManager/conf.d/. +# +# If two files define the same key, the one that is read afterwards will overwrite +# the previous one. + +[main] +plugins = ifcfg-rh, +dhcp = dhclient + +[logging] +# When debugging NetworkManager, enabling debug logging is of great help. +# +# Logfiles contain no passwords and little sensitive information. But please +# check before posting the file online. You can also personally hand over the +# logfile to a NM developer to treat it confidential. Meet us on #nm on Libera.Chat. +# +# You can also change the log-level at runtime via +# $ nmcli general logging level TRACE domains ALL +# However, usually it's cleaner to enable debug logging +# in the configuration and restart NetworkManager so that +# debug logging is enabled from the start. +# +# You will find the logfiles in syslog, for example via +# $ journalctl -u NetworkManager +# +# Please post full logfiles for bug reports without pre-filtering or truncation. +# Also, for debugging the entire `journalctl` output can be interesting. Don't +# limit unnecessarily with `journalctl -u`. Exceptions are if you are worried +# about private data. Check before posting logfiles! +# +# Note that debug logging of NetworkManager can be quite verbose. Some messages +# might be rate-limited by the logging daemon (see RateLimitIntervalSec, RateLimitBurst +# in man journald.conf). Please disable rate-limiting before collecting debug logs! +# +#level=TRACE +#domains=ALL From ca31f535c300aba6b2219c63bf2d1338ebe787c6 Mon Sep 17 00:00:00 2001 From: Enrico Usai Date: Wed, 21 Jun 2023 14:07:20 +0200 Subject: [PATCH 04/12] Add Rocky Linux to kitchen configuration files Copied from rhel8 with minor changes: * AMI name prefix took from EC2 Rocky Linux official AMI * `kernel_release` version took from an EC2 Rocky Linux instance * username `rocky` found in kitchen-ec2 driver documentation. Added Rocky Linux to kitchen tests hooks ### References * https://hub.docker.com/r/dokken/rockylinux-8 * https://github.com/test-kitchen/kitchen-ec2/tree/main/lib/kitchen/driver/aws/standard_platform Signed-off-by: Enrico Usai --- kitchen.docker.yml | 7 +++++++ kitchen.ec2.yml | 27 +++++++++++++++++++++++++++ kitchen/kitchen.run-hook.sh | 1 + 3 files changed, 35 insertions(+) diff --git a/kitchen.docker.yml b/kitchen.docker.yml index 62a7b69d8..94d6f80ff 100644 --- a/kitchen.docker.yml +++ b/kitchen.docker.yml @@ -69,3 +69,10 @@ platforms: cluster: base_os: rhel8 kernel_release: '4.18.0-477.13.1.el8_7.fake-value' # Use 477 version to match 8.8 kernel version available on docker + - name: rocky8 + driver: + image: <% if ENV['KITCHEN_ROCKY8_IMAGE'] %> <%= ENV['KITCHEN_ROCKY8_IMAGE'] %> <% else %> dokken/rockylinux-8 <% end %> + attributes: + cluster: + base_os: rocky8 + kernel_release: '4.18.0-477.10.1.el8_8.x86_64' \ No newline at end of file diff --git a/kitchen.ec2.yml b/kitchen.ec2.yml index 8bb9cdcde..004b6e0bf 100644 --- a/kitchen.ec2.yml +++ b/kitchen.ec2.yml @@ -38,6 +38,7 @@ lifecycle: case $KITCHEN_PLATFORM_NAME in alinux*|redhat* ) export KITCHEN_EC2_USER='ec2-user';; + rocky* ) export KITCHEN_EC2_USER='rocky';; centos* ) export KITCHEN_EC2_USER='centos';; ubuntu* ) export KITCHEN_EC2_USER='ubuntu';; esac @@ -127,6 +128,32 @@ platforms: attributes: cluster: base_os: rhel8 + - name: rocky8 + driver_plugin: ec2 + driver: + <% if ENV['KITCHEN_ROCKY8_AMI'] %> + # Use the Rocky Linux 8 AMI most similar to the base AMI used to build the ParallelCluster image + image_id: <%= ENV['KITCHEN_ROCKY8_AMI'] %> + <% else %> + image_search: + name: <% if ENV['KITCHEN_PHASE']=='install' %>Rocky-8-EC2-Base-8*<% else %><%= pcluster_prefix %>-rocky8-hvm-*<% end %> + architecture: <%= ENV['KITCHEN_ARCHITECTURE'] %> + <% end %> + block_device_mappings: + - device_name: /dev/sda1 + ebs: + volume_size: <% if (ENV['KITCHEN_VOLUME_SIZE'] || '') == '' %> 35 <% else %> <%= ENV['KITCHEN_VOLUME_SIZE'] %> <% end %> + volume_type: gp2 + delete_on_termination: true + <% %w(a b c d e f g h i j k l m n o p q r s t u v w x).each_with_index do | c, i | %> + - device_name: /dev/xvdb<%= c %> + virtual_name: ephemeral<%= i %> + <% end %> + transport: + username: rocky + attributes: + cluster: + base_os: rocky8 - name: centos7 driver_plugin: ec2 driver: diff --git a/kitchen/kitchen.run-hook.sh b/kitchen/kitchen.run-hook.sh index 122e15ea6..bdc68055e 100644 --- a/kitchen/kitchen.run-hook.sh +++ b/kitchen/kitchen.run-hook.sh @@ -26,6 +26,7 @@ if [ -e "${SCRIPT}" ]; then if [ -n "${KITCHEN_INSTANCE_HOSTNAME}" ]; then case ${KITCHEN_PLATFORM_NAME} in alinux*|redhat* ) export KITCHEN_EC2_USER='ec2-user';; + rocky* ) export KITCHEN_EC2_USER='rocky';; centos* ) export KITCHEN_EC2_USER='centos';; ubuntu* ) export KITCHEN_EC2_USER='ubuntu';; esac From 32ee370ed21b0287a99d6c3dd61254bf2eabdcb0 Mon Sep 17 00:00:00 2001 From: Enrico Usai Date: Thu, 22 Jun 2023 10:19:35 +0200 Subject: [PATCH 05/12] Add Rocky Linux to GitHub actions Signed-off-by: Enrico Usai --- .github/workflows/dokken-system-tests.yml | 1 + .github/workflows/dokken-validate.yml | 0 2 files changed, 1 insertion(+) create mode 100644 .github/workflows/dokken-validate.yml diff --git a/.github/workflows/dokken-system-tests.yml b/.github/workflows/dokken-system-tests.yml index 281cf30d2..610554000 100644 --- a/.github/workflows/dokken-system-tests.yml +++ b/.github/workflows/dokken-system-tests.yml @@ -34,6 +34,7 @@ jobs: - ubuntu2004 - ubuntu2204 - rhel8 + - rocky8 fail-fast: false steps: - uses: actions/checkout@main diff --git a/.github/workflows/dokken-validate.yml b/.github/workflows/dokken-validate.yml new file mode 100644 index 000000000..e69de29bb From 312ab9338ad767a042f046b44ac2f5412d99bf1f Mon Sep 17 00:00:00 2001 From: Enrico Usai Date: Tue, 27 Jun 2023 11:26:14 +0200 Subject: [PATCH 06/12] Add Rocky Linux to pcluster_dcv_connect.sh script Signed-off-by: Enrico Usai --- .../files/dcv/pcluster_dcv_connect.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbooks/aws-parallelcluster-platform/files/dcv/pcluster_dcv_connect.sh b/cookbooks/aws-parallelcluster-platform/files/dcv/pcluster_dcv_connect.sh index 78b2a3dd2..3d735b923 100644 --- a/cookbooks/aws-parallelcluster-platform/files/dcv/pcluster_dcv_connect.sh +++ b/cookbooks/aws-parallelcluster-platform/files/dcv/pcluster_dcv_connect.sh @@ -112,7 +112,7 @@ main() { os=$(< /etc/chef/dna.json jq -r .cluster.base_os) _log "Input parameters: user: ${user}, OS: ${os}, shared_folder_path: ${shared_folder_path}." - if ! [[ "${os}" =~ ^(alinux2|ubuntu2004|ubuntu2204|centos[7-8]|rhel8)$ ]]; then + if ! [[ "${os}" =~ ^(alinux2|ubuntu2004|ubuntu2204|centos[7-8]|rhel8|rocky8)$ ]]; then _fail "OS not supported." fi From e29afee40da044b00c5c950d11eb98aac0002c94 Mon Sep 17 00:00:00 2001 From: Enrico Usai Date: Thu, 22 Jun 2023 10:59:41 +0200 Subject: [PATCH 07/12] Enable PowerTools repository on Rocky Linux Needed by hwloc-devel blas-devel libedit-devel and glibc-static packages Signed-off-by: Enrico Usai --- .../resources/package_repos/package_repos_rocky8.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbooks/aws-parallelcluster-shared/resources/package_repos/package_repos_rocky8.rb b/cookbooks/aws-parallelcluster-shared/resources/package_repos/package_repos_rocky8.rb index 990158e05..2aef093e3 100644 --- a/cookbooks/aws-parallelcluster-shared/resources/package_repos/package_repos_rocky8.rb +++ b/cookbooks/aws-parallelcluster-shared/resources/package_repos/package_repos_rocky8.rb @@ -32,8 +32,8 @@ execute 'yum-config-manager-rhel' do # Needed by hwloc-devel blas-devel libedit-devel and glibc-static packages - command "yum-config-manager --enable codeready-builder-for-rhel-8-rhui-rpms" - end unless on_docker? + command "yum-config-manager --enable powertools" + end execute 'yum-config-manager_skip_if_unavail' do command "yum-config-manager --setopt=\*.skip_if_unavailable=1 --save" From 4bd8084ff6541d285302959b3e9c55f93259bc52 Mon Sep 17 00:00:00 2001 From: Enrico Usai Date: Thu, 22 Jun 2023 11:44:27 +0200 Subject: [PATCH 08/12] Remove coreutils package on docker Rocky Linux This package conflicts by design with `coreutils-single`. `coreutils-single` cannot be removed because related to `sudo`. This change permits the install_package test to be executed on docker. Signed-off-by: Enrico Usai --- .../resources/install_packages/install_packages_rocky8.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb b/cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb index e430ee0cb..b7d0cfaa8 100644 --- a/cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb +++ b/cookbooks/aws-parallelcluster-platform/resources/install_packages/install_packages_rocky8.rb @@ -22,12 +22,14 @@ def default_packages # environment-modules required by EFA, Intel MPI and ARM PL # iptables needed for IMDS setup - %w(vim ksh tcsh zsh openssl-devel ncurses-devel pam-devel net-tools openmotif-devel + packages = %w(vim ksh tcsh zsh openssl-devel ncurses-devel pam-devel net-tools openmotif-devel libXmu-devel hwloc-devel libdb-devel tcl-devel automake autoconf pyparted libtool httpd boost-devel redhat-lsb mlocate R atlas-devel blas-devel libffi-devel dkms libedit-devel jq libical-devel sendmail libxml2-devel libglvnd-devel python2 python2-pip libgcrypt-devel libevent-devel glibc-static bind-utils iproute NetworkManager-config-routing-rules python3 python3-pip iptables libcurl-devel yum-plugin-versionlock - coreutils moreutils curl environment-modules gcc gcc-c++ bzip2) + moreutils curl environment-modules gcc gcc-c++ bzip2) + packages.append("coreutils") unless on_docker? # on docker image coreutils conflict with coreutils-single, already installed on it + packages end From 0fb05e5666a288abf6d8750b93be3baeda355654 Mon Sep 17 00:00:00 2001 From: Enrico Usai Date: Thu, 22 Jun 2023 09:12:17 +0200 Subject: [PATCH 09/12] Skip FSx kernel_module step on docker Rocky Linux Define os_properties for rocky linux Signed-off-by: Enrico Usai --- .../lustre/partial/_install_lustre_centos_redhat.rb | 2 +- .../aws-parallelcluster-shared/libraries/test.rb | 4 ++++ .../test/libraries/os_properties.rb | 12 ++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/cookbooks/aws-parallelcluster-environment/resources/lustre/partial/_install_lustre_centos_redhat.rb b/cookbooks/aws-parallelcluster-environment/resources/lustre/partial/_install_lustre_centos_redhat.rb index 0f4dd0db2..b9a496a38 100644 --- a/cookbooks/aws-parallelcluster-environment/resources/lustre/partial/_install_lustre_centos_redhat.rb +++ b/cookbooks/aws-parallelcluster-environment/resources/lustre/partial/_install_lustre_centos_redhat.rb @@ -33,7 +33,7 @@ retry_delay 5 end - kernel_module 'lnet' unless redhat_on_docker? + kernel_module 'lnet' unless redhat_on_docker? || rocky_on_docker? end def find_kernel_patch_version diff --git a/cookbooks/aws-parallelcluster-shared/libraries/test.rb b/cookbooks/aws-parallelcluster-shared/libraries/test.rb index 1b061b27b..e5a4aba85 100644 --- a/cookbooks/aws-parallelcluster-shared/libraries/test.rb +++ b/cookbooks/aws-parallelcluster-shared/libraries/test.rb @@ -6,3 +6,7 @@ def on_docker? def redhat_on_docker? on_docker? && platform?('redhat') end + +def rocky_on_docker? + on_docker? && platform?('rocky') +end diff --git a/cookbooks/aws-parallelcluster-shared/test/libraries/os_properties.rb b/cookbooks/aws-parallelcluster-shared/test/libraries/os_properties.rb index fb3349834..22c951c5e 100644 --- a/cookbooks/aws-parallelcluster-shared/test/libraries/os_properties.rb +++ b/cookbooks/aws-parallelcluster-shared/test/libraries/os_properties.rb @@ -20,6 +20,14 @@ def redhat? inspec.os.name == 'redhat' end + def rocky? + inspec.os.name == 'rocky' + end + + def rocky_on_docker? + on_docker? && rocky? + end + def centos? inspec.os.name == 'centos' end @@ -32,6 +40,10 @@ def redhat8? redhat? && inspec.os.release.to_i == 8 end + def rocky8? + rocky? && inspec.os.release.to_i == 8 + end + def centos7? centos? && inspec.os.release.to_i == 7 end From fa8f9ded80337f84cfc706ee905a937aa42f3ac9 Mon Sep 17 00:00:00 2001 From: Enrico Usai Date: Thu, 22 Jun 2023 09:12:31 +0200 Subject: [PATCH 10/12] Fix Inspec tests condition for Rocky Linux Signed-off-by: Enrico Usai --- .../test/controls/awsbatch_config_spec.rb | 2 +- .../test/controls/cloudwatch_spec.rb | 4 ++-- .../test/controls/ephemeral_drives_spec.rb | 2 +- .../test/controls/disable_selinux_spec.rb | 2 +- .../test/controls/install_packages_spec.rb | 2 +- .../test/controls/stunnel_spec.rb | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cookbooks/aws-parallelcluster-awsbatch/test/controls/awsbatch_config_spec.rb b/cookbooks/aws-parallelcluster-awsbatch/test/controls/awsbatch_config_spec.rb index 676982316..7258bf4c3 100644 --- a/cookbooks/aws-parallelcluster-awsbatch/test/controls/awsbatch_config_spec.rb +++ b/cookbooks/aws-parallelcluster-awsbatch/test/controls/awsbatch_config_spec.rb @@ -10,7 +10,7 @@ # See the License for the specific language governing permissions and limitations under the License. control 'tag:config_awsbatch_cli_commands_available' do - only_if { node['cluster']['scheduler'] == 'awsbatch' && !os_properties.redhat8? } + only_if { node['cluster']['scheduler'] == 'awsbatch' && !os_properties.redhat8? && !os_properties.rocky8? } # Test that batch commands can be accessed without absolute path %w(awsbkill awsbqueues awsbsub awsbhosts awsbout awsbstat).each do |cli_commmand| diff --git a/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb b/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb index c825b672f..1c9df8816 100644 --- a/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb +++ b/cookbooks/aws-parallelcluster-environment/test/controls/cloudwatch_spec.rb @@ -40,7 +40,7 @@ describe file('/usr/local/bin/write_cloudwatch_agent_json.py') do it { should exist } - its('sha256sum') { should eq 'cf304d5c8fa3dd6b5866b28d4a866d5190d7282adeda3adbb39b8bed116ab30c' } + its('sha256sum') { should eq 'b2bc3a9de8aa6c8afd2f2978ac33b96e0c76daf6e8a144a1656a45683f751302' } its('owner') { should eq 'root' } its('group') { should eq 'root' } its('mode') { should cmp '0755' } @@ -56,7 +56,7 @@ describe file('/usr/local/etc/cloudwatch_agent_config_schema.json') do it { should exist } - its('sha256sum') { should eq '9019c9235fe54091db4c225fe6be552b229c958ab8a87fa94b5a875545bbfd87' } + its('sha256sum') { should eq '902aab6974f296b6da757159edf4210b3e4674ba4aea96c9cd1662bcbc987cb4' } its('owner') { should eq 'root' } its('group') { should eq 'root' } its('mode') { should cmp '0644' } diff --git a/cookbooks/aws-parallelcluster-environment/test/controls/ephemeral_drives_spec.rb b/cookbooks/aws-parallelcluster-environment/test/controls/ephemeral_drives_spec.rb index c9f4229d6..731906bb3 100644 --- a/cookbooks/aws-parallelcluster-environment/test/controls/ephemeral_drives_spec.rb +++ b/cookbooks/aws-parallelcluster-environment/test/controls/ephemeral_drives_spec.rb @@ -43,7 +43,7 @@ control 'tag:install_ephemeral_service_after_network_config' do title 'Check setup-ephemeral service to have the correct After statement' - network_target = os_properties.redhat? ? /^After=network-online.target/ : /^After=network.target$/ + network_target = os_properties.redhat? || os_properties.rocky? ? /^After=network-online.target/ : /^After=network.target$/ describe file('/etc/systemd/system/setup-ephemeral.service') do it { should exist } its('content') { should match network_target } diff --git a/cookbooks/aws-parallelcluster-platform/test/controls/disable_selinux_spec.rb b/cookbooks/aws-parallelcluster-platform/test/controls/disable_selinux_spec.rb index 1bd06b7c0..8e46b0f4e 100644 --- a/cookbooks/aws-parallelcluster-platform/test/controls/disable_selinux_spec.rb +++ b/cookbooks/aws-parallelcluster-platform/test/controls/disable_selinux_spec.rb @@ -14,7 +14,7 @@ describe selinux do it { should be_disabled } it { should_not be_enforcing } - end unless os_properties.redhat? || os_properties.centos? # Because it requires reboot of the instance + end unless os_properties.redhat? || os_properties.rocky? || os_properties.centos? # Because it requires reboot of the instance end control 'tag:testami_selinux_disabled' do diff --git a/cookbooks/aws-parallelcluster-platform/test/controls/install_packages_spec.rb b/cookbooks/aws-parallelcluster-platform/test/controls/install_packages_spec.rb index 68d8e70db..6da5058b6 100644 --- a/cookbooks/aws-parallelcluster-platform/test/controls/install_packages_spec.rb +++ b/cookbooks/aws-parallelcluster-platform/test/controls/install_packages_spec.rb @@ -5,7 +5,7 @@ only_if { !os_properties.redhat_on_docker? } # verify package with a common name is installed - describe package('coreutils') do + describe package('moreutils') do it { should be_installed } end diff --git a/cookbooks/aws-parallelcluster-platform/test/controls/stunnel_spec.rb b/cookbooks/aws-parallelcluster-platform/test/controls/stunnel_spec.rb index 625b58b43..323663adc 100644 --- a/cookbooks/aws-parallelcluster-platform/test/controls/stunnel_spec.rb +++ b/cookbooks/aws-parallelcluster-platform/test/controls/stunnel_spec.rb @@ -13,8 +13,8 @@ title "Check that the correct version of stunnel has been installed" # In AL2 stunnel comes as part of the aws-efs-utils package. - # In RHEL8 on Docker we disable the installation of base packages, so stunnel cannot be built. - only_if { !os_properties.alinux2? && !os_properties.redhat_on_docker? } + # In RHEL8 and Rocky8 on Docker we disable the installation of base packages, so stunnel cannot be built. + only_if { !os_properties.alinux2? && !os_properties.redhat_on_docker? && !os_properties.rocky_on_docker? } stunnel_version = node['cluster']['stunnel']['version'] From 0252604326b768e563ef72bb23d0f0ec34993e19 Mon Sep 17 00:00:00 2001 From: Enrico Usai Date: Thu, 22 Jun 2023 16:36:44 +0200 Subject: [PATCH 11/12] Add Rocky Linux 8 support in the README Signed-off-by: Enrico Usai --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85fc4572e..355bbbabc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ This file is used to list changes made in each version of the AWS ParallelCluste ------ **ENHANCEMENTS** +- Add support for Rocky Linux 8. - Allow configuration of static and dynamic node priorities in compute resources via the ParallelCluster configuration YAML file. - Forward SLURM_RESUME_FILE to ParallelCluster resume program. - Allow to override aws-parallelcluster-node package at cluster creation and update time (only on the head node during update). From b9e775f2e9b34248c90a0d0041e4aa827780e3da Mon Sep 17 00:00:00 2001 From: Enrico Usai Date: Fri, 18 Aug 2023 14:18:56 +0200 Subject: [PATCH 12/12] Add spack resource for rocky8 Signed-off-by: Enrico Usai --- .../resources/spack/spack_rocky8.rb | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 cookbooks/aws-parallelcluster-environment/resources/spack/spack_rocky8.rb diff --git a/cookbooks/aws-parallelcluster-environment/resources/spack/spack_rocky8.rb b/cookbooks/aws-parallelcluster-environment/resources/spack/spack_rocky8.rb new file mode 100644 index 000000000..3647cfde8 --- /dev/null +++ b/cookbooks/aws-parallelcluster-environment/resources/spack/spack_rocky8.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +# Copyright:: 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). +# You may not use this file except in compliance with the License. +# A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "LICENSE.txt" file accompanying this file. +# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied. +# See the License for the specific language governing permissions and limitations under the License. + +provides :spack, platform: 'rocky' do |node| + node['platform_version'].to_i == 8 +end + +use 'partial/_spack_common.rb' + +def dependencies + %w(autoconf automake bison byacc cscope ctags diffstat doxygen elfutils flex gcc gcc-c++ gcc-gfortran git + indent intltool libtool patch patchutils rcs rpm-build rpm-sign subversion swig system-rpm-config systemtap + curl findutils hostname iproute redhat-lsb-core python3 python3-setuptools unzip python3-boto3) +end + +def libfabric_path + '/opt/amazon/efa/lib64/pkgconfig/libfabric.pc' +end + +action :setup do + action_install_spack +end