Skip to content

Commit 7fda651

Browse files
author
Himani Deshpande
committed
Adding Chef Attributes for enabling Pyxis and enroot
1 parent e659633 commit 7fda651

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

cookbooks/aws-parallelcluster-platform/attributes/platform.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
# Enroot + Pyxis
1313
default['cluster']['enroot']['version'] = '3.4.1'
14+
default['cluster']['enroot']['enabled'] = 'no'
1415
default['cluster']['pyxis']['version'] = '0.20.0'
16+
default['cluster']['pyxis']['enabled'] = 'no'
1517

1618
# NVidia
1719
default['cluster']['nvidia']['enabled'] = 'no'

cookbooks/aws-parallelcluster-platform/resources/enroot/partial/_enroot_common.rb

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
action :configure do
2424
return if on_docker?
2525
return unless enroot_installed
26+
return unless configure_enroot
27+
return unless configure_pyxis
2628

2729
cookbook_file "/tmp/enroot.template.conf" do
2830
source 'enroot/enroot.template.conf'
@@ -59,7 +61,6 @@
5961
set -e
6062
ENROOT_CONFIG_RELEASE=pyxis
6163
SHARED_DIR=#{node['cluster']['shared_dir']}
62-
6364
ENROOT_CACHE_PATH=${SHARED_DIR}/enroot envsubst < /tmp/enroot.template.conf > /tmp/enroot.conf
6465
mv /tmp/enroot.conf /etc/enroot/enroot.conf
6566
chmod 0644 /etc/enroot/enroot.conf
@@ -76,11 +77,10 @@
7677
mode '0644'
7778
end
7879

79-
8080
link '/usr/local/share/pyxis/pyxis.conf' do
8181
to "#{node['cluster']['slurm']['install_dir']}/etc/plugstack.conf.d/pyxis.conf"
8282
end
83-
83+
8484
template "#{node['cluster']['slurm']['install_dir']}/etc/plugstack.conf.d/pyxis.conf " do
8585
source 'pyxis/pyxis.conf.erb'
8686
cookbook 'aws-parallelcluster-platform'
@@ -89,14 +89,13 @@
8989
mode '0644'
9090
end
9191

92-
9392
bash "Configure Pyxis" do
9493
user 'root'
95-
code <<-PYXIS_CONFIGURE
94+
code <<-PYXIS_CONFIGURE
95+
set -e
9696
SHARED_DIR=#{node['cluster']['shared_dir']}
9797
SHARED_DIR=${SHARED_DIR} envsubst < /opt/slurm/etc/plugstack.conf.d/pyxis.conf > /opt/slurm/etc/plugstack.conf.d/pyxis.tmp.conf
9898
mv /opt/slurm/etc/plugstack.conf.d/pyxis.tmp.conf /opt/slurm/etc/plugstack.conf.d/pyxis.conf
99-
10099
PYXIS_CONFIGURE
101100
retries 3
102101
retry_delay 5
@@ -110,3 +109,11 @@ def package_version
110109
def enroot_installed
111110
::File.exist?('/usr/bin/enroot')
112111
end
112+
113+
def configure_enroot
114+
['yes', true].include?(node['cluster']['enroot']['enabled'])
115+
end
116+
117+
def configure_pyxis
118+
['yes', true].include?(node['cluster']['pyxis']['enabled'])
119+
end

0 commit comments

Comments
 (0)