Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLAT-606 Rename services to be consistent [DONT MERGE] #205

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .env.cluster
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ OPENHIM_CONSOLE_INSTANCES=3
OPENHIM_CORE_MEDIATOR_HOSTNAME=openhimcomms.domain
OPENHIM_MEDIATOR_API_PORT=443
MONGO_SET_COUNT=3
OPENHIM_MONGO_URL=mongodb://mongo-1:27017,mongo-2:27017,mongo-3:27017/openhim?replicaSet=mongo-set
OPENHIM_MONGO_ATNAURL=mongodb://mongo-1:27017,mongo-2:27017,mongo-3:27017/openhim?replicaSet=mongo-set
OPENHIM_MONGO_URL=mongodb://mongo-01:27017,mongo-02:27017,mongo-03:27017/openhim?replicaSet=mongo-set
OPENHIM_MONGO_ATNAURL=mongodb://mongo-01:27017,mongo-02:27017,mongo-03:27017/openhim?replicaSet=mongo-set

# FHIR Datastore - HAPI FHIR
HAPI_FHIR_INSTANCES=3
REPMGR_PARTNER_NODES=postgres-1,postgres-2,postgres-3
POSTGRES_REPLICA_SET=postgres-1:5432,postgres-2:5432,postgres-3:5432
REPMGR_PARTNER_NODES=postgres-01,postgres-02,postgres-03
POSTGRES_REPLICA_SET=postgres-01:5432,postgres-02:5432,postgres-03:5432

# Sante Datastore - Sante MPI
REPMGR_PARTNER_NODES=santempi-psql-1,santempi-psql-2,santempi-psql-3
REPMGR_PARTNER_NODES=santempi-psql-01,santempi-psql-02,santempi-psql-03

# Reverse Proxy - Nginx
REVERSE_PROXY_INSTANCES=3
Expand Down
10 changes: 5 additions & 5 deletions .env.remote
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ OPENHIM_TRANSACTION_API_PORT=<port>
OPENHIM_MEDIATOR_API_PORT=<OPENHIM_MEDIATOR_API_PORT>
MOCK_SERVER_HOST=<mock_service_hostname>
MOCK_SERVER_PORT=<port>
POSTGRES_REPLICA_SET=postgres-1:5432,postgres-2:5432,postgres-3:5432
POSTGRES_REPLICA_SET=postgres-01:5432,postgres-02:5432,postgres-03:5432

# Analytics Datastore - Elastic Search
ES_HOSTS="analytics-datastore-elastic-search-01:9200","analytics-datastore-elastic-search-02:9200","analytics-datastore-elastic-search-03:9200"
Expand All @@ -16,13 +16,13 @@ ES_HOSTS="analytics-datastore-elastic-search-01:9200","analytics-datastore-elast
CLICKHOUSE_HOST=analytics-datastore-clickhouse-01

# FHIR Datastore - HAPI FHIR
REPMGR_PARTNER_NODES=postgres-1,postgres-2,postgres-3
POSTGRES_REPLICA_SET=postgres-1:5432,postgres-2:5432,postgres-3:5432
REPMGR_PARTNER_NODES=postgres-01,postgres-02,postgres-03
POSTGRES_REPLICA_SET=postgres-01:5432,postgres-02:5432,postgres-03:5432

# Interoperability Layer - OpenHIM
MONGO_SET_COUNT=3
OPENHIM_MONGO_URL=mongodb://mongo-1:27017,mongo-2:27017,mongo-3:27017/openhim?replicaSet=mongo-set
OPENHIM_MONGO_ATNAURL=mongodb://mongo-1:27017,mongo-2:27017,mongo-3:27017/openhim?replicaSet=mongo-set
OPENHIM_MONGO_URL=mongodb://mongo-01:27017,mongo-02:27017,mongo-03:27017/openhim?replicaSet=mongo-set
OPENHIM_MONGO_ATNAURL=mongodb://mongo-01:27017,mongo-02:27017,mongo-03:27017/openhim?replicaSet=mongo-set

# Message Bus - Kafka

Expand Down
22 changes: 11 additions & 11 deletions client-registry-santempi/docker-compose-postgres.cluster.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
version: '3.9'

