Skip to content

Commit

Permalink
Upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
pmanko committed Nov 17, 2023
1 parent 79d2856 commit 3c0a354
Show file tree
Hide file tree
Showing 14 changed files with 89 additions and 44 deletions.
22 changes: 22 additions & 0 deletions client-registry-opencr/.env.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion client-registry-opencr/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
28 changes: 17 additions & 11 deletions client-registry-opencr/docker-compose-hapi.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
26 changes: 13 additions & 13 deletions client-registry-opencr/docker-compose-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,38 @@ 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"
deploy:
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:
opencr-postgres-1-data:

networks:
default:
opencr-postgres:
name: opencr-postgres
opencr:
name: opencr
external: true

11 changes: 8 additions & 3 deletions client-registry-opencr/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion client-registry-opencr/hapi.Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 8 additions & 5 deletions client-registry-opencr/package-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

4 changes: 2 additions & 2 deletions client-registry-opencr/swarm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion message-bus-kafka/package-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 6 additions & 5 deletions mk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions openhim-mediator-fhir-converter/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion openhim-mediator-fhir-converter/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions shared-health-record/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion shared-health-record/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3c0a354

Please sign in to comment.