pleaserun icon indicating copy to clipboard operation
pleaserun copied to clipboard

Depend on other services getting started

Open shysteph opened this issue 10 years ago • 6 comments

Allow specifying a list of other names that this thing depends on in the pleasestart comment. Uses are things like applications that will not start without their database or chains of linked docker containers.

Possibly infer dependencies in the case of linked docker containers.

shysteph avatar Feb 11 '15 19:02 shysteph

(Waxing poetic about operations...) Operationally, I am against order-dependent software. Practically speaking, "app" requires "db" could just have the startup procedure of "app" wait until "db" is available. This puts the burden on the app itself and not the initialization system - this line of thinking comes mostly from working with dependent systems spread across machines/networks/datacenters where there is no local state of "db is up" because "db" runs on a system 4 racks away. :P

However, despite my hopes and opinions above, some init systems have dependency/ordering. lsb init, freebsd rcng, systemd, et al. Further, not all humans think like me - and that's awesome because a world full of same-thinkers would be really boring!

I'm not sure how this feature should be exposed in pleaserun, but I am definitely open to supporting it.

jordansissel avatar Feb 11 '15 22:02 jordansissel

The big issue, at least for small systems, is linked docker containers. To my knowledge they won't even start if the container they are --link ed to is not up.

I won't argue that order-dependency, especially in init scripts is right or good. But it is a thing. And I would like software to help with solving stupid computer problems. I think you have somewhat of the same philosophy there.

My thoughts from a command line perspective is to add a --depends that takes the same sort of names that --name takes, though in a comma separated list. For systems that easily do dependency just add the depend when generating the config and for things like init just inc the counter on the init script.

shysteph avatar Feb 11 '15 22:02 shysteph

+1

Should we limit --depends to programs[1] that are run on the same platform[2]?

  1. "program" - what pleaserun calls the thing you're running, like apache or nginx or redis.
  2. "platform" - what pleaserun calls the service manager (sysv init, systemd, launchd, upstart, etc)

For example, would you need a docker container to have order-dependence on something outside of docker?

jordansissel avatar Feb 11 '15 22:02 jordansissel

I think it is very reasonable to limit --depends to only other programs that pleaserun has created on the platform. I could see wanting a flag that does request all pleaserun programs get run near the end of things (network and filesystems are up?).

shysteph avatar Feb 16 '15 20:02 shysteph

I still want to do this, and might get to this soon.

jordansissel avatar May 18 '16 04:05 jordansissel

Woo. I know clustered environments that handle various service being unavailable are preferred but this would be totally awesome. <3

shysteph avatar May 18 '16 11:05 shysteph