We are developing a research platform based on jupyterhub / kubespawner and are trying to implement a way to either
- change ownership of a spawned notebook container or
- make the container available to multiple users
Our current idea is to modify the home template, inject a list of all users via
c.JupyterHub.template_vars and adding dropdowns to select a different user to hand over a specific container.
c.JupyterHub.template_varsis a static dict and would not reflect newly added users (maybe change Dict -> Dict factory (callable))
- Get a list of all users: Is direct access of the server state from jupyterhub_config.py possible? If not we would have to access the REST API (/hub/api/users) but this specific endpoint needs admin privileges
- Change ownership of a container: I think there is currently no API endpoint for this task. Is there another solution?
What do you think? Is there a better / different approach?