Skip to content

Commit

Permalink
Improve default docker compose (#1669)
Browse files Browse the repository at this point in the history
use an explicit external network this removes environment related
problems that can cause problems with quickstart.

Also remove multiple flow workers in the default configuration
  • Loading branch information
iskakaushik authored May 3, 2024
1 parent 95453f9 commit 0511166
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 55 deletions.
6 changes: 6 additions & 0 deletions dev-peerdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,11 @@ else
EXTRA_ARGS=""
fi

# check if peerdb_network exists if not create it
if ! $DOCKER network inspect peerdb_network &> /dev/null
then
$DOCKER network create peerdb_network
fi

export PEERDB_VERSION_SHA_SHORT=local-$(git rev-parse --short HEAD)
exec $DOCKER -f docker-compose-dev.yml up --build $EXTRA_ARGS
39 changes: 9 additions & 30 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version: "3.9"

name: peerdb-quickstart-dev

x-minio-config: &minio-config
PEERDB_CLICKHOUSE_AWS_CREDENTIALS_AWS_ACCESS_KEY_ID: _peerdb_minioadmin
PEERDB_CLICKHOUSE_AWS_CREDENTIALS_AWS_SECRET_ACCESS_KEY: _peerdb_minioadmin
Expand Down Expand Up @@ -145,42 +147,14 @@ services:
temporal-admin-tools:
condition: service_healthy

flow-worker1:
container_name: flow-worker1
build:
context: .
dockerfile: stacks/flow.Dockerfile
target: flow-worker
environment:
<<: [*catalog-config, *flow-worker-env, *minio-config]
depends_on:
temporal-admin-tools:
condition: service_healthy

flow-worker2:
container_name: flow-worker2
flow-worker:
container_name: flow-worker
build:
context: .
dockerfile: stacks/flow.Dockerfile
target: flow-worker
environment:
<<: [*catalog-config, *flow-worker-env, *minio-config]
profiles:
- multi
depends_on:
temporal-admin-tools:
condition: service_healthy

flow-worker3:
container_name: flow-worker3
build:
context: .
dockerfile: stacks/flow.Dockerfile
target: flow-worker
environment:
<<: [*catalog-config, *flow-worker-env, *minio-config]
profiles:
- multi
depends_on:
temporal-admin-tools:
condition: service_healthy
Expand Down Expand Up @@ -244,3 +218,8 @@ services:
volumes:
pgdata:
minio-data:

networks:
default:
external: true
name: peerdb_network
34 changes: 9 additions & 25 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version: "3.9"

name: peerdb-quickstart

x-minio-config: &minio-config
PEERDB_CLICKHOUSE_AWS_CREDENTIALS_AWS_ACCESS_KEY_ID: _peerdb_minioadmin
PEERDB_CLICKHOUSE_AWS_CREDENTIALS_AWS_SECRET_ACCESS_KEY: _peerdb_minioadmin
Expand Down Expand Up @@ -124,33 +126,11 @@ services:
temporal-admin-tools:
condition: service_healthy

flow-worker1:
container_name: flow-worker1
image: ghcr.io/peerdb-io/flow-worker:latest-dev
environment:
<<: [*catalog-config, *flow-worker-env, *minio-config]
depends_on:
temporal-admin-tools:
condition: service_healthy

flow-worker2:
container_name: flow-worker2
flow-worker:
container_name: flow-worker
image: ghcr.io/peerdb-io/flow-worker:latest-dev
environment:
<<: [*catalog-config, *flow-worker-env, *minio-config]
profiles:
- multi
depends_on:
temporal-admin-tools:
condition: service_healthy

flow-worker3:
container_name: flow-worker3
image: ghcr.io/peerdb-io/flow-worker:latest-dev
environment:
<<: [*catalog-config, *flow-worker-env, *minio-config]
profiles:
- multi
depends_on:
temporal-admin-tools:
condition: service_healthy
Expand Down Expand Up @@ -208,5 +188,9 @@ services:
volumes:
pgdata:
prometheusdata:
minio-data:

networks:
default:
external: true
name: peerdb_network
6 changes: 6 additions & 0 deletions run-peerdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@ then
exit 1
fi

# check if peerdb_network exists if not create it
if ! docker network inspect peerdb_network &> /dev/null
then
docker network create peerdb_network
fi

docker compose pull
docker compose -f docker-compose.yml up --no-attach catalog --no-attach temporal --no-attach temporal-ui --no-attach temporal-admin-tools

0 comments on commit 0511166

Please sign in to comment.