Skip to content
Snippets Groups Projects

update docker stack to include missing services

Merged Christopher Guindon requested to merge cguindon/master/fix-docker-stack into master
2 unresolved threads

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.

Edited by Christopher Guindon

Merge request reports

Pipeline #11066 passed

Pipeline passed for 0ca23e3b on cguindon/master/fix-docker-stack

Merged by Christopher GuindonChristopher Guindon 2 years ago (Oct 5, 2022 7:48pm UTC)

Merge details

  • Changes merged into with eb077790.
  • Deleted the source branch.

Pipeline #11071 passed

Pipeline passed for eb077790 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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>",
  • added 1 commit

    • 71955678 - update docker stack to include missing services

    Compare with previous version

  • added 1 commit

    • 0ca23e3b - update docker stack to include missing services

    Compare with previous version

  • 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)
    • @malowe

      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 Guindon
    • I am wondering if -Dconfig.secret.properties=$$PWD/config/application/secret.properties is only read at runtime? Since the db credentials are ignored in dev mode unless we use $CONFIG_SECRET_PATH. However, the oauth2 credentials do work without $CONFIG_SECRET_PATH

    • Yes, 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.

    • Please register or sign in to reply
  • requested review from @mbarbero

  • Christopher Guindon changed the description

    changed the description

  • Zachary Sabourin
  • Zachary Sabourin
  • Zachary Sabourin approved this merge request

    approved this merge request

  • mentioned in commit eb077790

  • Please register or sign in to reply
    Loading