Executable environment on the cloud with Binder

Binder allows you to execute and share notebooks to anyone using the web. The way Binder download the notebooks is through a GitHub repo, where the user should specify the environment to run them. This make your work reproducible and shareable very easy like never before!

It ties together many technologies :

  • Docker, a tool that emphasizes reproducibility by packaging your applications into containers to run them from any host.
  • JupyterHub, which uses kubernetes to share multiple instances of notebooks among many users.
  • repo2docker, a tool that converts GitHub repositories into Jupyter-enabled Docker images.

Pre-requisites

  • GitHub ease
  • Basic knowledge on python packages (pip)

What will you learn ?

  • Create a binder link

How to upload a work on Binder ?

Of course, you will need a GitHub account (GitLab, Gist also supported). After you can:

  1. Create a repository with at least one notebook (your work).
  2. Make the requirements.txt file, containing all the dependencies for your notebook(s).
  3. Build your repository into a Docker image that will host your interactive notebooks : https://mybinder.org/
  4. After few seconds, the link to share your notebook(s) from your GitHub repository are ready. Share it to anyone who has an internet browser!

Check this repo, it contains all the necessary requirements.

A few tips

Hosting the static execution

If you execute your notebook before pushing it to github, any user that open the session will have a ready to play environment (without the need to re-execute the notebook).

Binder badge

You can add a badge in your repository:

https://mybinder.org/badge_logo.svg

When clicking on this badge, anyone can access the executable environment in an easy way. Just add this snippet to your file, it can be either a .md or .rst:

https://mybinder.org/badge_logo.svg

JupyterLab

JupyterLab is a more powerfull web IDE for jupyter notebooks. Adding ?urlpath=lab at the end of the link will open a jupyter lab environment.

Pointing to a specific notebook

You can point to a specific notebook nilearn-example.ipynb by adding ?filepath=notebooks%2Fnilearn-example.ipynb at the end of the binder url.

Note

The slashes / are replaced by %2F.

Questions ?

If you have any issues using Alliance Canada, don’t hesitate to ask your questions on the SIMEXP lab slack in #conp channel!