Skip to content

Commit

Permalink
Merge pull request #261 from jembi/recipes
Browse files Browse the repository at this point in the history
Add default recipes
  • Loading branch information
bradsawadye authored Feb 23, 2024
2 parents 260013f + 965652d commit 8c80886
Show file tree
Hide file tree
Showing 25 changed files with 360 additions and 112 deletions.
3 changes: 2 additions & 1 deletion .env.cluster
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ GF_SERVER_DOMAIN=grafana.domain

# Client Registry - JeMPI
JEMPI_WEB_INSTANCES=3
REACT_APP_JEMPI_BASE_URL=https://jempi-api.domain/JeMPI
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_ASYNC_RECEIVER_INSTANCES=1
Expand Down
34 changes: 14 additions & 20 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,19 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
# replaces latest with the version of the release in the config.yaml file
- name: Set version
run: |
sed -i "s/latest/${{ github.event.release.tag_name }}/g" config.yaml
- name: Build Releases
run: ./get-cli.sh

- name: Test binaries
run: ./instant-linux help

- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./instant-linux
./instant-macos
./instant.exe
./config.yml
./banner.txt
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./config.yml
./banner.txt
./cdr-dw.env
./cdr.env
./mpi.env
60 changes: 45 additions & 15 deletions analytics-datastore-clickhouse/importer/config/clickhouseTables.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,52 @@
const CLUSTERED_MODE = process.env.CLUSTERED_MODE || 'true';
const CLUSTERED_MODE = process.env.CLUSTERED_MODE || "false";

const queries =
Boolean(CLUSTERED_MODE) === true
CLUSTERED_MODE === "true"
? [
`CREATE TABLE default_table(
createdAt Date,
updatedAt Date
)
ENGINE=MergeTree
ORDER BY tuple();`,
`CREATE TABLE patient_example ON CLUSTER '{cluster}' (
id String,
version String NULL,
inserted_at DateTime DEFAULT now(),
last_updated Date NULL,
goldenId String,
patientGivenName String,
patientFamilyName String,
)
ENGINE = ReplicatedMergeTree('/clickhouse/tables/{cluster}/{shard}/{table}', '{replica}')
ORDER BY tuple();`,
`CREATE TABLE observation_example ON CLUSTER '{cluster}' (
id String,
version String NULL,
inserted_at DateTime DEFAULT now(),
last_updated Date NULL,
observationValue Double,
patientId String,
)
ENGINE = ReplicatedMergeTree('/clickhouse/tables/{cluster}/{shard}/{table}', '{replica}')
ORDER BY tuple();`,
]
: [
`CREATE TABLE default.default_table ON CLUSTER '{cluster}' (
createdAt Date,
updatedAt Date
)
ENGINE = ReplicatedMergeTree('/clickhouse/tables/{cluster}/{shard}/{table}', '{replica}')
ORDER BY tuple();`,
: [
`CREATE TABLE patient_example(
id String,
version String NULL,
inserted_at DateTime DEFAULT now(),
last_updated Date NULL,
goldenId String,
patientGivenName String,
patientFamilyName String,
)
ENGINE=MergeTree
ORDER BY tuple();`,
`CREATE TABLE observation_example(
id String,
version String NULL,
inserted_at DateTime DEFAULT now(),
last_updated Date NULL,
observationValue Double,
patientId String,
)
ENGINE=MergeTree
ORDER BY tuple();`,
];

module.exports = queries;
20 changes: 20 additions & 0 deletions cdr-dw.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# General
CLUSTERED_MODE=false

# Log
DEBUG=0
BASHLOG_FILE=0
BASHLOG_FILE_PATH=platform.log

# Message Bus - Kafka
# !NOTE: Topics should comma seperated, optional include partion and repliction values
# e.g. <topic>:<partions>:<replicationFactor> -> test:3:2 (defaults to <topics>:3:1)
KAFKA_TOPICS=2xx,2xx-async,errors,reprocess,3xx,patient,observation,JeMPI-audit-trail

# SSO
KC_OPENHIM_SSO_ENABLED=true
OPENHIM_CONSOLE_SHOW_LOGIN=false
KC_JEMPI_SSO_ENABLED=true
REACT_APP_JEMPI_BASE_API_PORT=50001
KC_SUPERSET_SSO_ENABLED=true
KC_GRAFANA_SSO_ENABLED=true
19 changes: 19 additions & 0 deletions cdr.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# General
CLUSTERED_MODE=false

# Log
DEBUG=0
BASHLOG_FILE=0
BASHLOG_FILE_PATH=platform.log

# Message Bus - Kafka
# !NOTE: Topics should comma seperated, optional include partion and repliction values
# e.g. <topic>:<partions>:<replicationFactor> -> test:3:2 (defaults to <topics>:3:1)
KAFKA_TOPICS=2xx,2xx-async,errors,reprocess,3xx,patient,observation,JeMPI-audit-trail

# SSO
KC_OPENHIM_SSO_ENABLED=true
OPENHIM_CONSOLE_SHOW_LOGIN=false
KC_JEMPI_SSO_ENABLED=true
REACT_APP_JEMPI_BASE_API_PORT=50001
KC_GRAFANA_SSO_ENABLED=true
6 changes: 6 additions & 0 deletions client-registry-jempi/docker-compose.api-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ services:
- published: 50000
target: 50000
mode: host

jempi-api-kc:
ports:
- published: 50001
target: 50000
mode: host
55 changes: 50 additions & 5 deletions client-registry-jempi/docker-compose.api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,59 @@ services:
jempi-api:
image: jembi/jempi-api:${JEMPI_API_IMAGE_TAG}
environment:
POSTGRESQL_USER: ${POSTGRESQL_USERNAME}
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
LOG4J2_LEVEL: ${LOG4J2_LEVEL}
POSTGRESQL_IP: ${JEMPI_REPMGR_PRIMARY_HOST}
POSTGRESQL_PORT: 5432
POSTGRESQL_DATABASE: ${POSTGRESQL_DATABASE}
POSTGRESQL_USER: ${POSTGRESQL_USERNAME}
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_HOSTS}
KAFKA_APPLICATION_ID: ${KAFKA_APPLICATION_ID_API}
DGRAPH_HOSTS: ${DGRAPH_HOSTS}
DGRAPH_PORTS: ${DGRAPH_PORTS}
HTTP_SERVER_PORT: ${HTTP_SERVER_PORT}
API_HTTP_PORT: 50000
LINKER_IP: jempi-linker
LINKER_HTTP_PORT: 50000
volumes:
- "jempi-shared-data:/app/csv"
deploy:
replicas: ${JEMPI_API_INSTANCES}
resources:
limits:
memory: ${JEMPI_API_MEMORY_LIMIT}
reservations:
memory: ${JEMPI_API_MEMORY_RESERVE}
networks:
reverse-proxy:
kafka:
default:


