slurm container running when drone started
This commit is contained in:
25
roles/cobald/files/start-drone
Normal file
25
roles/cobald/files/start-drone
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
#SBATCH -D /shared
|
||||
export
|
||||
echo $@
|
||||
nodename=$(hostname | awk '{ print "drone" substr($1,match($1, "([[:digit:]]+)")) }')
|
||||
|
||||
function handler_quit(){
|
||||
echo "shutdown container"
|
||||
singularity instance stop slurm-drone
|
||||
scontrol update NodeName=${nodename} State=FUTURE
|
||||
exit 0
|
||||
}
|
||||
|
||||
trap handler_quit EXIT
|
||||
|
||||
# set -x
|
||||
|
||||
echo "starting ${nodename}"
|
||||
singularity instance start --writable-tmpfs /shared/slurmd.sif slurm-drone \
|
||||
slurm-ctl ${nodename}
|
||||
if [ $? -eq 0 ] ; then
|
||||
echo "container started, sleeping $(( 60 * ${SLURM_Walltime}))"
|
||||
sleep $(( 60 * ${SLURM_Walltime} ))
|
||||
fi
|
||||
handler_quit
|
Reference in New Issue
Block a user