binderhub icon indicating copy to clipboard operation
binderhub copied to clipboard

A BinderHub JupyterLab extension

Open choldgraf opened this issue 6 years ago • 9 comments

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:

  • Copy Binder link
  • Download repository as a zip file
  • (optional, disabled on mybinder.org) Copy Binder session w/ token

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

What this would require

  • Understanding of JupyterLab and labextensions
  • Understanding @bitnik's notebook Binder button to re-implement for JupyterLab

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.

choldgraf avatar Oct 23 '19 21:10 choldgraf

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:

  • Download the image (useful in combination with https://github.com/jupyter/repo2docker/pull/778)
  • Export repo contents and image to a repository (e.g. Zenodo - user would need to provide a token to submit on behalf)

nuest avatar Oct 23 '19 22:10 nuest

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

  • upload a zip you downloaded earlier to resume working on your binder

betatim avatar Oct 24 '19 05:10 betatim

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.

jhamman avatar Oct 25 '19 16:10 jhamman

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.

psychemedia avatar Jul 29 '20 08:07 psychemedia

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.

choldgraf avatar Sep 21 '21 16:09 choldgraf

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....

psychemedia avatar Sep 21 '21 16:09 psychemedia

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

manics avatar Sep 21 '21 18:09 manics

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.

betatim avatar Sep 24 '21 07:09 betatim

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.

minrk avatar Oct 05 '21 10:10 minrk