Page MenuHomePhabricator

"Launch in Binder" button for public PAWS notebooks
Closed, DeclinedPublic


Here, I have the use case in mind that a wiki page - say, a Wikipedia article - links to a Jupyter notebook that illustrates some aspect of a programming language, algorithm, dataset or similar.

In such a scenario, having those links point to public PAWS notebooks (which are static) would be useful, but would not provide an opportunity for interactive exploration, so I would like to have some kind of "launch in Binder" button for public PAWS notebooks, which would allow users to explore the notebook's functionality by themselves.

Event Timeline

Launch in Binder as in or should it be Launch in PAWS? If the latter, this becomes T264603

Launch in Binder as in or should it be Launch in PAWS? If the latter, this becomes T264603

The former (or some Wikimedia version of it, perhaps even via a publicly accessible mechanism on top of PAWS).

While I am very much in favour of making it easier to fork notebooks within PAWS, as per T264603, I opened this ticket specifically to be able to run PAWS-based notebooks in Binder, similar to how GitHub-based notebooks (example) can be run via calls like{x}?filepath={y}, where x is the branch and y the file path (example).

The reason why I want to be able to launch the notebooks using Binder is that I want to enable Wikipedia readers to explore such Wikipedia-linked notebooks, including interactively if they so choose. For example, the notebook linked from the External links section in the HMAC-based One-time Password algorithm article on the English Wikipedia is hosted on GitHub, so I can use the above URL pattern to launch it via Binder, but since the GitHub version can disappear or change at any moment, it would be preferable to have such Wikimedia-cited notebooks hosted on some Wikimedia infrastructure. Naturally, PAWS comes to mind here, but running PAWS-hosted notebooks currently requires a Wikimedia account (which few Wikipedia readers have), while launching via Binder does not, and PAWS-hosted public notebooks cannot be run directly.

It would thus be nice to have a similar mechanism for PAWS, e.g.{x}?filepath={y} or - if notebook versioning is ignored - something even simpler like{y} .

Binder has a list of supported repo providers, along with instructions on how to add new repo providers like PAWS.

A workaround would be to provide a mechanism by which a PAWS-hosted notebook could be more readily forked into some of the places currently listed as supported repo providers, similar to how GitHub-hosted repos can be archived on Zenodo, which is a Binder-supported repo provider (e.g. to launch Binder based on the Zenodo repo for my JupyterCon talk, you can simply click here).

I see the reasoning, but I worry the assumptions for PAWS and are too divergent for us to solve this easily.

The biggest show stopper is the OAuth tokens for the Wikimedia user, several notebooks are written with the assumption you are authorized for pywikibot and it would be impossible to securely give public access to the tokens for a Similar issues come up for notebooks that access wikireplicas or toolsdb.

This is enough to make me wary of adding a "Launch in Binder" button as it would be a bad experience for a significant number of notebooks.

Adding PAWS as repo provider in BinderHub would not be a lot a code, but I fear BinderHub might take issue with using what is essentially an unversioned file repository as a repo provider for binders.

There is also a significant issue with the base image and the lack of configuration files for repo2docker to build a similar image. We could in theory provide files to make a PAWS notebook that does not depend on Wikimedia secrets or infrastructure run in, but that would be a significant deviation from the current repo providers in BinderHub. In the end this is a discussion for the BinderHub project, not for here. I would be happy to participate and help in that discussion.

In the end, I think we can revisit the add a button part if we manage to add PAWS as a repoprovider upstream, but I find that unlikely enough that I am declining this for now.

(or some Wikimedia version of it, perhaps even via a publicly accessible mechanism on top of PAWS)

This is an interesting idea and I would support a Wikimedia BinderHub deployment, but I think we should discuss it in its own ticket.