Skip to content

Default to JupyterLab single document mode (/doc) #1026

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

Closed
manics opened this issue Mar 22, 2021 · 10 comments
Closed

Default to JupyterLab single document mode (/doc) #1026

manics opened this issue Mar 22, 2021 · 10 comments

Comments

@manics
Copy link
Member

manics commented Mar 22, 2021

Proposed change

Switch the default repo2docker interface from jupyter-notebook to JupyterLab's single document mode.

I'd like to gauge everyone's feelings on if/when we'd make the switch.

Background

The trigger for this comes from the decision to switch Z2JH to JupyterLab: jupyterhub/zero-to-jupyterhub-k8s#776 (comment). I asked whether we could change Z2JH to not set singleuser.cmd and instead default to whatever the default entrypoint/command is in the Docker image and instead change the default in the base docker-stacks images jupyterhub/zero-to-jupyterhub-k8s#776 (comment), an advantage being we would no longer ignore the default start-up scripts that lead to problems such as https://discourse.jupyter.org/t/pyspark-library-is-missing-from-jupyter-pyspark-notebook-when-running-with-jupyterhub-zero-to-jupyterhub-k8s/8450/2, and also backwards compatibility would hopefully be easier to handle.

@parente pointed me to an existing docker-stacks discussion on switching to JupyterLab jupyter/docker-stacks#1217 where one of the suggestions is to wait for other projects such as Z2JH and BinderHub (i.e. repo2docker) to switch. What does everyone think? If you can envisage switching R2D in the next few months then it might make sense to hold off on the Z2JH switch, and co-ordinate with docker-stacks instead to switch everything in one go. On the other hand if it's longer then we should probably figure out how to switch Z2JH and ensure older images continue to work.

@SylvainCorlay
Copy link
Collaborator

Thanks! +1000 on this! This is long overdue, as lab is where most of the team has been putting work (and love) for so long. This is also where all the current efforts are going with respect to accessibility, internationalization, collaborative editing, and the 3.x series of lab resolves the main pain points for extension authors.

@minrk
Copy link
Member

minrk commented Apr 9, 2021

I think we should make this switch now. Summarizing the separate transitions we can make from discussion in the meeting and pr:

  1. default UI to lab in repo2docker (NotebookApp.default_url)
  2. default UI (and filepath) to lab in binderhub (URL construction, as in Send filepath urls to JupyterLab instead of classic notebook binderhub#1288)
  3. switch server to jupyter_server (i.e. switch command to jupyter lab)

Switching UI in repo2docker and binderhub can reasonably be taken at the same time, but technically they are separate as BinderHub has full control over what URLs we redirect to (and with filepath, is fully overridden).

Personally, I think it's appropriate to switch default UI today. This can be done entirely on mybinder.org as in jupyterhub/binderhub#1288, or coordinated in both repo2docker and binderhub. The situation with lab and notebook only reverses: this only changes the default and is overridden easily with urlpath.

The server switch is a bigger deal, both because it's likely more disruptive (presumably there will be compatibility issues with server extensions - how many server extensions are used on Binder?), and because it's much harder to opt out on Binder (must specify the extreme override start command)

@SylvainCorlay
Copy link
Collaborator

@minrk, item 1 is in PR #1035.

@manics
Copy link
Member Author

manics commented Apr 9, 2021

When people have problems binderising a repo on Discourse we often tell them to try debugging the problem using repo2docker locally, so if we can keep binder and repo2docker in sync that's one less difference to worry about. It's not essential though.

jupyterhub/binderhub#1288 switches the filepath parameter which seems fine to me. For changing the default UI (/➡️ /tree vs /➡️/lab) can we do this entirely in the image built by repo2docker, so that custom applications such as https://discourse.jupyter.org/t/new-package-to-run-arbitrary-web-service-in-jupyterhub-jhsingle-native-proxy/3493/5 won't be broken by forcing them to /lab?

@betatim
Copy link
Member

betatim commented Apr 10, 2021

I like the idea of trying to take care of this switch within the image built by repo2docker. This could be nicer than jupyterhub/binderhub#1288 (comment).

For a repo that was a built a while ago we told users to use https://mybinder.org/v2/gh/org/repo/HEAD to launch it and that this will start classic notebook. If we change the URL that users are sent to in the container there will be images that used to work but are now broken because they don't have anything serving requests at that new URL. In a way we are changing the default value of a function argument to a value that existing users might not recognise.

How can we transition to the new default without breaking existing links/images?

@SylvainCorlay
Copy link
Collaborator

Use https://mybinder.org/v2/gh/org/repo/HEAD to launch it and that this will start classic notebook

We could have a v3...

@manics
Copy link
Member Author

manics commented Apr 22, 2021

It's still not clear to me why BinderHub/mybinder.org should care about whether the repo2docker image defaults to jupyterlab or notebook. Can't that be handled entirely within the image built by repo2docker, and mybinder just directs the user to / and lets the image take care of whether that goes to lab or notebook? Newly built images would default to jupyterlab, existing images in the cache would remain on notebook.

@minrk
Copy link
Member

minrk commented Apr 26, 2021

BinderHub doesn't need to care, I was mainly pointing out that it can make a transition at a different time or in a different way if we want to.

BinderHub does pick the UI for the user in filepath in how we construct the url (build /doc/tree/... instead of /tree/...). That's what jupyterhub/binderhub#1288 does, it doesn't actually change the default when no path is specified.

So I think we should merge both:

@manics
Copy link
Member Author

manics commented Apr 26, 2021

@minrk thanks for the explanation!

@minrk
Copy link
Member

minrk commented Sep 9, 2021

merged #1035

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants