Skip to content

Commit

Permalink
[docker-compose] Simplify bootstrapping sequence of the local DSS inf…
Browse files Browse the repository at this point in the history
…rastructure (requires docker v25+)
  • Loading branch information
barroco committed Nov 29, 2024
1 parent dd263d5 commit affafc7
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 143 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ restart-all: build-dss down-locally start-locally
.PHONY: start-locally
start-locally:
build/dev/run_locally.sh up -d
build/dev/wait_for_local_dss.sh

.PHONY: probe-locally
probe-locally:
Expand Down
40 changes: 26 additions & 14 deletions build/dev/docker-compose_dss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,21 @@ services:
restart: always
networks:
- dss_sandbox_default_network
healthcheck:
test: curl -f 'http://localhost:8080/health?ready=1' || exit 1
interval: 3m
start_period: 30s
start_interval: 5s

local-dss-rid-bootstrapper:
build:
context: ../..
dockerfile: Dockerfile
image: interuss-local/dss
volumes:
- local-dss-data:/var/local-dss-data
- $PWD/startup:/startup:ro
entrypoint: /startup/rid_bootstrapper.sh
command: /usr/bin/db-manager migrate --schemas_dir=/db-schemas/rid --db_version "latest" --cockroach_host local-dss-crdb
depends_on:
- local-dss-crdb
local-dss-crdb:
condition: service_healthy
networks:
- dss_sandbox_default_network

Expand All @@ -36,12 +39,10 @@ services:
context: ../..
dockerfile: Dockerfile
image: interuss-local/dss
volumes:
- local-dss-data:/var/local-dss-data
- $PWD/startup:/startup:ro
entrypoint: /startup/scd_bootstrapper.sh
entrypoint: /usr/bin/db-manager migrate --schemas_dir=/db-schemas/scd --db_version "latest" --cockroach_host local-dss-crdb
depends_on:
- local-dss-crdb
local-dss-crdb:
condition: service_healthy
networks:
- dss_sandbox_default_network

Expand All @@ -52,17 +53,23 @@ services:
image: interuss-local/dss
volumes:
- $PWD/../test-certs:/var/test-certs:ro
- local-dss-data:/var/local-dss-data
- $PWD/startup:/startup:ro
- $PWD/startup/core_service.sh:/startup/core_service.sh:ro
command: /startup/core_service.sh ${DEBUG_ON:-0}
ports:
- "4000:4000"
- "8082:8082"
depends_on:
- local-dss-rid-bootstrapper
- local-dss-scd-bootstrapper
local-dss-rid-bootstrapper:
condition: service_completed_successfully
local-dss-scd-bootstrapper:
condition: service_completed_successfully
networks:
- dss_sandbox_default_network
healthcheck:
test: wget -O - 'http://localhost/healthy' || exit 1
interval: 3m
start_period: 30s
start_interval: 5s

local-dss-dummy-oauth:
build:
Expand All @@ -74,6 +81,11 @@ services:
- "8085:8085"
networks:
- dss_sandbox_default_network
healthcheck:
test: wget -O - 'http://localhost:8085/token?intended_audience=-&scope=-' || exit 1
interval: 3m
start_period: 30s
start_interval: 5s

networks:
dss_sandbox_default_network:
Expand Down
2 changes: 0 additions & 2 deletions build/dev/startup/core_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# This startup script is meant to be invoked from within a Docker container
# started by docker-compose_dss.yaml, not on a local system.

/startup/wait_for_bootstrapping.sh

DEBUG_ON=${1:-0}

if [ "$DEBUG_ON" = "1" ]; then
Expand Down
21 changes: 0 additions & 21 deletions build/dev/startup/rid_bootstrapper.sh

This file was deleted.

21 changes: 0 additions & 21 deletions build/dev/startup/scd_bootstrapper.sh

This file was deleted.

16 changes: 0 additions & 16 deletions build/dev/startup/wait_for_bootstrapping.sh

This file was deleted.

68 changes: 0 additions & 68 deletions build/dev/wait_for_local_dss.sh

This file was deleted.

0 comments on commit affafc7

Please sign in to comment.