Skip to content

Commit 10b78cd

Browse files
committed
NGC 20.11 TF2
1 parent c832483 commit 10b78cd

File tree

1 file changed

+80
-58
lines changed

1 file changed

+80
-58
lines changed

vendor/ngc-tensorflow/Dockerfile.20.11-tf2-py3

Lines changed: 80 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,38 @@ FROM nvcr.io/nvidia/tensorflow:20.11-tf2-py3
22
# NVIDIA DIGITS runs on Python 3.6
33

44
RUN apt-get update && \
5-
apt-get install -y libsm6 libxext6 libxrender-dev mercurial libgdal-dev python3-gdal \
6-
libsdl-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev \
7-
libsmpeg-dev libportmidi-dev libavformat-dev libswscale-dev
5+
apt-get install -y --no-install-recommends \
6+
fonts-nanum \
7+
fonts-nanum-coding \
8+
fonts-nanum-extra \
9+
htop \
10+
ncurses-term \
11+
libasound2-dev \
12+
libsm6 libxext6 libxrender-dev mercurial libgdal-dev python3-gdal \
13+
libsdl-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev \
14+
libsmpeg-dev libportmidi-dev libavformat-dev libswscale-dev
815

9-
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal
10-
ENV C_INCLUDE_PATH=/usr/include/gdal
1116
ENV DEBIAN_FRONTEND=noninteractive \
1217
MPLBACKEND=Svg \
18+
PIP_IGNORE_INSTALLED=0 \
1319
PYTHONUNBUFFERED=1 \
20+
CPLUS_INCLUDE_PATH=/usr/include/gdal \
21+
C_INCLUDE_PATH=/usr/include/gdal \
1422
LD_LIBRARY_PATH="/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/local/nvidia/lib64:/usr/include/x86_64-linux-gnu" \
1523
PATH="/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/bin/cmake/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/src/lightgbm/LightGBM:/usr/local/bin/mecab" \
1624
mecab_dicdir=/usr/local/lib/mecab/dic/mecab-ko-dic \
25+
NODE_OPTIONS="--max-old-space-size=4096" \
1726
LANG=C.UTF-8
1827

1928
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 2
2029

2130
# install NLP packages *mecab-ko & khai*
2231
RUN apt-get update && \
2332
apt-get install -y \
33+
automake \
34+
gfortran \
35+
libasound2-dev \
2436
openjdk-8-jdk \
25-
libasound2-dev \
26-
gfortran \
27-
automake \
2837
&& \
2938
cd /tmp && \
3039
curl -LO https://bitbucket.org/eunjeon/mecab-ko/downloads/mecab-0.996-ko-0.9.2.tar.gz && \
@@ -53,34 +62,31 @@ RUN echo "Install mecab-ko-dic" && \
5362
# OpenCV
5463
RUN ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h && \
5564
apt-get install -y \
56-
libgstreamer1.0-dev \
57-
libgstreamer-plugins-base1.0-dev \
58-
libgtk-3-dev \
65+
libgstreamer1.0-dev \
66+
libgstreamer-plugins-base1.0-dev \
67+
libgtk-3-dev \
5968
libtbb-dev \
60-
libatlas-base-dev \
61-
libdc1394-22-dev \
62-
libxvidcore-dev \
63-
libfaac-dev \
64-
libmp3lame-dev \
65-
libtheora-dev \
66-
libvorbis-dev \
67-
libxvidcore-dev \
68-
libopencore-amrnb-dev libopencore-amrwb-dev \
69-
libavresample-dev \
70-
x264 \
71-
libx264-dev \
72-
v4l-utils \
73-
libprotobuf-dev protobuf-compiler \
74-
libgoogle-glog-dev libgflags-dev \
75-
libgphoto2-dev \
76-
libeigen3-dev \
77-
libhdf5-dev \
78-
&& \
79-
apt-get clean && \
80-
rm -rf /var/lib/apt/lists/
69+
libatlas-base-dev \
70+
libdc1394-22-dev \
71+
libxvidcore-dev \
72+
libfaac-dev \
73+
libmp3lame-dev \
74+
libtheora-dev \
75+
libvorbis-dev \
76+
libxvidcore-dev \
77+
libopencore-amrnb-dev libopencore-amrwb-dev \
78+
libavresample-dev \
79+
x264 \
80+
libx264-dev \
81+
v4l-utils \
82+
libprotobuf-dev protobuf-compiler \
83+
libgoogle-glog-dev libgflags-dev \
84+
libgphoto2-dev \
85+
libeigen3-dev \
86+
libhdf5-dev
8187

