Skip to content

Commit

Permalink
Install Intel OneAPI toolkits and Intel Python
Browse files Browse the repository at this point in the history
Signed-off-by: Hanwen <[email protected]>
  • Loading branch information
hanwen-cluster authored and hanwen-pcluste committed Nov 16, 2023
1 parent 139fe2a commit 9b32ac7
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ This file is used to list changes made in each version of the AWS ParallelCluste
------

**ENHANCEMENTS**
- Add support for installing Intel OneAPI Base Toolkit and HPC Toolkit, and Intel Python.
- Intel OneAPI Base Toolkits: 2023.2.0
- Intel OneAPI HPC Toolkits: 2023.2.0
- Intel Python: 2023.2.0
- Critical Update for Intel oneAPI DPC++/C++ Compiler: 2023.2.1
- Critical Update for Intel Fortran Compiler & Intel Fortran Compiler Classic: 2023.2.1

**CHANGES**
- Upgrade third-party cookbook dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,16 @@ suites:
verifier:
controls:
- /tag:config_intel_hpc/
- /tag:intel_one_api/
attributes:
resource: intel_hpc:configure
dependencies:
- resource:package_repos:update
- resource:intel_hpc:setup
cluster:
enable_intel_hpc_platform: 'true'
install_intel_base_toolkit: 'true'
install_intel_hpc_toolkit: 'true'
node_type: HeadNode
- name: sticky_bits
run_list:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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_intel_software

unified_mode true

property :intel_offline_installer_dir, String, required: true
property :software_name, String, required: true
property :software_url, String, required: true

default_action :install

action :install do
remote_file "#{new_resource.intel_offline_installer_dir}/#{new_resource.software_name}" do
source new_resource.software_url
mode '0744'
retries 3
retry_delay 5
action :create_if_missing
end
bash "install Intel #{new_resource.software_name}" do
cwd new_resource.intel_offline_installer_dir
code <<-INTEL
set -e
sh #{new_resource.software_name} -a -s --eula accept
rm -f #{new_resource.software_name}
INTEL
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,71 @@
end

action :configure do
# do nothing
return unless intel_hpc_supported? && (node['cluster']['install_intel_base_toolkit'] == "true" || node['cluster']['install_intel_hpc_toolkit'] == "true" || node['cluster']['install_intel_python'] == "true")

base_toolkit_version = "2023.2.0.49397"
base_toolkit_name = "l_BaseKit_p_#{base_toolkit_version}_offline.sh"
base_toolkit_url = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/992857b9-624c-45de-9701-f6445d845359/#{base_toolkit_name}"
hpc_toolkit_version = "2023.2.0.49440"
hpc_toolkit_name = "l_HPCKit_p_#{hpc_toolkit_version}_offline.sh"
hpc_toolkit_url = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/0722521a-34b5-4c41-af3f-d5d14e88248d/#{hpc_toolkit_name}"
intel_python_version = "2023.2.0.49422"
intel_python_name = "l_pythoni39_oneapi_p_#{intel_python_version}_offline.sh"
intel_python_url = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/03aae3a8-623a-47cf-9655-5dd8fcf86430/#{intel_python_name}"
# Below are critical security updates not included in the tookits:
cpp_compiler_version = "2023.2.1.8"
cpp_compiler_name = "l_dpcpp-cpp-compiler_p_#{cpp_compiler_version}_offline.sh"
cpp_compiler_url = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ebf5d9aa-17a7-46a4-b5df-ace004227c0e/#{cpp_compiler_name}"
fortran_compiler_version = "2023.2.1.8"
fortran_compiler_name = "l_fortran-compiler_p_#{fortran_compiler_version}_offline.sh"
fortran_compiler_url = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/0d65c8d4-f245-4756-80c4-6712b43cf835/#{fortran_compiler_name}"

intel_offline_installer_dir = '/opt/intel/offlineInstaller'

directory intel_offline_installer_dir do
recursive true
end

if node['cluster']['install_intel_base_toolkit'] == "true"
install_intel_software "Install Intel Base Toolkit" do
software_name base_toolkit_name
software_url base_toolkit_url
intel_offline_installer_dir intel_offline_installer_dir
end
install_intel_software "Critical Update for Intel oneAPI DPC++/C++ Compiler" do
software_name cpp_compiler_name
software_url cpp_compiler_url
intel_offline_installer_dir intel_offline_installer_dir
end
end
if node['cluster']['install_intel_hpc_toolkit'] == "true"
install_intel_software "Intel OneAPI HPC Toolkits" do
software_name hpc_toolkit_name
software_url hpc_toolkit_url
intel_offline_installer_dir intel_offline_installer_dir
end
install_intel_software "Critical Update for Intel Fortran Compiler & Intel Fortran Compiler Classic" do
software_name fortran_compiler_name
software_url fortran_compiler_url
intel_offline_installer_dir intel_offline_installer_dir
end
end
if node['cluster']['install_intel_python'] == "true"
install_intel_software "Install Intel Python" do
software_name intel_python_name
software_url intel_python_url
intel_offline_installer_dir intel_offline_installer_dir
end
end
bash "copy Intel modulefiles to MODULEPATH" do
cwd "/opt/intel"
code <<-INTEL
set -e
./modulefiles-setup.sh --output-dir="/usr/share/Modules/modulefiles/intel"
INTEL
end
end

def intel_hpc_supported?
!arm_instance?
end
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,31 @@
its('mode') { should cmp '0755' }
end
end

control 'tag:intel_one_api_toolkits_configured' do
# TODO: Enable this test in daily run. This test requires larger root volume size.
# TODO: After increasing the root volume size, config_intel_hpc_enough_space_on_root_volume needs to be ajusted.
title 'Checks Intel OneApi Toolkits have been installed'

only_if { !os_properties.on_docker? }
only_if { !os_properties.centos7? && !os_properties.arm? }

intel_directory = "/opt/intel"

if node['cluster']['install_intel_base_toolkit'] == 'true'
%w(advisor ccl compiler dal dnnl dpl ipp ippcp mkl vtune).each do |software|
describe directory("#{intel_directory}/#{software}") do
it { should exist }
end
end
end

modulefile_dir = "/usr/share/Modules/modulefiles"
# Intel PSXE module file
describe file("#{modulefile_dir}/intel") do
it { should exist }
its('owner') { should eq 'root' }
its('group') { should eq 'root' }
its('mode') { should cmp '0755' }
end
end

0 comments on commit 9b32ac7

Please sign in to comment.