From 62d3bd0bc958292206ca089851e923915a75baf9 Mon Sep 17 00:00:00 2001 From: maltegrosse Date: Tue, 24 Jan 2023 15:38:15 +0100 Subject: [PATCH] added tools --- Dockerfile | 186 +++++++++++++++++++++++++++- initital-condarc => initial-condarc | 0 2 files changed, 183 insertions(+), 3 deletions(-) rename initital-condarc => initial-condarc (100%) diff --git a/Dockerfile b/Dockerfile index 6724b00..a425664 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,12 @@ ARG NVIDIA_IMAGE=nvcr.io/nvidia/tensorflow:22.12-tf2-py3 FROM ${NVIDIA_IMAGE} +############################################################################ +#################### Dependency: jupyter/base-image ######################## +############################################################################ #### copied from https://github.com/jupyter/docker-stacks/tree/main/docker-stacks-foundation + # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. @@ -97,8 +101,8 @@ RUN mkdir "/home/${NB_USER}/work" && \ # Correct permissions # Do all this in a single RUN command to avoid duplicating all of the # files across image layers when the permissions change -RUN sleep 120 -COPY --chown="${NB_UID}:${NB_GID}" ./jupyterlab-datascience-gpu/initial-condarc "${CONDA_DIR}/.condarc" + +COPY --chown="${NB_UID}:${NB_GID}" initial-condarc "${CONDA_DIR}/.condarc" WORKDIR /tmp RUN set -x && \ arch=$(uname -m) && \ @@ -139,8 +143,138 @@ USER ${NB_UID} WORKDIR "${HOME}" + +############################################################################ +################# Dependency: jupyter/minimal-notebook ##################### +############################################################################ + +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. +ARG OWNER=jupyter + +LABEL maintainer="Jupyter Project " + +# Fix: https://github.com/hadolint/hadolint/wiki/DL4006 +# Fix: https://github.com/koalaman/shellcheck/wiki/SC3014 +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +USER root + +# Install all OS dependencies for fully functional notebook server +RUN apt-get update --yes && \ + apt-get install --yes --no-install-recommends \ + # Common useful utilities + git \ + nano-tiny \ + tzdata \ + unzip \ + vim-tiny \ + # Inkscape is installed to be able to convert SVG files + inkscape \ + # git-over-ssh + openssh-client \ + # less is needed to run help in R + # see: https://github.com/jupyter/docker-stacks/issues/1588 + less \ + # nbconvert dependencies + # https://nbconvert.readthedocs.io/en/latest/install.html#installing-tex + texlive-xetex \ + texlive-fonts-recommended \ + texlive-plain-generic && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +# Create alternative for nano -> nano-tiny +RUN update-alternatives --install /usr/bin/nano nano /bin/nano-tiny 10 + +# Switch back to jovyan to avoid accidental container runs as root +USER ${NB_UID} + +############################################################################ +################# Dependency: jupyter/scipy-notebook ####################### +############################################################################ + +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. +ARG OWNER=jupyter + +LABEL maintainer="Jupyter Project " + +# Fix: https://github.com/hadolint/hadolint/wiki/DL4006 +# Fix: https://github.com/koalaman/shellcheck/wiki/SC3014 +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +USER root + +RUN apt-get update --yes && \ + apt-get install --yes --no-install-recommends \ + # for cython: https://cython.readthedocs.io/en/latest/src/quickstart/install.html + build-essential \ + # for latex labels + cm-super \ + dvipng \ + # for matplotlib anim + ffmpeg && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +USER ${NB_UID} + +# Install Python 3 packages +RUN mamba install --quiet --yes \ + 'altair' \ + 'beautifulsoup4' \ + 'bokeh' \ + 'bottleneck' \ + 'cloudpickle' \ + 'conda-forge::blas=*=openblas' \ + 'cython' \ + 'dask' \ + 'dill' \ + 'h5py' \ + 'ipympl'\ + 'ipywidgets' \ + 'matplotlib-base' \ + 'numba' \ + 'numexpr' \ + 'pandas' \ + 'patsy' \ + 'protobuf' \ + 'pytables' \ + 'scikit-image' \ + 'scikit-learn' \ + 'scipy' \ + 'seaborn' \ + 'sqlalchemy' \ + 'statsmodels' \ + 'sympy' \ + 'widgetsnbextension'\ + 'xlrd' && \ + mamba clean --all -f -y && \ + fix-permissions "${CONDA_DIR}" && \ + fix-permissions "/home/${NB_USER}" + +# Install facets which does not have a pip or conda package at the moment +WORKDIR /tmp +RUN git clone https://github.com/PAIR-code/facets.git && \ + jupyter nbextension install facets/facets-dist/ --sys-prefix && \ + rm -rf /tmp/facets && \ + fix-permissions "${CONDA_DIR}" && \ + fix-permissions "/home/${NB_USER}" + +# Import matplotlib the first time to build the font cache. +ENV XDG_CACHE_HOME="/home/${NB_USER}/.cache/" + +RUN MPLBACKEND=Agg python -c "import matplotlib.pyplot" && \ + fix-permissions "/home/${NB_USER}" + +USER ${NB_UID} + +WORKDIR "${HOME}" + + + ################ copied from https://github.com/iot-salzburg/gpu-jupyter/tree/master/src + # LABEL authors="Christoph Schranz , Mathematical Michael " @@ -183,4 +317,50 @@ RUN git clone https://github.com/Syllo/nvtop.git /run/nvtop && \ RUN fix-permissions /home/$NB_USER -USER $NB_UID \ No newline at end of file +USER $NB_UID + + + ############################################################################ + ############################ Useful packages ############################### + ############################################################################ + +LABEL authors="Christoph Schranz , Mathematical Michael " + +USER root + +RUN pip install --no-cache-dir ipyleaflet "plotly>=4.14.3" "ipywidgets>=7.5" + +# Install important packages and Graphviz +RUN set -ex \ + && buildDeps=' \ + graphviz==0.19.1 \ +' \ + && apt-get update \ + && apt-get -y install htop apt-utils iputils-ping graphviz libgraphviz-dev openssh-client \ + && pip install --no-cache-dir $buildDeps + +# Install various extensions +RUN fix-permissions $CONDA_DIR + +# RUN jupyter labextension install @jupyterlab/github +# RUN pip install jupyterlab-git +RUN pip install jupyterlab-drawio +RUN jupyter nbextension enable --py --sys-prefix ipyleaflet +RUN jupyter labextension install jupyterlab-plotly +RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager plotlywidget +# RUN pip install --no-cache-dir jupyter-tabnine --user && \ +# jupyter nbextension install --py jupyter_tabnine --user && \ +# jupyter nbextension enable --py jupyter_tabnine --user && \ +# jupyter serverextension enable --py jupyter_tabnine --user +RUN pip install --no-cache-dir jupyter_contrib_nbextensions \ + jupyter_nbextensions_configurator rise +# jupyter nbextension enable codefolding/main +RUN jupyter labextension install @ijmbarr/jupyterlab_spellchecker + +RUN fix-permissions /home/$NB_USER + +# Switch back to jovyan to avoid accidental container runs as root +USER $NB_UID + +# Copy jupyter_notebook_config.json +#COPY jupyter_notebook_config.json /etc/jupyter/ \ No newline at end of file diff --git a/initital-condarc b/initial-condarc similarity index 100% rename from initital-condarc rename to initial-condarc