Notice: also trying to run slurmd on execute nodes as user makes no sense because it breaks sbatch. Furthermore there is another necessary to run mpi jobs (just tried MpiDefault=none). I don't consider running slurmd as root a good idea, but there seems to be no other choice at the moment.
44 lines
1.3 KiB
Docker
44 lines
1.3 KiB
Docker
FROM docker.io/library/centos:7 as base
|
|
|
|
RUN yum install -y epel-release && \
|
|
yum install -y slurm && \
|
|
yum clean all && rm -rf /var/cache/yum
|
|
|
|
RUN yum install -y less iproute bind-utils nmap-ncat net-tools && \
|
|
yum clean all && rm -rf /var/cache/yum
|
|
|
|
COPY entrypoint.sh /usr/local/sbin/entrypoint.sh
|
|
|
|
RUN chown root:root /usr/local/sbin/entrypoint.sh && \
|
|
chmod 755 /usr/local/sbin/entrypoint.sh
|
|
|
|
ENTRYPOINT [ "/usr/local/sbin/entrypoint.sh" ]
|
|
|
|
ARG slurmuser=slurm
|
|
ENV slurmuser=${slurmuser}
|
|
|
|
RUN useradd -d /var/lib/slurm -m --no-log-init --system $slurmuser &&\
|
|
slurm-setuser -u $slurmuser -g $slurmuser -y
|
|
|
|
ENV SLURMCTLD_LOG_PATH="/var/log/slurm/slurmctld.log"
|
|
ENV SLURMD_LOG_PATH="/var/log/slurm/slurmd.log"
|
|
ENV SLURM_SCHED_LOG_PATH="/var/log/slurm/slurmsched.log"
|
|
|
|
FROM base as slurmd
|
|
|
|
RUN yum install -y slurm-slurmd && \
|
|
yum clean all && rm -rf /var/cache/yum
|
|
|
|
CMD bash -c 'cat <({ su -s /bin/sh -c "munged -F" munge & \
|
|
slurmd -D 2>/dev/null 1>/dev/null & \
|
|
tail --retry --pid $! -f ${SLURMD_LOG_PATH} ${SLURM_SCHED_LOG_PATH} & })'
|
|
|
|
FROM base as slurmctld
|
|
|
|
RUN yum install -y slurm-slurmctld && \
|
|
yum clean all && rm -rf /var/cache/yum
|
|
|
|
CMD bash -c 'cat <({ su -s /bin/sh -c "munged -F" munge & \
|
|
su -s /bin/sh -c "slurmctld -D" ${slurmuser} 2>/dev/null 1>/dev/null & \
|
|
tail --retry --pid $! -f ${SLURMCTLD_LOG_PATH} ${SLURM_SCHED_LOG_PATH} & })'
|