Skip to content

Commit

Permalink
Merge pull request #1635 from minrk/jupyter-server
Browse files Browse the repository at this point in the history
switch default server to jupyter-server-based jupyter-lab
  • Loading branch information
consideRatio authored Feb 28, 2023
2 parents 44bc72b + 2f7189e commit 9641ab8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions binderhub/binderspawner_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
14 changes: 10 additions & 4 deletions helm-chart/binderhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -224,12 +228,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
Expand Down

0 comments on commit 9641ab8

Please sign in to comment.