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

docker-compose 3.4 support #69

Closed
blaggacao opened this issue Jan 26, 2018 · 4 comments
Closed

docker-compose 3.4 support #69

blaggacao opened this issue Jan 26, 2018 · 4 comments

Comments

@blaggacao
Copy link

blaggacao commented Jan 26, 2018

The depends_on flag was conceptually simplified only representing "docker running"
Readiness testing was made responsibility of the application.

@blaggacao
Copy link
Author

blaggacao commented Jan 26, 2018

see: https://docs.docker.com/compose/startup-order/

#!/bin/bash
# wait-for-postgres.sh

set -e

host="$1"
shift
cmd="$@"

until psql -h "$host" -U "postgres" -c '\q'; do
  >&2 echo "Postgres is unavailable - sleeping"
  sleep 1
done

>&2 echo "Postgres is up - executing command"
exec $cmd
command: ["./wait-for-postgres.sh", "master", "other_command"]

@vinhbuivan
Copy link

vinhbuivan commented Oct 30, 2019

Checkout with this docker-compose version. I tested and it run on docker stack.
docker-compose.zip

version: '3.7'
services:
  master:    
    image: 'citusdata/citus:8.3.2'
    ports: ["${MASTER_EXTERNAL_PORT:-5432}:5432"]
    labels: ['com.citusdata.role=Master', 'com.docker.compose.project=citus']
    healthcheck:
  worker:
    image: 'citusdata/citus:8.3.2'
    labels: ['com.citusdata.role=Worker', 'com.docker.compose.project=citus']
    depends_on: manager      
  manager:    
    image: 'citusdata/membership-manager:0.2.0'
    volumes: ['/var/run/docker.sock:/var/run/docker.sock']
	labels: ['com.citusdata.role=Manager', 'com.docker.compose.project=citus']
    depends_on: master      

@mubaidr
Copy link

mubaidr commented Apr 7, 2020

Issue #124 Worker node not being added is caused by this. Because manager service tries to connect to master service before it is ready and fails. But setting it to restart: on-failure will make sure it tires multiple times and eventually it will work.

More info: #124 (comment)

@hanefi
Copy link
Member

hanefi commented Apr 13, 2020

I created two PRs that aims to resolve this issue:

  1. Start polling for connections to coordinator node membership-manager#9 implements a polling mechanism in Membership Manager, so that (a) it will detect the readiness of the coordinator node, (b) properly report that it is ready to accept new Citus worker services
  2. Implement service dependencies for Docker-Compose V3 #187 (a) updates the docker images to properly detect dependencies, (b) introduce Compose V3 definitions

Once they are merged, this issue should be resolved

@hanefi hanefi closed this as completed Dec 8, 2020
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

No branches or pull requests

4 participants