From 50fb20c5ee5d42558bd7523aacf3c4fae5bb51f4 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Tue, 10 Dec 2024 16:35:51 +0000 Subject: [PATCH 1/2] Start jupyterlab app via jhsingle_native_proxy --- jhub_apps/spawner/command.py | 12 +++++++++++- jhub_apps/spawner/spawner_creation.py | 13 +------------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/jhub_apps/spawner/command.py b/jhub_apps/spawner/command.py index bd7a2700..3c6b6090 100644 --- a/jhub_apps/spawner/command.py +++ b/jhub_apps/spawner/command.py @@ -160,5 +160,15 @@ def get_substituted_args(self, **kwargs): f"--ready-timeout={READY_TIMEOUT}", ] ), - Framework.jupyterlab.value: Command(args=[]), + Framework.jupyterlab.value: Command(args=[ + "--destport=0", + TString("--conda-env=$conda_env"), + TString("$python_exec"), + "{-}m", + "jupyterhub.singleuser", + "{--}debug", + "--ip=0.0.0.0", + "--ready-check-path=/ready-check", + f"--ready-timeout={READY_TIMEOUT}", + ]), } diff --git a/jhub_apps/spawner/spawner_creation.py b/jhub_apps/spawner/spawner_creation.py index afa2ddac..20755677 100644 --- a/jhub_apps/spawner/spawner_creation.py +++ b/jhub_apps/spawner/spawner_creation.py @@ -104,11 +104,7 @@ def get_env(self): async def start(self): logger.info("Starting spawner process") await self._get_user_auth_state() - framework = self.user_options.get("framework") - if ( - self.user_options.get("jhub_app") - and framework != Framework.jupyterlab.value - ): + if self.user_options.get("jhub_app"): auth_type = "oauth" if self.user_options.get("public", False): auth_type = "none" @@ -127,13 +123,6 @@ async def start(self): self.cmd.append("--force-alive") else: self.cmd.append("--no-force-alive") - - if framework == Framework.jupyterlab.value: - self.cmd = [ - self.config.JAppsConfig.python_exec, - "-m", - "jupyterhub.singleuser", - ] logger.info(f"Final Spawner Command: {self.cmd}") return await super().start() From 7af875aeea73f470ef0c91a443042a7a88d3570b Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Fri, 8 Nov 2024 12:00:00 +0000 Subject: [PATCH 2/2] add port --- jhub_apps/spawner/command.py | 1 + 1 file changed, 1 insertion(+) diff --git a/jhub_apps/spawner/command.py b/jhub_apps/spawner/command.py index 3c6b6090..5371a3a5 100644 --- a/jhub_apps/spawner/command.py +++ b/jhub_apps/spawner/command.py @@ -166,6 +166,7 @@ def get_substituted_args(self, **kwargs): TString("$python_exec"), "{-}m", "jupyterhub.singleuser", + "{--}port={port}", "{--}debug", "--ip=0.0.0.0", "--ready-check-path=/ready-check",