jupyterhub / binderhub

Run your code in the cloud, with technology so advanced, it feels like magic!
https://binderhub.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2.54k stars 388 forks source link

Add `health_handler_class` to make `/health` handler is customisable #1598

Closed manics closed 1 year ago

manics commented 1 year ago

The original /health handler assumes everything is on Kubernetes, now it's configurable. The default behaviour is unchanged except for an additional field "_ignored": true:

{
  "ok": true,
  "checks": [
    {
      "service": "Docker registry",
      "ok": true
    },
    {
      "service": "JupyterHub API",
      "ok": true
    },
    {
      "service": "Pod quota",
      "total_pods": 0,
      "build_pods": 0,
      "user_pods": 0,
      "quota": null,
      "ok": true,
      "_ignored": true
    }
  ]
}

I could filter it out, but I think it's worth keeping since it makes it clear that the status of the check is always ignored: https://github.com/jupyterhub/binderhub/blob/a6f2701196427d11e44415f62dce26870e6cf511/binderhub/health.py#L201-L205

consideRatio commented 1 year ago

Nice _ignore_failure is great!