containers / podman-compose

a script to run docker-compose.yml using podman
GNU General Public License v2.0
5.08k stars 484 forks source link

Support depends_on type service_completed_successfully #575

Open micheljung opened 2 years ago

micheljung commented 2 years ago

Is your feature request related to a problem? Please describe.

The problem is that podman-compose is incompatible with current docker-compose.yml because it does not support service_completed_successfully.

According to the compose spec

Describe the solution you'd like podman-compose implements service_completed_successfully as per the spec.

Describe alternatives you've considered None

Additional context I didn't check if the other conditions are supported yet, but they should also be.

mbergen commented 1 year ago

It seems like service_healthy also does not work. service_started is the equivalent to no condition (default) and therefore works. Would be great to get these working!

mdellweg commented 1 year ago

Actually, i think podman waits for the healthiness anyway, so anything one specifies behaves like service_healthy.

mbergen commented 1 year ago

Actually, i think podman waits for the healthiness anyway, so anything one specifies behaves like service_healthy.

Last time i checked it podman was not executing any healthchecks, it was only waiting for services to be started. That's a huge difference.

Greenall commented 1 year ago

I'm on the following versions and can confirm that service_healthy condition seems to be ignored and treated as service_started. podman-compose version 1.0.6 podman version 4.4.1

kontsaki commented 9 months ago

any status update on this feature?

any way to workaround this?

w568w commented 9 months ago

@kontsaki Have a look at #453, which has a preliminary implementation of depends_on.

TL;DR (maybe inaccurate!): podman-compose is calling podman commands directly to do all stuffs (e.g. executing podman start foo --bar), which do not provide a way of "depending on" another container, because it needs a daemon to do that (as Docker does). There are some workarounds:

So, it is sad to say that there is still no good way to support it. I ended up having the container exit immediately when it fails to connect to the dependency container, and set restart: always.

kontsaki commented 9 months ago

I ended up using docker-compose provided by https://github.com/docker/compose and it works as expected with podman as the backend.

I have also installed the compat package podman-docker on Fedora, not sure if this makes podman run as daemon but currently everything works with rootless podman and all docker-compose features.

candleindark commented 8 months ago

@mbergen, @mdellweg, @Greenall I just filed a dedicated issue for the problem with the service_healthy condition.