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+) (interuss#786)
  • Loading branch information
barroco authored Sep 20, 2024
1 parent 6471593 commit 48b5627
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 150 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ tag:
.PHONY: start-locally
start-locally:
build/dev/run_locally.sh up -d
build/dev/wait_for_local_infra.sh

.PHONY: probe-locally
probe-locally:
Expand Down
43 changes: 27 additions & 16 deletions build/dev/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Brings up a local interoperability ecosystem consisting of a DSS instance and dummy OAuth server.

# To bring up this system, run ./run_locally.sh then optionally ./wait_for_local_infra.sh to wait for the servers to start.
# To bring up this system, run ./run_locally.sh up -d and wait for all containers to succeed or become healthy.

version: '3.8'

Expand All @@ -18,26 +18,27 @@ services:
restart: always
networks:
- dss_internal_network
healthcheck:
test: curl -f 'http://localhost:8080/health?ready=1' || exit 1
interval: 3m
start_period: 30s
start_interval: 5s

rid_bootstrapper:
image: interuss/dss:v0.18.0-rc1
volumes:
- dss_component_coordination:/var/dss_component_coordination
- $PWD/startup:/startup:ro
entrypoint: /startup/rid_bootstrapper.sh
command: /usr/bin/db-manager --schemas_dir=/db-schemas/rid --db_version "latest" --cockroach_host crdb
depends_on:
- crdb
crdb:
condition: service_healthy
networks:
- dss_internal_network

scd_bootstrapper:
image: interuss/dss:v0.18.0-rc1
volumes:
- dss_component_coordination:/var/dss_component_coordination
- $PWD/startup:/startup:ro
entrypoint: /startup/scd_bootstrapper.sh
command: /usr/bin/db-manager --schemas_dir=/db-schemas/scd --db_version "latest" --cockroach_host crdb
depends_on:
- crdb
crdb:
condition: service_healthy
networks:
- dss_internal_network

Expand All @@ -46,22 +47,28 @@ services:
image: interuss/dss:v0.18.0-rc1
volumes:
- $PWD/../test-certs:/var/test-certs:ro
- dss_component_coordination:/var/dss_component_coordination
- $PWD/startup:/startup:ro
- $PWD/startup/core_service.sh:/startup/core_service.sh:ro
command: /startup/core_service.sh ${DEBUG_ON:-0}
expose:
- 8082
ports:
- "4000:4000"
- "8082:80"
depends_on:
- rid_bootstrapper
- scd_bootstrapper
rid_bootstrapper:
condition: service_completed_successfully
scd_bootstrapper:
condition: service_completed_successfully
networks:
dss_internal_network:
interop_ecosystem_network:
aliases:
- dss.uss2.localutm
healthcheck:
test: wget -O - 'http://localhost/healthy' || exit 1
interval: 3m
start_period: 30s
start_interval: 5s

oauth:
hostname: oauth.authority.localutm
Expand All @@ -73,7 +80,11 @@ services:
- "8085:8085"
networks:
- interop_ecosystem_network

healthcheck:
test: wget -O - 'http://localhost:8085/token?intended_audience=-&scope=-' || exit 1
interval: 3m
start_period: 30s
start_interval: 5s

networks:
dss_internal_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.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.

72 changes: 0 additions & 72 deletions build/dev/wait_for_local_infra.sh

This file was deleted.

2 changes: 1 addition & 1 deletion monitoring/uss_qualifier/local_testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Most mock systems depend on a standards-compliant interoperability ecosystem in

To deploy a local interoperability ecosystem: `make start-locally`

To determine the status of a local interoperability ecosystem, run `docker container ls` and inspect the results for the three containers constituting the ecosystem (see diagram above). Alternately/additionally, run [`wait_for_local_infra.sh`](../../build/dev/wait_for_local_infra.sh) to see if it completes successfully.
To determine the status of a local interoperability ecosystem, run `docker container ls` and inspect the results for the three containers constituting the ecosystem (see diagram above).

To tear down a local interoperability ecosystem: `make down-locally`

Expand Down

0 comments on commit 48b5627

Please sign in to comment.