jupyterhub / dockerspawner

Spawns JupyterHub single user servers in Docker containers
https://jupyterhub-dockerspawner.readthedocs.io
BSD 3-Clause "New" or "Revised" License
491 stars 308 forks source link

Add implementation for delete_forever #512

Open richardbrinkman opened 10 months ago

richardbrinkman commented 10 months ago

Currently DockerSpawner does not implement the delete_forever function and since the implementation of it in the parent Spawner class is empty, nothing special happens when a user is deleted. If users have persistent storage such as user volumes or bind mounts, it will never be deleted.

Proposed change

Add a configurable option to turn on of off automatic deletion of persistent storage, for example: c.DockerSpawner.delete_persistent_storage_on_user_deletion = True.

Implement the DockerSpawner.delete_forever function that checks whether the volume of bind mount should be deleted.

Alternative options

Always delete persistent storage on user deletion, but that will be an backwards incompatible change.

Who would use this feature?

Admins that delete users. With the proposed feature they don't have to ssh into their Hub and perform a docker volume rm jupyter-hub-<username> any more.

welcome[bot] commented 10 months ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada: