1
1
FROM nvcr.io/nvidia/tensorflow:20.12-tf2-py3
2
- # NVIDIA DIGITS runs on Python 3.6
2
+ # NVIDIA DIGITS runs on Python 3.8
3
3
4
4
RUN apt-get update && \
5
- apt-get install -y libsm6 libxext6 libxrender-dev mercurial libopenblas-dev
5
+ apt-get install -y libsm6 libxext6 libxrender-dev
6
6
7
7
ENV DEBIAN_FRONTEND=noninteractive \
8
8
MPLBACKEND=Svg \
@@ -12,6 +12,12 @@ ENV DEBIAN_FRONTEND=noninteractive \
12
12
mecab_dicdir=/usr/local/lib/mecab/dic/mecab-ko-dic \
13
13
LANG=C.UTF-8
14
14
15
+ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 2
16
+
17
+ # WORKDIR /tmp
18
+ # RUN curl https://bootstrap.pypa.io/get-pip.py | python3 && \
19
+ # python3 -m pip install --no-cache-dir -U setuptools pip
20
+
15
21
# install NLP packages *mecab-ko & khai*
16
22
RUN apt-get update && \
17
23
apt-get install -y \
@@ -44,6 +50,7 @@ RUN echo "Install mecab-ko-dic" && \
44
50
git clone https://bitbucket.org/eunjeon/mecab-python-0.996.git && \
45
51
python3 -m pip install /tmp/mecab-python-0.996
46
52
53
+
47
54
# OpenCV
48
55
RUN ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h && \
49
56
apt-get install -y \
@@ -74,7 +81,7 @@ RUN ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h && \
74
81
rm -rf /var/lib/apt/lists/
75
82
76
83
WORKDIR /tmp
77
- ENV OPENCV_VERSION="4.5.0 "
84
+ ENV OPENCV_VERSION="4.5.1 "
78
85
RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
79
86
wget -O opencv-contrib.zip https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip && \
80
87
unzip ${OPENCV_VERSION}.zip && \
@@ -99,7 +106,7 @@ RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
99
106
-D WITH_V4L=ON \
100
107
-D BUILD_TESTS=OFF \
101
108
-D BUILD_PERF_TESTS=OFF \
102
- -D OPENCV_EXTRA_MODULES_PATH="../../opencv_contrib-4.5.0 /modules" \
109
+ -D OPENCV_EXTRA_MODULES_PATH="../../opencv_contrib-4.5.1 /modules" \
103
110
-D CMAKE_BUILD_TYPE=RELEASE \
104
111
-D CMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)" ) \
105
112
-D PYTHON_EXECUTABLE=$(which python3) \
@@ -112,46 +119,39 @@ RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
112
119
python3 -m pip install --no-cache-dir opencv-python && \
113
120
rm -fr opencv*
114
121
115
- RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 2
116
-
117
- WORKDIR /tmp
118
- RUN curl https://bootstrap.pypa.io/get-pip.py | python3 && \
119
- python3 -m pip install --no-cache-dir -U setuptools pip
120
122
121
123
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
122
124
apt-get update -y && \
123
125
apt-get install -y nodejs
124
126
125
127
WORKDIR /tmp
126
- RUN cd /tmp && \
127
- git clone --recursive https://github.com/bodono/scs-python.git && \
128
- cd scs-python && \
129
- python3 setup.py install --scs --gpu
128
+ RUN git clone -q --branch=v0.3.13 git://github.com/xianyi/OpenBLAS.git && \
129
+ cd OpenBLAS && \
130
+ make DYNAMIC_ARCH=1 NO_AFFINITY=1 NUM_THREADS=48 FC=gfortran && \
131
+ make install
132
+ RUN git clone --recursive https://github.com/bodono/scs-python.git && \
133
+ cd /tmp/scs-python && \
134
+ python setup.py install --scs --gpu
130
135
131
- ENV NUMPY_VERSION 1.19.4
132
- ENV SCIPY_VERSION 1.5.4
133
- RUN python3 -m pip install --no-cache-dir \
136
+ RUN python3 -m pip install --no-cache-dir \
137
+ argon2_cffi==20.1.0 \
134
138
Cython==0.29.21 \
135
139
tornado==6.0.4 \
136
140
pystan==2.19.1.1 \
137
141
pycairo==1.19.0 \
138
142
jupyter==1.0.0 \
139
- python-language-server[all] \
143
+ python-language-server[all] \
144
+ numpy==1.20.1 \
145
+ pandas==1.2.1 \
140
146
matplotlib==3.3.3
141
- RUN git clone --branch=v${NUMPY_VERSION} --depth=1 https://github.com/numpy/numpy.git numpy && \
142
- cd numpy && \
143
- git checkout -b v${NUMPY_VERSION} && \
144
- cp site.cfg.example site.cfg && \
145
- python3 setup.py bdist_wheel -d /tmp
146
-
147
+ ENV SCIPY_VERSION 1.6.0
147
148
# Install scipy
148
149
RUN cd /tmp && \
149
150
git clone --branch=v${SCIPY_VERSION} --depth=1 https://github.com/scipy/scipy.git scipy && \
150
151
cd scipy && \
151
152
git checkout -b v${SCIPY_VERSION} && \
152
153
cp site.cfg.example site.cfg && \
153
- python3 -m pip install -U --no-cache-dir /tmp/numpy-*.whl && \
154
- python3 setup.py install
154
+ python3 -m pip install .
155
155
156
156
WORKDIR /tmp
157
157
COPY ./requirements.txt /tmp
@@ -170,25 +170,7 @@ COPY ./service-defs /etc/backend.ai/service-defs
170
170
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 && \
171
171
mv /usr/local/lib/code-server-3.7.3-linux-amd64 /usr/local/lib/code-server-3.7.3 && \
172
172
ln -s /usr/local/lib/code-server-3.7.3/bin/code-server /usr/local/bin/code-server
173
- # Install Open MPI
174
- RUN mkdir /tmp/openmpi && \
175
- cd /tmp/openmpi && \
176
- wget https://www.open-mpi.org/software/ompi/v4.0/downloads/openmpi-4.0.5.tar.gz && \
177
- tar zxf openmpi-4.0.5.tar.gz && \
178
- cd openmpi-4.0.5 && \
179
- ./configure --enable-orterun-prefix-by-default && \
180
- make -j $(nproc) all && \
181
- make install && \
182
- ldconfig && \
183
- rm -rf /tmp/openmpi*
184
- # Create a wrapper for OpenMPI to allow running as root by default
185
- RUN mv /usr/local/bin/mpirun /usr/local/bin/mpirun.real && \
186
- echo '#!/bin/bash' > /usr/local/bin/mpirun && \
187
- echo 'mpirun.real --allow-run-as-root "$@"' >> /usr/local/bin/mpirun && \
188
- chmod a+x /usr/local/bin/mpirun
189
-
190
- # Configure OpenMPI to run good defaults:
191
- RUN echo "btl_tcp_if_exclude = lo,docker0" >> /usr/local/etc/openmpi-mca-params.conf
173
+
192
174
193
175
RUN jupyter nbextensions_configurator enable && \
194
176
jupyter contrib nbextension install && \
0 commit comments