File size: 11,943 Bytes
a2143bc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | # latest (git 'main') versions of all HEAR packages.
# ==================================================================
# module list
# ------------------------------------------------------------------
# python 3.8 (apt)
# pytorch latest (docker)
# tensorflow latest (pip)
# keras latest (pip)
# ==================================================================
FROM nvidia/cuda:11.2.0-cudnn8-devel-ubuntu18.04
ENV LANG C.UTF-8
RUN echo ''
RUN rm -rf /var/lib/apt/lists/* \
/etc/apt/sources.list.d/cuda.list \
/etc/apt/sources.list.d/nvidia-ml.list && \
apt-get update
# apt-get update && \
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
# ==================================================================
# tools
# ------------------------------------------------------------------
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
build-essential \
apt-utils \
ca-certificates \
wget \
git \
vim \
libssl-dev \
curl \
bc \
less \
locate \
unzip \
unrar
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && apt-get install -y -q
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ bionic main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null && \
apt-get update && \
rm /usr/share/keyrings/kitware-archive-keyring.gpg && \
$APT_INSTALL kitware-archive-keyring && \
$APT_INSTALL cmake
# ==================================================================
# python
# ------------------------------------------------------------------
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
software-properties-common \
&& \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive $APT_INSTALL \
python3.8 \
python3.8-dev \
python3-distutils-extra \
&& \
wget -O ~/get-pip.py \
https://bootstrap.pypa.io/get-pip.py && \
python3.8 ~/get-pip.py && \
ln -s /usr/bin/python3.8 /usr/local/bin/python3 && \
ln -s /usr/bin/python3.8 /usr/local/bin/python
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
$PIP_INSTALL \
setuptools \
pipdeptree \
&& \
$PIP_INSTALL \
numpy==1.19.2 \
scipy \
pandas \
cloudpickle \
scikit-image>=0.14.2 \
scikit-learn \
matplotlib \
Cython \
tqdm
# ==================================================================
# pytorch
# ------------------------------------------------------------------
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
$PIP_INSTALL \
future \
numpy==1.19.2 \
protobuf \
enum34 \
pyyaml \
typing \
&& \
$PIP_INSTALL \
--pre torch torchvision -f \
https://download.pytorch.org/whl/nightly/cu112/torch_nightly.html
# ==================================================================
# tensorflow
# ------------------------------------------------------------------
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install" && \
GIT_CLONE="git clone --depth 10" && \
$PIP_INSTALL \
tensorflow-gpu
# Hack to get tf 2.4.2 to play nice with CUDA 11.2
# https://medium.com/mlearning-ai/tensorflow-2-4-with-cuda-11-2-gpu-training-fix-87f205215419
RUN ln -s /usr/local/cuda-11.2/targets/x86_64-linux/lib/libcusolver.so.11 /usr/local/cuda-11.2/targets/x86_64-linux/lib/libcusolver.so.10
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/cuda-11.2/targets/x86_64-linux/lib"
# ==================================================================
# keras
# ------------------------------------------------------------------
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install" && \
GIT_CLONE="git clone --depth 10" && \
$PIP_INSTALL \
h5py \
keras
# && \
# ==================================================================
# heareval
# ------------------------------------------------------------------
## workaround readline fallback
#RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && apt-get install -y -q
RUN apt update
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
$APT_INSTALL software-properties-common
RUN apt update
RUN apt upgrade -y
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
$APT_INSTALL sox
# h5
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
$APT_INSTALL pkg-config libhdf5-100 libhdf5-dev
# LLVM >= 9.0
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
$APT_INSTALL --reinstall python3-apt && \
$APT_INSTALL gpg-agent
RUN wget --no-check-certificate -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
# Might need to change python version: nano /usr/bin/add-apt-repository
#RUN add-apt-repository 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
RUN add-apt-repository 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main'
RUN apt update
#RUN $APT_INSTALL llvm-10 lldb-10 llvm-10-dev libllvm10 llvm-10-runtime
#RUN update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-10 10
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
$APT_INSTALL llvm-11 lldb-11 llvm-11-dev libllvm11 llvm-11-runtime
RUN update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-11 11
RUN update-alternatives --config llvm-config
# For ffmpeg >= 4.2
# Could also build from source:
# https://github.com/jrottenberg/ffmpeg/blob/master/docker-images/4.3/ubuntu1804/Dockerfile
RUN add-apt-repository ppa:jonathonf/ffmpeg-4
RUN apt-get update
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
$APT_INSTALL ffmpeg
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
$PIP_INSTALL cython ipython
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install" && \
GIT_CLONE="git clone --depth 10" && \
$PIP_INSTALL \
numpy==1.19.2 \
pynvml
# gsutil
# https://cloud.google.com/storage/docs/gsutil_install#deb
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
$APT_INSTALL apt-transport-https ca-certificates gnupg
RUN wget -O - https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
RUN apt-get update
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
$APT_INSTALL google-cloud-sdk
#gcloud init
# Install heareval pypi dependencies first, and after get the github versions,
# because this makes it faster
# to rebuild the docker if code changes but not dependencies
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install" && \
GIT_CLONE="git clone --depth 10" && \
$PIP_INSTALL hearbaseline hearvalidator
# Touch this to force a rebuild of everything below
RUN echo 20210912
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install" && \
GIT_CLONE="git clone --depth 10" && \
$GIT_CLONE https://github.com/hearbenchmark/hear-baseline.git
RUN cd hear-baseline && \
python -m pip --no-cache-dir install -e ".[dev]"
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install" && \
GIT_CLONE="git clone --depth 10" && \
$GIT_CLONE https://github.com/hearbenchmark/hear-eval-kit.git
RUN cd hear-eval-kit && \
python -m pip --no-cache-dir install -e ".[dev]"
# THIS COMPLETE WACKNESS IS BECAUSE FUCKING dcase-util DEPENDS UPON librosa,
# which is a gnarly PITA to install and get play nice with other packages.
# I have no idea why we have numba==0.54.0
# and have to do numba==0.48 since that's in the setup.py for us
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install --upgrade" && \
GIT_CLONE="git clone --depth 10" && \
$PIP_INSTALL \
numba==0.48
# ==================================================================
# TODO Move this earlier
# ------------------------------------------------------------------
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install" && \
GIT_CLONE="git clone --depth 10" && \
$APT_INSTALL screen tmux
# pyenv
RUN curl https://pyenv.run | bash
# https://stackoverflow.com/a/66181816/82733
#RUN git clone --depth=1 https://github.com/pyenv/pyenv.git .pyenv
ENV HOME="/root"
ENV PYENV_ROOT="${HOME}/.pyenv"
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
RUN $PYENV_ROOT/bin/pyenv install 3.7.12
RUN $PYENV_ROOT/bin/pyenv install 3.8.12
RUN $PYENV_ROOT/bin/pyenv global system 3.7.12 3.8.12
RUN echo 'eval "$(pyenv init -)"' >> /root/.bashrc ; chmod +x /root/.bashrc
RUN echo 'eval "$(pyenv virtualenv-init -)"' >> /root/.bashrc ; chmod +x /root/.bashrc
RUN APT_INSTALL="apt-get install -y --no-install-recommends" && \
PIP_INSTALL="python -m pip --no-cache-dir install" && \
GIT_CLONE="git clone --depth 10" && \
$PIP_INSTALL gdown
# ==================================================================
# config & cleanup
# ------------------------------------------------------------------
RUN \
ldconfig && \
apt-get clean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* /tmp/* ~/*
RUN updatedb
EXPOSE 6006
|