From 75e3e746cf92c0010e57b5968e5815e393a91c75 Mon Sep 17 00:00:00 2001 From: Cheikh Gueye Wane Date: Fri, 24 Nov 2023 10:03:15 +0000 Subject: [PATCH] feat: workspace docker image (#55) --- docker-compose.yml | 4 +--- jupyterhub/config/jupyterhub_config.py | 5 +++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b69ce42..15e17d3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ # This compose file can be useful to develop and debug Jupyterhub code locally. # It is not meant to be deployed in production. -version: '3' +version: "3.9" services: jupyterhub: @@ -38,8 +38,6 @@ services: jupyter: # just used for building - the jupyterhub service will spawn jupyter containers on demand build: jupyter - networks: - - openhexa platform: linux/amd64 image: openhexa-base-notebook command: echo diff --git a/jupyterhub/config/jupyterhub_config.py b/jupyterhub/config/jupyterhub_config.py index e809861..c05867f 100644 --- a/jupyterhub/config/jupyterhub_config.py +++ b/jupyterhub/config/jupyterhub_config.py @@ -105,6 +105,11 @@ async def pre_spawn_start(self, user, spawner): # Let's use the hash generated on the app side spawner.pod_name = f"jupyter-{credentials_data['notebooks_server_hash']}" + + # SET DOCKER IMAGE + if credentials_data.get("image") is not None: + self.log.info(f"Using custom image: {credentials_data['image']}") + spawner.image = credentials_data["image"] # Disable persistent storage in workspaces if len(spawner.volumes) > 0 and spawner.volumes[0]["name"].startswith(