Skip to content

Commit 3519f53

Browse files
Revert "Make neuron_installed helper function more generic and add changelog"
This reverts commit 242fc21.
1 parent 9d8d241 commit 3519f53

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

CHANGELOG.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ This file is used to list changes made in each version of the AWS ParallelCluste
66
3.2.1
77
------
88

9-
**ENHANCEMENTS**
10-
- Add support for AWS Trainium instances.
11-
129
**CHANGES**
1310
- Upgrade NVIDIA driver to version 470.141.03.
1411
- Upgrade NVIDIA Fabric Manager to version 470.141.03.

cookbooks/aws-parallelcluster-install/recipes/neuron.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and
1616
# limitations under the License.
1717

18-
return if node['cluster']['base_os'] == 'centos7' || arm_instance? || is_package_installed?("aws-neuronx-dkms")
18+
return if node['cluster']['base_os'] == 'centos7' || arm_instance? || neuron_installed?
1919

2020
if platform?('amazon')
2121
# add neuron repository

libraries/helpers.rb

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -548,19 +548,18 @@ def efa_installed?
548548
dir_exist
549549
end
550550

551-
def is_package_installed?(package_name)
551+
def neuron_installed?
552+
package_name = "aws-neuronx-dkms"
552553
command = value_for_platform(
553-
%w(ubuntu debian) => {
554-
'default' => "apt list --installed | grep #{package_name}",
555-
},
556-
'default' => "yum list installed | grep #{package_name}"
557-
)
554+
%w(ubuntu debian) => {
555+
'default' => "apt list --installed | grep #{package_name}",
556+
},
557+
'default' => "yum list installed | grep #{package_name}")
558558

559559
cmd = Mixlib::ShellOut.new(command, timeout: 60)
560560
cmd.run_command
561-
Chef::Log.info("Checking if #{package_name} is installed...\n#{command}\n#{cmd.stdout.strip}")
562-
# Convert return code to boolean
563-
cmd.exitstatus.to_i.zero?
561+
# Return false if the package is not installed
562+
!(cmd.exitstatus != 0)
564563
end
565564

566565
def is_neuron_instance?

0 commit comments

Comments
 (0)