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

Implement conditional depends_on #453

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Mar 21, 2022

  1. Track dependency conditions when parsing cnditional depends_on

    This commit changes the way that depends_on blocks are parsed and
    tracked during the `podman-compose up` process.
    
    Each service's dependencies will be tracked as a dict in which keys are
    services being depended on and values are the condition to be met by
    said services before the current service can start.
    
    This lays the groundwork for supporting long-syntax / conditional
    depends_on blocks, but should not change any behavior so far.
    
    Signed-off-by: Adrian Torres <atorresj@redhat.com>
    Adrian Torres committed Mar 21, 2022
    Configuration menu
    Copy the full SHA
    30e5223 View commit details
    Browse the repository at this point in the history
  2. Wait for depends_on conditions before starting containers

    This commit implements the long-syntax / conditional depends_on compose
    mechanism which instructs the compose system to wait for a certain
    condition before starting a container.
    
    Currently available conditions are:
    
    - service_started: same behavior as before this commit, the depending
      container will start as soon as the depended on container has started
    - service_healthy: if the depended on container has a healthcheck, wait
      until said container is marked as healthy before starting the
      depending container
    - service_completed_successfully: wait until the depended on container
      has exited and its exit code is 0, after which the depending container
      can be started
    
    This mechanism is part of the v3 [1] compose spec and is useful for
    controlling container startup based on other containers that can take a
    certain amount of time to start or on containers that do complicated
    setups and must exit before starting other containers.
    
    [1] https://red.ht/conditional-depends
    
    Signed-off-by: Adrian Torres <atorresj@redhat.com>
    Adrian Torres committed Mar 21, 2022
    Configuration menu
    Copy the full SHA
    fcbf15e View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2022

  1. Update podman_compose.py

    Co-authored-by: Dawid Dziurla <dawidd0811@gmail.com>
    Elkasitu and dawidd6 committed Oct 6, 2022
    Configuration menu
    Copy the full SHA
    dad5d56 View commit details
    Browse the repository at this point in the history