Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use appropriate dependency condition for one-shot containers when running compose up --wait #9572

Merged
merged 2 commits into from
Jun 26, 2022

Conversation

laurazard
Copy link
Member

Signed-off-by: Laura Brehm [email protected]

What I did

When creating a dependency map to wait on during compose up --wait, we were previously applying the running_or_healthy condition to all containers indiscriminately.

However, in compose files with one-shot containers used for setup (database migrations, etc.) that are configured as dependencies of others with the condition service_completed_successfully, this does not work and the command will get stuck as it is expected that these containers run and then exit, and so they never satisfy running_or_healthy.

This PR changes the dependency logic to use the appropriate condition for these containers so that compose up --wait exits properly when all services have reach the desired state (running/healthy for some, exited for one-shots).

Also add e2e tests to ensure compose up --wait does not get stuck forever waiting for one-shot containers.

Related issue

Fixes #9273

(not mandatory) A picture of a cute animal, if possible in relation with what you did

IMG_2944

…ning `compose up --wait`

Also add e2e tests to ensure `compose up --wait` does not get stuck forever waiting for one-shot containers

Signed-off-by: Laura Brehm <[email protected]>
@laurazard laurazard requested a review from a team June 17, 2022 23:29
Copy link
Contributor

@milas milas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@glours glours left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@laurazard laurazard enabled auto-merge June 26, 2022 12:47
@laurazard laurazard merged commit 3ccf434 into docker:v2 Jun 26, 2022
@felipecrs
Copy link

What animal is this?

haines added a commit to haines/cerbos-sdk-javascript that referenced this pull request Oct 25, 2022
haines added a commit to cerbos/cerbos-sdk-javascript that referenced this pull request Oct 25, 2022
@dimaqq
Copy link

dimaqq commented Feb 8, 2023

cc @ilyamonakov for your case of --wait waiting forever for a one-shot container in docker compose 2.15.x

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.

up --wait should not wait for one-shot containers
6 participants