Skip to content

Commit bf38a4f

Browse files
Himani Anil Deshpandehanwen-cluster
Himani Anil Deshpande
authored andcommitted
[Bug] Installing Pyxis if nvidia is installed or enabled
1 parent bd667fa commit bf38a4f

File tree

3 files changed

+24
-23
lines changed

3 files changed

+24
-23
lines changed

cookbooks/aws-parallelcluster-slurm/recipes/install/install_pyxis.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 unless nvidia_installed?
18+
return unless nvidia_enabled? || nvidia_installed?
1919
return if pyxis_installed?
2020

2121
pyxis_version = node['cluster']['pyxis']['version']

cookbooks/aws-parallelcluster-slurm/spec/unit/recipes/install_pyxis_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
node.override['cluster']['pyxis']['version'] = pyxis_version
3434
node.override['cluster']['pyxis']['runtime_path'] = pyxis_runtime_dir
3535
end
36+
allow_any_instance_of(Object).to receive(:nvidia_enabled?).and_return(true)
3637
allow_any_instance_of(Object).to receive(:nvidia_installed?).and_return(true)
3738
allow_any_instance_of(Object).to receive(:pyxis_installed?).and_return(false)
3839
runner.converge(described_recipe)
@@ -93,6 +94,7 @@
9394
runner = runner(platform: platform, version: version) do |_node|
9495
RSpec::Mocks.configuration.allow_message_expectations_on_nil = true
9596
end
97+
allow_any_instance_of(Object).to receive(:nvidia_enabled?).and_return(true)
9698
allow_any_instance_of(Object).to receive(:nvidia_installed?).and_return(true)
9799
allow_any_instance_of(Object).to receive(:pyxis_installed?).and_return(true)
98100
runner.converge(described_recipe)

cookbooks/aws-parallelcluster-slurm/test/controls/pyxis_spec.rb

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,24 @@
99
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied.
1010
# See the License for the specific language governing permissions and limitations under the License.
1111

12-
# FIXME: Re-enabled the following check and fix failures
13-
# control 'tag:install_pyxis_installed' do
14-
# only_if { instance.nvidia_installed? }
15-
#
16-
# title 'Checks Pyxis has been installed'
17-
#
18-
# examples_dir = "/opt/parallelcluster/examples"
19-
# dirs = [ examples_dir, "#{examples_dir}/spank", "#{examples_dir}/pyxis" ]
20-
# dirs.each do |path|
21-
# describe directory(path) do
22-
# it { should exist }
23-
# end
24-
# end
25-
#
26-
# describe file("#{examples_dir}/pyxis/pyxis.conf") do
27-
# it { should exist }
28-
# end
29-
#
30-
# describe file("#{examples_dir}/spank/plugstack.conf") do
31-
# it { should exist }
32-
# end
33-
# end
12+
control 'tag:install_pyxis_installed' do
13+
only_if { ['yes', true, 'true'].include?(node['cluster']['nvidia']['enabled']) || instance.nvidia_installed? }
14+
15+
title 'Checks Pyxis has been installed'
16+
17+
examples_dir = "/opt/parallelcluster/examples"
18+
dirs = [ examples_dir, "#{examples_dir}/spank", "#{examples_dir}/pyxis" ]
19+
dirs.each do |path|
20+
describe directory(path) do
21+
it { should exist }
22+
end
23+
end
24+
25+
describe file("#{examples_dir}/pyxis/pyxis.conf") do
26+
it { should exist }
27+
end
28+
29+
describe file("#{examples_dir}/spank/plugstack.conf") do
30+
it { should exist }
31+
end
32+
end

0 commit comments

Comments
 (0)