forked from giovtorres/slurm-docker-cluster
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
149 lines (135 loc) · 5.56 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
FROM ubuntu:17.10
LABEL org.label-schema.vcs-url="https://github.com/giovtorres/slurm-docker-cluster" \
org.label-schema.docker.cmd="docker-compose up -d" \
org.label-schema.name="slurm-docker-cluster" \
org.label-schema.description="Slurm Docker cluster on CentOS 7" \
maintainer="Giovanni Torres"
ARG SLURM_VERSION=17.11.5
ARG SLURM_DOWNLOAD_MD5=21fbe051aee43689dcd7711e47064f89
ARG SLURM_DOWNLOAD_URL=https://download.schedmd.com/slurm/slurm-"$SLURM_VERSION".tar.bz2
ARG GOSU_VERSION=1.10
RUN apt-get update \
&& apt-get -y install \
wget \
bzip2 \
perl \
build-essential \
vim \
git \
make \
munge \
libmunge2 \
libmunge-dev \
libmariadbd-dev \
libmariadb-client-lgpl-dev \
libpam-dev \
libnuma-dev \
libjson-c-dev \
h5utils \
openssl \
python-dev \
python-pip \
python3 \
python3-dev \
python3-pip \
mariadb-server \
psmisc \
bash-completion \
nscd \
openssh-server \
distcc \
&& apt-get clean \
&& rm -rf /var/cache/apt
RUN DEBIAN_FRONTEND=noninteractive apt-get -y -q install nslcd
RUN pip3 install --upgrade pip
RUN pip install --upgrade pip
RUN pip install Cython nose \
&& pip3 install Cython nose
RUN set -x \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-amd64" \
# && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-amd64" \
# && export GNUPGHOME="$(mktemp -d)" \
# && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
# && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
# && rm -rf $GNUPGHOME /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true
RUN groupadd -r slurm --gid=995 && useradd -r -g slurm --uid=995 slurm
RUN set -x \
&& wget -O slurm.tar.bz2 "$SLURM_DOWNLOAD_URL" \
&& echo "$SLURM_DOWNLOAD_MD5" slurm.tar.bz2 | md5sum -c - \
&& mkdir -p /usr/local/src/slurm \
&& tar jxf slurm.tar.bz2 -C /usr/local/src/slurm --strip-components=1 \
&& rm slurm.tar.bz2 \
&& cd /usr/local/src/slurm \
&& ./configure --enable-debug --prefix=/usr --sysconfdir=/etc/slurm \
--with-mysql_config=/usr/bin --libdir=/usr/lib64 \
&& 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/slurm.epilog.clean /etc/slurm/slurm.epilog.clean \
&& 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 \
&& cd \
&& rm -rf /usr/local/src/slurm \
&& mkdir -p /etc/slurm \
/var/spool/slurmd \
/var/run/slurmd \
/var/run/slurmdbd \
/var/run/sshd \
/var/lib/slurmd \
/var/log/slurm \
/data \
&& 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 \
&& chown -R slurm:slurm /var/*/slurm* \
&& /usr/sbin/create-munge-key \
&& mkdir -p /var/run/munge \
&& chown munge: /var/run/munge
# Install Nvidia CUDA
RUN apt-get update && apt-get install -y dirmngr
RUN wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.1.85-1_amd64.deb \
&& dpkg -i cuda-repo-ubuntu1604_9.1.85-1_amd64.deb \
&& apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
RUN apt-get -y update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install cuda \
&& rm cuda-repo-ubuntu1604_9.1.85-1_amd64.deb
# End Nvidia CUDA
# Install Pytorch + tensorflow
RUN apt-get -y install cuda-command-line-tools-9.1 python3-dev python-dev python3-virtualenv python-virtualenv
RUN pip3 install http://download.pytorch.org/whl/cu91/torch-0.3.1-cp36-cp36m-linux_x86_64.whl \
&& pip3 install torchvision && pip install torchvision
RUN pip3 install numpy \
&& pip install numpy
RUN pip3 install tensorflow tensorflow-gpu \
&& pip install tensorflow tensorflow-gpu
RUN pip3 install sklearn scipy pandas \
&& pip install sklearn scipy pandas
# End Pytorch + tensorflow
COPY slurm.conf /etc/slurm/slurm.conf
COPY slurmdbd.conf /etc/slurm/slurmdbd.conf
COPY nslcd.conf /etc/nslcd.conf
COPY nscd.conf /etc/nscd.conf
COPY nsswitch.conf /etc/nsswitch.conf
COPY sshd_config /etc/ssh/sshd_config
COPY pam.d /etc/pam.d
COPY mysql_password.txt /root/mysql_password.txt
# init system
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64
RUN chmod +x /usr/local/bin/dumb-init
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["/usr/local/bin/dumb-init", "--", "/usr/local/bin/docker-entrypoint.sh"]
#CMD ["bash", "-c", "/usr/local/bin/docker-entrypoint.sh slurmdbd"]
CMD ["slurmdbd"]
#ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
# add new packages here
RUN apt-get update && apt-get -y install curl golang-go cargo rustc tmux \
zsh tcsh sl lolcat cowsay neovim python3-neovim
RUN chown -R 106:106 /etc/munge/