jempi-api-kc:
image: jembi/jempi-api-kc:${JEMPI_API_KC_IMAGE_TAG}
environment:
LOG4J2_LEVEL: ${LOG4J2_LEVEL}
LINKER_HOST: ${LINKER_HOST}
KC_REALM_NAME: ${KC_REALM_NAME}
KC_API_URL: ${KC_API_URL}
KC_JEMPI_CLIENT_ID: ${KC_JEMPI_CLIENT_ID}
KC_JEMPI_CLIENT_SECRET: ${KC_JEMPI_CLIENT_SECRET}
KC_JEMPI_ROOT_URL: ${KC_JEMPI_ROOT_URL}
KC_FRONTEND_URL: ${KC_FRONTEND_URL}
JEMPI_SESSION_SECRET: ${JEMPI_SESSION_SECRET}
JEMPI_SESSION_SECURE: ${JEMPI_SESSION_SECURE}
JEMPI_SESSION_DOMAIN_NAME: ${JEMPI_SESSION_DOMAIN_NAME}
POSTGRESQL_IP: ${JEMPI_REPMGR_PRIMARY_HOST}
POSTGRESQL_PORT: 5432
POSTGRESQL_DATABASE: ${POSTGRESQL_DATABASE}
POSTGRESQL_USER: ${POSTGRESQL_USERNAME}
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_HOSTS}
KAFKA_APPLICATION_ID: ${KAFKA_APPLICATION_ID_API}
DGRAPH_HOSTS: ${DGRAPH_HOSTS}
DGRAPH_PORTS: ${DGRAPH_PORTS}
API_KC_HTTP_PORT: 50000
LINKER_IP: jempi-linker
LINKER_HTTP_PORT: 50000
volumes:
- "jempi-shared-data:/app/csv"
deploy:
Expand All @@ -28,8 +71,10 @@ services:
kafka:
default:


volumes:
jempi-shared-data:
jempi-shared-data:


networks:
reverse-proxy:
Expand Down
40 changes: 27 additions & 13 deletions client-registry-jempi/docker-compose.combined.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
jempi-async-receiver:
image: jembi/jempi-async-receiver:${JEMPI_ASYNC_RECEIVER_IMAGE_TAG}
environment:
LOG4J2_LEVEL: ${LOG4J2_LEVEL}
LOG4J2_LEVEL: ${LOG4J2_LEVEL}
KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_HOSTS}
KAFKA_CLIENT_ID: ${KAFKA_CLIENT_ID_ASYNC}
volumes:
Expand All @@ -20,10 +20,11 @@ services:
kafka:
default:


jempi-etl:
image: jembi/jempi-etl:${JEMPI_ETL_IMAGE_TAG}
environment:
LOG4J2_LEVEL: ${LOG4J2_LEVEL}
LOG4J2_LEVEL: ${LOG4J2_LEVEL}
KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_HOSTS}
KAFKA_APPLICATION_ID: ${KAFKA_APPLICATION_ID_ETL}
deploy:
Expand All @@ -37,19 +38,24 @@ services:
kafka:
default:


