Skip to content

Commit

Permalink
Merge branch 'CU-86bygcqxd_Images-Placement-for-DataStore-Dashboards-…
Browse files Browse the repository at this point in the history
…Monitoring' of github.com:jembi/platform into CU-86bygcqxd_Images-Placement-for-DataStore-Dashboards-Monitoring
  • Loading branch information
bradsawadye committed May 24, 2024
2 parents 3b9816c + e679746 commit 6d44cf0
Show file tree
Hide file tree
Showing 51 changed files with 595 additions and 284 deletions.
6 changes: 3 additions & 3 deletions .env.cluster
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,18 @@ GF_SERVER_DOMAIN=grafana.domain
KC_POSTGRES_REPLICA_SET=pgpool-1:5432,pgpool-2:5432,pgpool-3:5432

# Client Registry - JeMPI
JEMPI_WEB_INSTANCES=3
JEMPI_WEB_INSTANCES=1
REACT_APP_JEMPI_BASE_API_HOST=https://jempi-api.domain
REACT_APP_JEMPI_BASE_API_PORT=50000
JEMPI_SESSION_SECURE=true
JEMPI_REPMGR_PARTNER_NODES=jempi-postgresql-01,jempi-postgresql-02,jempi-postgresql-03
JEMPI_REPMGR_PARTNER_NODES=jempi-postgresql-01
JEMPI_ASYNC_RECEIVER_INSTANCES=1
JEMPI_SYNC_RECEIVER_INSTANCES=1
JEMPI_PRE_PROCESSOR_INSTANCES=1
JEMPI_CONTROLLER_INSTANCES=1
JEMPI_EM_CALCULATOR_INSTANCES=1
JEMPI_LINKER_INSTANCES=1
JEMPI_API_INSTANCES=3
JEMPI_API_INSTANCES=1

# Resource limits
OPENHIM_MEMORY_LIMIT=4G
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,33 @@ jobs:
build-and-push:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push tag
if: ${{ github.ref_name != 'main' }}
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
tags: jembi/platform:${{ github.ref_name }}

- name: Build and push latest
if: ${{ github.ref_name == 'main' }}
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
tags: jembi/platform:latest
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openhie/package-base:2.3.1
FROM openhie/package-base:2.3.2

# Install yq
RUN curl -L https://github.com/mikefarah/yq/releases/download/v4.23.1/yq_linux_amd64 -o /usr/bin/yq
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ Each service's resource allocations can be piped into their .yml file through en
- Take note to not allocate less memory to ELK Stack services than their JVM heap sizes.
- Exit code 137 indicates an out-of-memory failure. When running into this, it means that the service has been allocated too little memory.

## Build multi-platform docker images
It's essential to make sure that any docker image should be available for multiple platforms : AMD, ARM, ... (not only linux, but MacOS as well). To do so you can follow the steps below :
1. Create your own custom builder by running `docker buildx create --name mycustombuilder --driver docker-container --bootstrap`
2. Ask docker to use this new builder for future builds by running `docker buildx use mycustombuilder`
3. Inspect buildx to see if docker has indeed switched builders to the new one you asked it to use by running `docker buildx inspect`
4. Then you can perform the build and push, for example : `docker buildx build --platform linux/amd64,linux/arm64 --push -t jembi/hapi:v7.0.3-wget .`

## Tests

Tests are located in `/test`
Expand Down
5 changes: 5 additions & 0 deletions client-registry-jempi/docker-compose.api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ services:
reverse-proxy:
kafka:
default:
jempi:


jempi-api-kc:
Expand Down Expand Up @@ -77,6 +78,7 @@ services:
reverse-proxy:
kafka:
default:
jempi:


volumes:
Expand All @@ -87,6 +89,9 @@ networks:
reverse-proxy:
name: reverse-proxy_public
external: true
jempi:
name: jempi_public
external: true
kafka:
name: kafka_public
external: true
Expand Down
17 changes: 16 additions & 1 deletion client-registry-jempi/docker-compose.combined-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ services:
placement:
constraints:
- "node.labels.name==node-1"


jempi-bootstrapper:
deploy:
placement:
constraints:
- "node.labels.name==node-1"

jempi-postgresql-02:
image: bitnami/postgresql-repmgr:15.2.0
environment:
Expand Down Expand Up @@ -36,6 +42,8 @@ services:
configs:
- target: /docker-entrypoint-initdb.d/jempi_psql_init_db.sql
source: jempi_psql_init_db.sql
networks:
jempi:

jempi-postgresql-03:
image: bitnami/postgresql-repmgr:15.2.0
Expand Down Expand Up @@ -66,7 +74,14 @@ services:
configs:
- target: /docker-entrypoint-initdb.d/jempi_psql_init_db.sql
source: jempi_psql_init_db.sql
networks:
jempi:

volumes:
jempi-psql-02-data:
jempi-psql-03-data:

networks:
jempi:
name: jempi_public
external: true
12 changes: 11 additions & 1 deletion client-registry-jempi/docker-compose.combined.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ services:
networks:
kafka:
default:
jempi:


