polonskiy / crowdr

Crowdr is a tool for managing multiple Docker containers
MIT License
95 stars 9 forks source link

Run ordering #11

Closed byrnedo closed 8 years ago

byrnedo commented 8 years ago

Shouldn't the run command default to running containers in the order they are defined in the cfg file?

Right now it's a tsort|tac which runs them z-a.

Would be great if there was some way to control the order ( or at least run them as they were defined )

polonskiy commented 8 years ago

Order in config doesn't matter. Run/start/stop/etc ordering is based on links. If foo depends on bar, bar will be started first. Check this example:

#!/bin/bash

echo "
db image busybox
db command cat

web image busybox
web command cat
web link cache
web link db

cache image busybox
cache command cat
"
byrnedo commented 8 years ago

My use case is that I'm using consul and although there are no links between containers, the consul container and some others need to be started first. On 30 Dec 2015 07:49, "Anton Polonskiy" notifications@github.com wrote:

Order in config doesn't matter. Run/start/stop/etc ordering is based on links. If foo depends on bar, bar will be started first. Check this example:

!/bin/bash

echo "db image busyboxdb command catweb image busyboxweb command catweb link cacheweb link dbcache image busyboxcache command cat"

— Reply to this email directly or view it on GitHub https://github.com/polonskiy/crowdr/issues/11#issuecomment-167953397.

byrnedo commented 8 years ago

I guess maybe having something like 'depends' in the config could be good for non link based dependencies? On 30 Dec 2015 07:57, "Donal Byrne" byrnedo@tcd.ie wrote:

My use case is that I'm using consul and although there are no links between containers, the consul container and some others need to be started first. On 30 Dec 2015 07:49, "Anton Polonskiy" notifications@github.com wrote:

Order in config doesn't matter. Run/start/stop/etc ordering is based on links. If foo depends on bar, bar will be started first. Check this example:

!/bin/bash

echo "db image busyboxdb command catweb image busyboxweb command catweb link cacheweb link dbcache image busyboxcache command cat"

— Reply to this email directly or view it on GitHub https://github.com/polonskiy/crowdr/issues/11#issuecomment-167953397.

marcinwaldowski commented 8 years ago

+1

If you use user-defined networks in docker then you do not use 'link' at all. Therefore it would be nice to have something like 'depends' which work same way as 'link' in crowdr.

It looks like links are going to be deprecated (link):

While links are still supported in this limited capacity, you should avoid them in preference of Docker networks. The link feature is expected to be deprecated and removed in a future release.

polonskiy commented 8 years ago

Fixed in 0.9.0