From d947e311a5f4cf4d9c251da29962d085b37aa2fe Mon Sep 17 00:00:00 2001 From: Himani Anil Deshpande Date: Tue, 13 May 2025 20:23:35 -0400 Subject: [PATCH] [Bug] Installing Pyxis if nvidia is installed --- .../recipes/install/install_pyxis.rb | 2 +- .../spec/unit/recipes/install_pyxis_spec.rb | 4 ++-- .../aws-parallelcluster-slurm/test/controls/pyxis_spec.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cookbooks/aws-parallelcluster-slurm/recipes/install/install_pyxis.rb b/cookbooks/aws-parallelcluster-slurm/recipes/install/install_pyxis.rb index bfc7db8a41..cfc6cad809 100644 --- a/cookbooks/aws-parallelcluster-slurm/recipes/install/install_pyxis.rb +++ b/cookbooks/aws-parallelcluster-slurm/recipes/install/install_pyxis.rb @@ -15,7 +15,7 @@ # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and # limitations under the License. -return unless nvidia_enabled? +return unless nvidia_installed? return if pyxis_installed? pyxis_version = node['cluster']['pyxis']['version'] diff --git a/cookbooks/aws-parallelcluster-slurm/spec/unit/recipes/install_pyxis_spec.rb b/cookbooks/aws-parallelcluster-slurm/spec/unit/recipes/install_pyxis_spec.rb index e9305968fb..04681fdd0e 100644 --- a/cookbooks/aws-parallelcluster-slurm/spec/unit/recipes/install_pyxis_spec.rb +++ b/cookbooks/aws-parallelcluster-slurm/spec/unit/recipes/install_pyxis_spec.rb @@ -33,7 +33,7 @@ node.override['cluster']['pyxis']['version'] = pyxis_version node.override['cluster']['pyxis']['runtime_path'] = pyxis_runtime_dir end - allow_any_instance_of(Object).to receive(:nvidia_enabled?).and_return(true) + allow_any_instance_of(Object).to receive(:nvidia_installed?).and_return(true) allow_any_instance_of(Object).to receive(:pyxis_installed?).and_return(false) runner.converge(described_recipe) end @@ -93,7 +93,7 @@ runner = runner(platform: platform, version: version) do |_node| RSpec::Mocks.configuration.allow_message_expectations_on_nil = true end - allow_any_instance_of(Object).to receive(:nvidia_enabled?).and_return(true) + allow_any_instance_of(Object).to receive(:nvidia_installed?).and_return(true) allow_any_instance_of(Object).to receive(:pyxis_installed?).and_return(true) runner.converge(described_recipe) end diff --git a/cookbooks/aws-parallelcluster-slurm/test/controls/pyxis_spec.rb b/cookbooks/aws-parallelcluster-slurm/test/controls/pyxis_spec.rb index 0cc7e8697e..a89132acdb 100644 --- a/cookbooks/aws-parallelcluster-slurm/test/controls/pyxis_spec.rb +++ b/cookbooks/aws-parallelcluster-slurm/test/controls/pyxis_spec.rb @@ -10,7 +10,7 @@ # See the License for the specific language governing permissions and limitations under the License. control 'tag:install_pyxis_installed' do - only_if { ['yes', true, 'true'].include?(node['cluster']['nvidia']['enabled']) } + only_if { instance.nvidia_installed? } title 'Checks Pyxis has been installed'