HomeDevCentral

Determine in what order containers should be run

Description

Determine in what order containers should be run

Summary:
Once upon a time, a small systemd service was prepared to hardcode a list
of containers to launch once Docker is up. See D20 and T467.

On docker-002, we've now with Sentry ± 200 order conditions to solve.

Also on docker-002, we've still services defined with links between containers.
In such case, Docker will simply refuse to start container B as long as
the container A isn't there to satisfy "B has a link A". A correct list
is so vital in that case.

Containers are now defined in pillar, under docker_containers key.
There are a lot of configuration keys there like mysql_link that
can be interpreted as, for example, "devcentral depends of acquisitariat".

Dependencies between services are so documented by this change
under docker_containers_dependencies pillar entry, shared between all
Docker engines.

docker-paas-list-containers can then be used to query both pillar entries,
build a graph of dependencies and solve a topological order for the graph.

Fixes T1428.

Test Plan:

  • For docker-002, it gives P319.
  • For the systemd unit, deploy should be no op as all containers are already started

Reviewers: dereckson

Reviewed By: dereckson

Maniphest Tasks: T1428

Differential Revision: https://devcentral.nasqueron.org/D2934

Details

Provenance
derecksonAuthored on Mar 27 2023, 19:57
derecksonPushed on Mar 28 2023, 00:32
Reviewer
dereckson
Differential Revision
D2934: Determine in what order containers should be run
Parents
rOPS0783f15922b9: Install gifsicle and mozjpeg
Branches
Unknown
Tags
Unknown
Tasks
T1428: Refactor systemd-unit for Docker containers