Commit 4da0c640 authored by Pape, David (FWCC) - 139658's avatar Pape, David (FWCC) - 139658
Browse files

Generate fewer layers by using fewer RUN commands

parent fd825bf6
Pipeline #48444 passed with stage
in 12 minutes and 10 seconds
......@@ -2,7 +2,7 @@ FROM fedora:latest
# TODO: remove boost-devel when the dependency in soci-sqlite3-devel is fixed
RUN dnf upgrade -y && dnf install -y \
nano hostname hwloc procps-ng wget which tree dnf-plugins-core rpm-build \
sudo nano hostname hwloc procps-ng wget which tree dnf-plugins-core rpm-build \
cmake make gcc gcc-c++ gcc-gfortran openmpi pkgconf gcovr \
munge munge-devel \
mariadb-server mariadb-devel \
......@@ -11,28 +11,28 @@ RUN dnf upgrade -y && dnf install -y \
doxygen graphviz python python-pip
# recompile Slurm rpms enabling multiple-slurmd option
RUN dnf download --source slurm
RUN rpm -i slurm*.src.rpm
WORKDIR /root/rpmbuild/SPECS
RUN sed -i "s/--disable-multiple-slurmd/--enable-multiple-slurmd/" slurm.spec
RUN dnf builddep -y slurm.spec
RUN rpmbuild -bb slurm.spec
WORKDIR /root/rpmbuild/RPMS/x86_64
RUN dnf install -y slurm{,-libs,-devel,-perlapi,-slurm{ctld,d,dbd}}-$(ls slurm* | head -n 1 | cut -d - -f 2-)
WORKDIR /
RUN rm -rf slurm*.src.rpm /root/rpmbuild
RUN dnf download --source slurm && \
rpm -i slurm*.src.rpm && \
cd /root/rpmbuild/SPECS && \
sed -i "s/--disable-multiple-slurmd/--enable-multiple-slurmd/" slurm.spec && \
dnf builddep -y slurm.spec && \
rpmbuild -bb slurm.spec && \
cd /root/rpmbuild/RPMS/x86_64 && \
dnf install -y slurm{,-libs,-devel,-perlapi,-slurm{ctld,d,dbd}}-$(ls slurm* | head -n 1 | cut -d - -f 2-) && \
cd / && \
rm -rf slurm*.src.rpm /root/rpmbuild
ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh /usr/local/bin/
RUN chmod 755 /usr/local/bin/wait-for-it.sh
RUN useradd --system -c "Slurm Workload Manager" -s /sbin/nologin slurm && \
mkdir -p /var/{spool,run,log}/slurm && chown slurm /var/{spool,run,log}/slurm
RUN useradd -c "Jane Doe" -G users -m janedoe
RUN useradd -c "Cluster User 1" -G users -m --uid=2001 cu1
RUN useradd -c "Cluster User 2" -G users -m --uid=2002 cu2
RUN useradd -c "Cluster User 3" -G users -m --uid=2003 cu3
RUN useradd -c "Cluster User 4" -G users -m --uid=2004 cu4
RUN echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
useradd --system -c "Slurm Workload Manager" -s /sbin/nologin slurm && \
mkdir -p /var/{spool,run,log}/slurm && chown slurm /var/{spool,run,log}/slurm && \
useradd -c "Jane Doe" -G users,wheel -m janedoe && \
useradd -c "Cluster User 1" -G users -m --uid=2001 cu1 && \
useradd -c "Cluster User 2" -G users -m --uid=2002 cu2 && \
useradd -c "Cluster User 3" -G users -m --uid=2003 cu3 && \
useradd -c "Cluster User 4" -G users -m --uid=2004 cu4
COPY docker-entrypoint.sh /usr/local/bin/
......
......@@ -79,9 +79,9 @@ EOF
_slurm_accounting() {
{
sacctmgr -i add cluster sid
sacctmgr -i add account test Cluster=sid Description="test account" Organization="none"
sacctmgr -i add account users Cluster=sid Description="cluster users" Organization="none"
sacctmgr -i add user janedoe DefaultAccount=test
sacctmgr -i add account admins Cluster=sid Description="cluster admins" Organization="none"
sacctmgr -i add account users Cluster=sid Description="cluster users" Organization="none"
sacctmgr -i add user janedoe DefaultAccount=admins
sacctmgr -i add user cu1 DefaultAccount=users
sacctmgr -i add user cu2 DefaultAccount=users
sacctmgr -i add user cu3 DefaultAccount=users
......@@ -97,7 +97,7 @@ _main() {
_slurm_setup
_slurm_accounting
if [[ "${1:0:1}" = "-" ]]; then
if [[ "${1:0:1}" == "-" ]]; then
echo "Please pass a program name to the container!"
exit 1
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment