From dc64fd0c5ed3d12470e79496fedabe0d22e8786e Mon Sep 17 00:00:00 2001
From: Moritz Maxeiner <mm@ucw.sh>
Date: Tue, 1 Dec 2020 15:08:41 +0100
Subject: [PATCH] [jupyterhub] add venv&kernel for tensorflow 2

---
 jupyterhub/base/Dockerfile | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/jupyterhub/base/Dockerfile b/jupyterhub/base/Dockerfile
index d913ef3..3155711 100755
--- a/jupyterhub/base/Dockerfile
+++ b/jupyterhub/base/Dockerfile
@@ -85,7 +85,42 @@ RUN mkdir -p /usr/local/venv && \
         neo \
         'mxnet-cu101>=1.6.0,<1.7.0' \
         && \
-    ipython kernel install --name=default
+    ipython kernel install --name=default --display-name "Python (Default)"
+
+RUN mkdir -p /usr/local/venv && \
+    python${PYTHON_VERSION} -m venv /usr/local/venv/tf2 && \
+    . /usr/local/venv/tf2/bin/activate && \
+    python${PYTHON_VERSION} -m pip install --upgrade \
+        pip==${PYTHON_PIP_VERSION} \
+        setuptools==${PYTHON_SETUPTOOLS_VERSION} && \
+    pip install tensorflow==2.3.1 && \
+    pip install \
+        wheel \
+        black \
+        isort \
+        pandas \
+        scipy \
+        pingouin \
+        statsmodels \
+        matplotlib \
+        seaborn \
+        brokenaxes \
+        tables \
+        xlrd \
+        hsluv \
+        ipympl \
+        ipywebrtc \
+        ipyvolume \
+        JPype1 \
+        PySide2 \
+        ipykernel \
+        tqdm \
+        sklearn \
+        ffmpeg-python \
+        neo \
+        'mxnet-cu101>=1.6.0,<1.7.0' \
+        && \
+    ipython kernel install --name=tf2 --display-name "Python (TensorFlow 2)"
 
 RUN apt-get update && \
     apt-get install -y \
-- 
GitLab