diff --git a/client-registry-opencr/.env.build b/client-registry-opencr/.env.build index b8a2109..a86c169 100644 --- a/client-registry-opencr/.env.build +++ b/client-registry-opencr/.env.build @@ -2,3 +2,25 @@ PatientRelationship_json_DIGEST=testing123 config_json_DIGEST=testing123 decisionRules_json_DIGEST=testing123 mediator_json_DIGEST=testing123 +OPENCR_REPMGR_PRIMARY_HOST=opencr-postgres-1 +OPENCR_REPMGR_PARTNER_NODES=opencr-postgres-1 +OPENCR_REPMGR_PASSWORD=instant101 +HAPI_FHIR_INSTANCES=1 +HAPI_FHIR_CPU_LIMIT=0 +HAPI_FHIR_CPU_RESERVE=0.05 +HAPI_FHIR_MEMORY_LIMIT=3G +HAPI_FHIR_MEMORY_RESERVE=500M +OPENCR_POSTGRES_REPLICA_SET=opencr-postgres-1:5432 +OPENCR_HAPI_POSTGRES_PASSWORD=postgres +OPENCR_HF_POSTGRES_CPU_LIMIT=0 +OPENCR_HF_POSTGRES_CPU_RESERVE=0.05 +OPENCR_HF_POSTGRES_MEMORY_LIMIT=3G +OPENCR_HF_POSTGRES_MEMORY_RESERVE=500M +OPENCR_HF_POSTGRESQL_PASSWORD=instant101 +OPENCR_HF_POSTGRESQL_USERNAME=admin +OPENCR_HF_POSTGRESQL_DATABASE=hapi +ES_MEMORY_LIMIT=3G +ES_MEMORY_RESERVE=500M +CR_REPMGR_PRIMARY_HOST=postgres-1 +CR_REPMGR_PARTNER_NODES=postgres-1 +CR_REPMGR_PASSWORD=instant101 diff --git a/client-registry-opencr/Dockerfile b/client-registry-opencr/Dockerfile index 95f548c..73e5c42 100644 --- a/client-registry-opencr/Dockerfile +++ b/client-registry-opencr/Dockerfile @@ -1,4 +1,6 @@ -FROM intrahealth/opencr:bac5a14 +FROM intrahealth/opencr:latest + +RUN apt-get update && apt-get install -y wget && rm -rf /var/lib/apt/lists/* COPY ./config/entrypoint.sh /entrypoint.sh diff --git a/client-registry-opencr/docker-compose-hapi.yml b/client-registry-opencr/docker-compose-hapi.yml index 7588361..3937bed 100644 --- a/client-registry-opencr/docker-compose-hapi.yml +++ b/client-registry-opencr/docker-compose-hapi.yml @@ -1,32 +1,38 @@ version: "3.9" - +#docker stack deploy -c ./client-registry-opencr/docker-compose-hapi.yml --with-registry-auth client-registry-opencr services: opencr-hapi-fhir: - build: - context: ./ - dockerfile: hapi.Dockerfile - image: itechuw/hapi-wget:v5.1.0 + image: jembi/hapi:v5.7.0-wget networks: opencr: default: environment: + - spring.datasource.url=jdbc:postgresql://${OPENCR_POSTGRES_REPLICA_SET}/hapi?targetServerType=primary + - spring.datasource.username=admin + - spring.datasource.password=instant101 + - spring.datasource.driverClassName=org.postgresql.Driver + - spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL95Dialect + - hapi.fhir.allow_external_references=true + - hapi.fhir.auto_create_placeholder_reference_targets=true + - hapi.fhir.bulk_export_enabled=true + - hapi.fhir.enable_repository_validating_interceptor=true - JAVA_TOOL_OPTIONS=-Xmx2g - CATALINA_OPTS=-Xmx2g deploy: - replicas: ${HAPI_FHIR_INSTANCES-1} + replicas: ${HAPI_FHIR_INSTANCES} placement: max_replicas_per_node: 1 resources: limits: - cpus: ${HAPI_FHIR_CPU_LIMIT-1} - memory: ${HAPI_FHIR_MEMORY_LIMIT-2G} + cpus: ${HAPI_FHIR_CPU_LIMIT} + memory: ${HAPI_FHIR_MEMORY_LIMIT} reservations: - cpus: ${HAPI_FHIR_CPU_RESERVE-0.5} - memory: ${HAPI_FHIR_MEMORY_RESERVE-1G} + cpus: ${HAPI_FHIR_CPU_RESERVE} + memory: ${HAPI_FHIR_MEMORY_RESERVE} healthcheck: test: /bin/wget --no-verbose --tries=1 --spider http://localhost:8080 - interval: 15s + interval: 30s timeout: 5s retries: 5 start_period: 2m diff --git a/client-registry-opencr/docker-compose-postgres.yml b/client-registry-opencr/docker-compose-postgres.yml index 3e21bf8..2f9fc83 100644 --- a/client-registry-opencr/docker-compose-postgres.yml +++ b/client-registry-opencr/docker-compose-postgres.yml @@ -4,15 +4,15 @@ services: opencr-postgres-1: image: bitnami/postgresql-repmgr:14 environment: - POSTGRESQL_PASSWORD: ${OPENCR_HF_POSTGRESQL_PASSWORD-instant101} - POSTGRESQL_USERNAME: ${OPENCR_HF_POSTGRESQL_USERNAME-admin} - POSTGRESQL_DATABASE: ${OPENCR_HF_POSTGRESQL_DATABASE-hapi} + POSTGRESQL_PASSWORD: ${OPENCR_HF_POSTGRESQL_PASSWORD} + POSTGRESQL_USERNAME: ${OPENCR_HF_POSTGRESQL_USERNAME} + POSTGRESQL_DATABASE: ${OPENCR_HF_POSTGRESQL_DATABASE} REPMGR_NODE_NETWORK_NAME: opencr-postgres-1 - REPMGR_PASSWORD: ${OPENCR_REPMGR_PASSWORD} + REPMGR_PASSWORD: ${CR_REPMGR_PASSWORD} REPMGR_RECONNECT_INTERVAL: 3 REPMGR_NODE_NAME: opencr-postgres-1 - REPMGR_PRIMARY_HOST: ${OPENCR_REPMGR_PRIMARY_HOST} - REPMGR_PARTNER_NODES: ${OPENCR_REPMGR_PARTNER_NODES} + REPMGR_PRIMARY_HOST: ${CR_REPMGR_PRIMARY_HOST} + REPMGR_PARTNER_NODES: ${CR_REPMGR_PARTNER_NODES} POSTGRESQL_POSTGRES_PASSWORD: ${OPENCR_HAPI_POSTGRES_PASSWORD} volumes: - "opencr-postgres-1-data:/bitnami/postgresql" @@ -20,14 +20,14 @@ services: replicas: 1 resources: limits: - cpus: ${HF_POSTGRES_CPU_LIMIT} - memory: ${HF_POSTGRES_MEMORY_LIMIT} + cpus: ${OPENCR_HF_POSTGRES_CPU_LIMIT} + memory: ${OPENCR_HF_POSTGRES_MEMORY_LIMIT} reservations: - cpus: ${HF_POSTGRES_CPU_RESERVE} - memory: ${HF_POSTGRES_MEMORY_RESERVE} + cpus: ${OPENCR_HF_POSTGRES_CPU_RESERVE} + memory: ${OPENCR_HF_POSTGRES_MEMORY_RESERVE} networks: default: - opencr-postgres: + opencr: volumes: @@ -35,7 +35,7 @@ volumes: networks: default: - opencr-postgres: - name: opencr-postgres + opencr: + name: opencr external: true diff --git a/client-registry-opencr/docker-compose.yml b/client-registry-opencr/docker-compose.yml index 1473a0d..fa3afa4 100644 --- a/client-registry-opencr/docker-compose.yml +++ b/client-registry-opencr/docker-compose.yml @@ -1,9 +1,9 @@ version: '3.9' services: - + # docker-compose -f client-registry-opencr/docker-compose.yml --env-file client-registry-opencr/.env.build build opencr: - image: itechuw/opencr:bac5a14-2 + image: itechuw/opencr:latest build: context: . dockerfile: Dockerfile @@ -39,7 +39,12 @@ services: - 'traefik.http.routers.opencr.rule=Host(`hie-pilot.gov.bw`) && PathPrefix(`/crux`) || PathPrefix(`/ocrux`)' - 'traefik.http.services.opencr.loadbalancer.server.scheme=http' - 'traefik.http.routers.opencr.service=opencr' - + healthcheck: + test: /usr/bin/wget --no-verbose --tries=1 --spider http://localhost:3000/crux/ + interval: 30s + timeout: 20s + retries: 5 + start_period: 1m configs: config.json: file: ./config/_config.json diff --git a/client-registry-opencr/hapi.Dockerfile b/client-registry-opencr/hapi.Dockerfile index ffb2b49..a1f7fc5 100644 --- a/client-registry-opencr/hapi.Dockerfile +++ b/client-registry-opencr/hapi.Dockerfile @@ -1,4 +1,4 @@ -FROM hapiproject/hapi:v5.1.0 +FROM hapiproject/hapi:latest # Copy the static shell into base image COPY --from=busybox:1.36.0-uclibc /bin/sh /bin/sh diff --git a/client-registry-opencr/package-metadata.json b/client-registry-opencr/package-metadata.json index 82d6fc8..4718190 100644 --- a/client-registry-opencr/package-metadata.json +++ b/client-registry-opencr/package-metadata.json @@ -16,15 +16,18 @@ "HAPI_FHIR_MEMORY_RESERVE": "500M", "OPENCR_POSTGRES_REPLICA_SET": "opencr-postgres-1:5432", "OPENCR_HAPI_POSTGRES_PASSWORD": "postgres", - "HF_POSTGRES_CPU_LIMIT": "0", - "HF_POSTGRES_CPU_RESERVE": "0.05", - "HF_POSTGRES_MEMORY_LIMIT": "3G", - "HF_POSTGRES_MEMORY_RESERVE": "500M", + "OPENCR_HF_POSTGRES_CPU_LIMIT": "0", + "OPENCR_HF_POSTGRES_CPU_RESERVE": "0.05", + "OPENCR_HF_POSTGRES_MEMORY_LIMIT": "3G", + "OPENCR_HF_POSTGRES_MEMORY_RESERVE": "500M", "OPENCR_HF_POSTGRESQL_PASSWORD": "instant101", "OPENCR_HF_POSTGRESQL_USERNAME": "admin", "OPENCR_HF_POSTGRESQL_DATABASE": "hapi", "ES_MEMORY_LIMIT": "3G", - "ES_MEMORY_RESERVE": "500M" + "ES_MEMORY_RESERVE": "500M", + "CR_REPMGR_PRIMARY_HOST": "opencr-postgres-1", + "CR_REPMGR_PARTNER_NODES": "opencr-postgres-1", + "CR_REPMGR_PASSWORD": "instant101" } } diff --git a/client-registry-opencr/swarm.sh b/client-registry-opencr/swarm.sh index 3425814..fe1b1d6 100644 --- a/client-registry-opencr/swarm.sh +++ b/client-registry-opencr/swarm.sh @@ -51,7 +51,7 @@ function initialize_package() { fi ( - # docker::deploy_service "$STACK" "${COMPOSE_FILE_PATH}" "docker-compose-postgres.yml" "$postgres_cluster_compose_filename" "$postgres_dev_compose_filename" + docker::deploy_service "$STACK" "${COMPOSE_FILE_PATH}" "docker-compose-postgres.yml" docker::deploy_service "$STACK" "${COMPOSE_FILE_PATH}" "docker-compose-es.yml" @@ -72,7 +72,7 @@ function destroy_package() { log warn "Volumes are only deleted on the host on which the command is run. Postgres volumes on other nodes are not deleted" fi - docker::prune_configs "hapi-fhir" + docker::prune_configs "opencr" } main() { diff --git a/message-bus-kafka/package-metadata.json b/message-bus-kafka/package-metadata.json index 17e7b10..a0e14f8 100644 --- a/message-bus-kafka/package-metadata.json +++ b/message-bus-kafka/package-metadata.json @@ -11,7 +11,7 @@ "KAFKA_CPU_RESERVE": "0.05", "KAFKA_MEMORY_LIMIT": "3G", "KAFKA_MEMORY_RESERVE": "500M", - "KAFKA_TOPICS": "2xx,2xx-async,3xx,reprocess,errors,metrics:3:1", + "KAFKA_TOPICS": "send-adt-to-ipms,send-orm-to-ipms,save-pims-patient,save-ipms-patient,handle-adt-from-ipms,handle-oru-from-ipms,reprocess,errors,metrics:3:1", "KAFDROP_INSTANCES": "1", "KAFDROP_CPU_LIMIT": "0", "KAFDROP_CPU_RESERVE": "0.05", diff --git a/mk.sh b/mk.sh index f64d819..23cb33e 100755 --- a/mk.sh +++ b/mk.sh @@ -2,13 +2,14 @@ ./build-image.sh -./instant package remove -n shared-health-record --env-file .env -# ./instant package remove -n client-registry-opencr --env-file .env +#./instant package remove -n shared-health-record --env-file .env +./instant package remove -n client-registry-opencr --env-file .env # ./instant package remove -n fhir-datastore-hapi-fhir --env-file .env # ./instant package remove -n message-bus-kafka --env-file .env +# ./instant package remove -n openhim-mediator-fhir-converter --env-file .env - +# ./instant package init -n openhim-mediator-fhir-converter --env-file .env -d # ./instant package init -n message-bus-kafka --env-file .env # ./instant package init -n fhir-datastore-hapi-fhir --env-file .env -# ./instant package init -n client-registry-opencr --env-file .env -./instant package init -n shared-health-record --env-file .env +./instant package init -n client-registry-opencr --env-file .env +#./instant package init -n shared-health-record --env-file .env -d diff --git a/openhim-mediator-fhir-converter/docker-compose.dev.yml b/openhim-mediator-fhir-converter/docker-compose.dev.yml index 6477dec..8b0748e 100644 --- a/openhim-mediator-fhir-converter/docker-compose.dev.yml +++ b/openhim-mediator-fhir-converter/docker-compose.dev.yml @@ -3,6 +3,10 @@ version: '3.9' services: openhim-mediator-fhir-converter: ports: + - target: 9229 + published: 9229 + mode: host - target: 2019 published: 2019 mode: host + entrypoint: /app/deploy/debug.sh diff --git a/openhim-mediator-fhir-converter/docker-compose.yml b/openhim-mediator-fhir-converter/docker-compose.yml index 45b81cf..9f944a9 100644 --- a/openhim-mediator-fhir-converter/docker-compose.yml +++ b/openhim-mediator-fhir-converter/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.9' services: openhim-mediator-fhir-converter: - image: itechuw/openhim-mediator-fhir-converter:debug-2 + image: itechuw/openhim-mediator-fhir-converter:debug-3 networks: - default - openhim diff --git a/shared-health-record/docker-compose.dev.yml b/shared-health-record/docker-compose.dev.yml index 4736f52..c198f81 100644 --- a/shared-health-record/docker-compose.dev.yml +++ b/shared-health-record/docker-compose.dev.yml @@ -2,6 +2,8 @@ version: '3.9' services: shared-health-record: + # image: ghcr.io/i-tech-uw/shared-health-record:debug-5 + image: itechuw/shared-health-record:debug-1 entrypoint: node --inspect=0.0.0.0:9230 /app/dist/app.js ports: diff --git a/shared-health-record/docker-compose.yml b/shared-health-record/docker-compose.yml index 82733ce..e1e3652 100644 --- a/shared-health-record/docker-compose.yml +++ b/shared-health-record/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.9' services: shared-health-record: - image: ghcr.io/i-tech-uw/shared-health-record:debug-2 + image: itechuw/shared-health-record:latest networks: - default - hapi-fhir