This is a working example for napari-workshop-template on binder that fixes issues #1. Here is a summary of the structure:
the binder folder contains three files:
environment.yml installs packages to install on binder necessary to run napari such as the remote desktop server
apt.txt installs necessary Linux packages
postBuild installs specific packages necessary to run a given notebook. For this it uses the requirements.txt file at the top of the repository (see below)
requirements.txt file contains the packages necessary to run the workshop. This includes, napari and jupyter as well as other packages that might be demoed. As an example I added the napari-animation plugin. The file also installs jupyter-book in order to build the website
environment.yml at the top of the repository is not the same as the one in the binder folder. It is an alternative to the requirements.txt file for people who prefer to set-up things via conda directly.
All the notebooks have an additional cell to execute in case they are run on binder (to make sure it uses the remote desktop
Given this structure, it might not be necessary to maintain two separate branches as the "complexity" from binder is hidden in the binder folder and people can just build the website and/or run on binder.
I modified other things compared to the main repo and I have a couple of questions about this:
the original requirements.txt file contains all packages necessary with fixed versions. Is that necessary? Fixing everything like that tends to age poorly. In my version, I just install the essentials (jupyter, jupyter-book and napari), and then it's sufficient to periodically check that everything still works. Having a simpler requirements.txt file makes it also more transparent how users can just adde their own packages for workshops
is there any specific reason to used .md files instead of .ipynb? This just adds complexity has people then also need to install jupytext and then right-click on files to open them as notebooks. Having directly ipynb would make this simpler.
is it necessary to execute the notebooks when building the website? Of course it's neat as a control that everything works but especially with napari this might create unnecessary trouble.
This is a working example for napari-workshop-template on binder that fixes issues #1. Here is a summary of the structure:
binder
folder contains three files:environment.yml
installs packages to install on binder necessary to run napari such as the remote desktop serverapt.txt
installs necessary Linux packagespostBuild
installs specific packages necessary to run a given notebook. For this it uses therequirements.txt
file at the top of the repository (see below)requirements.txt
file contains the packages necessary to run the workshop. This includes, napari and jupyter as well as other packages that might be demoed. As an example I added thenapari-animation
plugin. The file also installs jupyter-book in order to build the websiteenvironment.yml
at the top of the repository is not the same as the one in thebinder
folder. It is an alternative to therequirements.txt
file for people who prefer to set-up things via conda directly.Given this structure, it might not be necessary to maintain two separate branches as the "complexity" from binder is hidden in the
binder
folder and people can just build the website and/or run on binder.I modified other things compared to the main repo and I have a couple of questions about this:
requirements.txt
file contains all packages necessary with fixed versions. Is that necessary? Fixing everything like that tends to age poorly. In my version, I just install the essentials (jupyter, jupyter-book and napari), and then it's sufficient to periodically check that everything still works. Having a simplerrequirements.txt
file makes it also more transparent how users can just adde their own packages for workshops