JupyterHub 使用注销不停止 docker 容器

JupyterHub use logout does not stop docker container

我按照本教程使用非常基本的 DummyAuthenticator 和 Docker Spawner 在 google 云上成功配置了 jupyterhub:https://github.com/jupyterhub/jupyterhub-deploy-docker 一切正常,但是当用户注销时,它的 docker 容器仍然是 运行。我期待容器在未使用时会停止。就我的口味而言,这是一种资源浪费。是否有机会触发该行为?

我认为 JupyterHub 不会通过注销自动删除任何服务。

但您可以使用 Cull-Idle。 它提供了一个脚本来剔除和关闭空闲的单用户笔记本服务器。而且它非常容易使用。

Link :

https://github.com/jupyterhub/jupyterhub/tree/master/examples/cull-idle

我从 jupyterhub 生成的默认配置文件中使用了这个。

注销时关闭所有用户服务器

c.JupyterHub.shutdown_on_logout = 真

剔除应该用于在用户仍处于登录状态时关闭不活动的服务器。