Open jtpio opened 4 years ago
Here is an example of a plugin that doesn't use the default environment: https://github.com/plasmabio/tljh-repo2docker
Instead it uses repo2docker to build Docker images local to the server. This enables multiple and isolated user environments on the same machine.
The environments can be managed via the UI:
Adding an environment is very similar to what one would do on Binder:
The environments can then be selected on the server options page:
Pretty much like a Binder on a single machine :)
Maybe there could indeed be a new hook added to spec, something like tljh_user_environment
.
It might be possible to use some of the pluggy options for the specs to enable only one result for a particular hook. For example with firstresult
: https://pluggy.readthedocs.io/en/latest/#first-result-only
The default user environment plugin shipped with TLJH would define this hook. It would be "overridden" by other plugins that implement the same hook. So only one would be executed.
This issue has been mentioned on Jupyter Community Forum. There might be relevant details there:
https://discourse.jupyter.org/t/a-tljh-plugin-to-build-user-environments-with-repo2docker/4258/1
@jtpio Just picking up on the TLJH+dockerspawner comment, there is a recipe documented here for setting up TLJH to use dockerspawner. I imagine that elements of the tljh_repo2docker
might be reusable, although the UI requirements and workflow would be slightly different:
TLJH's focus on simplicity and good defaults is great, which makes it very tempting to use it for other cases than it was designed for!
One of these use cases is being able to use TLJH with containers and the
DockerSpawner
. This is something that was mentioned in #484 and #524 (and some Discourse topics). The Voila Gallery TLJH plugin is another example that usesDockerSpawner
to spawn servers: https://github.com/voila-dashboards/tljh-voila-galleryAs of today, the TLJH installer creates a default user environment, which also installs extensions for JupyterLab and rebuilds the application. These steps increase the time it takes to install TLJH, and could ideally be skipped when the default environment is not needed (using Docker images instead).
The idea would be to extend the existing plugin system to allow more advanced usage, while keeping the same defaults as now.
@yuvipanda shared good ideas in this comment on how we could proceed: