Skip to content

Commit f00df40

Browse files
committed
delete nodejs
1 parent ec3718e commit f00df40

File tree

1 file changed

+230
-0
lines changed

1 file changed

+230
-0
lines changed
Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
FROM nvcr.io/nvidia/pytorch:22.09-py3
2+
# NVIDIA NGC PyTorch with Python 3.8 (CONDA)
3+
4+
ENV DEBIAN_FRONTEND=noninteractive \
5+
MPLBACKEND=Svg \
6+
PIP_IGNORE_INSTALLED=0 \
7+
PYTHONUNBUFFERED=1 \
8+
LD_LIBRARY_PATH="/usr/local/cuda/compat/lib:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib:/usr/local/cuda/lib64:/usr/local/nvidia/lib64:/usr/local/cuda-11.8/include:/usr/include/x86_64-linux-gnu:$LD_LIBRARY_PATH" \
9+
PATH="/usr/local/nvm/versions/node/v16.15.1/bin:/opt/conda/lib/python3.8/site-packages/torch_tensorrt/bin:/opt/conda/bin:/usr/local/mpi/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/ucx/bin:/opt/tensorrt/bin:/usr/local/src/lightgbm/LightGBM:/usr/local/bin/mecab" \
10+
mecab_dicdir=/usr/local/lib/mecab/dic/mecab-ko-dic \
11+
CPLUS_INCLUDE_PATH=/usr/include/gdal \
12+
C_INCLUDE_PATH=/usr/include/gdal \
13+
LANG=C.UTF-8
14+
15+
RUN apt-get update && \
16+
apt-get install -y --no-install-recommends \
17+
automake \
18+
bzip2 \
19+
cabextract \
20+
ffmpeg \
21+
fonts-nanum \
22+
fonts-nanum-coding \
23+
fonts-nanum-extra \
24+
gfortran \
25+
htop \
26+
libasound2-dev \
27+
libatlas-base-dev \
28+
libavresample-dev \
29+
libdc1394-22-dev \
30+
libeigen3-dev \
31+
libfaac-dev \
32+
libgdal-dev \
33+
libgflags-dev \
34+
libgoogle-glog-dev \
35+
libgphoto2-dev \
36+
libgstreamer-plugins-base1.0-dev \
37+
libgstreamer1.0-dev \
38+
libgtk-3-dev \
39+
libhdf5-dev \
40+
libjemalloc-dev \
41+
libmp3lame-dev \
42+
libncurses-dev \
43+
libopenblas-dev \
44+
libopencore-amrnb-dev \
45+
libopencore-amrwb-dev \
46+
libprotobuf-dev \
47+
libtheora-dev \
48+
libvorbis-dev \
49+
libx264-dev \
50+
libxext6 \
51+
libxrender-dev \
52+
libxvidcore-dev \
53+
libsm6 \
54+
libtbb-dev \
55+
mercurial \
56+
ncurses-term \
57+
openjdk-8-jdk \
58+
pbzip2 \
59+
pv \
60+
pdsh \
61+
protobuf-compiler \
62+
v4l-utils \
63+
x264
64+
65+
# Install CUDA + cuDNN
66+
RUN ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so.8.3.2 /usr/local/cuda/lib64/libcudnn.so && \
67+
rm -rf /var/lib/apt/lists/* && \
68+
ldconfig
69+
70+
# Install cmake
71+
RUN wget https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1-Linux-x86_64.sh \
72+
-q -O /tmp/cmake-install.sh && \
73+
chmod u+x /tmp/cmake-install.sh && \
74+
mkdir /usr/bin/cmake && \
75+
/tmp/cmake-install.sh --skip-license --prefix=/usr/bin/cmake && \
76+
rm /tmp/cmake-install.sh
77+
78+
RUN update-alternatives --install /opt/conda/bin/python python /opt/conda/bin/python3 2
79+
80+
# install NLP packages *mecab-ko & khai*
81+
WORKDIR /tmp
82+
RUN curl -LO https://bitbucket.org/eunjeon/mecab-ko/downloads/mecab-0.996-ko-0.9.2.tar.gz && \
83+
tar zxfv mecab-0.996-ko-0.9.2.tar.gz && \
84+
cd mecab-0.996-ko-0.9.2 && \
85+
./configure && \
86+
make -j$(nproc) && \
87+
make check && \
88+
make install
89+
90+
RUN echo "Install mecab-ko-dic" && \
91+
cd /tmp && \
92+
ldconfig && \
93+
curl -LO https://bitbucket.org/eunjeon/mecab-ko-dic/downloads/mecab-ko-dic-2.1.1-20180720.tar.gz && \
94+
tar -zxvf mecab-ko-dic-2.1.1-20180720.tar.gz && \
95+
cd mecab-ko-dic-2.1.1-20180720 && \
96+
./autogen.sh && \
97+
./configure && \
98+
make -j$(nproc) && \
99+
sh -c 'echo "dicdir=/usr/local/lib/mecab/dic/mecab-ko-dic" > /usr/local/etc/mecabrc' && \
100+
make install && \
101+
cd /tmp && \
102+
git clone https://bitbucket.org/eunjeon/mecab-python-0.996.git && \
103+
python3 -m pip install /tmp/mecab-python-0.996
104+
105+
WORKDIR /tmp
106+
RUN git clone -q --branch=v0.3.20 https://github.com/xianyi/OpenBLAS.git && \
107+
cd OpenBLAS && \
108+
make DYNAMIC_ARCH=1 NO_AFFINITY=1 NUM_THREADS=48 FC=gfortran && \
109+
make install && \
110+
cd /tmp && \
111+
git clone --recursive https://github.com/bodono/scs-python.git && \
112+
cd /tmp/scs-python && \
113+
python setup.py install --scs --gpu
114+
115+
RUN /opt/conda/bin/conda install -n base conda==4.13.0
116+
RUN /opt/conda/bin/conda install -c conda-forge opencv ffmpeg
117+
118+
# install git-lfs
119+
WORKDIR /tmp
120+
RUN curl -sLO https://github.com/git-lfs/git-lfs/releases/download/v3.3.0/git-lfs-linux-amd64-v3.3.0.tar.gz && \
121+
tar -zxf git-lfs-linux-amd64-v3.3.0.tar.gz && \
122+
cd git-lfs-3.3.0 && \
123+
bash install.sh && \
124+
rm -rf /tmp/*
125+
126+
WORKDIR /tmp
127+
RUN git clone https://github.com/aristocratos/bashtop.git && \
128+
cd bashtop && \
129+
make install
130+
131+
RUN curl -fL https://github.com/cdr/code-server/releases/download/v4.9.1/code-server-4.9.1-linux-amd64.tar.gz \
132+
| tar -C /usr/local/lib -xz && \
133+
mv /usr/local/lib/code-server-4.9.1-linux-amd64 /usr/local/lib/code-server-4.9.1 && \
134+
ln -s /usr/local/lib/code-server-4.9.1/bin/code-server /usr/local/bin/code-server
135+
136+
WORKDIR /tmp
137+
COPY ./requirements.22.09.1.txt /tmp/requirements.txt
138+
RUN /opt/conda/bin/python3 -m pip install --no-cache-dir -r requirements.txt
139+
COPY ./requirements.22.09.2.txt /tmp/requirements.txt
140+
RUN /opt/conda/bin/python3 -m pip install --no-cache-dir -r requirements.txt
141+
COPY ./requirements.22.09.3.txt /tmp/requirements.txt
142+
RUN /opt/conda/bin/python3 -m pip install --no-cache-dir -r requirements.txt
143+
COPY ./requirements.22.09.4.txt /tmp/requirements.txt
144+
RUN /opt/conda/bin/python3 -m pip install --no-cache-dir -r requirements.txt
145+
COPY ./requirements.22.09.5.txt /tmp/requirements.txt
146+
RUN /opt/conda/bin/python3 -m pip install --no-cache-dir -r requirements.txt && \
147+
rm -f /tmp/*.whl /tmp/requirem*
148+
149+
# Install Open MPI
150+
RUN mkdir /tmp/openmpi && \
151+
cd /tmp/openmpi && \
152+
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.4.tar.gz && \
153+
tar zxf openmpi-4.1.4.tar.gz && \
154+
cd openmpi-4.1.4 && \
155+
./configure --enable-orterun-prefix-by-default && \
156+
make -j $(nproc) all && \
157+
make install && \
158+
ldconfig && \
159+
rm -rf /tmp/openmpi* && \
160+
# Create a wrapper for OpenMPI to allow running as root by default
161+
mv /usr/local/bin/mpirun /usr/local/bin/mpirun.real && \
162+
echo '#!/bin/bash' > /usr/local/bin/mpirun && \
163+
echo 'mpirun.real --allow-run-as-root "$@"' >> /usr/local/bin/mpirun && \
164+
chmod a+x /usr/local/bin/mpirun && \
165+
# Configure OpenMPI to run good defaults:
166+
echo "btl_tcp_if_exclude = lo,docker0" >> /usr/local/etc/openmpi-mca-params.conf
167+
168+
# Install Horovod, temporarily using CUDA stubs
169+
RUN ldconfig /usr/local/cuda/targets/x86_64-linux/lib/stubs && \
170+
LD_LIBRARY_PATH="/usr/local/cuda/compat/lib:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib:/usr/local/cuda/lib64:/usr/local/nvidia/lib64:/usr/local/cuda-11.8/include:/usr/include/x86_64-linux-gnu:/usr/include:$LD_LIBRARY_PATH" \
171+
HOROVOD_NCCL_LINK=SHARED \
172+
HOROVOD_WITH_MPI=1 \
173+
HOROVOD_GPU_ALLREDUCE=NCCL \
174+
NCCL_LIBRARY=/usr/include \
175+
HOROVOD_NCCL_INCLUDE=/usr/include \
176+
HOROVOD_NCCL_LIB=/lib/x86_64-linux-gnu \
177+
HOROVOD_GPU_BROADCAST=NCCL \
178+
HOROVOD_WITHOUT_TENSORFLOW=1 HOROVOD_WITH_PYTORCH=1 HOROVOD_WITHOUT_MXNET=1 \
179+
pip install --no-cache-dir horovod==0.24.2 && \
180+
ldconfig
181+
182+
RUN python3 -m pip install --no-cache-dir \
183+
mpi4py==3.1.3 \
184+
nni==2.9 \
185+
mlflow==1.29.0 \
186+
scikit-nni==0.2.1
187+
188+
RUN jupyter nbextensions_configurator enable && \
189+
jupyter contrib nbextension install && \
190+
jupyter nbextension enable --py --sys-prefix widgetsnbextension && \
191+
jupyter serverextension enable --py jupyterlab --sys-prefix && \
192+
jupyter labextension install --no-build @jupyter-widgets/jupyterlab-manager && \
193+
jupyter labextension install --no-build @krassowski/jupyterlab-lsp && \
194+
jupyter serverextension enable --py jupyter_lsp && \
195+
jupyter nbextension enable execute_time/ExecuteTime && \
196+
jupyter nbextension enable toc2/main && \
197+
jupyter lab build
198+
199+
RUN apt autoclean && \
200+
sed -i 's/source \/usr\/local\/nvm\/nvm.sh//' /etc/bash.bashrc && \
201+
ln -sf /usr/share/terminfo/x/xterm-color /usr/share/terminfo/x/xterm-256color && \
202+
rm -rf /var/lib/apt/lists/* && \
203+
rm -rf /root/.cache && \
204+
rm -rf /tmp/*
205+
206+
RUN /opt/conda/bin/python3 -m ipykernel install \
207+
--prefix=/opt/conda/ \
208+
--display-name "PyTorch 1.13 (NGC 22.09/Python 3.8 Conda) on Backend.AI" && \
209+
cat /opt/conda/share/jupyter/kernels/python3/kernel.json
210+
ENV JUPYTER_PATH="/opt/conda/share/jupyter"
211+
212+
# Backend.AI specifics
213+
COPY ./service-defs /etc/backend.ai/service-defs
214+
COPY ./runner-scripts/bootstrap.sh runner-scripts/setup_multinode.py /opt/container/
215+
216+
LABEL ai.backend.kernelspec="1" \
217+
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
218+
ai.backend.features="batch query uid-match user-input" \
219+
ai.backend.base-distro="ubuntu16.04" \
220+
ai.backend.accelerators="cuda" \
221+
ai.backend.resource.min.cpu="1" \
222+
ai.backend.resource.min.mem="1g" \
223+
ai.backend.resource.min.cuda.device=1 \
224+
ai.backend.resource.min.cuda.shares=0 \
225+
ai.backend.base-distro="ubuntu16.04" \
226+
ai.backend.runtime-type="python" \
227+
ai.backend.runtime-path="/opt/conda/bin/python3" \
228+
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"
229+
230+
WORKDIR /home/work

0 commit comments

Comments
 (0)