|
| 1 | +FROM lablup/common-base:py38-cuda11.1 |
| 2 | + |
| 3 | +RUN python3 -m pip install --no-cache-dir --upgrade \ |
| 4 | + -q git+https://github.com/google-research/tensorflow_constrained_optimization |
| 5 | + |
| 6 | +RUN python3 -m pip install --no-cache-dir \ |
| 7 | + --use-feature=2020-resolver \ |
| 8 | + requests_oauthlib==1.2.0 \ |
| 9 | + neural-structured-learning==1.3.1 \ |
| 10 | + pydot==1.4.0 \ |
| 11 | + proto-plus==1.10.2 |
| 12 | +RUN python3 -m pip install --no-cache-dir \ |
| 13 | + --use-feature=2020-resolver \ |
| 14 | + tensorflow-transform==0.25.0 \ |
| 15 | + tensorflow_model_analysis \ |
| 16 | + tensorflow-datasets \ |
| 17 | + tensorflow_probability==0.11.1 \ |
| 18 | + tensorflow-addons==0.11.2 \ |
| 19 | + neural-structured-learning==1.3.1 \ |
| 20 | + tensorflow-model-optimization==0.5.0 \ |
| 21 | + tfx==0.25.0 \ |
| 22 | + tfx-bsl==0.25.0 \ |
| 23 | + tf-agents==0.6.0 |
| 24 | + |
| 25 | +RUN python3 -m pip install --no-cache-dir \ |
| 26 | + --use-feature=2020-resolver \ |
| 27 | + fastavro==1.2.0 \ |
| 28 | + pymongo==3.11.2 \ |
| 29 | + docker==4.4.1 \ |
| 30 | + pbr==5.5.1 \ |
| 31 | + mock==1.3.0 \ |
| 32 | + proto-plus==1.13.0 \ |
| 33 | + oauth2client==4.1.3 \ |
| 34 | + future==0.18.1 \ |
| 35 | + gin_config==0.4.0 \ |
| 36 | + joblib==0.14.0 \ |
| 37 | + libcst==0.3.14 |
| 38 | + |
| 39 | +RUN python3 -m pip install --no-cache-dir \ |
| 40 | + --use-feature=2020-resolver \ |
| 41 | + google_cloud_spanner==1.19.0 \ |
| 42 | + googleapis-common-protos==1.51.0 \ |
| 43 | + google_cloud_videointelligence==1.15.0 \ |
| 44 | + google_cloud_vision==0.42.0 \ |
| 45 | + google_cloud_pubsub==1.6.0 \ |
| 46 | + google_cloud_dlp==0.15.0 \ |
| 47 | + google_cloud_datastore==1.15.2 \ |
| 48 | + google_cloud_bigtable==1.6.0 \ |
| 49 | + google_api_core==1.24.0 |
| 50 | + |
| 51 | +RUN python3 -m pip install --no-cache-dir \ |
| 52 | + mesh-tensorflow==0.1.18 \ |
| 53 | + tensorflow-cloud==0.1.10 \ |
| 54 | + tensorflow-hub==0.9.0 |
| 55 | + |
| 56 | +RUN python3 -m pip install --no-cache-dir \ |
| 57 | + -i https://pypi-nightly.tensorflow.org/simple tensorflow-data-validation |
| 58 | +RUN python3 -m pip install --no-cache-dir \ |
| 59 | + tensorflow-graphics-gpu==1.0.0 \ |
| 60 | + tensorflow-io==0.17.0 \ |
| 61 | + tensorflow_ranking==0.3.2 \ |
| 62 | + tensorflow-plot==0.3.2 \ |
| 63 | + tensorflow_text==2.4.1 \ |
| 64 | + tensorflow-gan==2.0.0 |
| 65 | +RUN python3 -m pip uninstall --no-cache-dir -y \ |
| 66 | + tensorflow==2.3.0 \ |
| 67 | + tensorflow-gpu==2.4.1 \ |
| 68 | + tensorboard==2.3.0 \ |
| 69 | + tensorboard-plugin-wit==1.7.0 && \ |
| 70 | + python3 -m pip install --no-cache-dir \ |
| 71 | + tensorflow-gpu==2.4.1 \ |
| 72 | + tensorboard-plugin-wit==1.8.0 \ |
| 73 | + tensorboard==2.4.1 |
| 74 | + |
| 75 | +RUN python3 -m pip install --extra-index-url \ |
| 76 | + https://developer.download.nvidia.com/compute/redist nvidia-dali-cuda100 \ |
| 77 | + && \ |
| 78 | + python3 -m pip install --extra-index-url \ |
| 79 | + https://developer.download.nvidia.com/compute/redist nvidia-dali-tf-plugin-cuda100 |
| 80 | + |
| 81 | +# Install PyTorch and MXNet |
| 82 | +ENV PYTORCH_VERSION=1.7.1 |
| 83 | +ENV TORCHVISION_VERSION=0.8.2 |
| 84 | +ENV TORCHAUDIO_VERSION=0.7.2 |
| 85 | +ENV TORCHTEXT_VERSION=0.8.1 |
| 86 | +ENV TENSORBOARDX_VERSION=2.1 |
| 87 | +ENV MXNET_VERSION=1.6.0 |
| 88 | + |
| 89 | +RUN python3 -m pip uninstall -y torch && \ |
| 90 | + python3 -m pip install --no-cache-dir \ |
| 91 | + https://download.pytorch.org/whl/cu110/torch-${PYTORCH_VERSION}%2Bcu110-cp38-cp38-linux_x86_64.whl \ |
| 92 | + https://download.pytorch.org/whl/cu110/torchvision-${TORCHVISION_VERSION}%2Bcu110-cp38-cp38-linux_x86_64.whl \ |
| 93 | + https://download.pytorch.org/whl/torchaudio-${TORCHAUDIO_VERSION}-cp38-cp38-linux_x86_64.whl \ |
| 94 | + https://download.pytorch.org/whl/torchtext-${TORCHTEXT_VERSION}-cp38-cp38-linux_x86_64.whl && \ |
| 95 | + python3 -m pip install --no-cache-dir tensorboardX==${TENSORBOARDX_VERSION} |
| 96 | + |
| 97 | +RUN python3 -m pip install --no-cache-dir mxnet mkl |
| 98 | + |
| 99 | +# Install Horovod, temporarily using CUDA stubs |
| 100 | +RUN ldconfig /usr/local/cuda/targets/x86_64-linux/lib/stubs && \ |
| 101 | + HOROVOD_GPU_ALLREDUCE=NCCL HOROVOD_GPU_BROADCAST=NCCL \ |
| 102 | + HOROVOD_WITH_TENSORFLOW=1 HOROVOD_WITH_PYTORCH=1 HOROVOD_WITHOUT_MXNET=1 \ |
| 103 | + pip install --no-cache-dir horovod==0.21.1 && \ |
| 104 | + ldconfig |
| 105 | + |
| 106 | +RUN python3 -m pip install --no-cache-dir \ |
| 107 | + mpi4py==3.0.3 \ |
| 108 | + mlflow==1.12.1 \ |
| 109 | + nni==1.9 \ |
| 110 | + scikit-nni==0.2.1 |
| 111 | + |
| 112 | +# install kaldi |
| 113 | +WORKDIR /opt |
| 114 | +RUN apt update && \ |
| 115 | + apt list --upgradable && \ |
| 116 | + apt-get install -y --no-install-recommends \ |
| 117 | + patch wget rsync jq gnupg libtcmalloc-minimal4 && \ |
| 118 | + apt-get install -y --no-install-recommends \ |
| 119 | + automake \ |
| 120 | + autoconf \ |
| 121 | + flac \ |
| 122 | + gawk \ |
| 123 | + libatlas3-base \ |
| 124 | + libtool \ |
| 125 | + sox \ |
| 126 | + subversion \ |
| 127 | + unzip \ |
| 128 | + bc \ |
| 129 | + libatlas-base-dev \ |
| 130 | + gfortran \ |
| 131 | + zlib1g-dev && \ |
| 132 | + apt-get install -y --no-install-recommends \ |
| 133 | + git libglib2.0-0 less libnl-route-3-200 libnl-3-dev \ |
| 134 | + libnl-route-3-dev libnuma-dev libnuma1 \ |
| 135 | + libpmi2-0-dev nano numactl openssh-client vim && \ |
| 136 | + rm -rf /var/lib/apt/lists/* |
| 137 | +RUN ln -sf /usr/include/x86_64-linux-gnu/atlas /usr/local/include/atlas && \ |
| 138 | + ln -sf /usr/include/x86_64-linux-gnu/cblas.h /usr/local/include/cblas.h && \ |
| 139 | + ln -sf /usr/include/x86_64-linux-gnu/clapack.h /usr/local/include/clapack.h && \ |
| 140 | + ln -sf /usr/lib/x86_64-linux-gnu/atlas /usr/local/lib/atlas |
| 141 | + |
| 142 | +RUN git clone https://github.com/hephaex/kaldi.git /opt/kaldi && \ |
| 143 | + cd /opt/kaldi/tools && \ |
| 144 | + make -j $(nproc) && \ |
| 145 | + cd /opt/kaldi/src && \ |
| 146 | + ./configure --shared --use-cuda \ |
| 147 | + --cudatk-dir=/usr/local/cuda/ \ |
| 148 | + --mathlib=ATLAS \ |
| 149 | + --cuda-arch="-gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80" && \ |
| 150 | + make depend -j $(nproc) && \ |
| 151 | + make -j $(nproc) |
| 152 | +RUN cd /opt/kaldi/src && \ |
| 153 | + make ext -j $(nproc) && \ |
| 154 | + ldconfig && \ |
| 155 | + find /opt/kaldi -type f \( -name "*.o" -o -name "*.la" -o -name "*.a" \) -\ |
| 156 | +exec rm {} \; && \ |
| 157 | + rm -rf /opt/kaldi/.git |
| 158 | + |
| 159 | +RUN mkdir -p /workspace && \ |
| 160 | + chmod -R 777 /workspace |
| 161 | + |
| 162 | +RUN apt autoclean && \ |
| 163 | + rm -rf /var/lib/apt/lists/* && \ |
| 164 | + rm -rf /root/.cache && \ |
| 165 | + rm -rf /tmp/* |
| 166 | + |
| 167 | +# Copy Backend.Ai multi-node support |
| 168 | +COPY runner-scripts/bootstrap.sh runner-scripts/setup_multinode.py /opt/container/ |
| 169 | +COPY service-defs /etc/backend.ai/service-defs |
| 170 | + |
| 171 | +# Install ipython kernelspec |
| 172 | +Run python3 -m ipykernel install --display-name "Lablup FF 21.02 on Python 3.8 (CUDA 11.1)" && \ |
| 173 | + cat /usr/local/share/jupyter/kernels/python3/kernel.json |
| 174 | + |
| 175 | +# Backend.AI specifics |
| 176 | +LABEL ai.backend.kernelspec="1" \ |
| 177 | + ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \ |
| 178 | + ai.backend.features="batch query uid-match user-input" \ |
| 179 | + ai.backend.base-distro="ubuntu16.04" \ |
| 180 | + ai.backend.resource.min.cpu="1" \ |
| 181 | + ai.backend.resource.min.mem="1g" \ |
| 182 | + ai.backend.resource.min.cuda.device=0 \ |
| 183 | + ai.backend.resource.min.cuda.shares=0 \ |
| 184 | + ai.backend.runtime-type="python" \ |
| 185 | + ai.backend.runtime-path="/usr/bin/python3" \ |
| 186 | + ai.backend.service-ports="ipython:pty:3000,jupyter:http:8081,jupyterlab:http:8090,vscode:http:8180,tensorboard:http:6006,mlflow-ui:preopen:5000,nniboard:preopen:8080" |
| 187 | + |
| 188 | +WORKDIR /home/work |
| 189 | +# vim: ft=dockerfile |
0 commit comments