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.54k stars 387 forks source link

A BinderHub JupyterLab extension #987

Open choldgraf opened 4 years ago

choldgraf commented 4 years ago

In https://github.com/jupyterhub/mybinder.org-deploy/pull/1202#issuecomment-545631591 @bitnik has been adding a little button to the top-right of the classic notebook interface for Binder links. This got me thinking that we could expose something similar for JupyterLab with an extension.

What do folks think about creating a JupyterLab extension that opens via the sidebar and uses the Binder logo as its icon (similar to what the Dask labextension uses.

This extension could be installed by default on all JupyterLab Binder sessions, and could expose a few simple buttons:

If other obvious use-cases come up, the extension could be extended to other kinds of things too.

What this would require

That said, I don't believe that it would be too technically difficult, considering the fact that much of the under-the-hood implementation should already be possible because of @bitnik's PR. Obviously it'd be more complex as other features were added.

And for deploying on something like mybinder.org, it'd also require a community decision to enable it.

I'm curious what @jhamman and others who deploy BinderHubs for their own communities think about this.

nuest commented 4 years ago

I think this is a great idea and can imagine some further buttons (which go well beyond the metadata exposed so far), and I'm excited to see this mechanism which might help me to realise them:

betatim commented 4 years ago

Would be a nice win for UX!

We should try to reuse existing stuff where we can. For example there are already a few notebook extensions (for example here and nbzip) that do "turn this directory into a zip file". It would be great if we could use their machinery and only add a new button to the UI that is connected to an action they already provide. Mostly because it means we have to maintain less code ourselves :)

Another cool feature

jhamman commented 4 years ago

We'd be all for this. I think @bitnik's feature set on the notebook UI is a great start. Beyond that, I can see how a download this binder button, or a publish my modified binder button would get a lot of use.

psychemedia commented 4 years ago

Related, https://github.com/plasmabio/tljh-repo2docker : "TLJH plugin to build and use Docker images as user environments. The Docker images are built using repo2docker."

And also "A Persistent BinderHub Deployment" (relates to https://github.com/jupyterhub/binderhub/issues/794):

We want to unite the best of JupyterHub and BinderHub. From a user’s point of view we think the way forward is to enable a binder form on the home page of every user on the JupyterHub installation. To achieve this, we added 2 new features to BinderHub, authentication and persistent storage.

choldgraf commented 2 years ago

Are the JupyterLab buttons that we serve on mybinder.org built into BinderHub, or special-cased for mybinder.org?

image

If the former, then I think we could close this issue unless folks really want a sidebar extension.

psychemedia commented 2 years ago

I think I saw a mention somewhere in one of the JupyterLite discussions about a button to run a notebook from a JupyterLite/JupyterLab UI on a remote MyBinder server. The extension suggested by this thread would cover that wouldn't it?

Ah... maybe I misremembered: it was a suggestion for a Binder kernel....

manics commented 2 years ago

They're built in to repo2docker https://github.com/jupyterhub/repo2docker/blob/3eef69f7454ddb9086af38b2ece5f632af05920f/repo2docker/buildpacks/conda/environment.yml#L7 I'm planning to transfer that extension as soon as I've cleaned up a few minor things: https://github.com/jupyterhub/team-compass/issues/437

betatim commented 2 years ago

I think we can close this.

A more ambitious (and not yet done) UI tweak would be having a single bit of UI that BinderHub can inject into the UI independent of the UI a container is using. So instead of having a classic notebook extension, a lab extension, a RStudio extension, etc there'd be one that houses the "Link to this Binder", "Share this Binder", etc actions. However this is a new topic/issue.

minrk commented 2 years ago

In investigating the issues related to https://github.com/jupyterhub/jupyterhub/pull/3636#issuecomment-934174628 , I think we should ship a lab extension for mybinder.org like the hub-extension that registers a custom onConnectionLost handler to give a more informative error and disable reconnects by setting isConnected = false.