-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
87 lines (77 loc) · 2.76 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
FROM python:3.7
ARG DEBIAN_FRONTEND=noninteractive
ARG DEBCONF_NOWARNINGS="yes"
ENV PATH "/root/.pyenv/shims:/root/.pyenv/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin"
RUN apt-get update \
&& apt-get install -y --no-install-recommends --assume-yes apt-utils \
&& apt-get install -y --no-install-recommends --assume-yes \
aptitude \
build-essential \
sudo \
gcc \
munge \
libmunge-dev \
libboost-all-dev \
libmunge2 \
software-properties-common \
default-mysql-server \
default-mysql-client \
default-libmysqlclient-dev \
mariadb-server \
mailutils \
unzip \
libmariadbd-dev \
supervisor \
nano \
less \
&& apt-get clean
# Install Slurm
# Compile, build and install Slurm from Git source
ARG SLURM_TAG=slurm-22-05-2-1
RUN git config --global advice.detachedHead false
WORKDIR /workspace
RUN git clone -b ${SLURM_TAG} --single-branch --depth 1 https://github.com/SchedMD/slurm.git \
&& cd slurm \
&& ./configure --prefix=/usr --sysconfdir=/etc/slurm --with-mysql_config=/usr/bin --libdir=/usr/lib64 --with-hdf5=no --enable-debug --enable-multiple-slurmd \
&& make \
&& make -j 4 install \
&& install -D -m644 etc/cgroup.conf.example /etc/slurm/cgroup.conf.example \
&& install -D -m644 etc/slurm.conf.example /etc/slurm/slurm.conf.example \
&& install -D -m600 etc/slurmdbd.conf.example /etc/slurm/slurmdbd.conf.example \
&& install -D -m644 contribs/slurm_completion_help/slurm_completion.sh /etc/profile.d/slurm_completion.sh \
&& cd .. \
&& rm -rf slurm \
&& slurmctld -V \
&& groupadd -r slurm \
&& useradd -r -g slurm slurm \
&& mkdir -p /etc/sysconfig/slurm \
/var/spool/slurmd \
/var/spool/slurmctld \
/var/log/slurm \
/var/run/slurm \
&& chown -R slurm:slurm /var/spool/slurmd \
/var/spool/slurmctld \
/var/log/slurm \
/var/run/slurm
VOLUME ["/var/lib/mysql", "/var/lib/slurmd", "/var/spool/slurm", "/var/log/slurm", "/run/munge"]
COPY --chown=slurm files/create-munge-key /sbin/
RUN /sbin/create-munge-key \
&& chown munge:munge -R /run/munge
WORKDIR /var/log/slurm
WORKDIR /var/run/supervisor
COPY files/supervisord.conf /etc/
# mark externally mounted volumes
COPY --chown=slurm files/slurm.conf /etc/slurm/slurm.conf
COPY --chown=slurm files/slurmdbd.conf /etc/slurm/slurmdbd.conf
RUN chmod 0600 /etc/slurm/slurmdbd.conf
## finally
RUN echo "alias ls='ls -h --color=always -v --author --time-style=long-iso'" >> ~/.bashrc \
&& du -sh / 2>&1 | grep -v "cannot"
EXPOSE 6817 6818 6819 6820 3306 6011 6012
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
# define command at startup
ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--", "/usr/local/bin/docker-entrypoint.sh"]
WORKDIR /
CMD ["/bin/bash"]