From 2dc33eb701f13b7635e850aa9cd444c9a1b23451 Mon Sep 17 00:00:00 2001 From: Enol Fernandez Date: Wed, 3 Jan 2024 08:21:51 +0000 Subject: [PATCH] Make the use of the sidecar optional --- egi_notebooks_hub/d4science.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/egi_notebooks_hub/d4science.py b/egi_notebooks_hub/d4science.py index 67eafc2..1584c03 100644 --- a/egi_notebooks_hub/d4science.py +++ b/egi_notebooks_hub/d4science.py @@ -14,7 +14,7 @@ from oauthenticator.oauth2 import OAuthLoginHandler from tornado import web from tornado.httpclient import AsyncHTTPClient, HTTPError, HTTPRequest -from traitlets import Dict, List, Unicode +from traitlets import Bool, Dict, List, Unicode D4SCIENCE_REGISTRY_BASE_URL = os.environ.get( "D4SCIENCE_REGISTRY_BASE_URL", @@ -250,6 +250,10 @@ class D4ScienceSpawner(KubeSpawner): config=True, help="""Frame ancestors for embedding the hub in d4science""", ) + use_sidecar = Bool(True, + config=True, + help="""Whether to use or not a sidecar for the workspace""", + ) sidecar_image = Unicode( "eginotebooks/d4science-storage", config=True, @@ -460,7 +464,7 @@ async def pre_spawn_hook(self, spawner): vre = context[context.rindex("/") + 1 :] spawner.log.debug("VRE: %s", vre) spawner.environment["VRE"] = vre - if token: + if token and self.use_sidecar: spawner.extra_containers = [ { "name": "workspace-sidecar",