services:
santempi-psql-1:
santempi-psql-01:
deploy:
placement:
constraints:
- "node.labels.name==node-1"

santempi-psql-2:
santempi-psql-02:
image: bitnami/postgresql-repmgr:14
environment:
POSTGRESQL_PASSWORD: ${SANTEMPI_POSTGRESQL_PASSWORD}
POSTGRESQL_USERNAME: ${SANTEMPI_POSTGRESQL_USERNAME}
REPMGR_NODE_NETWORK_NAME: santempi-psql-2
REPMGR_NODE_NETWORK_NAME: santempi-psql-02
REPMGR_PASSWORD: SanteDB123
REPMGR_RECONNECT_INTERVAL: 3
REPMGR_NODE_NAME: santempi-psql-2
REPMGR_NODE_NAME: santempi-psql-02
REPMGR_PRIMARY_HOST: ${SANTEMPI_REPMGR_PRIMARY_HOST}
REPMGR_PARTNER_NODES: ${SANTEMPI_REPMGR_PARTNER_NODES}
volumes:
- 'santempi-psql-2-data:/bitnami/postgresql'
- 'santempi-psql-02-data:/bitnami/postgresql'
deploy:
replicas: 1
placement:
constraints:
- "node.labels.name==node-2"

santempi-psql-3:
santempi-psql-03:
image: bitnami/postgresql-repmgr:14
environment:
POSTGRESQL_PASSWORD: ${SANTEMPI_POSTGRESQL_PASSWORD}
POSTGRESQL_USERNAME: ${SANTEMPI_POSTGRESQL_USERNAME}
REPMGR_NODE_NETWORK_NAME: santempi-psql-3
REPMGR_NODE_NETWORK_NAME: santempi-psql-03
REPMGR_PASSWORD: SanteDB123
REPMGR_RECONNECT_INTERVAL: 3
REPMGR_NODE_NAME: santempi-psql-3
REPMGR_NODE_NAME: santempi-psql-03
REPMGR_PRIMARY_HOST: ${SANTEMPI_REPMGR_PRIMARY_HOST}
REPMGR_PARTNER_NODES: ${SANTEMPI_REPMGR_PARTNER_NODES}
volumes:
- 'santempi-psql-3-data:/bitnami/postgresql'
- 'santempi-psql-03-data:/bitnami/postgresql'
deploy:
replicas: 1
placement:
constraints:
- "node.labels.name==node-3"

volumes:
santempi-psql-2-data:
santempi-psql-3-data:
santempi-psql-02-data:
santempi-psql-03-data:
2 changes: 1 addition & 1 deletion client-registry-santempi/docker-compose-postgres.dev.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.9'

services:
santempi-psql-1:
santempi-psql-01:
ports:
- target: 5432
published: 5433
Expand Down
10 changes: 5 additions & 5 deletions client-registry-santempi/docker-compose-postgres.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
version: '3.9'

services:
santempi-psql-1:
santempi-psql-01:
image: bitnami/postgresql-repmgr:14
environment:
POSTGRESQL_PASSWORD: ${SANTEMPI_POSTGRESQL_PASSWORD}
POSTGRESQL_USERNAME: ${SANTEMPI_POSTGRESQL_USERNAME}
REPMGR_NODE_NETWORK_NAME: santempi-psql-1
REPMGR_NODE_NETWORK_NAME: santempi-psql-01
REPMGR_PASSWORD: SanteDB123
REPMGR_RECONNECT_INTERVAL: 3
REPMGR_NODE_NAME: santempi-psql-1
REPMGR_NODE_NAME: santempi-psql-01
REPMGR_PRIMARY_HOST: ${SANTEMPI_REPMGR_PRIMARY_HOST}
REPMGR_PARTNER_NODES: ${SANTEMPI_REPMGR_PARTNER_NODES}
volumes:
- 'santempi-psql-1-data:/bitnami/postgresql'
- 'santempi-psql-01-data:/bitnami/postgresql'
deploy:
replicas: 1

