You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow easy healthcheck for the dagger engine #7733
It's currently quite difficult to write a healthcheck for the dagger engine itself - how do you know if it's running, and ready to accept connections?
Previously, you used to be able to use the buildctl command to connect manually (but that was removed), or even use a dummy dagger query command (but that was also removed).
We should make it easy to run a command in the engine container to see if the engine is running and healthy. Ideally, this would mean shipping dagger inside the engine container, and maybe even providing a simple dagger ping or dagger health command to check communication (we could use this in our own CI as well).
Previously, you used to be able to use the buildctl command to connect manually (but that was removed), or even use a dummy dagger query command (but that was also removed).
Did we remove the buildctl CLI from the image? At the moment we are still using buildctl in our helm chart:
I'm planning on adding a whole engine API under query in our graphql API (to support cache query and control as part of #7646), at which point we can move version and/or add ping under there. So then this would be dagger core engine version/dagger core engine ping.
Bundle the CLI and the engine together into a single image
Still agree with doing this generally speaking, but I don't think it would be a pre-req for implementing this functionality. At least that I can see it's orthogonal.
I'm planning on adding a whole engine API under query in our graphql API (to support cache query and control as part of #7646), at which point we can move version and/or add ping under there. So then this would be dagger core engine version/dagger core engine ping.
Isn't the entire API the engine API already? What's the rule for what goes under engine and what doesn't?
Bundle the CLI and the engine together into a single image
Still agree with doing this generally speaking, but I don't think it would be a pre-req for implementing this functionality. At least that I can see it's orthogonal.
Isn't the issue that the dagger binary isn't available in the image, therefore there is no reliable way to query the API for a healthcheck? ie. you need dagger installed to run dagger query. Or am I missing something?
Isn't the entire API the engine API already? What's the rule for what goes under engine and what doesn't?
We call it the core API; the engine API would be for all the global state of the engine as a whole, so things like it's version, it's cache configuration, it's current disk usage, manual pruning, etc.
Open to bikeshedding on the name as always but that's what I was imagining regardless of the name.
Isn't the issue that the dagger binary isn't available in the image, therefore there is no reliable way to query the API for a healthcheck? ie. you need dagger installed to run dagger query. Or am I missing something?
AFAIK it's fine to require the CLI to run a health check on the engine container. You need something to call to run a health check, may as well be the CLI for the general case in order to handle all the different drivers for connecting to the engine
For the particular case of the engine being connected to direct over tcp/unix-sock, then you could just implement this with curl though, you'd just be submitting a gql query.
Think we can close this out, since we've settled on using dagger core version as a health check, and this is now what we use for our own helm charts as well.
Activity
matipan commentedon Jun 24, 2024
Did we remove the buildctl CLI from the image? At the moment we are still using
buildctlin our helm chart:dagger/helm/dagger/templates/engine-daemonset.yaml
Lines 71 to 73 in 8aac1a6
jedevc commentedon Jun 24, 2024
Oops. That's not right 😱
dagger/ci/build/builder.go
Lines 257 to 259 in 8aac1a6
buildctlneeds to exist, but it's a symlink todial-stdio- this was changed ages ago, in #6100 (comment).matipan commentedon Jun 24, 2024
Good to know!
What does
dial-stdioright now do for us in the context of health check?jedevc commentedon Jun 24, 2024
Uh, it hangs until
stdinis closed 🤔shykes commentedon Jun 24, 2024
I think the solution is:
ping() String!function in the dagger apiThen the healtcheck can simply be
dagger query << '{ping}'or, in the future,dagger core pingsipsma commentedon Jun 24, 2024
I'm planning on adding a whole
engineAPI under query in our graphql API (to support cache query and control as part of #7646), at which point we can moveversionand/or addpingunder there. So then this would bedagger core engine version/dagger core engine ping.Still agree with doing this generally speaking, but I don't think it would be a pre-req for implementing this functionality. At least that I can see it's orthogonal.
shykes commentedon Jun 24, 2024
Isn't the entire API the engine API already? What's the rule for what goes under
engineand what doesn't?Isn't the issue that the
daggerbinary isn't available in the image, therefore there is no reliable way to query the API for a healthcheck? ie. you needdaggerinstalled to rundagger query. Or am I missing something?sipsma commentedon Jun 25, 2024
We call it the
coreAPI; the engine API would be for all the global state of the engine as a whole, so things like it's version, it's cache configuration, it's current disk usage, manual pruning, etc.Open to bikeshedding on the name as always but that's what I was imagining regardless of the name.
AFAIK it's fine to require the CLI to run a health check on the engine container. You need something to call to run a health check, may as well be the CLI for the general case in order to handle all the different drivers for connecting to the engine
curlthough, you'd just be submitting a gql query.feat: Bundle CLI in the Engine image (a.k.a. One True Artefact) (#8147)
jedevc commentedon Sep 5, 2024
Think we can close this out, since we've settled on using
dagger core versionas a health check, and this is now what we use for our own helm charts as well.🎉