cgroups inside singularity container
This commit is contained in:
11
roles/cobald/files/cgroup.conf.noautomount
Normal file
11
roles/cobald/files/cgroup.conf.noautomount
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
###
|
||||||
|
#
|
||||||
|
# Slurm cgroup support configuration file
|
||||||
|
#
|
||||||
|
# See man slurm.conf and man cgroup.conf for further
|
||||||
|
# information on cgroup configuration parameters
|
||||||
|
#--
|
||||||
|
CgroupAutomount=no
|
||||||
|
|
||||||
|
ConstrainCores=no
|
||||||
|
ConstrainRAMSpace=no
|
@@ -4,6 +4,7 @@ From: slurm:slurmd
|
|||||||
%files
|
%files
|
||||||
31-slurmd-configless /etc/docker-init.d/31-slurm-configless
|
31-slurmd-configless /etc/docker-init.d/31-slurm-configless
|
||||||
/container/volumes/munge/munge.key /etc/munge/munge.key
|
/container/volumes/munge/munge.key /etc/munge/munge.key
|
||||||
|
cgroup.conf.noautomount /etc/slurm/cgroup.conf
|
||||||
|
|
||||||
%post
|
%post
|
||||||
rm /etc/docker-init.d/30-slurmd
|
rm /etc/docker-init.d/30-slurmd
|
||||||
|
@@ -8,15 +8,27 @@ function handler_quit(){
|
|||||||
echo "shutdown container"
|
echo "shutdown container"
|
||||||
singularity instance stop slurm-drone
|
singularity instance stop slurm-drone
|
||||||
scontrol update NodeName=${nodename} State=FUTURE
|
scontrol update NodeName=${nodename} State=FUTURE
|
||||||
|
umount /inner-cgroup/freezer
|
||||||
|
umount /inner-cgroup
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
trap handler_quit EXIT
|
|
||||||
|
|
||||||
# set -x
|
# set -x
|
||||||
|
|
||||||
|
trap handler_quit EXIT
|
||||||
|
|
||||||
|
echo "mounting cgroups"
|
||||||
|
mkdir /inner-cgroup
|
||||||
|
mount -t tmpfs none /inner-cgroup
|
||||||
|
mkdir /inner-cgroup/freezer/
|
||||||
|
mount --bind /sys/fs/cgroup/freezer/slurm/ /inner-cgroup/freezer/
|
||||||
|
mount -o remount,ro /inner-cgroup
|
||||||
|
|
||||||
echo "starting ${nodename}"
|
echo "starting ${nodename}"
|
||||||
singularity instance start --writable-tmpfs /shared/slurmd.sif slurm-drone \
|
singularity instance start \
|
||||||
|
-B /inner-cgroup/:/sys/fs/cgroup/ \
|
||||||
|
--writable-tmpfs /shared/slurmd.sif slurm-drone \
|
||||||
slurm-ctl ${nodename}
|
slurm-ctl ${nodename}
|
||||||
if [ $? -eq 0 ] ; then
|
if [ $? -eq 0 ] ; then
|
||||||
echo "container started, sleeping $(( 60 * ${SLURM_Walltime}))"
|
echo "container started, sleeping $(( 60 * ${SLURM_Walltime}))"
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
loop:
|
loop:
|
||||||
- slurm-slurmd.def
|
- slurm-slurmd.def
|
||||||
- 31-slurmd-configless
|
- 31-slurmd-configless
|
||||||
|
- cgroup.conf.noautomount
|
||||||
register: cobald_copy_sing_files
|
register: cobald_copy_sing_files
|
||||||
|
|
||||||
- name: remove old container
|
- name: remove old container
|
||||||
|
Reference in New Issue
Block a user