NebraLtd / helium-miner-software

Software for Nebra (and third party) Helium Miners
https://nebra.io/hnt
MIT License
93 stars 48 forks source link

Adopt health checks for dbus-session #177

Open vpetersson opened 2 years ago

vpetersson commented 2 years ago

I attempted to add a health check for dbus-session in https://github.com/NebraLtd/helium-miner-software/pull/174. However, since we are currently using docker-compose version 2, this will not work. To implement this health check properly, we need to upgrade to 2.4. There is as pull request for this below, so let's just wait until this has been sorted out.

The health check would look something like this:

    healthcheck:
      test: [
        "dbus-send",
        "--system",
        "--print-reply",
        "--dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames"
      ]
      interval: 5m
      timeout: 10s
      retries: 5
      start_period: 30s

We might need to tweak these values a bit.

The task includes:

References

shawaj commented 2 years ago

Need to add one for diagnostics too presumably?

vpetersson commented 2 years ago

Already added that.

shawaj commented 2 years ago

Already added that.

But it's not being checked anywhere? Need to add that to the docker compose for miner and config containers

shawaj commented 2 years ago

Needs to be like:

    depends_on:
      dbus-session:
        condition: service_healthy
      diagnostics:
        condition: service_healthy
vpetersson commented 2 years ago

You are correct. We need to add this condition too. I assumed that was implicit, but it wasn't.

shawaj commented 2 years ago

I think service_started is the default https://docs.docker.com/compose/compose-file/compose-file-v2/#depends_on

vpetersson commented 2 years ago

From balena support:


Victor, I'm afraid this will not work even after (any level of) support for 2.4 is added. Our Supervisors currently only understand the service_started kind of depends_on (ie. not service_healthy). We do have plans to ultimately extend support for several newer properties and features of Docker Compose but it's a complex that just hasn't been prioritised yet.

Can you briefly describe the use case you have for depending on service_healthy? We may be able to suggest workarounds for the short/mid term.

shawaj commented 2 years ago

@vpetersson ahh that is annoying...did they have any possible workarounds?

vpetersson commented 2 years ago

The current workaround is essentially what we're doing (i.e. a checker in the init script). I've requested here if the new changes will also include the service_healthy state.