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

Adopt health checks for dbus-session #177

Open
5 tasks
vpetersson opened this issue Oct 20, 2021 · 9 comments
Open
5 tasks

Adopt health checks for dbus-session #177

vpetersson opened this issue Oct 20, 2021 · 9 comments

Comments

@vpetersson
Copy link
Contributor

vpetersson commented Oct 20, 2021

I attempted to add a health check for dbus-session in #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
Copy link
Member

shawaj commented Oct 20, 2021

Need to add one for diagnostics too presumably?

@vpetersson
Copy link
Contributor Author

Already added that.

@shawaj
Copy link
Member

shawaj commented Oct 20, 2021

Already added that.

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

@shawaj
Copy link
Member

shawaj commented Oct 20, 2021

Needs to be like:

    depends_on:
      dbus-session:
        condition: service_healthy
      diagnostics:
        condition: service_healthy

@vpetersson
Copy link
Contributor Author

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

@shawaj
Copy link
Member

shawaj commented Oct 20, 2021

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

@vpetersson
Copy link
Contributor Author

vpetersson commented Oct 20, 2021

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
Copy link
Member

shawaj commented Oct 21, 2021

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

@vpetersson
Copy link
Contributor Author

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.

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

2 participants