#Capture asService Exit Code

1 messages · Page 1 of 1 (latest)

pliant stag
#

This feels like potentially a dumb question, Is there a way to capture the exit code for asService?

I am using the Python SDK for dagger and I would like to fail early in the case that there's a failure in the asService call (or potenitally re-attempt with another asService call). However, I don't see a way to query the exit code. Referencing the Python documentation for Service here.

Maybe if I call Service.sync() will that force an exception that is captureable?

void maple
# pliant stag This feels like potentially a dumb question, Is there a way to capture the exit ...

hey there. This is not currently possible. If a service fails to start, then whatever containers which depend on it will get stuck until the whole pipeline bails because of the service startup timeout.

What you can do is to call start on the service which will block until the service is ready. I don't think it's currently returning an error if by some reason the service exists with an error. Might be worth checking this out and opening an issue fi that's not the case. cc @deft sedge

pliant stag
#

Hello Marco,

I do call start on the service, but it does not panic as I expect it would. Example shown in this image, the asService call exists with a code of 1, but the start call does not panic.

#

Created the issue here.

GitHub

An open-source runtime for composable workflows. Great for AI agents and CI/CD. - dagger/dagger