Skip to content

Update ovis-compose.yml#287

Merged
torbrenner merged 7 commits intosamply:ovisfrom
tm16-medma:patch-1
Apr 14, 2025
Merged

Update ovis-compose.yml#287
torbrenner merged 7 commits intosamply:ovisfrom
tm16-medma:patch-1

Conversation

@tm16-medma
Copy link

Please ignore the command in mongo :) It will be replaced soon with proper user authentication

Please ignore the command in mongo :) It will be replaced soon with proper user authentication
…on to sh

- Removed the traefik service and renamed traefik-forward-auth to ovis- with ovis-traefik-forward-auth the labels, however would need help there as i got no knowledge of how OAuth2 works (Torben initialized that container)
- Updated MongoDB service configuration to include a direct initialization script for user and operation collections in the sh instead of in the compose directly
- Adjusted volume paths to only use the /var/cache/bridgehead/ccp directory
- Adjusted frontend and backend service labels for Traefik routing to not use ports
- Cleaned up unnecessary network definitions and volumes.
- Renamed FHIR Server URL to bridgehead-ccp-blaze:8080/fhir
- Removed redundant entrypoint (python main.py) of fhir transformer
- "traefik.enable=true"
- "traefik.http.routers.ovis-frontend.tls=true"
- "traefik.http.routers.ovis-frontend.rule=Host(`${GUI_HOST:-localhost}`)"
# - "traefik.http.routers.lens.middlewares=traefik-forward-auth"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To activate authentication, this needs to be uncommented

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has been uncommented

- "traefik.http.routers.ovis-frontend.rule=Host(`${GUI_HOST:-localhost}`)"
# - "traefik.http.routers.lens.middlewares=traefik-forward-auth"
- "traefik.http.services.ovis-frontend.loadbalancer.server.port=5173"
volumes:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What purpose does this volume serve? As far as i know, /app/.svelte-kit contains the application (frontend and backend) and besides using docker watch for faster development iterations i don't see any benefit in having this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Volume has been removed

fhir-transformer:
image: docker.verbis.dkfz.de/ovis/adt-mon-gql-fhir-transformer:latest
restart: on-failure
network_mode: "host"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is network_mode host relevant? The fhir transformer seems to access the fhir db via internal docker service name, so the container shouldn't need to jump in on the host network.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not relevant, so has also been removed

- "traefik.http.middlewares.ovis-traefik-forward-auth.forwardauth.address=http://ovis-traefik-forward-auth:4180"
- "traefik.http.middlewares.ovis-traefik-forward-auth.forwardauth.authResponseHeaders=Authorization, X-Forwarded-User, X-Auth-Request-User, X-Auth-Request-Email"
- "traefik.http.services.ovis-traefik-forward-auth.loadbalancer.server.port=4180"
- "traefik.http.routers.oauth2.rule=Host(`${GUI_HOST:-localhost}`) && PathPrefix(`/oauth2/`)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it would be good to use /oauth2-ovis/ as PathPrefix. This is necessary to avoid conflicts with the id-management (ccp/modules/id-management-compose.yml) or datashield modules.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path prefix changed from oauth2 to oauth2-ovis

ovis-traefik-forward-auth:
image: quay.io/oauth2-proxy/oauth2-proxy:latest
environment:
- http_proxy=${http_proxy}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

best is to use http://forward_proxy:3128 for http_proxy and https_proxy. The forward proxy is commonly established by the minimal module and handles communication with site proxy.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://forward_proxy:3128 now set as default value for http_proxy and https_proxy

- OAUTH2_PROXY_CLIENT_ID=${OAUTH_CLIENT_ID}
- OAUTH2_PROXY_CLIENT_SECRET=${OAUTH_CLIENT_SECRET}
- OAUTH2_PROXY_COOKIE_SECRET=${AUTHENTICATION_SECRET}
- OAUTH2_PROXY_COOKIE_DOMAINS=.${GUI_HOST:-localhost}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the bridgehead we already have the environment variable HOST defined. I would adjust all occurences of GUI_HOST to HOST

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GUI_HOST environmental variable has been now changed to HOST

command: mongod
volumes:
- /var/cache/bridgehead/ccp/ovis/mongo/mongo_db:/data/db
- /var/cache/bridgehead/ccp/ovis/mongo/mongo_conf:/data/configdb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it necessary to mount mongo_conf to the host? Is this needed to persist the configuration across restarts, or will the init.js script automatically apply the necessary config with each restart?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mongo_conf and mongo_db has now been removed as OVis is unaffected when both volumes are removed

- ADRESS=${ADRESS:-mongodb://mongo:27017}
volumes:
- /var/cache/bridgehead/ccp/ovis/shared_data:/shared
- /var/cache/bridgehead/ccp/ovis/init_onco/node_modules:/app/node_modules
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it necessary to mount the node modules outside of the container?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nodemodules have been removed, assumed they were necessary as they were in the initial ovis docker file, but it is not, same with every other volume like .svelte-kit, it got included in the original Dockerfile, so i left it, but yeah, now all those unnecessary volumes got removed.

- /var/cache/bridgehead/ccp/ovis/mongo/mongo_conf:/data/configdb
- /var/cache/bridgehead/ccp/ovis/mongo/init/init.js:/docker-entrypoint-initdb.d/init.js

init_onco:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of init_onco? It is the same container as backend but with another entrypoint?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

init_onco's entrypoint has now been merged with backend, so init_onco thus has been removed.

restart: always
environment:
- NODE_ENV=development
- VITE_GRAPHQL_URL=http://localhost:${APOLLO_PORT:-4001}/graphql
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will ovis do the call to the graphql backend via the browser or a backend in the frontend application? If via frontend, you would need to replace localhost with ${HOST}. If via backend the service name should be enough backend.
Maybe the NODE_ENV should also not be development, what happens if this is removed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its via frontend, so localhost got replaced with HOST but is still set to localhost as default value, because i could only test it locally.

- Replaced GUI_HOST with HOST
- Removed NODE_ENV
- Combine init_onco and backend service
- removed node_modules and .svelte-kit volumes
- removed mongodb volumes
- adjusted http_proxy and https_proxy
- adjusted path prefix from oaut2 to oauth2-ovis
- removed network-mode "host" in fhir-transformer service
@torbrenner torbrenner merged commit 324c2b3 into samply:ovis Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants