Skip to content

Commit fd6ca1f

Browse files
committed
fixed dependency
1 parent 0954ce9 commit fd6ca1f

File tree

1 file changed

+55
-36
lines changed

1 file changed

+55
-36
lines changed

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

Lines changed: 55 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
FROM nvcr.io/nvidia/tensorflow:20.12-tf2-py3
1+
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
6-
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
8+
9+
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal
10+
ENV C_INCLUDE_PATH=/usr/include/gdal
711
ENV DEBIAN_FRONTEND=noninteractive \
812
MPLBACKEND=Svg \
913
PYTHONUNBUFFERED=1 \
@@ -12,6 +16,8 @@ ENV DEBIAN_FRONTEND=noninteractive \
1216
mecab_dicdir=/usr/local/lib/mecab/dic/mecab-ko-dic \
1317
LANG=C.UTF-8
1418

19+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 2
20+
1521
# install NLP packages *mecab-ko & khai*
1622
RUN apt-get update && \
1723
apt-get install -y \
@@ -44,7 +50,6 @@ RUN echo "Install mecab-ko-dic" && \
4450
git clone https://bitbucket.org/eunjeon/mecab-python-0.996.git && \
4551
python3 -m pip install /tmp/mecab-python-0.996
4652

47-
4853
# OpenCV
4954
RUN ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h && \
5055
apt-get install -y \
@@ -75,7 +80,7 @@ RUN ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h && \
7580
rm -rf /var/lib/apt/lists/
7681

7782
WORKDIR /tmp
78-
ENV OPENCV_VERSION="4.5.0"
83+
ENV OPENCV_VERSION="4.5.1"
7984
RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
8085
wget -O opencv-contrib.zip https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip && \
8186
unzip ${OPENCV_VERSION}.zip && \
@@ -100,7 +105,7 @@ RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
100105
-D WITH_V4L=ON \
101106
-D BUILD_TESTS=OFF \
102107
-D BUILD_PERF_TESTS=OFF \
103-
-D OPENCV_EXTRA_MODULES_PATH="../../opencv_contrib-4.5.0/modules" \
108+
-D OPENCV_EXTRA_MODULES_PATH="../../opencv_contrib-4.5.1/modules" \
104109
-D CMAKE_BUILD_TYPE=RELEASE \
105110
-D CMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") \
106111
-D PYTHON_EXECUTABLE=$(which python3) \
@@ -113,53 +118,50 @@ RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
113118
python3 -m pip install --no-cache-dir opencv-python && \
114119
rm -fr opencv*
115120

116-
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 2
117-
118-
WORKDIR /tmp
119-
RUN curl https://bootstrap.pypa.io/get-pip.py | python3 && \
120-
python3 -m pip install --no-cache-dir -U setuptools pip
121121

122122
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
123123
apt-get update -y && \
124124
apt-get install -y nodejs
125125

126126
WORKDIR /tmp
127-
RUN git clone -q --branch=master git://github.com/xianyi/OpenBLAS.git && \
127+
RUN git clone -q --branch=v0.3.13 git://github.com/xianyi/OpenBLAS.git && \
128128
cd OpenBLAS && \
129129
make DYNAMIC_ARCH=1 NO_AFFINITY=1 NUM_THREADS=48 FC=gfortran && \
130130
make install
131131
RUN git clone --recursive https://github.com/bodono/scs-python.git && \
132132
cd /tmp/scs-python && \
133133
python setup.py install --scs --gpu
134+
RUN mkdir -p /opt/oracle && \
135+
cd /opt/oracle && \
136+
apt-get clean && \
137+
rm -rf /var/lib/apt/lists/* && \
138+
apt-get update -y && \
139+
apt-get install -y --no-install-recommends libaio1 default-libmysqlclient-dev && \
140+
wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip && \
141+
unzip instantclient-basiclite-linuxx64.zip && \
142+
rm -f instantclient-basiclite-linuxx64.zip && \
143+
cd /opt/oracle/instantclient* && \
144+
rm -f *jdbc* *occi* *mysql* *README *jar uidrvci genezi adrci && \
145+
echo /opt/oracle/instantclient* > /etc/ld.so.conf.d/oracle-instantclient.conf && \
146+
ldconfig
134147

135-
COPY ./numpy-1.19.4-cp36-cp36m-manylinux2010_x86_64.whl /tmp
136-
COPY ./pandas-1.0.4+4.g29edbab4a-cp36-cp36m-linux_x86_64.whl /tmp
137-
RUN python3 -m pip install --no-cache-dir \
138-
Cython==0.29.21 \
139-
tornado==6.0.4 \
140-
pystan==2.19.1.1 \
141-
pycairo==1.19.0 \
142-
jupyter==1.0.0 \
143-
python-language-server[all] \
144-
matplotlib==3.3.3
145-
ENV SCIPY_VERSION 1.5.4
148+
WORKDIR /tmp
149+
RUN python3 -m pip install --no-cache-dir \
150+
Cython==0.29.21 \
151+
argon2_cffi==20.1.0
152+
COPY ./requirements.txt /tmp
153+
RUN python3 -m pip install --no-cache-dir -r requirements.txt && \
154+
rm -f /tmp/*.whl /tmp/requirements.txt
155+
ENV SCIPY_VERSION 1.6.0
146156
# Install scipy
147157
RUN cd /tmp && \
148158
git clone --branch=v${SCIPY_VERSION} --depth=1 https://github.com/scipy/scipy.git scipy && \
149159
cd scipy && \
150160
git checkout -b v${SCIPY_VERSION} && \
151161
cp site.cfg.example site.cfg && \
152-
python3 -m pip install -U --no-cache-dir \
153-
/tmp/numpy-1.19.4-cp36-cp36m-manylinux2010_x86_64.whl \
154-
/tmp/pandas-1.0.4+4.g29edbab4a-cp36-cp36m-linux_x86_64.whl \
155-
&& \
156-
python3 setup.py install
157-
158-
WORKDIR /tmp
159-
COPY ./requirements.txt /tmp
160-
RUN python3 -m pip install --no-cache-dir --upgrade -r requirements.txt && \
161-
python3 -m pip install --no-cache-dir tensorflow_model_analysis && \
162-
rm -f /tmp/*.whl /tmp/requirements.txt
162+
pip uninstall -y typing && \
163+
python3 -m pip install .
164+
163165

164166
# install git-lfs
165167
WORKDIR /tmp
@@ -172,7 +174,25 @@ COPY ./service-defs /etc/backend.ai/service-defs
172174
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 && \
173175
mv /usr/local/lib/code-server-3.7.3-linux-amd64 /usr/local/lib/code-server-3.7.3 && \
174176
ln -s /usr/local/lib/code-server-3.7.3/bin/code-server /usr/local/bin/code-server
177+
# Install Open MPI
178+
RUN mkdir /tmp/openmpi && \
179+
cd /tmp/openmpi && \
180+
wget https://www.open-mpi.org/software/ompi/v4.0/downloads/openmpi-4.0.5.tar.gz && \
181+
tar zxf openmpi-4.0.5.tar.gz && \
182+
cd openmpi-4.0.5 && \
183+
./configure --enable-orterun-prefix-by-default && \
184+
make -j $(nproc) all && \
185+
make install && \
186+
ldconfig && \
187+
rm -rf /tmp/openmpi*
188+
# Create a wrapper for OpenMPI to allow running as root by default
189+
RUN mv /usr/local/bin/mpirun /usr/local/bin/mpirun.real && \
190+
echo '#!/bin/bash' > /usr/local/bin/mpirun && \
191+
echo 'mpirun.real --allow-run-as-root "$@"' >> /usr/local/bin/mpirun && \
192+
chmod a+x /usr/local/bin/mpirun
175193

194+
# Configure OpenMPI to run good defaults:
195+
RUN echo "btl_tcp_if_exclude = lo,docker0" >> /usr/local/etc/openmpi-mca-params.conf
176196

177197
RUN jupyter nbextensions_configurator enable && \
178198
jupyter contrib nbextension install && \
@@ -191,13 +211,12 @@ RUN jupyter nbextensions_configurator enable && \
191211

192212
RUN apt autoclean && \
193213
sed -i 's/source \/usr\/local\/nvm\/nvm.sh//' /etc/bash.bashrc && \
194-
python3 -m pip uninstall -y tensorboard-plugin-wit && \
195214
rm -rf /var/lib/apt/lists/* && \
196215
rm -rf /root/.cache && \
197216
rm -rf /tmp/*
198217

199218
# Install ipython kernelspec
200-
RUN /usr/bin/python3 -m ipykernel install --display-name "Python 3.6 (NGC 20.12 / TensorFlow 2.3) on Backend.AI" && \
219+
RUN /usr/bin/python3 -m ipykernel install --display-name "Python 3.6 (NGC 20.11 / TensorFlow 2.3) on Backend.AI" && \
201220
cat /usr/local/share/jupyter/kernels/python3/kernel.json
202221

203222
# Backend.AI specifics

0 commit comments

Comments
 (0)