mybinder.org-deploy icon indicating copy to clipboard operation
mybinder.org-deploy copied to clipboard

How is the Docker registry health check conducted?

Open rgaiacs opened this issue 1 year ago • 2 comments

On Friday, 02 August 2024, @arnim noticed that GESIS server was having problems with the Docker registry.

curl https://mybinder.org/health | python3 -m json.tool
{
    "ok": true,
    "checks": [
        {
            "service": "Docker registry",
            "ok": false
        },
        {
            "service": "JupyterHub API",
            "ok": true
        },
        {
            "service": "Pod quota",
            "total_pods": 5,
            "build_pods": 2,
            "user_pods": 3,
            "quota": 250,
            "ok": true,
            "_ignore_failure": true
        }
    ]
}

Knowing how the docker registry health check is conducted will help me to inspect it.

Thanks for the help.

rgaiacs avatar Aug 07 '24 09:08 rgaiacs

It's very basic, it just checks a connection is possible: https://github.com/jupyterhub/binderhub/blob/a8a2e197d5ebbed78f1ee5ee3a40547dc8e0f7eb/binderhub/health.py#L150-L159

We could potentially have a more complex check, though it might end up being specific to the registry implementation

manics avatar Aug 07 '24 11:08 manics

We're already calling a Registry class method in the health check

  • https://github.com/jupyterhub/binderhub/blob/a8a2e197d5ebbed78f1ee5ee3a40547dc8e0f7eb/binderhub/health.py#L158C24-L158C42
  • https://github.com/jupyterhub/binderhub/blob/c71bd8af339c08d9d673a369fe83225cb672d7b3/binderhub/registry.py#L272 so I think it'd be fine to add a new health_check method to the registry class, which defaults to the current check but could be easily overridden.

manics avatar Aug 07 '24 19:08 manics