From 68e093feb1557d07687d1dc1824e78fcd0816f8f Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 15 Feb 2023 15:31:39 +0100 Subject: [PATCH 1/2] switch default server to jupyter-server-based jupyter-lab This will launch jupyter-server, and be far more likely to be compatible with current repos than launching the old jupyter-notebook server --- helm-chart/binderhub/values.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/helm-chart/binderhub/values.yaml b/helm-chart/binderhub/values.yaml index 131472eb8..dde5b7a68 100644 --- a/helm-chart/binderhub/values.yaml +++ b/helm-chart/binderhub/values.yaml @@ -224,12 +224,14 @@ jupyterhub: else: have_lab = major >= 3 - if have_lab and "NotebookApp.default_url" not in " ".join(sys.argv): - # if recent-enough lab is available, make it the default UI - sys.argv.insert(1, "--NotebookApp.default_url=/lab/") + if have_lab: + # technically, we could accept another jupyter-server-based frontend + exe = "jupyter-lab" + else: + exe = "jupyter-notebook" # launch the notebook server - os.execvp("jupyter-notebook", sys.argv) + os.execvp(exe, sys.argv) events: true storage: type: none From 2f7189ee9788e384ff65141d6d535439255ae1ab Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 15 Feb 2023 15:46:29 +0100 Subject: [PATCH 2/2] duplicate NotebookApp CLI args to ServerApp ahead of ServerApp deprecating handling of NotebookApp aliases --- binderhub/binderspawner_mixin.py | 4 ++++ helm-chart/binderhub/values.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/binderhub/binderspawner_mixin.py b/binderhub/binderspawner_mixin.py index 175e1d56a..aaa4761f8 100644 --- a/binderhub/binderspawner_mixin.py +++ b/binderhub/binderspawner_mixin.py @@ -84,6 +84,10 @@ def get_args(self): if self.cors_allow_origin == "*": args.append("--NotebookApp.allow_origin_pat=.*") args += self.args + # ServerApp compatibility: duplicate NotebookApp args + for arg in list(args): + if arg.startswith("--NotebookApp."): + args.append(arg.replace("--NotebookApp.", "--ServerApp.")) return args def start(self): diff --git a/helm-chart/binderhub/values.yaml b/helm-chart/binderhub/values.yaml index dde5b7a68..0b3139be9 100644 --- a/helm-chart/binderhub/values.yaml +++ b/helm-chart/binderhub/values.yaml @@ -169,6 +169,10 @@ jupyterhub: if self.cors_allow_origin == "*": args.append("--NotebookApp.allow_origin_pat=.*") args += self.args + # ServerApp compatibility: duplicate NotebookApp args + for arg in list(args): + if arg.startswith("--NotebookApp."): + args.append(arg.replace("--NotebookApp.", "--ServerApp.")) return args def start(self):