From 5df08c2ab82000ba3f429c42cd39e143393f225e Mon Sep 17 00:00:00 2001 From: John Hill Date: Tue, 25 Oct 2022 01:14:51 -0700 Subject: [PATCH] Update docker compose references to support working in CI and python3 (#13) --- .gitignore | 3 +++ docker/Makefile | 8 +++++++- docker/docker-compose.yml | 17 +++++++++++++++-- pom.xml | 2 +- src/main/yamcs/etc/yamcs.yaml | 8 +++++++- 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 75dfdfa..632ff9e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ # Maven output /target/ + +# VSCode +.vscode/settings.json diff --git a/docker/Makefile b/docker/Makefile index f110fa9..52ec546 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -1,3 +1,9 @@ +ifeq ($(shell which python3),) + PYTHON = python +else + PYTHON = python3 +endif + .DEFAULT_GOAL := help all: ## run all, yamcs-up (yamcs-down) and yamcs-simulator @@ -11,7 +17,7 @@ yamcs-down: ## bring down yamcs system yamcs-simulator: yamcs-up ## run yamcs simulator @echo "connect via http://localhost:8090/ system make take about 50 seconds to startup" && \ - cd .. && python ./simulator.py + cd .. && $(PYTHON) ./simulator.py yamcs-shell: ## shell into yamcs container docker-compose up -d && docker run -it yamcs "bash" diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 9ea7ec6..21a71c9 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -5,8 +5,21 @@ services: hostname: yamcs container_name: yamcs command: "mvn yamcs:run" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8090"] + interval: 10s + timeout: 5s + retries: 30 + start_period: 30s volumes: - ../:/yamcs ports: - - "127.0.0.1:8090:8090" - - "127.0.0.1:10015:10015/udp" + - "8090:8090" + - "10015:10015/udp" + extra_hosts: + - "host.docker.internal:host-gateway" + networks: + - quickstart +networks: + quickstart: + driver: bridge diff --git a/pom.xml b/pom.xml index 88ff7ae..4d7a083 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ Update this to the latest Yamcs release. Check https://mvnrepository.com/artifact/org.yamcs/yamcs-core --> - 5.7.7 + 5.7.8 diff --git a/src/main/yamcs/etc/yamcs.yaml b/src/main/yamcs/etc/yamcs.yaml index 4fe3360..2146495 100644 --- a/src/main/yamcs/etc/yamcs.yaml +++ b/src/main/yamcs/etc/yamcs.yaml @@ -1,5 +1,11 @@ services: - class: org.yamcs.http.HttpServer + args: + port: 8090 + address: "0.0.0.0" # https://github.com/yamcs/quickstart/issues/11 + cors: + allowOrigin: "*" + allowCredentials: false # This is where Yamcs will persist its data. Paths are resolved relative to where Yamcs is running # from (by default: target/yamcs). This means that `mvn clean` will remove also persisted data. @@ -11,4 +17,4 @@ instances: # Secret key unique to a particular Yamcs installation. # This is used to provide cryptographic signing. -secretKey: changeme +secretKey: changeme \ No newline at end of file