jempi-etl:
Expand All @@ -37,6 +38,7 @@ services:
networks:
kafka:
default:
jempi:


jempi-controller:
Expand Down Expand Up @@ -70,6 +72,7 @@ services:
networks:
kafka:
default:
jempi:


jempi-linker:
Expand Down Expand Up @@ -104,6 +107,7 @@ services:
networks:
kafka:
default:
jempi:

jempi-bootstrapper:
image: jembi/jempi-bootstrapper:${JEMPI_BOOTSTRAPPER_IMAGE_TAG}
Expand All @@ -124,6 +128,7 @@ services:
networks:
kafka:
default:
jempi:

jempi-postgresql-01:
image: bitnami/postgresql-repmgr:15.2.0
Expand Down Expand Up @@ -151,6 +156,8 @@ services:
configs:
- target: /docker-entrypoint-initdb.d/jempi_psql_init_db.sql
source: jempi_psql_init_db.sql
networks:
jempi:

volumes:
jempi-psql-01-data:
Expand All @@ -161,7 +168,10 @@ networks:
kafka:
name: kafka_public
external: true
defualt:
default:
jempi:
name: jempi_public
external: true


configs:
Expand Down
13 changes: 12 additions & 1 deletion client-registry-jempi/docker-compose.dgraph-zero-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ services:
constraints:
- node.labels.name == node-1
command: dgraph zero --my=jempi-zero-01:5080 --replicas 3 --bindall --raft "idx=1"

networks:
jempi:

jempi-zero-02:
image: dgraph/dgraph:v22.0.0
volumes:
Expand All @@ -25,6 +27,8 @@ services:
restart_policy:
condition: on-failure
command: dgraph zero --my=jempi-zero-02:5080 --replicas 3 --peer=jempi-zero-01:5080 --raft "idx=2"
networks:
jempi:

jempi-zero-03:
image: dgraph/dgraph:v22.0.0
Expand All @@ -43,7 +47,14 @@ services:
restart_policy:
condition: on-failure
command: dgraph zero --my=jempi-zero-03:5080 --replicas 3 --peer=jempi-zero-01:5080 --raft "idx=3"
networks:
jempi:

volumes:
jempi-zero-02-data:
jempi-zero-03-data:

networks:
jempi:
name: jempi_public
external: true
7 changes: 7 additions & 0 deletions client-registry-jempi/docker-compose.dgraph-zero.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ services:
restart_policy:
condition: on-failure
command: dgraph zero --my=jempi-zero-01:5080 --replicas 1
networks:
jempi:

volumes:
jempi-zero-01-data:

networks:
jempi:
name: jempi_public
external: true
13 changes: 13 additions & 0 deletions client-registry-jempi/docker-compose.dgraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ services:
restart_policy:
condition: on-failure
command: dgraph alpha --my=jempi-alpha-01:7080 --zero=jempi-zero-01:5080 --security whitelist=0.0.0.0/0 --telemetry "sentry=false;"
networks:
jempi:

jempi-alpha-02:
image: dgraph/dgraph:v22.0.0
Expand All @@ -32,6 +34,8 @@ services:
restart_policy:
condition: on-failure
command: dgraph alpha --my=jempi-alpha-02:7081 --zero=jempi-zero-01:5080 --security whitelist=0.0.0.0/0 -o 1 --telemetry "sentry=false;"
networks:
jempi:

jempi-alpha-03:
image: dgraph/dgraph:v22.0.0
Expand All @@ -48,6 +52,8 @@ services:
restart_policy:
condition: on-failure
command: dgraph alpha --my=jempi-alpha-03:7082 --zero=jempi-zero-01:5080 --security whitelist=0.0.0.0/0 -o 2 --telemetry "sentry=false;"
networks:
jempi:

jempi-ratel:
image: dgraph/ratel:v21.03.2
Expand All @@ -61,8 +67,15 @@ services:
restart_policy:
condition: on-failure
command: dgraph-ratel
networks:
jempi:

volumes:
jempi-alpha-01-data:
jempi-alpha-02-data:
jempi-alpha-03-data:

