@@ -70,7 +70,8 @@ RUN apt-get update && \
70
70
apt-get clean && \
71
71
rm -rf /var/lib/apt/lists/*
72
72
73
- # # FROM CUDA 11.0 base
73
+ # # FROM CUDA 11.0 base [https://gitlab.com/nvidia/cuda/blob/ubuntu18.04/11.0/base/Dockerfile]
74
+
74
75
RUN apt-get update && \
75
76
apt-get install -y --no-install-recommends gnupg2 curl ca-certificates && \
76
77
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | apt-key add - && \
@@ -89,7 +90,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
89
90
RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
90
91
echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf
91
92
92
- # # FROM CUDA 11.0 runtime
93
+ # # FROM CUDA 11.0 runtime [https://gitlab.com/nvidia/cuda/blob/ubuntu18.04/11.0/runtime/Dockerfile]
94
+
93
95
RUN apt-get update && apt-get install -y --no-install-recommends \
94
96
cuda-libraries-11-0=11.0.3-1 \
95
97
libnpp-11-0=11.1.0.245-1 \
@@ -101,7 +103,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
101
103
apt-mark hold libcublas-11-0 libnccl2 && \
102
104
rm -rf /var/lib/apt/lists/*
103
105
104
- # # FROM CUDA 11.0 devel
106
+ # # FROM CUDA 11.0 devel [https://gitlab.com/nvidia/cuda/blob/ubuntu18.04/11.0/devel/Dockerfile]
107
+
105
108
RUN apt-get update && apt-get install -y --no-install-recommends \
106
109
cuda-cudart-dev-11-0=11.0.221-1 \
107
110
cuda-command-line-tools-11-0=11.0.3-1 \
@@ -117,13 +120,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
117
120
rm -rf /var/lib/apt/lists/*
118
121
119
122
# # FROM CUDA 11.0-CUDNN 8 devel
123
+
120
124
RUN apt-get update && apt-get install -y --no-install-recommends \
121
125
libcudnn8=$CUDNN_VERSION-1+cuda11.0 \
122
126
libcudnn8-dev=$CUDNN_VERSION-1+cuda11.0 && \
123
127
apt-mark hold libcudnn8 && \
124
128
rm -rf /var/lib/apt/lists/*
125
129
126
- # Install Conda
127
130
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py37_4.9.2-Linux-x86_64.sh -O miniconda.sh && \
128
131
mkdir -p /opt && \
129
132
sh miniconda.sh -b -p /opt/conda && \
@@ -136,6 +139,7 @@ RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py37_4.9.2-Linux
136
139
/opt/conda/bin/conda clean -afy
137
140
138
141
# Install OpenBlas
142
+ WORKDIR /tmp
139
143
RUN git clone -q --branch=master git://github.com/xianyi/OpenBLAS.git && \
140
144
cd OpenBLAS && \
141
145
make DYNAMIC_ARCH=1 NO_AFFINITY=1 NUM_THREADS=48 FC=gfortran && \
@@ -213,14 +217,12 @@ RUN git clone https://github.com/hephaex/kaldi.git /opt/kaldi && \
213
217
find /opt/kaldi/src -name "*.o" -exec rm -f {} \; && \
214
218
find /opt/kaldi/src -name "*.o" -exec rm -f {} \;
215
219
216
-
217
- # Download ESPnet
218
- RUN git clone https://github.com/espnet/espnet /opt/espnet
219
-
220
220
# Install espnet
221
- WORKDIR /opt/espnet/tools
222
221
ENV TH_VERSION 1.7.1
223
222
ENV CUDA_VER 11.0
223
+ RUN git clone https://github.com/espnet/espnet /opt/espnet
224
+ WORKDIR /opt/espnet/tools
225
+
224
226
# Replace nvidia-smi for nvcc because docker does not load nvidia-smi
225
227
RUN if [ -z "$( which nvcc )" ]; then \
226
228
echo "Build without CUDA" && \
@@ -258,16 +260,18 @@ RUN /opt/conda/bin/python3 -m pip install --no-cache-dir \
258
260
jupyter==1.0.0 \
259
261
python-language-server[all]
260
262
263
+ # Copy Backend.Ai multi-node support
264
+ COPY runner-scripts/bootstrap.sh /opt/container/
261
265
COPY ./service-defs /etc/backend.ai/service-defs
262
- RUN echo ". /opt/espnet/tools/activate_python.sh" >> /etc/profile
263
-
264
- RUN chmod +x /opt/espnet/tools/activate_python.sh && \
266
+ RUN echo "source /opt/espnet/tools/activate_python.sh" >> /etc/profile && \
267
+ chmod +x /opt/espnet/tools/activate_python.sh && \
265
268
chmod -R 777 /opt/espnet
266
269
267
270
# Install ipython kernelspec
268
271
Run /opt/conda/bin/python3 -m ipykernel install --display-name "A4003 (ESPNet, PyTorch 1.7.1 on Python 3.7 & CUDA 11.0)" && \
269
272
cat /usr/local/share/jupyter/kernels/python3/kernel.json
270
273
274
+
271
275
# Backend.AI specifics
272
276
LABEL ai.backend.kernelspec="1" \
273
277
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
@@ -279,7 +283,8 @@ LABEL ai.backend.kernelspec="1" \
279
283
ai.backend.resource.min.cuda.shares=0 \
280
284
ai.backend.runtime-type="python" \
281
285
ai.backend.runtime-path="/opt/conda/bin/python3" \
282
- ai.backend.service-ports="ipython:pty:3000,jupyter:http:8081,tensorboard:http:6006"
286
+ ai.backend.service-ports="ipython:pty:3000,jupyter:http:8081,jupyterlab:http:8090,vscode:http:8180,tensorboard:http:6006"
287
+
283
288
284
289
WORKDIR /home/work
285
290
# vim: ft=dockerfile
0 commit comments