diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7d87cc2bd97eb622df774f45d3180f94abd5d470..8efe8353cb96db279fee7364097add2ee0ca8e88 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,7 @@ build ubuntu: script: - image_name="${CI_REGISTRY}/${CI_PROJECT_PATH,,}" - podman build --pull -t "${image_name}/ubuntu" ubuntu + - podman build -t "${image_name}/jupyterhub" jupyterhub deploy ubuntu: stage: deploy @@ -19,5 +20,6 @@ deploy ubuntu: script: - image_name="${CI_REGISTRY}/${CI_PROJECT_PATH,,}" - podman push "${image_name}/ubuntu" + - podman push "${image_name}/jupyterhub" after_script: - podman logout "${CI_REGISTRY}" diff --git a/jupyterhub/Dockerfile b/jupyterhub/Dockerfile new file mode 100755 index 0000000000000000000000000000000000000000..5ee3d4b938251de0ef456615389d6e5a7132a742 --- /dev/null +++ b/jupyterhub/Dockerfile @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: Apache-2.0 +FROM git.imp.fu-berlin.de:5000/bioroboticslab/robofish/docker/ubuntu + +LABEL maintainer="Moritz Maxeiner <moritz.maxeiner@fu-berlin.de>" +LABEL authors="Moritz Maxeiner <moritz.maxeiner@fu-berlin.de>" + +RUN apt-get update && \ + apt-get install -y \ + curl && \ + apt-get clean + +RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \ + apt-get update && \ + apt-get install -y \ + openssh-server \ + nodejs \ + node-gyp \ + libssl1.0-dev \ + openbox \ + openjdk-11-jre-headless && \ + apt-get clean + +COPY --from=git.imp.fu-berlin.de:5000/bioroboticslab/robofish/docker/tensorflow:1.15.3 /opt/tensorflow/build/tensorflow-1.15.3-cp37-cp37m-linux_x86_64.whl /opt/tensorflow/tensorflow-1.15.3-cp37-cp37m-linux_x86_64.whl + +RUN python3.7 -m pip --no-cache-dir install \ + jupyterlab \ + jupyterhub \ + && \ + python3.7 -m jupyter labextension install \ + @jupyter-widgets/jupyterlab-manager \ + jupyter-matplotlib && \ + python3.7 -m jupyter serverextension enable --sys-prefix --py jupyterlab && \ + python3.7 -m jupyter labextension install \ + jupyter-webrtc \ + ipyvolume \ + jupyter-threejs + +RUN mkdir -p ~/.venv && \ + python3.7 -m venv ~/.venv/robofish && \ + . ~/.venv/robofish/bin/activate && \ + pip --no-cache-dir install --upgrade pip==20.1.1 && \ + pip --no-cache-dir install --upgrade setuptools==49.1.0 && \ + pip install /opt/tensorflow/tensorflow-1.15.3-cp37-cp37m-linux_x86_64.whl && \ + pip --no-cache-dir install \ + wheel \ + scipy \ + matplotlib \ + pandas \ + tables \ + ipympl \ + ipywebrtc \ + ipyvolume \ + seaborn \ + JPype1 \ + PySide2 \ + ipykernel \ + mxnet-cu101==1.6.0 \ + && \ + ipython kernel install --user --name=robofish + +COPY jupyter_notebook_config.py /root/.jupyter/ +COPY themes.jupyterlab-settings /root/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/ +COPY commands.jupyterlab-settings /root/.jupyter/lab/user-settings/@jupyterlab/codemirror-extension/ + +RUN chmod -x /etc/update-motd.d/* + +WORKDIR "/root" +CMD [ "jupyterhub-singleuser" ] diff --git a/jupyterhub/commands.jupyterlab-settings b/jupyterhub/commands.jupyterlab-settings new file mode 100755 index 0000000000000000000000000000000000000000..e954c5465e1cfab369dfd26561ff5a45b8d65fb7 --- /dev/null +++ b/jupyterhub/commands.jupyterlab-settings @@ -0,0 +1,3 @@ +{ + "theme": "jupyter" +} \ No newline at end of file diff --git a/jupyterhub/jupyter_notebook_config.py b/jupyterhub/jupyter_notebook_config.py new file mode 100755 index 0000000000000000000000000000000000000000..97475e78164cbda26822c40f0a6e11dc0c49a3a5 --- /dev/null +++ b/jupyterhub/jupyter_notebook_config.py @@ -0,0 +1,5 @@ +c.NotebookApp.open_browser = False +c.NotebookApp.token = '' +c.NotebookApp.allow_root = True +c.NotebookApp.terminado_settings = { 'shell_command': ['/bin/bash', '-l'] } +c.MultiKernelManager.default_kernel_name = 'robofish' diff --git a/jupyterhub/themes.jupyterlab-settings b/jupyterhub/themes.jupyterlab-settings new file mode 100755 index 0000000000000000000000000000000000000000..b71898fbde3625ed149f4ba98f4b8bec264d0781 --- /dev/null +++ b/jupyterhub/themes.jupyterlab-settings @@ -0,0 +1,3 @@ +{ + "theme": "JupyterLab Dark" +} \ No newline at end of file