jempi-controller:
image: jembi/jempi-controller:${JEMPI_CONTROLLER_IMAGE_TAG}
environment:
POSTGRESQL_USER: ${POSTGRESQL_USERNAME}
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
LOG4J2_LEVEL: ${LOG4J2_LEVEL}
POSTGRESQL_IP: ${JEMPI_REPMGR_PRIMARY_HOST}
POSTGRESQL_PORT: 5432
POSTGRESQL_DATABASE: ${POSTGRESQL_DATABASE}
POSTGRESQL_HOST: ${POSTGRESQL_HOST}
POSTGRESQL_USER: ${POSTGRESQL_USERNAME}
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_HOSTS}
KAFKA_APPLICATION_ID: ${KAFKA_APPLICATION_ID_CTRL}
KAFKA_CLIENT_ID: ${KAFKA_CLIENT_ID_CTRL}
HTTP_SERVER_PORT: ${HTTP_SERVER_PORT}
LOG4J2_LEVEL: ${LOG4J2_LEVEL}
LINKER_HOST: ${LINKER_HOST}
CONTROLLER_HTTP_PORT: 50000
API_IP: jempi-api
API_HTTP_PORT: 50000
LINKER_IP: jempi-linker
LINKER_HTTP_PORT: 50000
deploy:
replicas: ${JEMPI_CONTROLLER_INSTANCES}
resources:
Expand All @@ -61,20 +67,25 @@ services:
kafka:
default:


jempi-linker:
image: jembi/jempi-linker:${JEMPI_LINKER_IMAGE_TAG}
environment:
POSTGRESQL_USER: ${POSTGRESQL_USERNAME}
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
LOG4J2_LEVEL: ${LOG4J2_LEVEL}
POSTGRESQL_IP: ${JEMPI_REPMGR_PRIMARY_HOST}
POSTGRESQL_PORT: 5432
POSTGRESQL_DATABASE: ${POSTGRESQL_DATABASE}
POSTGRESQL_USER: ${POSTGRESQL_USERNAME}
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_HOSTS}
KAFKA_APPLICATION_ID_INTERACTIONS: ${KAFKA_APPLICATION_ID_INTERACTIONS}
KAFKA_APPLICATION_ID_MU: ${KAFKA_APPLICATION_ID_MU}
KAFKA_CLIENT_ID_NOTIFICATIONS: ${KAFKA_CLIENT_ID_NOTIFICATIONS}
DGRAPH_HOSTS: ${DGRAPH_HOSTS}
DGRAPH_PORTS: ${DGRAPH_PORTS}
HTTP_SERVER_PORT: ${HTTP_SERVER_PORT}
LOG4J2_LEVEL: ${LOG4J2_LEVEL}
LINKER_HTTP_PORT: 50000
API_IP: jempi-api
API_HTTP_PORT: 50000
LINKER_MATCH_THRESHOLD: ${LINKER_MATCH_THRESHOLD}
LINKER_MATCH_THRESHOLD_MARGIN: ${LINKER_MATCH_THRESHOLD_MARGIN}
deploy:
Expand All @@ -88,6 +99,7 @@ services:
kafka:
default:


jempi-postgresql-01:
image: bitnami/postgresql-repmgr:15.2.0
environment:
Expand All @@ -114,17 +126,19 @@ services:
configs:
- target: /docker-entrypoint-initdb.d/jempi_psql_init_db.sql
source: jempi_psql_init_db.sql

volumes:
jempi-psql-01-data:
jempi-shared-data:


networks:
kafka:
name: kafka_public
external: true
defualt:


configs:
jempi_psql_init_db.sql:
file: ./importer/jempi_psql_init_db.sql
Expand Down
15 changes: 10 additions & 5 deletions client-registry-jempi/docker-compose.web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ services:
jempi-web:
image: jembi/jempi-web:${JEMPI_WEB_VERSION}
environment:
REACT_APP_JEMPI_BASE_URL: ${REACT_APP_JEMPI_BASE_URL}
REACT_APP_MOCK_BACKEND: ${REACT_APP_MOCK_BACKEND}
REACT_APP_KC_FRONTEND_URL: ${KC_FRONTEND_URL}
REACT_APP_KC_REALM_NAME: ${KC_REALM_NAME}
REACT_APP_KC_JEMPI_CLIENT_ID: ${KC_JEMPI_CLIENT_ID}
REACT_APP_JEMPI_BASE_API_HOST: ${REACT_APP_JEMPI_BASE_API_HOST}
REACT_APP_JEMPI_BASE_API_PORT: ${REACT_APP_JEMPI_BASE_API_PORT}
REACT_APP_ENABLE_SSO: ${KC_JEMPI_SSO_ENABLED}
REACT_APP_MAX_UPLOAD_CSV_SIZE_IN_MEGABYTES: 128
NODE_ENV: production
KC_FRONTEND_URL: ${KC_FRONTEND_URL}
KC_REALM_NAME: ${KC_REALM_NAME}
KC_JEMPI_CLIENT_ID: ${KC_JEMPI_CLIENT_ID}
REACT_APP_SHOW_BRAND_LOGO: "false"
deploy:
replicas: ${JEMPI_WEB_INSTANCES}
placement:
Expand All @@ -23,6 +27,7 @@ services:
keycloak:
default:


networks:
reverse-proxy:
name: reverse-proxy_public
Expand Down
Loading

0 comments on commit 8c80886

Please sign in to comment.