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

Linking back to the source of a binder #674

Closed betatim closed 4 years ago

betatim commented 6 years ago

via https://twitter.com/podehaye/status/1045071251667079169

We should consider displaying a (prominent) link back to the source of a live binder instance.

I think it is pretty hard to tell the difference between https://mybinder.org/v2/gl/betatim/not-evil-at-all?urlpath=something/here/now.ipynb and https://mybinder.org/v2/gh/betatim/not-evil-at-all?urlpath=something/here/now.ipynb

Another use case is people following a launch link and then ending up in a binder and now wondering "so where is the github repo for this?"

These two cases together make me think that we should figure out a way to display a banner or something like that at the top of all pages served by a BinderHub. One way would be to modify the notebook server templates via the appendix. With that we could cover lab and notebook but RStudio would be harder to do. Could the nbrserverproxy inject some HTML (@ryanlovett) to add a banner?

Related #579

arnim commented 6 years ago

@bitnik has implemented something similar with "Copy repo link" https://notebooks.gesis.org/binder/v2/gh/gesiscss/workshop_girls_day/master

jzf2101 commented 6 years ago

Actually the I was thinking of the opposite- which is we should also think of a way of allowing scientists to publish code anonymously for the purposes of double-blind review

betatim commented 6 years ago

@jzf2101 should we make a new issue for that? I think BinderHub would need a lot of reworking if we wanted to make it not show where things came from. Maybe a stop gap solution is to have a GitHub org that has obfuscated names for the repos or something?

choldgraf commented 6 years ago

@arnim @bitnik this is quite nice! Any idea on how tough this would be to implement for mybinder.org?

choldgraf commented 6 years ago

re: @betatim 's original points about other UIs, if there isn't a UI-generic way to do this, we could also put a button on the binder loading UI

jhamman commented 6 years ago

@bitnik - this is really nice. Does anyone have thoughts on how this would work with jupyter-lab? Perhaps building on jupyterlab-hub?

choldgraf commented 6 years ago

Yeah I bet you could do this with a Lab plugin - I don't have a ton of experience w/ JupyterLab though :-/ maybe @ian-r-rose has thoughts?

ian-r-rose commented 6 years ago

It would be pretty straightforward to make a lab extension that adds a badge plus tooltip that point back to the original repo. If you felt comfortable with including such a plugin in the base image we could have it enabled by default (though I don't think that would solve the original security concern).

jhamman commented 6 years ago

@ian-r-rose - +1 on this idea. This shouldn't be all that hard. Most of this info is already available in environment variables so I would image this would be about an easy of a plugin as one can image.

betatim commented 6 years ago

Maybe we should use the UI specific suggestions made here as they are a good start and cover the two most popular UIs.

It would also allow us to have an easier story around how to share a binder by providing a button for that instead of people sharing the hub.mybinder.org links.

Can we display something in the menu bar on the right side in Jupyter lab?

I think the way to install these would be via the appendix instead of putting it in the base image.

bitnik commented 6 years ago

@choldgraf I can make a PR for mybinder.org to add those buttons and there we can also discuss which buttons are needed and how to name them. Or probably better first I should document how to use the appendix. There is already an example in github (https://github.com/jupyterhub/binderhub/tree/master/examples/appendix), which is to replace the login template, but it is not in the documentation.

What do you think?

Btw to shortly explain: I added those buttons in https://notebooks.gesis.org/binder/v2/gh/gesiscss/workshop_girls_day/master by using custom.js feature of Jupyter Notebook. And added this custom.js into image via the appendix.

ian-r-rose commented 6 years ago

@betatim Yes, we should be able to add a badge in the menu bar. Can you point me to the appendix and describe briefly what that would entail?

jhamman commented 6 years ago

@ian-r-rose - are you thinking of a tab on the left bar like this?

picture1

ian-r-rose commented 6 years ago

@jhamman I was thinking something more along the lines of a badge in the top menu bar. Or even an item in the "Help" menu.

choldgraf commented 6 years ago

I like @jhamman 's pattern there as well. Though agree if it were in the top menu bar it'd be more immediately discoverable. Then again, we could always have both of these in the feature roadmap :-)

ian-r-rose commented 6 years ago

The side panel is oriented around having panels with more stuff in them. Is there something you had in mind for more content there? Otherwise I would think that a top button or menu item would be more consistent.

betatim commented 6 years ago

@ian-r-rose re: appendix - maybe we start with a PR from @bitnik for the notebook UI which will demonstrate the appendix feature.

In short, binderhub adds a little extra to every build after the user has had their say to make some final tweaks which are needed for running on a binderhub but not needed if you are launching it with repo2docker at home. Also the appendix works even when people have a custom Dockerfile.

I like the idea of placing it in the top right of the menubar to try and place it in approximately the same location in both lab and notebook. IMHO the main purpose of this is to make it very easy to find and understand for those who aren't Jupyter/Binder regulars. So we should aim for the most "in your face" solution that isn't totally horrible. Experienced people already know how to find all the info they are after (I think).

jzf2101 commented 6 years ago

We can make a separate issue for my question I'm just mentioning it

bitnik commented 6 years ago

I did the PR on Binderhub: https://github.com/jupyterhub/binderhub/pull/682 - I will do another PR for mybinder.org

Also the appendix works even when people have a custom Dockerfile.

@betatim I don't think that appendix works with custom Dockerfiles. It uses the dockerfile without appendix: https://github.com/jupyter/repo2docker/blob/master/repo2docker/buildpacks/docker.py#L34

bitnik commented 6 years ago

There will be also Quit button in jupyterlab by v0.35 (https://github.com/jupyterlab/jupyterlab/issues/4647)

I don't if it is easy to do but I think it would be nice to move it where repo link will be

betatim commented 5 years ago

Rebooting this issue. It would be great to upstream the "share this link to start your own instance of this" button from GESIS to BinderHub. As a v1 I'd go with the button as-is from GESIS. Then we refine/improve/expand scope.

A separate PR that does this for classic notebook and one that does this for lab would be Ok with me. It allows us to work on them independently.

@bitnik do you want to attempt this?