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.
Of course, you will need a GitHub account (GitLab, Gist also supported). After you can:
- Create a repository with at least one notebook (your work).
- Make the
requirements.txt
file, containing all the dependencies for your notebook(s). - Build your repository into a Docker image that will host your interactive notebooks : https://mybinder.org/
- 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.
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).
You can add a badge in your repository:
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
:
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/<user_name>/<repo_name>/master)
.. image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/ltetrel/binder-tuto/master?filepath=notebooks%2Fnilearn-example.ipynb
Adding ?urlpath=lab
at the end of the link will open a jupyter lab environment.
You can also point to a specific notebook with ?filepath=notebooks%2Fnilearn-example.ipynb
!
@emdupre, @mathieuboudreau