You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2025/03/10 19:44:31 UTC

(airavata) 07/31: revise jupyterhub spawned notebooks, add makefiles

This is an automated email from the ASF dual-hosted git repository.

lahirujayathilake pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git

commit 17012d556bc461b9e530ed12b999878fd96d66c7
Author: yasith <ya...@icloud.com>
AuthorDate: Wed Feb 26 00:01:01 2025 -0600

    revise jupyterhub spawned notebooks, add makefiles
---
 .../deployments/jupyterhub/Dockerfile-jl-base      | 28 ++++++++++++++++++++
 .../deployments/jupyterhub/Dockerfile-jl-iguide    | 30 ++++++++++++++++++++++
 .../deployments/jupyterhub/Dockerfile-nb-base      | 20 ---------------
 .../deployments/jupyterhub/Dockerfile-nb-iguide    | 21 ---------------
 .../deployments/jupyterhub/Makefile                | 13 ++++++++++
 .../deployments/jupyterhub/jupyterhub_config.py    |  2 +-
 6 files changed, 72 insertions(+), 42 deletions(-)

diff --git a/modules/agent-framework/deployments/jupyterhub/Dockerfile-jl-base b/modules/agent-framework/deployments/jupyterhub/Dockerfile-jl-base
new file mode 100644
index 0000000000..e115370edc
--- /dev/null
+++ b/modules/agent-framework/deployments/jupyterhub/Dockerfile-jl-base
@@ -0,0 +1,28 @@
+FROM mambaorg/micromamba:latest
+
+USER root
+WORKDIR /home/jovyan
+
+RUN micromamba install -y -n base -c conda-forge \
+    python=3.11 \
+    pip \
+    git \
+    && micromamba clean --all -y
+
+RUN micromamba run -n base pip install --no-cache-dir \
+    jupyterlab \
+    airavata-jupyter-magic
+
+COPY data/ ./
+
+RUN micromamba run -n base \
+    git clone https://github.com/cyber-shuttle/jupyter-notebook-examples ./examples
+
+EXPOSE 8888
+CMD micromamba run -n base jupyter lab \
+    --ip=0.0.0.0 \
+    --port=8888 \
+    --no-browser \
+    --allow-root \
+    --NotebookApp.exec_lines='import airavata_magics' \
+    --NotebookApp.token=''
diff --git a/modules/agent-framework/deployments/jupyterhub/Dockerfile-jl-iguide b/modules/agent-framework/deployments/jupyterhub/Dockerfile-jl-iguide
new file mode 100644
index 0000000000..a49e2f78b4
--- /dev/null
+++ b/modules/agent-framework/deployments/jupyterhub/Dockerfile-jl-iguide
@@ -0,0 +1,30 @@
+FROM mambaorg/micromamba:latest
+
+USER root
+WORKDIR /home/jovyan
+
+RUN micromamba install -y -n base -c conda-forge \
+    python=3.11 \
+    pip \
+    git \
+    && micromamba clean --all -y
+
+RUN micromamba run -n base pip install --no-cache-dir \
+    jupyterlab \
+    airavata-jupyter-magic
+
+COPY data/ ./
+
+RUN micromamba run -n base \
+    git clone https://github.com/cyber-shuttle/jupyter-notebook-examples ./examples
+RUN micromamba run -n base \
+    git clone https://github.com/DImuthuUpe/population_vulnerable_to_dam_failure ./dam
+
+EXPOSE 8888
+CMD micromamba run -n base jupyter lab \
+    --ip=0.0.0.0 \
+    --port=8888 \
+    --no-browser \
+    --allow-root \
+    --NotebookApp.exec_lines='import airavata_magics' \
+    --NotebookApp.token=''
diff --git a/modules/agent-framework/deployments/jupyterhub/Dockerfile-nb-base b/modules/agent-framework/deployments/jupyterhub/Dockerfile-nb-base
deleted file mode 100644
index cfcdfe2601..0000000000
--- a/modules/agent-framework/deployments/jupyterhub/Dockerfile-nb-base
+++ /dev/null
@@ -1,20 +0,0 @@
-FROM python:3.12-slim
-
-USER root
-WORKDIR /home/jovyan
-
-RUN pip install jupyterlab airavata-magics
-RUN git clone https://github.com/cyber-shuttle/jupyter-notebook-examples examples
-
-EXPOSE 8888
-COPY data/* .
-
-ENTRYPOINT [
-    "jupyter", "lab",
-    "--ip=0.0.0.0",
-    "--port=8888",
-    "--no-browser",
-    "--allow-root",
-    "--NotebookApp.exec_lines='import airavata_magics'",
-    "--NotebookApp.token=''"
-]
diff --git a/modules/agent-framework/deployments/jupyterhub/Dockerfile-nb-iguide b/modules/agent-framework/deployments/jupyterhub/Dockerfile-nb-iguide
deleted file mode 100644
index 153fb9d7be..0000000000
--- a/modules/agent-framework/deployments/jupyterhub/Dockerfile-nb-iguide
+++ /dev/null
@@ -1,21 +0,0 @@
-FROM python:3.12-slim
-
-USER root
-WORKDIR /home/jovyan
-
-RUN pip install jupyterlab airavata-magics
-RUN git clone https://github.com/cyber-shuttle/jupyter-notebook-examples examples
-RUN git clone https://github.com/DImuthuUpe/population_vulnerable_to_dam_failure iguide
-
-EXPOSE 8888
-COPY data/* .
-
-ENTRYPOINT [
-    "jupyter", "lab",
-    "--ip=0.0.0.0",
-    "--port=8888",
-    "--no-browser",
-    "--allow-root",
-    "--NotebookApp.exec_lines='import airavata_magics'",
-    "--NotebookApp.token=''"
-]
diff --git a/modules/agent-framework/deployments/jupyterhub/Makefile b/modules/agent-framework/deployments/jupyterhub/Makefile
index e69de29bb2..b1ce481d6b 100644
--- a/modules/agent-framework/deployments/jupyterhub/Makefile
+++ b/modules/agent-framework/deployments/jupyterhub/Makefile
@@ -0,0 +1,13 @@
+build-jl-base:
+	docker build --platform linux/amd64 -t cybershuttle/jupyterlab-base -f Dockerfile-jl-base . && \
+    docker push cybershuttle/jupyterlab-base
+
+build-jl-iguide:
+	docker build --platform linux/amd64 -t cybershuttle/jupyterlab-iguide -f Dockerfile-jl-iguide . && \
+	docker push cybershuttle/jupyterlab-iguide
+
+run-jl-base:
+	docker run -p 18888:8888 -it cybershuttle/jupyterlab-base
+
+run-jl-iguide:
+	docker run -p 18888:8888 -it cybershuttle/jupyterlab-iguide
diff --git a/modules/agent-framework/deployments/jupyterhub/jupyterhub_config.py b/modules/agent-framework/deployments/jupyterhub/jupyterhub_config.py
index 379062251a..66e5f08f9e 100644
--- a/modules/agent-framework/deployments/jupyterhub/jupyterhub_config.py
+++ b/modules/agent-framework/deployments/jupyterhub/jupyterhub_config.py
@@ -20,7 +20,7 @@ c.GenericOAuthenticator.allow_all = True
 
 # Spawner Configuration
 c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'
-c.DockerSpawner.image = os.environ.get('DOCKER_NOTEBOOK_IMAGE', 'jupyter/base-notebook:latest')
+c.DockerSpawner.image = os.environ.get('DOCKER_NOTEBOOK_IMAGE', 'cybershuttle/jupyterlab-base:latest')
 c.DockerSpawner.notebook_dir = '/home/jovyan'
 c.DockerSpawner.volumes = {
     'jupyterhub-user-{username}': '/home/jovyan',