Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support idle culler debug logging #3216

Open
manics opened this issue Sep 8, 2023 · 0 comments
Open

Support idle culler debug logging #3216

manics opened this issue Sep 8, 2023 · 0 comments

Comments

@manics
Copy link
Member

manics commented Sep 8, 2023

Proposed change

The Z2jh idle culler does not support debug logging:

cull_cmd = ["python3", "-m", "jupyterhub_idle_culler"]
base_url = c.JupyterHub.get("base_url", "/")
cull_cmd.append("--url=http://localhost:8081" + url_path_join(base_url, "hub/api"))
cull_timeout = get_config("cull.timeout")
if cull_timeout:
cull_cmd.append(f"--timeout={cull_timeout}")
cull_every = get_config("cull.every")
if cull_every:
cull_cmd.append(f"--cull-every={cull_every}")
cull_concurrency = get_config("cull.concurrency")
if cull_concurrency:
cull_cmd.append(f"--concurrency={cull_concurrency}")
if get_config("cull.users"):
cull_cmd.append("--cull-users")
jupyterhub_idle_culler_role["scopes"].append("admin:users")
if not get_config("cull.adminUsers"):
cull_cmd.append("--cull-admin-users=false")
if get_config("cull.removeNamedServers"):
cull_cmd.append("--remove-named-servers")
cull_max_age = get_config("cull.maxAge")
if cull_max_age:
cull_cmd.append(f"--max-age={cull_max_age}")
c.JupyterHub.services.append(
{
"name": "jupyterhub-idle-culler",
"command": cull_cmd,
}
)

For instance, it should be possible to enable debug logs using Tornado's built-in option --logging=debug, which could be passed when debug.enabled is set in the chart.

I noticed this whilst answering https://discourse.jupyter.org/t/idle-culler-not-culling/21301/3

Alternative options

  • Add a new option to control idle culler logging
  • Allowing an array of additional command line args to be passed
  • Allow the entire idle culler command to be overridden

Who would use this feature?

Admins wanting to debug the culling in z2jh.

(Optional): Suggest a solution

See above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant