score-compose icon indicating copy to clipboard operation
score-compose copied to clipboard

[feature request] Support of Ordered Container Start

Open mathieu-benoit opened this issue 6 months ago • 2 comments

Support of Ordered Container Start coming from this new Spec version:

  • Issue: https://github.com/score-spec/spec/issues/104
  • PR: https://github.com/score-spec/spec/pull/136

The Spec itself is not yet released, the goal is to use the Spec version from this specific branch first: https://github.com/kai-kystverket/spec/tree/feat/add-before-field-to-containers and this needs to integrated in a temporary score-go version with this: https://github.com/score-spec/score-go/issues/118.

depends_on is the essential ingredient here: https://github.com/compose-spec/compose-spec/blob/main/05-services.md#depends_on. Compose supports waiting for started, ready, or completed. However we are inverting the depends_on to be "before". This should be fine.

These should be caught when running score-xyz generate.

  • cyclic relationship container-a.before.containers = [container-b]; container-b.before.containers = [container-a]
  • unknown links container-a.before.containers = [unknown]
  • Some Score implementations may not support any kind of ready field.
containers:
  init-one:
    ...
    before:
      containers:
      - init-two
  init-two:
    ...
    before:
      containers:
      - main
  main:
    ...
containers:
  init:
    ...
    before:
      ready: complete # implicit default
      containers:
      - main
  sidecar:
    ...
    before:
      containers:
      - main
      ready: started
  main:
    ....

mathieu-benoit avatar Jun 10 '25 14:06 mathieu-benoit

@astromechza, like discussed, let's clarify what we want here, thanks!

mathieu-benoit avatar Jun 10 '25 15:06 mathieu-benoit

JFYI score-go's branch/PR now in place: https://github.com/score-spec/score-go/pull/121

mathieu-benoit avatar Jun 17 '25 15:06 mathieu-benoit