jupyterhub / binderhub

Run your code in the cloud, with technology so advanced, it feels like magic!
https://binderhub.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2.57k stars 390 forks source link

Jupyter Server support #1634

Closed minrk closed 1 year ago

minrk commented 1 year ago

Proposed change

Recent JupyterLab, and a growing number of extensions require the newer Jupyter Server, and will no longer run on the legacy jupyter-notebook server. But BinderHub (without auth) hardcodes the launch command as jupyter-notebook, and there's no way for repos to opt-in to the current standard Jupyter server (except by redefining jupyter-notebook).

At this point, I think we should switch to launching jupyter-server by default, which I think will be more compatible more often, but is a backward-incompatible change for some repos, especially those that may have old server extensions. In a binder context, I think there are far more lab extensions than classic nb extensions, so I think at this point it will result in fewer broken repos, not more. But it's still a breaking change since which repos are broken will change.

xref https://github.com/jupyter-server/jupyter_server/issues/1038

Alternative options

Make this an option somehow, and possibly opt-in (eventually, it has to be opt-out since we're currently defaulting to a deprecated package that already doesn't work with the current version of our default UI). I don't know where to express that., though, in a way that's going to work.

Who would use this feature?

Everyone who wants to use recent JupyterLab or any other Jupyter frontends other than notebook<7.

(Optional): Suggest a solution

Add to our launch command jupyter-server by default with a fallback on jupyter-notebook. We could gate this on the presence of Jupyter Server 2.0, because Jupyter Server 1.0 tends to be compatible with the legacy notebook server. This decision isn't really made by the user though, it's made for most repos by the repo2docker base env. And I think it would be pretty weird to say 'if you want to launch the old jupyter-notebook, install jupyter-server<2.'

mathbunnyru commented 1 year ago

I think this is the reason why https://mybinder.org/v2/gh/jupyter/docker-stacks/main?urlpath=lab/tree/README.ipynb is broken for jupyter/docker-stacks project after a recent update.

mathbunnyru commented 1 year ago

I hope it will be fixed after a merge :)

mathbunnyru commented 1 year ago
Screenshot 2023-02-28 at 17 11 25

It doesn't work for me :( Launch url: https://mybinder.org/v2/gh/jupyter/docker-stacks/main?urlpath=lab/tree/README.ipynb Project: https://github.com/jupyter/docker-stacks

manics commented 1 year ago

@mathbunnyru It's fixed in BinderHub, but it's not yet deployed to mybinder.org

mathbunnyru commented 1 year ago

Thank you @manics. I thought it was deployed automatically after GitHub push. Could you please ping me when it will be deployed?

manics commented 1 year ago

@mathbunnyru Since it's a potentially disruptive breaking change it'll be announced on Discourse.

minrk commented 1 year ago

@mathbunnyru this has been deployed to mybinder.org now

mathbunnyru commented 1 year ago

@minrk, thank you. I've updated the image and confirm it works well 👍

mathbunnyru commented 1 year ago

It seems to be a bit slow to start, though. (after building image)