Skip to content

Commit 4a625ee

Browse files
author
Himani Anil Deshpande
committed
[NVIDIA-IMEX] Add Version and package name for debian installation
1 parent d2c5206 commit 4a625ee

File tree

9 files changed

+61
-12
lines changed

9 files changed

+61
-12
lines changed

cookbooks/aws-parallelcluster-platform/resources/nvidia_imex/nvidia_imex_alinux2023.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
end
1818

1919
use 'partial/_nvidia_imex_common.rb'
20+
use 'partial/_nvidia_imex_rhel.rb'
2021

2122
def _nvidia_imex_version
2223
"#{nvidia_driver_major_version}-#{nvidia_imex_full_version}"

cookbooks/aws-parallelcluster-platform/resources/nvidia_imex/nvidia_imex_amazon2.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
provides :nvidia_imex, platform: 'amazon', platform_version: '2'
1616

1717
use 'partial/_nvidia_imex_common.rb'
18+
use 'partial/_nvidia_imex_rhel.rb'
1819

1920
def imex_installed
2021
# We do not install NVIDIA-Imex for Alinux2 due to restriction on NVIDIA driver

cookbooks/aws-parallelcluster-platform/resources/nvidia_imex/nvidia_imex_redhat8.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
end
1818

1919
use 'partial/_nvidia_imex_common.rb'
20+
use 'partial/_nvidia_imex_rhel.rb'
2021

2122
def _nvidia_imex_version
2223
"#{nvidia_driver_major_version}-#{nvidia_imex_full_version}"

cookbooks/aws-parallelcluster-platform/resources/nvidia_imex/nvidia_imex_rocky8.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
end
1818

1919
use 'partial/_nvidia_imex_common.rb'
20+
use 'partial/_nvidia_imex_rhel.rb'
2021

2122
def _nvidia_imex_version
2223
"#{nvidia_driver_major_version}-#{nvidia_imex_full_version}"

cookbooks/aws-parallelcluster-platform/resources/nvidia_imex/nvidia_imex_ubuntu22+.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717
end
1818

1919
use 'partial/_nvidia_imex_common.rb'
20+
use 'partial/_nvidia_imex_debian.rb'
2021

2122
def _nvidia_imex_version
22-
"1:#{nvidia_driver_major_version}_#{nvidia_imex_full_version}"
23-
# The single digit "1" is epoch version. Without the "1", package install fails because version does not exist.
24-
# See details here:
25-
# https://askubuntu.com/questions/441879/why-do-some-packages-have-extra-numbers-before-a-colon-on-the-front-of-their-ver
23+
"#{nvidia_driver_major_version}_#{nvidia_imex_full_version}"
2624
end

cookbooks/aws-parallelcluster-platform/resources/nvidia_imex/partial/_nvidia_imex_common.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22
#
3-
# Copyright:: 2013-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
# Copyright:: 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License").
66
# You may not use this file except in compliance with the License.
@@ -48,10 +48,7 @@
4848
action :create
4949
end
5050

51-
install_packages 'Install nvidia-imex' do
52-
packages "#{nvidia_imex_service}-#{_nvidia_imex_version}"
53-
action :install
54-
end
51+
action_install_imex
5552
# Save Imex version in Node Attributes for InSpec Tests
5653
node.default['cluster']['nvidia']['imex']['version'] = nvidia_imex_full_version
5754
node.default['cluster']['nvidia']['imex']['package'] = "#{nvidia_imex_service}-#{nvidia_driver_major_version}"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# frozen_string_literal: true
2+
#
3+
# Copyright:: 2025 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+
action :install_imex do
16+
apt_package "Install nvidia-imex" do
17+
package_name "#{nvidia_imex_service}-#{nvidia_driver_major_version}"
18+
version nvidia_imex_full_version
19+
retries 10
20+
retry_delay 5
21+
end
22+
end
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# frozen_string_literal: true
2+
#
3+
# Copyright:: 2025 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+
action :install_imex do
16+
install_packages 'Install nvidia-imex' do
17+
packages "#{nvidia_imex_service}-#{_nvidia_imex_version}"
18+
action :install
19+
end
20+
end

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,17 @@ def self.configure(chef_run)
241241
.with(user: 'root')
242242
.with(group: 'root')
243243
.with(mode: '0644')
244-
is_expected.to install_install_packages('Install nvidia-imex')
245-
.with(packages: "#{nvidia_imex_name}")
246-
.with(action: %i(install))
244+
if platform == 'ubuntu'
245+
is_expected.to install_apt_package('Install nvidia-imex')
246+
.with(package_name: 'nvidia-imex-1')
247+
.with(version: "#{nvidia_imex_version}")
248+
.with(retries: 10)
249+
.with(retry_delay: 5)
250+
else
251+
is_expected.to install_install_packages('Install nvidia-imex')
252+
.with(packages: "#{nvidia_imex_name}")
253+
.with(action: %i(install))
254+
end
247255
end
248256
it 'sets nvidia-imex version' do
249257
expect(node.default['cluster']['nvidia']['imex']['version']).to eq(nvidia_imex_version)

0 commit comments

Comments
 (0)