update docker stack to include missing services
The goal of this MR is to streamline the initial setup needed by a developer who wishes to work on this project.
This also allows us to run both the application in a docker container and in quarkus:dev mode in parallel for various debugging and testing tasks.
Merge request reports
Activity
added 1 commit
- 195a8553 - update docker stack to include missing services
added 1 commit
- 69422767 - update docker stack to include missing services
added 1 commit
- db05fb33 - update docker stack to include missing services
added 1 commit
- 120e3f7d - update docker stack to include missing services
added 1 commit
- 6cc70ef7 - update docker stack to include missing services
requested review from @zacharysabourin, @epoirier, and @oliviergoulet
- config/json/post-git-eca.json 0 → 100644
1 { 2 "repoUrl":"https://gitlab.eclipse.org/eclipse/oniro-core/oniro", 3 "provider":"gitlab", 4 "commits":[ 5 { 6 "author":{ 7 "name":"Christopher Guindon", 8 "mail":"chris.guindon@eclipse-foundation.org" 9 }, 10 "committer":{ 11 "name":"Zachary Sabourin", 12 "mail":"zachary.sabourin@eclipse-foundation.org" 13 }, 14 "body":"test: testing eca validation endpointSigned-off-by: Christopher Guindon <chris.guindon@eclipse-foundation.org>", Yeah, it's to allow us to rapidly test the API. I use this JSON payload in my rest which I call with !104 (diffs)
added 1 commit
- 71955678 - update docker stack to include missing services
added 1 commit
- 0ca23e3b - update docker stack to include missing services
1 1 SHELL = /bin/bash 2 pre-setup:; 3 @echo "Creating environment file from template" 4 @rm -f .env && envsubst < config/.env.sample > .env 5 setup:; 6 @echo "Generating secret files from templates using environment file + variables" 7 @source .env && rm -f ./config/application/secret.properties && envsubst < config/application/secret.properties.sample > config/application/secret.properties 8 2 dev-start: clean; 9 source .env && mvn compile -e quarkus:dev -Dconfig.secret.properties=$$PWD/config/application/secret.properties 3 docker-compose up -d gitlab mariadb 4 $(MAKE) import-mariadb-tables 5 (CONFIG_SECRET_PATH=$$PWD/config/application/secret.properties mvn compile -e quarkus:dev -Dconfig.secret.properties=$$PWD/config/application/secret.properties -Djava.net.preferIPv4Stack=true) Djava.net.preferIPv4Stack=true is really the key here.
By adding this, we can connect to the application in quarkus:dev from a docker container defined in the docker-compose.yml file. I think this is going to be very useful for debugging all our quarkus API projects.
I also learned that
CONFIG_SECRET_PATH=$$PWD/config/application/secret.properties
is needed to stop the quarkus DEV service from automatically starting a MariaDB instance. I think we prefer to use the mariadb instance that I create using docker-compose.Edited by Christopher GuindonYes, the secret configs are only read at runtime, and there is no default value for the path either. The differences between oidc and the db come down to implementation in the actual extensions and our defaults. Our default OIDC stuff precludes the devservices from launching when some stuff is missing, but the default for JDBC/Agroal is to spin up devservices if you're missing the URL which is set in the secret for security purposes. We could set bad defaults so that devservices doesn't spin up, but I don't think that's the ideal way to do it.
requested review from @mbarbero
- Resolved by Zachary Sabourin
- Resolved by Zachary Sabourin
mentioned in commit eb077790