volumes:
santempi-psql-1-data:
santempi-psql-01-data:
4 changes: 2 additions & 2 deletions client-registry-santempi/package-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"SANTEMPI_INSTANCES": "1",
"SANTEMPI_POSTGRESQL_PASSWORD": "SanteDB123",
"SANTEMPI_POSTGRESQL_USERNAME": "santedb",
"SANTEMPI_REPMGR_PRIMARY_HOST": "santempi-psql-1",
"SANTEMPI_REPMGR_PARTNER_NODES": "santempi-psql-1"
"SANTEMPI_REPMGR_PRIMARY_HOST": "santempi-psql-01",
"SANTEMPI_REPMGR_PARTNER_NODES": "santempi-psql-01"
}
}
15 changes: 8 additions & 7 deletions client-registry-santempi/swarm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ function init_vars() {
UTILS_PATH="${COMPOSE_FILE_PATH}/../utils"

POSTGRES_SERVICES=(
"santempi-psql-1"
"santempi-psql-01"
)
if [[ "${CLUSTERED_MODE}" == "true" ]]; then
POSTGRES_SERVICES=(
"${POSTGRES_SERVICES[@]}"
"santempi-psql-2"
"santempi-psql-3"
)
for i in {2..3}; do
POSTGRES_SERVICES=(
"${POSTGRES_SERVICES[@]}"
"santempi-psql-0$i"
)
done
fi

SERVICE_NAMES=(
Expand Down Expand Up @@ -83,7 +84,7 @@ function initialize_package() {
function destroy_package() {
docker::service_destroy "${SERVICE_NAMES[@]}"

docker::try_remove_volume santedb-data santempi-psql-1-data
docker::try_remove_volume santedb-data santempi-psql-01-data

if [[ "${CLUSTERED_MODE}" == "true" ]]; then
log warn "Volumes are only deleted on the host on which the command is run. Postgres volumes on other nodes are not deleted"
Expand Down
2 changes: 1 addition & 1 deletion documentation/disaster-recovery-process/openhim-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ In order to restore from a backup you would need to launch a Mongo container wit

Then exec into the container and run mongorestore:

`mongorestore --uri="mongodb://mongo-1:27017,mongo-2:27017,mongo-3:27017/openhim?replicaSet=mongo-set" --gzip --archive=/backups/<NAME_OF_BACKUP_FILE>`
`mongorestore --uri="mongodb://mongo-01:27017,mongo-02:27017,mongo-03:27017/openhim?replicaSet=mongo-set" --gzip --archive=/backups/<NAME_OF_BACKUP_FILE>`

The data should be restored.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ description: Listed in this page are all environment variables needed to run Kib
| SANTEMPI\_AUDIT\_CONNECTION\_STRING | String | Audit connection string to SanteMPI | No | _Check below table_ |
| SANTEMPI\_POSTGRESQL\_PASSWORD | String | SanteMPI postgreSQL password | No | SanteDB123 |
| SANTEMPI\_POSTGRESQL\_USERNAME | String | SanteMPI postgreSQL username | No | santempi |
| SANTEMPI\_REPMGR\_PRIMARY\_HOST | String | SanteMPI postgreSQL replicas manager primary host | No | santempi-psql-1 |
| SANTEMPI\_REPMGR\_PARTNER\_NODES | String | SanteMPI postgreSQL replicas manager nodes hosts | Yes | santempi-psql-1,santempi-psql-2,santempi-psql- |
| SANTEMPI\_REPMGR\_PRIMARY\_HOST | String | SanteMPI postgreSQL replicas manager primary host | No | santempi-psql-01 |
| SANTEMPI\_REPMGR\_PARTNER\_NODES | String | SanteMPI postgreSQL replicas manager nodes hosts | Yes | santempi-psql-01,santempi-psql-02,santempi-psql- |

### Note

Expand All @@ -21,11 +21,11 @@ The environment variable `SANTEMPI_REPMGR_PARTNER_NODES` will differ from cluste
Default value for `SANTEMPI_MAIN_CONNECTION_STRING`:&#x20;

```
server=santempi-psql-1;port=5432; database=santedb; user id=santedb; password=SanteDB123; pooling=true; MinPoolSize=5; MaxPoolSize=15; Timeout=60;
server=santempi-psql-01;port=5432; database=santedb; user id=santedb; password=SanteDB123; pooling=true; MinPoolSize=5; MaxPoolSize=15; Timeout=60;
```

Default value for `SANTEMPI_AUDIT_CONNECTION_STRING`:&#x20;

```
server=santempi-psql-1;port=5432; database=auditdb; user id=santedb; password=SanteDB123; pooling=true; MinPoolSize=5; MaxPoolSize=15; Timeout=60;
server=santempi-psql-01;port=5432; database=auditdb; user id=santedb; password=SanteDB123; pooling=true; MinPoolSize=5; MaxPoolSize=15; Timeout=60;
```
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ description: >-

| Variable Name | Type | Revelance | Required | Default |
| ----------------------------- | ------ | ----------------------------------------------------------------- | -------- | --------------- |
| REPMGR\_PRIMARY\_HOST | String | Service name of the primary replication manager host (PostgreSQL) | No | postgres-1 |
| REPMGR\_PARTNER\_NODES | String | Service names of the replicas of PostgreSQL | Yes | postgres-1 |
| POSTGRES\_REPLICA\_SET | String | PostgreSQL replica set (host and port of the replicas) | Yes | postgres-1:5432 |
| REPMGR\_PRIMARY\_HOST | String | Service name of the primary replication manager host (PostgreSQL) | No | postgres-01 |
| REPMGR\_PARTNER\_NODES | String | Service names of the replicas of PostgreSQL | Yes | postgres-01 |
| POSTGRES\_REPLICA\_SET | String | PostgreSQL replica set (host and port of the replicas) | Yes | postgres-01:5432 |
| HAPI\_FHIR\_CPU\_LIMIT | Number | CPU limit usage for hapi-fhir service | No | 0 (unlimited) |
| HAPI\_FHIR\_CPU\_RESERVE | Number | Reserved CPU usage for hapi-fhir service | No | 0.05 |
| HAPI\_FHIR\_MEMORY\_LIMIT | String | RAM limit usage for hapi-fhir service | No | 3G |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ description: >-
| OPENHIM\_MEDIATOR\_API\_PORT | Number | Port of the Openhim mediator | Yes | 8080 |
| OPENHIM\_CORE\_INSTANCES | Number | Number of openhim-core instances | No | 1 |
| OPENHIM\_CONSOLE\_INSTANCES | String | Number of openhim-console instances | No | 1 |
| OPENHIM\_MONGO\_URL | String | MongoDB connection string | Yes | mongodb://mongo-1:27017/openhim |
| OPENHIM\_MONGO\_ATNAURL | String | ??????????? | Yes | mongodb://mongo-1:27017/openhim |
| OPENHIM\_MONGO\_URL | String | MongoDB connection string | Yes | mongodb://mongo-01:27017/openhim |
| OPENHIM\_MONGO\_ATNAURL | String | ??????????? | Yes | mongodb://mongo-01:27017/openhim |
| OPENHIM\_CPU\_LIMIT | Number | CPU limit usage for openhim-core | No | 0 |
| OPENHIM\_CPU\_RESERVE | Number | Reserverd CPU usage for openhim-core | No | 0.05 |
| OPENHIM\_MEMORY\_LIMIT | String | RAM usage limit for openhim-core | No | 3G |
Expand Down
24 changes: 11 additions & 13 deletions fhir-datastore-hapi-fhir/docker-compose-postgres.cluster.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
version: '3.9'

services:
postgres-1:
postgres-01:
environment:
REPMGR_PARTNER_NODES: ${REPMGR_PARTNER_NODES}
deploy:
placement:
constraints:
- "node.labels.name==node-1"

postgres-2:
postgres-02:
image: bitnami/postgresql-repmgr:14
environment:
POSTGRESQL_PASSWORD: ${HF_POSTGRESQL_PASSWORD}
POSTGRESQL_USERNAME: ${HF_POSTGRESQL_USERNAME}
POSTGRESQL_DATABASE: ${HF_POSTGRESQL_DATABASE}
REPMGR_NODE_NETWORK_NAME: postgres-2
REPMGR_NODE_NETWORK_NAME: postgres-02
REPMGR_PASSWORD: ${REPMGR_PASSWORD}
REPMGR_RECONNECT_INTERVAL: 3
REPMGR_NODE_NAME: postgres-2
REPMGR_NODE_NAME: postgres-02
REPMGR_PRIMARY_HOST: ${REPMGR_PRIMARY_HOST}
REPMGR_PARTNER_NODES: ${REPMGR_PARTNER_NODES}
volumes:
- 'hapi-postgres-2-data:/bitnami/postgresql'
- 'hapi-postgres-02-data:/bitnami/postgresql'
deploy:
placement:
constraints:
Expand All @@ -39,21 +39,20 @@ services:
default:
pg_backup_net: {}


postgres-3:
postgres-03:
image: bitnami/postgresql-repmgr:14
environment:
POSTGRESQL_PASSWORD: ${HF_POSTGRESQL_PASSWORD}
POSTGRESQL_USERNAME: ${HF_POSTGRESQL_USERNAME}
POSTGRESQL_DATABASE: ${HF_POSTGRESQL_DATABASE}
REPMGR_NODE_NETWORK_NAME: postgres-3
REPMGR_NODE_NETWORK_NAME: postgres-03
REPMGR_PASSWORD: ${REPMGR_PASSWORD}
REPMGR_RECONNECT_INTERVAL: 3
REPMGR_NODE_NAME: postgres-3
REPMGR_NODE_NAME: postgres-03
REPMGR_PRIMARY_HOST: ${REPMGR_PRIMARY_HOST}
REPMGR_PARTNER_NODES: ${REPMGR_PARTNER_NODES}
volumes:
- 'hapi-postgres-3-data:/bitnami/postgresql'
- 'hapi-postgres-03-data:/bitnami/postgresql'
deploy:
placement:
constraints:
Expand All @@ -70,7 +69,6 @@ services:
default:
pg_backup_net: {}


volumes:
hapi-postgres-2-data:
hapi-postgres-3-data:
hapi-postgres-02-data:
hapi-postgres-03-data:
2 changes: 1 addition & 1 deletion fhir-datastore-hapi-fhir/docker-compose-postgres.dev.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.9'

services:
postgres-1:
postgres-01:
ports:
- target: 5432
published: 5432
Expand Down
11 changes: 6 additions & 5 deletions fhir-datastore-hapi-fhir/docker-compose-postgres.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
version: "3.9"

services:
postgres-1:
postgres-01:
image: bitnami/postgresql-repmgr:14
environment:
POSTGRESQL_PASSWORD: ${HF_POSTGRESQL_PASSWORD}
POSTGRESQL_USERNAME: ${HF_POSTGRESQL_USERNAME}
POSTGRESQL_DATABASE: ${HF_POSTGRESQL_DATABASE}
REPMGR_NODE_NETWORK_NAME: postgres-1
REPMGR_NODE_NETWORK_NAME: postgres-01
REPMGR_PASSWORD: ${REPMGR_PASSWORD}
REPMGR_RECONNECT_INTERVAL: 3
REPMGR_NODE_NAME: postgres-1
REPMGR_NODE_NAME: postgres-01
REPMGR_PRIMARY_HOST: ${REPMGR_PRIMARY_HOST}
REPMGR_PARTNER_NODES: ${REPMGR_PARTNER_NODES}
POSTGRESQL_POSTGRES_PASSWORD: ${HAPI_POSTGRES_PASSWORD}
volumes:
- "hapi-postgres-1-data:/bitnami/postgresql"
- "hapi-postgres-01-data:/bitnami/postgresql"
deploy:
replicas: 1
resources:
Expand All @@ -30,7 +30,8 @@ services:
pg_backup_net: {}

volumes:
hapi-postgres-1-data:
hapi-postgres-01-data:


networks:
default:
Expand Down
6 changes: 3 additions & 3 deletions fhir-datastore-hapi-fhir/package-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
"dependencies": [],
"environmentVariables": {
"CLUSTERED_MODE": "false",
"REPMGR_PRIMARY_HOST": "postgres-1",
"REPMGR_PARTNER_NODES": "postgres-1",
"REPMGR_PRIMARY_HOST": "postgres-01",
"REPMGR_PARTNER_NODES": "postgres-01",
"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",
"POSTGRES_REPLICA_SET": "postgres-1:5432",
"POSTGRES_REPLICA_SET": "postgres-01:5432",
"HAPI_POSTGRES_PASSWORD": "postgres",
"HF_POSTGRES_CPU_LIMIT": "0",
"HF_POSTGRES_CPU_RESERVE": "0.05",
Expand Down
Loading