Skip to content

Commit a8b0b3d

Browse files
author
Himani Deshpande
committed
Running Config Phase of Enroot and Pyxis only on HeadNode
1 parent b00a0c6 commit a8b0b3d

File tree

5 files changed

+53
-10
lines changed

5 files changed

+53
-10
lines changed

cookbooks/aws-parallelcluster-platform/recipes/config.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
include_recipe 'aws-parallelcluster-platform::supervisord_config'
2727
fetch_config 'Fetch and load cluster configs'
2828
include_recipe 'aws-parallelcluster-platform::config_login' if node['cluster']['node_type'] == 'LoginNode'
29-
enroot 'Configure Enroot' do
30-
action :configure
29+
if node['cluster']['node_type'] == 'HeadNode'
30+
enroot 'Configure Enroot' do
31+
action :configure
32+
end
3133
end

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

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,28 @@
3333
action :create_if_missing
3434
end
3535

36+
directory "#{node['cluster']['shared_dir']}/enroot" do
37+
owner node['cluster']['cluster_user']
38+
# group node['cluster']['cluster_user']
39+
# mode '0755'
40+
action :create
41+
end
42+
43+
directory "#{node['cluster']['shared_dir']}/pyxis" do
44+
owner node['cluster']['cluster_user']
45+
# group node['cluster']['cluster_user']
46+
# mode '0755'
47+
action :create
48+
end
49+
3650
bash "Configure enroot" do
3751
user 'root'
3852
code <<-ENROOT_CONFIGURE
3953
set -e
4054
ENROOT_CONFIG_RELEASE=pyxis
4155
SHARED_DIR=#{node['cluster']['shared_dir']}
4256
NONROOT_USER=#{node['cluster']['cluster_user']}
43-
mkdir -p ${SHARED_DIR}/enroot
44-
chown ${NONROOT_USER} ${SHARED_DIR}/enroot
57+
4558
ENROOT_CACHE_PATH=${SHARED_DIR}/enroot envsubst < /tmp/enroot.template.conf > /tmp/enroot.conf
4659
mv /tmp/enroot.conf /etc/enroot/enroot.conf
4760
chmod 0644 /etc/enroot/enroot.conf
@@ -53,13 +66,41 @@
5366
5467
chmod 1777 ${SHARED_DIR}/enroot
5568
56-
mkdir -p ${SHARED_DIR}/pyxis/
57-
chown ${NONROOT_USER} ${SHARED_DIR}/pyxis/
58-
sed -i '${s/$/ runtime_path=${SHARED_DIR}\\/pyxis/}' /opt/slurm/etc/plugstack.conf.d/pyxis.conf
69+
ENROOT_CONFIGURE
70+
retries 3
71+
retry_delay 5
72+
end
73+
74+
template "#{node['cluster']['slurm']['install_dir']}/etc/plugstack.conf" do
75+
source 'pyxis/plugstack.conf.erb'
76+
cookbook 'aws-parallelcluster-platform'
77+
owner 'root'
78+
group 'root'
79+
mode '0644'
80+
end
81+
82+
83+
link '/usr/local/share/pyxis/pyxis.conf' do
84+
to "#{node['cluster']['slurm']['install_dir']}/etc/plugstack.conf.d/pyxis.conf"
85+
end
86+
87+
template "#{node['cluster']['slurm']['install_dir']}/etc/plugstack.conf.d/pyxis.conf " do
88+
source 'pyxis/pyxis.conf.erb'
89+
cookbook 'aws-parallelcluster-platform'
90+
owner 'root'
91+
group 'root'
92+
mode '0644'
93+
end
94+
95+
96+
bash "Configure Pyxis" do
97+
user 'root'
98+
code <<-PYXIS_CONFIGURE
99+
SHARED_DIR=#{node['cluster']['shared_dir']}
59100
SHARED_DIR=${SHARED_DIR} envsubst < /opt/slurm/etc/plugstack.conf.d/pyxis.conf > /opt/slurm/etc/plugstack.conf.d/pyxis.tmp.conf
60101
mv /opt/slurm/etc/plugstack.conf.d/pyxis.tmp.conf /opt/slurm/etc/plugstack.conf.d/pyxis.conf
61102
62-
ENROOT_CONFIGURE
103+
PYXIS_CONFIGURE
63104
retries 3
64105
retry_delay 5
65106
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include /opt/slurm/etc/plugstack.conf.d/*
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
runtime_path=<%= node['cluster']['shared_dir'] %>/pyxis/

cookbooks/aws-parallelcluster-slurm/recipes/install/install_pyxis.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
CPPFLAGS='-I /opt/slurm/include/' make
3939
CPPFLAGS='-I /opt/slurm/include/' make install
4040
mkdir -p /opt/slurm/etc/plugstack.conf.d
41-
echo -e 'include /opt/slurm/etc/plugstack.conf.d/*' | tee /opt/slurm/etc/plugstack.conf
42-
ln -fs /usr/local/share/pyxis/pyxis.conf /opt/slurm/etc/plugstack.conf.d/pyxis.conf
4341
PYXIS_INSTALL
4442
retries 3
4543
retry_delay 5

0 commit comments

Comments
 (0)