8288
WORKDIR /tmp
83-
ENV OPENCV_VERSION="4.5.1"
89+
ENV OPENCV_VERSION="4.5.2"
8490
RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
8591
wget -O opencv-contrib.zip https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip && \
8692
unzip ${OPENCV_VERSION}.zip && \
@@ -105,7 +111,7 @@ RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
105111
-D WITH_V4L=ON \
106112
-D BUILD_TESTS=OFF \
107113
-D BUILD_PERF_TESTS=OFF \
108-
-D OPENCV_EXTRA_MODULES_PATH="../../opencv_contrib-4.5.1/modules" \
114+
-D OPENCV_EXTRA_MODULES_PATH="../../opencv_contrib-4.5.2/modules" \
109115
-D CMAKE_BUILD_TYPE=RELEASE \
110116
-D CMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") \
111117
-D PYTHON_EXECUTABLE=$(which python3) \
@@ -119,7 +125,7 @@ RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
119125
rm -fr opencv*
120126

121127

122-
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
128+
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
123129
apt-get update -y && \
124130
apt-get install -y nodejs
125131

@@ -145,6 +151,25 @@ RUN mkdir -p /opt/oracle && \
145151
echo /opt/oracle/instantclient* > /etc/ld.so.conf.d/oracle-instantclient.conf && \
146152
ldconfig
147153

154+
155+
# install bashtop
156+
WORKDIR /tmp
157+
RUN git clone https://github.com/aristocratos/bashtop.git && \
158+
cd bashtop && \
159+
make install
160+
161+
# install git-lfs
162+
WORKDIR /tmp
163+
RUN curl -sLO https://github.com/git-lfs/git-lfs/releases/download/v2.12.1/git-lfs-linux-amd64-v2.12.1.tar.gz && \
164+
tar -zxf git-lfs-linux-amd64-v2.12.1.tar.gz && \
165+
bash install.sh && \
166+
rm -rf /tmp/*
167+
168+
# install code-server
169+
RUN curl -fL https://github.com/cdr/code-server/releases/download/v3.9.0/code-server-3.9.0-linux-amd64.tar.gz | tar -C /usr/local/lib -xz && \
170+
mv /usr/local/lib/code-server-3.9.0-linux-amd64 /usr/local/lib/code-server-3.9.0 && \
171+
ln -s /usr/local/lib/code-server-3.9.0/bin/code-server /usr/local/bin/code-server
172+
148173
WORKDIR /tmp
149174
RUN python3 -m pip install --no-cache-dir \
150175
Cython==0.29.21 \
@@ -163,18 +188,6 @@ RUN cd /tmp && \
163188
pip uninstall -y typing && \
164189
python3 -m pip install .
165190

166-
167-
# install git-lfs
168-
WORKDIR /tmp
169-
RUN curl -sLO https://github.com/git-lfs/git-lfs/releases/download/v2.12.1/git-lfs-linux-amd64-v2.12.1.tar.gz && \
170-
tar -zxf git-lfs-linux-amd64-v2.12.1.tar.gz && \
171-
bash install.sh && \
172-
rm -rf /tmp/*
173-
174-
COPY ./service-defs /etc/backend.ai/service-defs
175-
RUN curl -fL https://github.com/cdr/code-server/releases/download/v3.7.3/code-server-3.7.3-linux-amd64.tar.gz | tar -C /usr/local/lib -xz && \
176-
mv /usr/local/lib/code-server-3.7.3-linux-amd64 /usr/local/lib/code-server-3.7.3 && \
177-
ln -s /usr/local/lib/code-server-3.7.3/bin/code-server /usr/local/bin/code-server
178191
# Install Open MPI
179192
RUN mkdir /tmp/openmpi && \
180193
cd /tmp/openmpi && \
@@ -192,28 +205,35 @@ RUN mv /usr/local/bin/mpirun /usr/local/bin/mpirun.real && \
192205
echo 'mpirun.real --allow-run-as-root "$@"' >> /usr/local/bin/mpirun && \
193206
chmod a+x /usr/local/bin/mpirun
194207

208+
RUN python3 -m pip install --no-cache-dir \
209+
mpi4py==3.0.3 \
210+
nni==2.0 \
211+
mlflow==1.14.1 \
212+
scikit-nni==0.2.1
213+
195214
# Configure OpenMPI to run good defaults:
196215
RUN echo "btl_tcp_if_exclude = lo,docker0" >> /usr/local/etc/openmpi-mca-params.conf
197216

198-
ENV NODE_OPTIONS="--max-old-space-size=4096"
199-
200217
RUN jupyter nbextensions_configurator enable && \
201218
jupyter contrib nbextension install && \
202219
jupyter nbextension enable --py --sys-prefix widgetsnbextension && \
203-
jupyter serverextension enable --py jupyterlab --sys-prefix && \
204-
jupyter labextension install --no-build @jupyter-widgets/jupyterlab-manager && \
205-
jupyter labextension install --no-build @krassowski/jupyterlab-lsp && \
206-
jupyter serverextension enable --py jupyter_lsp && \
207-
jupyter labextension install --no-build @jupyterlab/toc && \
208220
jupyter nbextension enable execute_time/ExecuteTime && \
209221
jupyter nbextension enable toc2/main && \
210-
jupyter labextension install @pyviz/jupyterlab_pyviz && \
211-
jupyter labextension install @bokeh/jupyter_bokeh && \
212-
jupyter labextension install --no-build jupyterlab-nvdashboard && \
222+
jupyter serverextension enable --py jupyterlab --sys-prefix && \
223+
jupyter serverextension enable --py jupyter_lsp && \
224+
jupyter labextension install @jupyter-widgets/jupyterlab-manager --no-build && \
225+
jupyter labextension install [email protected] --no-build && \
226+
jupyter labextension install @jupyterlab/toc --no-build && \
227+
jupyter labextension install @kiteco/jupyterlab-kite --no-build && \
228+
jupyter labextension install jupyterlab-flake8 --no-build && \
229+
jupyter labextension install @pyviz/jupyterlab_pyviz --no-build && \
230+
jupyter labextension install @bokeh/jupyter_bokeh --no-build && \
231+
jupyter labextension install jupyterlab-nvdashboard --no-build && \
213232
jupyter lab build
214233

215234
RUN apt autoclean && \
216235
sed -i 's/source \/usr\/local\/nvm\/nvm.sh//' /etc/bash.bashrc && \
236+
ln -sf /usr/share/terminfo/x/xterm-color /usr/share/terminfo/x/xterm-256color && \
217237
rm -rf /var/lib/apt/lists/* && \
218238
rm -rf /root/.cache && \
219239
rm -rf /tmp/*
@@ -223,6 +243,8 @@ RUN /usr/bin/python3 -m ipykernel install --display-name "Python 3.6 (NGC 20.11
223243
cat /usr/local/share/jupyter/kernels/python3/kernel.json
224244

225245
# Backend.AI specifics
246+
COPY ./service-defs /etc/backend.ai/service-defs
247+
COPY runner-scripts/bootstrap.sh runner-scripts/setup_multinode.py /opt/container/
226248
LABEL ai.backend.kernelspec="1" \
227249
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
228250
ai.backend.features="batch query uid-match user-input" \
@@ -235,7 +257,7 @@ LABEL ai.backend.kernelspec="1" \
235257
ai.backend.base-distro="ubuntu16.04" \
236258
ai.backend.runtime-type="python" \
237259
ai.backend.runtime-path="/usr/bin/python" \
238-
ai.backend.service-ports="ipython:pty:3000,jupyter:http:8080,jupyterlab:http:8090,vscode:http:8180,tensorboard:http:6006"
260+
ai.backend.service-ports="ipython:pty:3000,jupyter:http:8091,jupyterlab:http:8090,vscode:http:8180,tensorboard:http:6006,mlflow-ui:preopen:5000,nniboard:preopen:8080"
239261

240262
WORKDIR /home/work
241263
# vim: ft=dockerfile

0 commit comments

Comments
 (0)