-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathslurm-single-node
80 lines (63 loc) · 2.87 KB
/
slurm-single-node
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
FROM ubuntu:22.04
ARG VERSION=${VERSION}
ENV VERSION=${VERSION}
RUN apt update && apt-get update && apt install sudo git gcc make ruby \
ruby-dev python3 libpam0g-dev libmysqlclient-dev mariadb-client \
mariadb-server wget vim curl -y
RUN gem install fpm
RUN apt-get install libmunge-dev libmunge2 munge -y && \
apt-get install libhdf5-serial-dev hdf5-tools -y && \
apt-get install cmake libhttp-parser-dev libyaml-dev libjson-c-dev \
autoconf automake autotools-dev libtool pkg-config libjansson-dev -y
RUN git clone --depth 1 --single-branch -b v1.12.0 https://github.com/benmcollins/libjwt.git libjwt
WORKDIR /libjwt
RUN autoreconf --force --install && \
./configure --prefix=/usr/ && \
make -j && \
make install
RUN useradd -m -u 1004 slurm && \
useradd slurmrestd
RUN echo $VERSION
RUN mkdir /storage
WORKDIR /storage
RUN wget https://download.schedmd.com/slurm/slurm-$VERSION.tar.bz2 && \
tar xvf slurm-$VERSION.tar.bz2 && \
cd slurm-$VERSION && \
./configure --prefix=/storage/slurm-build --sysconfdir=/etc/slurm --enable-pam \
--with-pam_dir=/lib/x86_64-linux-gnu/security/ --with-http-parser=/usr/ \
--with-yaml=/usr/ --with-jwt=/usr/ && \
make && \
make contrib && \
make install
WORKDIR /storage
RUN fpm -s dir -t deb -v 1.0 -n slurm-$VERSION --prefix=/usr -C /storage/slurm-build .
RUN dpkg -i slurm-${VERSION}_1.0_amd64.deb
# Make runtime and conf directories
RUN mkdir -p /etc/slurm /etc/slurm/prolog.d /etc/slurm/epilog.d /var/spool/slurm/ctld \
/var/spool/slurm/d /var/log/slurm /var/run/slurm
RUN chown slurm /var/spool/slurm/ctld /var/spool/slurm/d /var/log/slurm /var/run/slurm
# Generate slurm jwt key and set ownership/permissions
RUN dd if=/dev/random of=/etc/slurm/jwt_hs256.key bs=32 count=1
RUN chown slurm:slurm /etc/slurm/jwt_hs256.key
RUN chmod 600 /etc/slurm/jwt_hs256.key
# Get example files and copy to corresponding directories
RUN git clone https://github.com/mknoxnv/ubuntu-slurm.git
RUN cp ubuntu-slurm/slurmd.init /etc/init.d/slurmd
RUN cp ubuntu-slurm/slurm.default /etc/default/slurm
RUN chmod 755 /etc/init.d/slurmd
RUN cp ubuntu-slurm/slurmdbd.init /etc/init.d/slurmdbd
RUN chmod 755 /etc/init.d/slurmdbd
RUN cp ubuntu-slurm/slurmdbd.service /etc/systemd/system/
RUN cp ubuntu-slurm/slurmdbd.conf /etc/slurm/
RUN rm -rf ubuntu-slurm
COPY src/scripts/initialize-mariadb.sh initialize-mariadb.sh
COPY src/scripts/start-slurm-cluster.sh start-slurm-cluster.sh
COPY src/scripts/start-slurmrestd.sh start-slurmrestd.sh
COPY src/conf/single-node-slurm.conf /etc/slurm/slurm.conf
COPY src/conf/single-node-slurmdbd.conf /etc/slurm/slurmdbd.conf
# Set ownership/permissions for slurmudb (as of 20.11.8)
RUN chmod 600 /etc/slurm/slurmdbd.conf
RUN chown slurm:slurm /etc/slurm/slurmdbd.conf
RUN echo "/usr/lib/slurm" | sudo tee /etc/ld.so.conf && \
ldconfig
ENTRYPOINT sudo sh start-slurm-cluster.sh