Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch default server to jupyter-server-based jupyter-lab #1635

Merged
merged 2 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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