Skip to content

[Bug] Installing Pyxis if nvidia is installed or enabled #2955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[Bug] Installing Pyxis if nvidia is installed or enabled
  • Loading branch information
Himani Anil Deshpande committed May 20, 2025
commit 06012f9b4f0091cdcd4e949bd714c9342dfe8c0b
Original file line number Diff line number Diff line change
Expand Up @@ -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_installed?
return unless nvidia_enabled? || nvidia_installed?
return if pyxis_installed?

pyxis_version = node['cluster']['pyxis']['version']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +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)
Expand Down Expand Up @@ -93,6 +94,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)
Expand Down
43 changes: 21 additions & 22 deletions cookbooks/aws-parallelcluster-slurm/test/controls/pyxis_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,24 @@
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied.
# See the License for the specific language governing permissions and limitations under the License.

# FIXME: Re-enabled the following check and fix failures
# control 'tag:install_pyxis_installed' do
# only_if { instance.nvidia_installed? }
#
# title 'Checks Pyxis has been installed'
#
# examples_dir = "/opt/parallelcluster/examples"
# dirs = [ examples_dir, "#{examples_dir}/spank", "#{examples_dir}/pyxis" ]
# dirs.each do |path|
# describe directory(path) do
# it { should exist }
# end
# end
#
# describe file("#{examples_dir}/pyxis/pyxis.conf") do
# it { should exist }
# end
#
# describe file("#{examples_dir}/spank/plugstack.conf") do
# it { should exist }
# end
# end
control 'tag:install_pyxis_installed' do
only_if { ['yes', true, 'true'].include?(node['cluster']['nvidia']['enabled']) || instance.nvidia_installed? }

title 'Checks Pyxis has been installed'

examples_dir = "/opt/parallelcluster/examples"
dirs = [ examples_dir, "#{examples_dir}/spank", "#{examples_dir}/pyxis" ]
dirs.each do |path|
describe directory(path) do
it { should exist }
end
end

describe file("#{examples_dir}/pyxis/pyxis.conf") do
it { should exist }
end

describe file("#{examples_dir}/spank/plugstack.conf") do
it { should exist }
end
end
Loading