docker-compose-buildkite-plugin icon indicating copy to clipboard operation
docker-compose-buildkite-plugin copied to clipboard

what is the purpose of scale to 0 instances in the starting dependencies phase?

Open OliverKoo opened this issue 3 years ago • 1 comments

Hello BK friends,

What is the purpose of --scale "${run_service}=0" in the starting dependencies phase?

https://github.com/buildkite-plugins/docker-compose-buildkite-plugin/blob/1dccf2935514285ef95910372feeb9b05a6995e7/commands/run.sh#L226

@lox committed this a long while back and I havn't seen much issue about it so I am sure there is a good reason for this(I am a docker noob so this might be a dumb question) but I am getting an error saying no container found for project "buildkite18e15a6103824eb89c747d49151c7eea": not found which makes sense because we set scale to 0

however if I run without the --scale argument locally then the build works.

OliverKoo avatar Apr 02 '22 01:04 OliverKoo

In case anyone stumbles upon here. For me the issue showed up in docker-compose version 2.4.1 Upgrading to docker-compose version 2.5 solved the problem.

This is the original PR https://github.com/buildkite-plugins/docker-compose-buildkite-plugin/pull/186 describes why this is useful

goromlagche avatar May 13 '22 14:05 goromlagche

@OliverKoo for future reference that line was added to make sure that all dependencies are up and running before starting up the service. As you can see in the line, the only service scaled to 0 is the main service itself. Why? The comment just before that states so:

https://github.com/buildkite-plugins/docker-compose-buildkite-plugin/blob/1dccf2935514285ef95910372feeb9b05a6995e7/commands/run.sh#L220

It is possible that there is another configuration issue with your setup or, as @goromlagche mentioned, a bug in docker compose itself.

toote avatar Sep 22 '22 22:09 toote