Skip to content

Commit 1c47a31

Browse files
committed
fix pcluster 3.6.0 computer fleet passwordless ssh
1 parent 0e14084 commit 1c47a31

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

modules-ubuntu/02.activate.passwordless.AD.headnode.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ activateSSH() {
1616
}
1717

1818
addAdmins2Sudoers() {
19-
echo "${ec2user_pass}" | passwd ubuntu
19+
#echo "${ec2user_pass}" | passwd ubuntu
2020
cat > /etc/sudoers.d/100-AD-admins << EOF
2121
# add domain admins as sudoers
2222
%Sudoers ALL=(ALL) NOPASSWD:ALL

modules-ubuntu/02.activate.passwordless.sudo.compute.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ source "/etc/parallelcluster/cfnconfig"
55

66
activateSSSD() {
77
sed -i 's/fallback_homedir = \/home\/%u/override_homedir = \/fsx\/home-%u/g' /etc/sssd/sssd.conf
8-
ROU_PW=$(aws secretsmanager get-secret-value --secret-id "${stack_name}-ROU" --query SecretString --output text --region "${cfn_region}")
8+
searchstring="-ComputeFleet"
9+
stack=${stack_name%$searchstring*}
10+
ROU_PW=$(aws secretsmanager get-secret-value --secret-id "${stack}-ROU" --query SecretString --output text --region "${cfn_region}")
911
sed -E -i "s|^#?(ldap_default_authtok\s=)\s.*|\1 ${ROU_PW}|" /etc/sssd/sssd.conf
1012
systemctl restart sssd
1113
}

modules-ubuntu/03.configure.slurm.acct.headnode.sh

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,16 @@ patchSlurmConfig() {
4040
sed -i "s/ClusterName=parallelcluster.*/ClusterName=${stack_name}/" "/opt/slurm/etc/slurm.conf"
4141
sed -i "s/SlurmctldPort=6820-6829/SlurmctldPort=6820-6849/" "/opt/slurm/etc/slurm.conf"
4242
rm -f /var/spool/slurm.state/clustername
43+
44+
#need to add TRESBillingWeights="CPU=0.01,Mem=0.0" to each cpu partition to avoid AssocGrpBillingMinutes problem
45+
for file in /opt/slurm/etc/pcluster/*_partition.conf; do
46+
sed -i '${s/$/ TRESBillingWeights="CPU=0.01,Mem=0.0"/}' $file
47+
done
4348
}
4449

4550
installLuaSubmit() {
46-
apt-get install -y lua-devel luarocks redis
51+
apt-get install -y liblua5.1-dev luarocks redis
52+
luarocks install luasocket
4753
luarocks install redis-lua
4854
luarocks install lua-cjson
4955
export token="$(aws secretsmanager get-secret-value --secret-id "ADtokenPSU" --query SecretString --output text --region "${cfn_region}")"
@@ -119,11 +125,6 @@ function slurm_job_submit(job_desc, submit_uid)
119125
end
120126
job_desc.account = job_desc.comment
121127
end
122-
if (job_desc.gres == nil) and (job_desc.tres_per_job == nil) and (job_desc.tres_per_node == nil) and (job_desc.tres_per_task == nil) and (job_desc.shared ~= 0) then
123-
slurm.log_info("User did not specified GPUS.")
124-
slurm.user_msg("[error] No GPUs were requested on the GPU cluster. If you do not need GPUs please use the CPU cluster instead.")
125-
return slurm.ERROR
126-
end
127128
ngpus = 0
128129
local tab = apiCall(job_desc.user_name, stability_cluster, job_desc.account, ngpus)
129130
if tab.result=="rejected" then
@@ -152,11 +153,6 @@ function slurm_job_modify(job_desc, job_rec, modify_uid)
152153
end
153154
job_desc.account = job_desc.comment
154155
end
155-
if (job_desc.gres == nil) and (job_desc.tres_per_job == nil) and (job_desc.tres_per_node == nil) and (job_desc.tres_per_task == nil) and (job_desc.shared ~= 0) then
156-
slurm.log_info("User did not specified GPUS.")
157-
slurm.user_msg("[error] No GPUs were requested on the GPU cluster. If you do not need GPUs please use the CPU cluster instead.")
158-
return slurm.ERROR
159-
end
160156
ngpus = 0
161157
local tab = apiCall(job_desc.user_name, stability_cluster, job_desc.account, ngpus)
162158
if tab.result=="rejected" then
@@ -181,7 +177,8 @@ EOF
181177
echo 'JobSubmitPlugins=lua' >> /opt/slurm/etc/slurm.conf
182178

183179
cat > /etc/sudoers.d/100-AD-admins << EOF
184-
180+
# add domain admins as sudoers
181+
%Sudoers ALL=(ALL) NOPASSWD:ALL
185182
EOF
186183
}
187184

@@ -198,6 +195,7 @@ main() {
198195
echo "[INFO][$(date '+%Y-%m-%d %H:%M:%S')] 03.configure.slurm.acct.headnode.sh: START" >&2
199196
configureFederatedSlurmDBD
200197
patchSlurmConfig
198+
installLuaSubmit
201199
restartSlurmDaemons
202200
echo "[INFO][$(date '+%Y-%m-%d %H:%M:%S')] 03.configure.slurm.acct.headnode.sh: STOP" >&2
203201
}

modules/03.configure.slurm.acct.headnode.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ EOF
141141
echo 'JobSubmitPlugins=lua' >> /opt/slurm/etc/slurm.conf
142142

143143
cat > /etc/sudoers.d/100-AD-admins << EOF
144-
144+
# add domain admins as sudoers
145+
%Sudoers ALL=(ALL) NOPASSWD:ALL
145146
EOF
146147
}
147148

0 commit comments

Comments
 (0)