Skip to content

Commit 532c645

Browse files
Revert "Make neuron_installed helper function more generic and add changelog"
This reverts commit cbed2e7 Signed-off-by: Francesco Giordano <[email protected]>
1 parent 151d22c commit 532c645

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

CHANGELOG.md

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

99
**ENHANCEMENTS**
10-
- Add support for AWS Trainium instances.
1110
- Add support for Slurm Accounting.
1211
- Add support for adding and removing shared storages at cluster update.
1312
- Add possibility to specify multiple instance types for the same compute resource.

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
@@ -541,19 +541,18 @@ def efa_installed?
541541
dir_exist
542542
end
543543

544-
def is_package_installed?(package_name)
544+
def neuron_installed?
545+
package_name = "aws-neuronx-dkms"
545546
command = value_for_platform(
546-
%w(ubuntu debian) => {
547-
'default' => "apt list --installed | grep #{package_name}",
548-
},
549-
'default' => "yum list installed | grep #{package_name}"
550-
)
547+
%w(ubuntu debian) => {
548+
'default' => "apt list --installed | grep #{package_name}",
549+
},
550+
'default' => "yum list installed | grep #{package_name}")
551551

552552
cmd = Mixlib::ShellOut.new(command, timeout: 60)
553553
cmd.run_command
554-
Chef::Log.info("Checking if #{package_name} is installed...\n#{command}\n#{cmd.stdout.strip}")
555-
# Convert return code to boolean
556-
cmd.exitstatus.to_i.zero?
554+
# Return false if the package is not installed
555+
!(cmd.exitstatus != 0)
557556
end
558557

559558
def is_neuron_instance?

0 commit comments

Comments
 (0)