From fc34bc74aacc802af746c1298bf1f88ce1b83880 Mon Sep 17 00:00:00 2001 From: stevejpurves Date: Mon, 13 Feb 2023 11:59:30 +0000 Subject: [PATCH] added `remove_named_servers` setting --- docs/topic/idle-culler.md | 16 ++++++++++++++++ tljh/configurer.py | 3 +++ 2 files changed, 19 insertions(+) diff --git a/docs/topic/idle-culler.md b/docs/topic/idle-culler.md index ecb0243..89e400a 100644 --- a/docs/topic/idle-culler.md +++ b/docs/topic/idle-culler.md @@ -40,6 +40,12 @@ the users will not be culled alongside their notebooks and will continue to exis services.cull.users = False ``` +If named servers are in use, they are not removed after being culled. + +```python +services.cull.remove_named_servers = False +``` + ## Configuring the idle culler The available configuration options are: @@ -76,6 +82,16 @@ sudo tljh-config set services.cull.max_age sudo tljh-config reload ``` +### Remove Named Servers + +Remove named servers after they are shutdown. Only applies if named servers are +enabled on the hub installation: + +```bash +sudo tljh-config set services.cull.remove_named_servers True +sudo tljh-config reload +``` + ### User culling In addition to servers, it is also possible to cull the users. This is usually diff --git a/tljh/configurer.py b/tljh/configurer.py index e753afa..f731ee7 100644 --- a/tljh/configurer.py +++ b/tljh/configurer.py @@ -59,6 +59,7 @@ default = { "concurrency": 5, "users": False, "max_age": 0, + "remove_named_servers": False }, "configurator": {"enabled": False}, }, @@ -256,6 +257,8 @@ def set_cull_idle_service(config): cull_cmd += ["--max-age=%d" % cull_config["max_age"]] if cull_config["users"]: cull_cmd += ["--cull-users"] + if cull_config["remove_named_servers"]: + cull_cmd += ["--remove-named-servers"] cull_service = { "name": "cull-idle",