Skip to content

Commit 73a359a

Browse files
committed
Common Base 21.03 (Python 3.6 & CUDA 11.1)
1 parent cce75b6 commit 73a359a

File tree

1 file changed

+98
-109
lines changed

1 file changed

+98
-109
lines changed

commons/Dockerfile.base.cuda11.1

Lines changed: 98 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
FROM nvidia/cuda:11.1-cudnn8-devel-ubuntu18.04
1+
2FROM nvidia/cuda:11.1-cudnn8-devel-ubuntu18.04
22

33
# TensorFlow version is tightly coupled to CUDA and cuDNN so it should be selected carefully
44
ARG CUDA=11.1
5-
ARG LIBNVINFER=7.2.2-1
5+
ARG LIBNVINFER=7.2.3-1
66
ARG LIBNVINFER_MAJOR_VERSION=7
77
ARG CUDNN=8.0.5.39-1
8-
ENV NCCL=2.8.3
9-
ENV NCCL_VERSION=2.8.3-1+cuda11.1
8+
ENV NCCL=2.8.4
9+
ENV NCCL_VERSION=2.8.4-1+cuda11.1
1010
ENV CUDNN_VERSION 8.0.5.43
1111
ENV MLNX_OFED_VERSION=5.1-2.3.7.1
1212
ENV MKL_VERSION=2020.3
1313
ENV MKL_BUILD=279
14-
ENV NUMPY_VERSION 1.19.4
15-
ENV SCIPY_VERSION 1.5.4
16-
ENV OPENMPI 4.0.5
17-
# Python 2.7 or 3.6 is supported by Ubuntu Bionic out of the box
14+
ENV NUMPY_VERSION 1.20.2
15+
ENV SCIPY_VERSION 1.6.2
16+
ENV OPENMPI 4.1.0
17+
# Python 3.6 is supported by Ubuntu Bionic out of the box
1818
ARG python=3.6
1919
ENV PYTHON_VERSION=${python}
2020

@@ -23,10 +23,10 @@ ENV DEBIAN_FRONTEND=noninteractive \
2323
CPLUS_INCLUDE_PATH=/usr/include/gdal \
2424
C_INCLUDE_PATH=/usr/include/gdal \
2525
PYTHONUNBUFFERED=1 \
26-
LIBRARY_PATH="/usr/local/cuda/lib64/stubs" \
26+
LIBRARY_PATH=/usr/local/cuda/lib64/stubs \
2727
_CUDA_COMPAT_PATH="/usr/local/cuda/compat" \
2828
LD_LIBRARY_PATH="/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/compat/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:/usr/include/x86_64-linux-gnu:/opt/intel/compilers_and_libraries_2020.3.279/linux/mkl/lib/intel64" \
29-
PATH="/usr/local/mpi/bin:/ur/local/ucx:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/bin/cmake/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/tensorrt/bin:/usr/local/src/lightgbm/LightGBM:/usr/local/bin/mecab" \
29+
PATH="/usr/local/mpi/bin:/usr/local/ucx:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/bin/cmake/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/tensorrt/bin:/usr/local/src/lightgbm/LightGBM:/usr/local/bin/mecab" \
3030
mecab_dicdir=/usr/local/lib/mecab/dic/mecab-ko-dic \
3131
LANG=C.UTF-8
3232

@@ -45,71 +45,79 @@ RUN rm -fr /var/lib/apt/lists/* && \
4545
wget https://apt.repos.intel.com/setup/intelproducts.list -O /etc/apt/sources.list.d/intelproducts.list && \
4646
apt-get update -y && \
4747
apt-get install -y --allow-downgrades --allow-change-held-packages --no-install-recommends \
48-
build-essential \
48+
bashtop \
4949
ca-certificates \
50-
gcc g++ make \
51-
gfortran \
50+
curl \
5251
dkms \
53-
git \
54-
vim \
55-
htop bashtop \
56-
yasm \
57-
wget zip unzip \
58-
openssh-client openssh-server \
59-
libssl-dev \
60-
libmpdec2 \
61-
pdsh curl net-tools \
52+
fonts-nanum \
53+
fonts-nanum-coding \
54+
fonts-nanum-extra \
55+
g++ \
56+
gfortran \
57+
htop \
58+
intel-mkl-2020.3-111 intel-ipp-2020.2-108 intel-tbb-2020.3-108 intel-daal-2020.2-108 intel-mpi-2019.8-108 \
6259
iputils-ping \
60+
libasound2-dev \
61+
libavcodec-dev \
62+
libboost-dev \
63+
libboost-filesystem-dev \
64+
libboost-system-dev \
65+
libcairo2-dev libgirepository1.0-dev pkg-config gir1.2-gtk-3.0 \
66+
libgdal-dev python3-gdal \
67+
libjasper-dev \
68+
libnuma-dev \
69+
libopenblas-dev liblapack-dev \
70+
libsm6 \
71+
libswscale-dev \
72+
libv4l-dev \
73+
libxext6 \
74+
libxine2-dev \
75+
libxml2-dev \
76+
libxrender-dev \
77+
libxslt1-dev \
78+
make \
79+
mime-support \
80+
net-tools \
81+
openssh-server \
82+
pdsh \
83+
proj-bin libproj-dev libgeos-dev libgeos++-dev graphviz \
84+
subversion \
85+
unzip \
86+
xvfb \
87+
xz-utils \
88+
yasm \
89+
zip \
90+
openssh-client \
91+
build-essential \
92+
gcc \
93+
git \
94+
libavformat-dev \
6395
libcurl3-dev \
6496
libfreetype6-dev \
97+
libgeos-dev libgeos++-dev \
6598
libhdf5-serial-dev \
66-
libzmq3-dev \
6799
libjpeg-dev \
100+
libmpdec2 \
68101
libpng-dev \
69-
libsm6 \
70-
libxext6 \
71-
libxrender-dev \
72-
libgdal-dev python3-gdal \
73102
libsdl-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev \
74103
libsmpeg-dev libportmidi-dev libavformat-dev libswscale-dev \
75-
libcairo2-dev libgirepository1.0-dev pkg-config gir1.2-gtk-3.0 \
76-
libgeos-dev libgeos++-dev \
104+
libssl-dev \
105+
libtiff-dev \
106+
libzmq3-dev \
77107
pkg-config \
78-
zlib1g-dev \
79-
mime-support \
80-
intel-mkl-2020.3-111 intel-ipp-2020.2-108 intel-tbb-2020.3-108 intel-daal-2020.2-108 intel-mpi-2019.8-108 \
81-
proj-bin libproj-dev libgeos-dev libgeos++-dev graphviz \
82108
python${PYTHON_VERSION} \
83109
python${PYTHON_VERSION}-dev \
84-
libxml2-dev \
85-
libxslt1-dev \
86-
libasound2-dev \
87-
libnuma-dev \
88-
libjasper-dev \
89-
libtiff-dev \
90-
libavcodec-dev \
91-
libavformat-dev \
92-
libswscale-dev \
93-
libxine2-dev \
94-
libv4l-dev \
95-
libboost-dev \
96-
libboost-system-dev \
97-
libboost-filesystem-dev \
98-
libopenblas-dev liblapack-dev \
99-
xvfb \
100-
xz-utils \
101-
fonts-nanum \
102-
fonts-nanum-coding \
103-
fonts-nanum-extra \
104-
&& \
110+
vim \
111+
wget \
112+
zlib1g-dev && \
105113
echo "/opt/intel/daal/lib/intel64" >> /etc/ls.so.conf && \
106114
echo "/opt/intel/ipp/lib/intel64" >> /etc/ls.so.conf && \
107115
echo "/opt/intel/lib/intel64" >> /etc/ls.so.conf && \
108116
echo "/opt/intel/mkl/lib/intel64" >> /etc/ls.so.conf && \
109117
find /usr/local/cuda-${CUDA}/lib64/ -type f -name 'lib*_static.a' -not -name 'libcudart_static.a' -delete
110118

111119
WORKDIR /tmp
112-
RUN curl -fsSL https://developer.download.nvidia.com/compute/redist/nccl/v2.8/nccl_2.8.3-1+cuda11.1_x86_64.txz -O && \
120+
RUN curl -fsSL https://developer.download.nvidia.com/compute/redist/nccl/v2.8/nccl_2.8.4-1+cuda11.1_x86_64.txz -O && \
113121
tar --no-same-owner --keep-old-files --lzma -xvf nccl_${NCCL}-1+cuda11.1_x86_64.txz -C /usr/local/cuda/lib64/ --strip-components=2 --wildcards '*/lib/libnccl.so.*' && \
114122
tar --no-same-owner --keep-old-files --lzma -xvf nccl_${NCCL}-1+cuda11.1_x86_64.txz -C /usr/lib/pkgconfig/ --strip-components=3 --wildcards '*/lib/pkgconfig/*' && \
115123
rm nccl_${NCCL}-1+cuda11.1_x86_64.txz && \
@@ -124,7 +132,7 @@ RUN ln -s /usr/local/cuda-11.1 /usr/local/cuda && \
124132
ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so.8.0.5 /usr/local/cuda/lib64/libcudnn.so && \
125133
ldconfig
126134

127-
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
135+
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
128136
apt-get update -y && \
129137
apt-get install -y nodejs
130138

@@ -161,6 +169,14 @@ RUN git clone https://github.com/Mellanox/nv_peer_memory.git /tmp/nv_peer_memory
161169
dpkg-buildpackage -us -uc && \
162170
dpkg -i /tmp/nvidia-peer-memory_1.1-0_all.deb
163171

172+
RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0-Linux-x86_64.sh \
173+
-q -O /tmp/cmake-install.sh && \
174+
chmod u+x /tmp/cmake-install.sh && \
175+
mkdir /usr/bin/cmake && \
176+
/tmp/cmake-install.sh --skip-license --prefix=/usr/bin/cmake && \
177+
rm /tmp/cmake-install.sh
178+
179+
# Oracle client
164180
RUN mkdir -p /opt/oracle && \
165181
cd /opt/oracle && \
166182
apt-get clean && \
@@ -179,26 +195,20 @@ RUN if [[ "${PYTHON_VERSION}" == "3.6" ]]; then \
179195
apt-get install -y python${PYTHON_VERSION}-distutils python-apt ; \
180196
fi
181197

182-
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 2
183-
184-
185-
198+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
186199

187200
WORKDIR /tmp
188201
RUN curl https://bootstrap.pypa.io/get-pip.py | python3 && \
189-
python3 -m pip install --no-cache-dir -U setuptools pip==20.3.2
190-
191-
RUN python3 -m pip install --no-cache-dir \
192-
Cython==0.29.21 \
193-
tornado==6.1 \
194-
nvidia-pyindex==1.0.5 \
195-
matplotlib==3.3.3
202+
python3 -m pip install --no-cache-dir -U setuptools pip && \
203+
python3 -m pip install --no-cache-dir cython pybind11
196204

197205
WORKDIR /tmp
206+
# OpenBlas
198207
RUN git clone -q --branch=master git://github.com/xianyi/OpenBLAS.git && \
199208
cd OpenBLAS && \
200209
make DYNAMIC_ARCH=1 NO_AFFINITY=1 NUM_THREADS=48 FC=gfortran && \
201210
make install
211+
# Numpy
202212
RUN git clone --branch=v${NUMPY_VERSION} --depth=1 https://github.com/numpy/numpy.git numpy && \
203213
cd numpy && \
204214
git checkout -b v${NUMPY_VERSION} && \
@@ -210,7 +220,7 @@ RUN git clone --branch=v${NUMPY_VERSION} --depth=1 https://github.com/numpy/nump
210220
echo "lapack_libs =" >> site.cfg && \
211221
python3 setup.py bdist_wheel -d /tmp
212222

213-
# Install scipy
223+
# Scipy
214224
RUN cd /tmp && \
215225
git clone --branch=v${SCIPY_VERSION} --depth=1 https://github.com/scipy/scipy.git scipy && \
216226
cd scipy && \
@@ -221,12 +231,12 @@ RUN cd /tmp && \
221231
echo "library_dirs = /opt/intel/compilers_and_libraries_2020.3.279/linux/mkl/lib/intel64" >> site.cfg && \
222232
echo "mkl_libs = mkl_rt" >> site.cfg && \
223233
echo "lapack_libs =" >> site.cfg && \
224-
python3 -m pip install -U --no-cache-dir /tmp/numpy-1.19.4-cp36-cp36m-linux_x86_64.whl && \
234+
python3 -m pip install -U --no-cache-dir /tmp/numpy-*.whl && \
225235
python3 setup.py install
226236
RUN cd /tmp && \
227237
git clone --recursive https://github.com/bodono/scs-python.git && \
228238
cd scs-python && \
229-
python setup.py install --scs --gpu
239+
python3 setup.py install --scs --gpu
230240

