forked from DataWorkflowServices/slurm-docker-cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
127 lines (109 loc) · 4.1 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
FROM rockylinux:8 AS base
LABEL org.opencontainers.image.source="https://github.com/giovtorres/slurm-docker-cluster" \
org.opencontainers.image.title="slurm-docker-cluster" \
org.opencontainers.image.description="Slurm Docker cluster on Rocky Linux 8" \
org.label-schema.docker.cmd="docker-compose up -d" \
maintainer="Giovanni Torres"
ARG SLURM_TAG=slurm-23-02-7-1
ARG GOSU_VERSION=1.11
ARG TARGETARCH
ARG TARGETOS
RUN sed -i 's/^mirrorlist/#mirrorlist/g' /etc/yum.repos.d/Rocky-* && \
sed -i 's|^#baseurl=|baseurl=|' /etc/yum.repos.d/Rocky-*
RUN set -ex \
&& yum makecache \
&& yum -y update \
&& yum -y install dnf-plugins-core \
&& yum config-manager --set-enabled powertools \
&& yum -y install \
lua-devel \
cmake \
wget \
bzip2 \
perl \
gcc \
gcc-c++\
git \
gnupg \
make \
munge \
munge-devel \
python3-devel \
python3-pip \
python3 \
mariadb-server \
mariadb-devel \
psmisc \
bash-completion \
vim-enhanced \
&& yum clean all \
&& rm -rf /var/cache/yum \
&& ln -s /usr/lib64/pkgconfig/lua.pc /usr/lib64/pkgconfig/lua-5.3.pc
RUN alternatives --set python /usr/bin/python3
RUN pip3 install Cython nose
RUN set -ex \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-${TARGETARCH}"
RUN chmod +x /usr/local/bin/gosu \
&& gosu nobody true
RUN set -x \
&& git clone --depth 1 --single-branch -b json-c-0.15-20200726 https://github.com/json-c/json-c.git json-c \
&& mkdir json-c-build \
&& cd json-c-build \
&& cmake ../json-c \
&& make \
&& make install \
&& cd .. && rm -rf json-c json-c-build \
&& echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf \
&& echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local.conf \
&& ldconfig
FROM base AS configurator
RUN set -x \
&& git clone -b ${SLURM_TAG} --single-branch --depth=1 https://github.com/SchedMD/slurm.git \
&& pushd slurm \
&& ./configure --enable-debug --prefix=/usr --sysconfdir=/etc/slurm \
--with-mysql_config=/usr/bin --libdir=/usr/lib64 --with-json=/usr/local
FROM configurator AS builder
RUN set -x \
&& pushd slurm \
&& export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig/:$PKG_CONFIG_PATH \
&& make 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 -m644 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 \
&& popd \
&& rm -rf slurm
RUN set -x \
&& groupadd -r --gid=990 slurm \
&& useradd -r -g slurm --uid=990 slurm \
&& mkdir /etc/sysconfig/slurm \
/var/spool/slurmd \
/var/run/slurmd \
/var/run/slurmdbd \
/var/lib/slurmd \
/var/log/slurm \
/jobs \
&& touch /var/lib/slurmd/node_state \
/var/lib/slurmd/front_end_state \
/var/lib/slurmd/job_state \
/var/lib/slurmd/resv_state \
/var/lib/slurmd/trigger_state \
/var/lib/slurmd/assoc_mgr_state \
/var/lib/slurmd/assoc_usage \
/var/lib/slurmd/qos_usage \
/var/lib/slurmd/fed_mgr_state \
/var/log/slurmctld.log \
&& chown -R slurm:slurm /var/*/slurm* /jobs \
&& /sbin/create-munge-key \
&& curl -k -LO "https://dl.k8s.io/release/$(curl -k -L -s https://dl.k8s.io/release/stable.txt)/bin/${TARGETOS}/${TARGETARCH}/kubectl" \
&& install -o slurm -g slurm -m 0755 kubectl /usr/local/bin/kubectl
COPY cgroup.conf /etc/slurm/cgroup.conf
COPY slurm.conf /etc/slurm/slurm.conf
RUN echo "BurstBufferType=burst_buffer/lua" >> /etc/slurm/slurm.conf
COPY slurmdbd.conf /etc/slurm/slurmdbd.conf
RUN set -x \
&& chown slurm:slurm /etc/slurm/slurmdbd.conf \
&& chmod 600 /etc/slurm/slurmdbd.conf
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["slurmdbd"]