jupyterhub / kubespawner

Kubernetes spawner for JupyterHub
https://jupyterhub-kubespawner.readthedocs.io
BSD 3-Clause "New" or "Revised" License
531 stars 299 forks source link

add single user server spawn delay and user-facing message #825

Open shaneknapp opened 3 months ago

shaneknapp commented 3 months ago

this PR allows admins to add a delay to single-user server spawns (useful for testing), and adds a configurable message to present to users after an amount of time has passed, imploring patience.

adding a delay was useful in debugging some grafana metrics (https://github.com/berkeley-dsep-infra/datahub/issues/4237, https://github.com/berkeley-dsep-infra/datahub/pull/4241).

the 'patience message' was added as users would believe that hubs were down/not working/etc when it took longer than a couple of minutes to launch their notebooks, particularly when a new GCP node was spinning up during peak usage times (https://github.com/berkeley-dsep-infra/datahub/issues/3845, https://github.com/berkeley-dsep-infra/datahub/pull/3963).

this has been incredibly useful for us at UC Berkeley and has saved both us and our users many hours of unnecessary support and debugging requests due to slow launches.

ref: https://github.com/jupyterhub/kubespawner/issues/651

shaneknapp commented 3 weeks ago

@yuvipanda @consideRatio

manics commented 1 week ago

I'm not a fan of adding properties just for testing, especially since we already have a lot of complicated configuration properties, and it's trivial to add a delay by subclassing the spawner in-line in the Z2JH config.

A custom user message about the delay sounds useful though. Is there any way to put this in the parent class so it's available to all spawners, or is it inherently tied to KubeSpawner?