|
| 1 | +FROM ubuntu:22.04 |
| 2 | +ENV DEBIAN_FRONTEND noninteractive |
| 3 | +RUN apt-get update && \ |
| 4 | + apt-get install -y \ |
| 5 | + ca-certificates apt-utils \ |
| 6 | + wget curl git-core \ |
| 7 | + vim-tiny zip unzip \ |
| 8 | + libssl-dev \ |
| 9 | + proj-bin libproj-dev \ |
| 10 | + libgeos-dev libgeos++-dev \ |
| 11 | + mime-support \ |
| 12 | + gcc g++ \ |
| 13 | + cmake ncurses-term && \ |
| 14 | + ln -sf /usr/share/terminfo/x/xterm-color /usr/share/terminfo/x/xterm-256color && \ |
| 15 | + apt-get clean && \ |
| 16 | + rm -rf /var/lib/apt/lists/ |
| 17 | + |
| 18 | +RUN apt-get update && \ |
| 19 | + apt-get install -y software-properties-common && \ |
| 20 | + add-apt-repository ppa:deadsnakes/ppa && \ |
| 21 | + apt-get update && \ |
| 22 | + apt-get install -y python3.10 python3.10-dev python3.10-distutils && \ |
| 23 | + apt-get clean && \ |
| 24 | + rm -rf /var/lib/apt/lists/ |
| 25 | + |
| 26 | +# BLAS / HDF5 is needed to compile pandas package. |
| 27 | +RUN apt-get update && \ |
| 28 | + apt-get install -y libopenblas-dev pkg-config libhdf5-dev && \ |
| 29 | + apt-get clean && \ |
| 30 | + rm -rf /var/lib/apt/lists/ |
| 31 | + |
| 32 | +ENV PYTHONUNBUFFERED=1 \ |
| 33 | + PATH=/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ |
| 34 | + LANG=C.UTF-8 |
| 35 | + |
| 36 | +RUN curl https://bootstrap.pypa.io/get-pip.py | python3.10 && \ |
| 37 | + python3.10 -m pip install --upgrade pip && \ |
| 38 | + python3.10 -m pip install --no-cache-dir -U setuptools && \ |
| 39 | + python3.10 -m pip install --no-cache-dir h5py && \ |
| 40 | + python3.10 -m pip install --no-cache-dir Cython && \ |
| 41 | + python3.10 -m pip install --no-cache-dir matplotlib bokeh && \ |
| 42 | + python3.10 -m pip install --no-cache-dir versioneer && \ |
| 43 | + python3.10 -m pip install --no-cache-dir pyproj cartopy && \ |
| 44 | + python3.10 -m pip install --no-cache-dir pandas && \ |
| 45 | + python3.10 -m pip install --no-cache-dir seaborn && \ |
| 46 | + python3.10 -m pip install --no-cache-dir pillow && \ |
| 47 | + python3.10 -m pip install --no-cache-dir networkx cvxpy && \ |
| 48 | + python3.10 -m pip install --no-cache-dir scikit-learn scikit-image && \ |
| 49 | + python3.10 -m pip install --no-cache-dir pygments && \ |
| 50 | + python3.10 -m pip install --no-cache-dir ipython && \ |
| 51 | + python3.10 -m pip install --no-cache-dir jupyter && \ |
| 52 | + python3.10 -m pip install --no-cache-dir jupyterlab && \ |
| 53 | + rm -rf /root/.cache && \ |
| 54 | + rm -f /tmp/*.whl |
| 55 | +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 2 |
| 56 | +RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2 |
| 57 | + |
| 58 | +# Install ipython kernelspec |
| 59 | +RUN python3.10 -m ipykernel install --display-name "Python 3.10 on Backend.AI" && \ |
| 60 | + cat /usr/local/share/jupyter/kernels/python3/kernel.json |
| 61 | + |
| 62 | +# Backend.AI specifics |
| 63 | +COPY ./service-defs /etc/backend.ai/service-defs |
| 64 | +LABEL ai.backend.kernelspec="1" \ |
| 65 | + ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \ |
| 66 | + ai.backend.features="batch query uid-match user-input" \ |
| 67 | + ai.backend.resource.min.cpu="1" \ |
| 68 | + ai.backend.resource.min.mem="256m" \ |
| 69 | + ai.backend.base-distro="ubuntu20.04" \ |
| 70 | + ai.backend.runtime-type="python" \ |
| 71 | + ai.backend.runtime-path="/usr/bin/python3" \ |
| 72 | + ai.backend.service-ports="ipython:pty:3000,jupyter:http:8070,jupyterlab:http:8090" |
| 73 | +COPY policy.yml /etc/backend.ai/jail/policy.yml |
| 74 | + |
| 75 | +# vim: ft=dockerfile |
0 commit comments