networks:
jempi:
name: jempi_public
external: true
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"inputTransforms": {
"total": "$count(lookupRequests.jempiSearchAll.data.goldenRecords)",
"entry": "$map(lookupRequests.jempiSearchAll.data.goldenRecords, function($v) {{'fullUrl': 'Patient/' & $v.goldenId, 'resource': {'resourceType': 'Patient','id': $v.goldenId,'name': {'given': [$v.demographicData.givenName],'family': $v.demographicData.familyName},'address': [{'city': $v.demographicData.city}],'birthDate': $v.demographicData.dob,'telecom': [{'value': $v.demographicData.phoneNumber,'system': 'phone'}],'identifier': [{'system': $v.sourceId.facility,'value': $v.sourceId.patient},{'system': 'NationalID','value': $v.demographicData.nationalId}],'gender': $v.demographicData.gender}}})"
"entry": "$append([], $map(lookupRequests.jempiSearchAll.data.goldenRecords, function($v) {{'fullUrl': 'Patient/' & $v.goldenId, 'resource': {'resourceType': 'Patient','id': $v.goldenId,'name': {'given': [$v.demographicData.givenName],'family': $v.demographicData.familyName},'address': [{'city': $v.demographicData.city}],'birthDate': $v.demographicData.dob,'telecom': [{'value': $v.demographicData.phoneNumber,'system': 'phone'}],'identifier': [{'system': $v.sourceId.facility,'value': $v.sourceId.patient},{'system': 'NationalID','value': $v.demographicData.nationalId}],'gender': $v.demographicData.gender}}}))"
},
"inputMapping": {
"constants.resourceType": "resourceType",
Expand Down
3 changes: 3 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ packages:
- identity-access-manager-keycloak
- openhim-mapping-mediator
- database-postgres
- reprocess-mediator
- fhir-ig-importer

profiles:
Expand All @@ -43,6 +44,8 @@ profiles:
- openhim-mapping-mediator
- kafka-mapper-consumer
- kafka-unbundler-consumer
- fhir-ig-importer
- reprocess-mediator
envFiles:
- cdr-dw.env

Expand Down
7 changes: 3 additions & 4 deletions documentation/recipes/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

---
description: Pre-defined recipes for common use cases
---

# 📜 Recipes

OpenHIM platform comes bundles with a set of generic packages that can be deployed and configured to support a number of different use cases. To help users of OpenHIM Platform get started with something they can make use of immediately, a number of default OpenHIM Platform reciepes are provided. These help you get started with everything you need setup and configured for a particular use case.

We current support the following default recipes:

OpenHIM platform comes bundled with a set of generic packages that can be deployed and configured to support a number of different use cases. To help users of OpenHIM Platform get started with something they can make use of immediately, a number of default OpenHIM Platform recipes are provided. These help you get started with everything you need setup and configured for a particular use case.

We currently support the following default recipes:

<table data-view="cards"><thead><tr><th align="center"></th><th></th><th data-hidden></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td align="center"><strong>Central Data Repository with Data Warehouse</strong></td><td>A FHIR-based Shared Health record linked to an MPI for linking and matching patient demographics and a default reporting pipeline to transform and visualise FHIR data.</td><td></td><td><a href="central-data-repository-with-data-warehousing.md">central-data-repository-with-data-warehousing.md</a></td></tr><tr><td align="center"><strong>Central Data Repository</strong></td><td>A FHIR-based Shared Health record linked to an MPI for linking and matching patient demographics. No reporting is include but all FHIR data is pushed to Kafka for external system to use.</td><td></td><td><a href="central-data-repository-no-reporting.md">central-data-repository-no-reporting.md</a></td></tr><tr><td align="center"><strong>Master Patient Index</strong></td><td>A master patient index setup using JeMPI. it also includes OpenHIM as the API gateway providing security, a mapping mediator to allow FHIR-based communication with JeMPI and Keycloak to support user management.</td><td></td><td><a href="master-patient-index.md">master-patient-index.md</a></td></tr></tbody></table>
2 changes: 1 addition & 1 deletion fhir-ig-importer/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ services:
fhir-ig-importer-ui:
ports:
- target: 8080
published: 3000
published: 3334
mode: host
2 changes: 2 additions & 0 deletions fhir-ig-importer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
networks:
hapi-fhir:
openhim:
default:
environment:
HAPI_FHIR_BASE_URL: ${HAPI_FHIR_BASE_URL}
HAPI_FHIR_INSTANCES: ${HAPI_FHIR_INSTANCES}
Expand All @@ -27,4 +28,5 @@ networks:
openhim:
name: openhim_public
external: true
default:

8 changes: 8 additions & 0 deletions fhir-ig-importer/importer/docker-compose.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ services:
target: /openhimConfig.js
- source: fhir-ig-importer-config-importer-openhim-import.json
target: /openhim-import.json
- source: fhir-ig-importer-config-importer-ig-importer-app.json
target: /ig-importer-app.json
deploy:
replicas: 1
restart_policy:
Expand All @@ -34,8 +36,14 @@ configs:
name: fhir-ig-importer-config-importer-openhim-import.json-${fhir_ig_importer_config_importer_openhim_import_js_DIGEST:?err}
labels:
name: fhir-ig-importer
fhir-ig-importer-config-importer-ig-importer-app.json:
file: ./volume/ig-importer-app.json
name: fhir-ig-importer-config-importer-ig-importer-app.json-${fhir_ig_importer_config_importer_ig_importer_app_DIGEST:?err}
labels:
name: fhir-ig-importer

networks:
openhim:
name: openhim_public
external: true
default:
11 changes: 11 additions & 0 deletions fhir-ig-importer/importer/volume/ig-importer-app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "FHIR IG Importer",
"description": "FHIR IG microfrontend app",
"category": "HIE Configuration",
"type": "esmodule",
"url": "http://localhost:3334/jembi-fhir-ig-importer.js",
"showInPortal": true,
"showInSideBar": true,
"access_roles": ["admin"],
"icon": "https://fonts.gstatic.com/s/i/materialicons/medical_information/v1/24px.svg"
}
Loading

0 comments on commit 6d44cf0

Please sign in to comment.