231241
# install NLP packages *mecab-ko & khai*
232242
RUN apt-get update && \
@@ -257,15 +267,10 @@ RUN echo "Install mecab-ko-dic" && \
257267
git clone https://bitbucket.org/eunjeon/mecab-python-0.996.git && \
258268
python3 -m pip install /tmp/mecab-python-0.996
259269

260-
RUN python3 -m pip install pip --no-cache-dir \
261-
Cartopy==0.18.0 \
262-
nvidia-dlprof \
263-
notebook==6.0.3
264-
265270
WORKDIR /tmp
266-
COPY ./requirements.txt /tmp
267-
RUN python3 -m pip install --no-cache-dir -r requirements.txt && \
268-
rm -f /tmp/requirements.txt
271+
COPY ./requirements.py38.txt /tmp
272+
RUN python3 -m pip install --no-cache-dir -r requirements.py38.txt && \
273+
rm -f /tmp/*.whl /tmp/requirements.py38.txt
269274

270275
# OpenCV
271276
RUN ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h && \
@@ -296,13 +301,6 @@ RUN ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h && \
296301
apt-get clean && \
297302
rm -rf /var/lib/apt/lists/
298303

299-
RUN wget https://github.com/Kitware/CMake/releases/download/v3.19.2/cmake-3.19.2-Linux-x86_64.sh \
300-
-q -O /tmp/cmake-install.sh && \
301-
chmod u+x /tmp/cmake-install.sh && \
302-
mkdir /usr/bin/cmake && \
303-
/tmp/cmake-install.sh --skip-license --prefix=/usr/bin/cmake && \
304-
rm /tmp/cmake-install.sh
305-
306304
WORKDIR /tmp
307305
ENV OPENCV_VERSION="4.5.1"
308306
RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
@@ -360,9 +358,9 @@ RUN cd /usr/local/src && mkdir lightgbm && cd lightgbm && \
360358

361359
# Install Open UCX
362360
WORKDIR /tmp
363-
RUN wget https://github.com/openucx/ucx/archive/v1.9.0.tar.gz && \
364-
tar xvf v1.9.0.tar.gz && \
365-
cd ucx-1.9.0 && \
361+
RUN wget https://github.com/openucx/ucx/archive/v1.10.0.tar.gz && \
362+
tar xvf v1.10.0.tar.gz && \
363+
cd ucx-1.10.0 && \
366364
bash ./autogen.sh && \
367365
mkdir build && \
368366
cd build && \
@@ -373,7 +371,7 @@ RUN wget https://github.com/openucx/ucx/archive/v1.9.0.tar.gz && \
373371
# Install Open MPI
374372
RUN mkdir /tmp/openmpi && \
375373
cd /tmp/openmpi && \
376-
wget https://www.open-mpi.org/software/ompi/v4.0/downloads/openmpi-${OPENMPI}.tar.gz && \
374+
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-${OPENMPI}.tar.gz && \
377375
tar zxf openmpi-${OPENMPI}.tar.gz && \
378376
cd openmpi-${OPENMPI} && \
379377
./configure --enable-orterun-prefix-by-default --with-cuda --with-ucx=/usr/local/ucx --enable-mca-no-build=btl-uct && \
@@ -383,11 +381,10 @@ RUN mkdir /tmp/openmpi && \
383381
rm -rf /tmp/openmpi*
384382

385383
# Install OpenSSH for MPI to communicate between containers
386-
RUN apt-get install -y --no-install-recommends openssh-client openssh-server && \
387-
mkdir -p /var/run/sshd
388384

389385
# Allow OpenSSH to talk to containers without asking for confirmation
390-
RUN cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new && \
386+
RUN mkdir -p /var/run/sshd && \
387+
cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new && \
391388
echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new && \
392389
mv /etc/ssh/ssh_config.new /etc/ssh/ssh_config
393390

@@ -400,27 +397,20 @@ RUN mv /usr/local/bin/mpirun /usr/local/bin/mpirun.real && \
400397
# Configure OpenMPI to run good defaults:
401398
RUN echo "btl_tcp_if_exclude = lo,docker0" >> /usr/local/etc/openmpi-mca-params.conf
402399

403-
# Install OpenSSH for MPI to communicate between containers
404-
RUN mkdir -p /var/run/sshd
405-
406-
# Allow OpenSSH to talk to containers without asking for confirmation
407-
RUN cat /etc/ssh/ssh_config | grep -v StrictHostKeyChecking > /etc/ssh/ssh_config.new && \
408-
echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config.new && \
409-
mv /etc/ssh/ssh_config.new /etc/ssh/ssh_config
410-
411-
# install git-lfs
400+
# Install git-lfs
412401
WORKDIR /tmp
413-
RUN curl -sLO https://github.com/git-lfs/git-lfs/releases/download/v2.13.1/git-lfs-linux-amd64-v2.13.1.tar.gz && \
414-
tar -zxf git-lfs-linux-amd64-v2.13.1.tar.gz && \
402+
RUN curl -sLO https://github.com/git-lfs/git-lfs/releases/download/v2.13.3/git-lfs-linux-amd64-v2.13.3.tar.gz && \
403+
tar -zxf git-lfs-linux-amd64-v2.13.3.tar.gz && \
415404
bash install.sh && \
416405
rm -rf /tmp/*
417406

418-
COPY ./service-defs /etc/backend.ai/service-defs
419-
RUN curl -fL https://github.com/cdr/code-server/releases/download/v3.8.0/code-server-3.8.0-linux-amd64.tar.gz \
407+
# Install VSCode
408+
RUN curl -fL https://github.com/cdr/code-server/releases/download/v3.9.2/code-server-3.9.2-linux-amd64.tar.gz \
420409
| tar -C /usr/local/lib -xz && \
421-
mv /usr/local/lib/code-server-3.8.0-linux-amd64 /usr/local/lib/code-server-3.8.0 && \
422-
ln -s /usr/local/lib/code-server-3.8.0/bin/code-server /usr/local/bin/code-server
410+
mv /usr/local/lib/code-server-3.9.2-linux-amd64 /usr/local/lib/code-server-3.9.2 && \
411+
ln -s /usr/local/lib/code-server-3.9.2/bin/code-server /usr/local/bin/code-server
423412

413+
# Install Jupyterlab extensions
424414
RUN jupyter nbextensions_configurator enable && \
425415
jupyter contrib nbextension install && \
426416
jupyter nbextension enable --py --sys-prefix widgetsnbextension && \
@@ -429,18 +419,17 @@ RUN jupyter nbextensions_configurator enable && \
429419
jupyter labextension install --no-build @krassowski/jupyterlab-lsp && \
430420
jupyter serverextension enable --py jupyter_lsp && \
431421
jupyter labextension install --no-build @jupyterlab/toc && \
432-
# jupyter labextension install @jupyterlab/hdf5
433422
jupyter nbextension enable execute_time/ExecuteTime && \
434423
jupyter nbextension enable toc2/main && \
435424
jupyter labextension install @pyviz/jupyterlab_pyviz && \
436425
jupyter labextension install @bokeh/jupyter_bokeh && \
437426
jupyter labextension install --no-build jupyterlab-nvdashboard && \
438427
jupyter lab build
439428

429+
# Clean up
440430
RUN apt autoclean && \
441431
ln -s /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcusolver.so.11 /usr/local/cuda-11.1/targets/x86_64-linux/lib/libcusolver.so.10 && \
442432
sed -i 's/source \/usr\/local\/nvm\/nvm.sh//' /etc/bash.bashrc && \
443-
python3 -m pip uninstall -y tensorboard-plugin-wit && \
444433
rm -rf /var/lib/apt/lists/* && \
445434
rm -rf /root/.cache && \
446435
rm -rf /tmp/*

0 commit comments

Comments
 (0)