Skip to content

feat: support ordered container start (#321)#454

Open
Abhishek9639 wants to merge 1 commit intoscore-spec:mainfrom
Abhishek9639:feat/ordered-container-start
Open

feat: support ordered container start (#321)#454
Abhishek9639 wants to merge 1 commit intoscore-spec:mainfrom
Abhishek9639:feat/ordered-container-start

Conversation

@Abhishek9639
Copy link
Copy Markdown
Contributor

Description

What does this PR do?

This PR adds support for ordered container start by mapping the Score spec's before field to Docker Compose's depends_on. When a container declares before: containers: [main], the generated compose output will have main with a depends_on entry pointing back to that container.

The ready condition is mapped as follows:

  • started (default) -> service_started
  • complete -> service_completed_successfully
  • healthy -> service_healthy

Validation is added during score-compose generate to catch:

  • Cyclic dependencies between containers
  • References to containers that don't exist in the workload
  • Containers referencing themselves

For ready: healthy, a warning is emitted if no readiness or liveness probe is defined. This keeps generation working while letting users know they may need to add a healthcheck. Waiting for @chris-stephenson's feedback on whether this should be an error instead.

Uses the score-go ordered-containers branch as instructed by @mathieu-benoit.

Fixes #321

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I've signed off with an email address that matches the commit author.

@Abhishek9639
Copy link
Copy Markdown
Contributor Author

Hi @mathieu-benoit,
This is ready for review.

Quick summary of what's here:

  • Inversion of before -> depends_on with condition mapping (started, complete, healthy).
  • Validation during generate for cycles, unknown container refs, and self-references.
  • Using the score-go ordered-containers branch as you suggested.

One open point: for ready: healthy without a healthcheck probe, I went with emitting a warning for now instead of failing. Happy to change this based on @chris-stephenson's feedback.

Let me know if anything needs adjusting.
Thanks

@Abhishek9639 Abhishek9639 force-pushed the feat/ordered-container-start branch from 5640aea to eda9cd0 Compare April 8, 2026 22:00
@mathieu-benoit mathieu-benoit marked this pull request as draft April 8, 2026 22:17
@Abhishek9639 Abhishek9639 force-pushed the feat/ordered-container-start branch from eda9cd0 to a209c16 Compare April 9, 2026 03:26
@Abhishek9639 Abhishek9639 removed their assignment Apr 9, 2026
@Abhishek9639 Abhishek9639 marked this pull request as ready for review April 9, 2026 03:30
@Abhishek9639 Abhishek9639 marked this pull request as draft April 9, 2026 03:37
@Abhishek9639
Copy link
Copy Markdown
Contributor Author

Moved this back to draft while waiting for @chris-stephenson's feedback on the ready: healthy behavior.

Also @mathieu-benoit, could you please re-assign me to this PR? I don't have write permissions to set the assignee myself.
Thanks

@Abhishek9639 Abhishek9639 force-pushed the feat/ordered-container-start branch 2 times, most recently from 990584a to add396d Compare April 9, 2026 16:41
@Abhishek9639 Abhishek9639 marked this pull request as ready for review April 9, 2026 16:43
@Abhishek9639
Copy link
Copy Markdown
Contributor Author

@mathieu-benoit @chris-stephenson
The requested change is pushed! ready: healthy without a healthcheck probe is now a hard failure, and I've also added a test case for it.

I've marked the PR as ready for review.
Let me know if anything else is needed.
Thanks

@mathieu-benoit
Copy link
Copy Markdown
Contributor

mathieu-benoit commented Apr 9, 2026

Wonderful, thanks @Abhishek9639!

@chris-stephenson, before merging score-go and then this one, let's make sure that the Spec is LGTMed before, @Abhishek9639 brought a good there question, let's confirm there please: score-spec/spec#136 (comment).

Signed-off-by: Abhishek <abhishekup082@gmail.com>
@Abhishek9639 Abhishek9639 force-pushed the feat/ordered-container-start branch from add396d to 9ec8325 Compare April 10, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature request] Support of Ordered Container Start

2 participants