Skip to content

Commit 4912f4d

Browse files
committed
Merge remote-tracking branch 'origin/main' into PLAT-346-cluster-logstash
2 parents fc428de + 372ea7e commit 4912f4d

File tree

19 files changed

+457
-191
lines changed

19 files changed

+457
-191
lines changed

.env.ci

Lines changed: 0 additions & 64 deletions
This file was deleted.

.env.cluster

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# General
2+
3+
STATEFUL_NODES=cluster
4+
5+
# LOG
6+
7+
DEBUG=1
8+
BASHLOG_FILE=0
9+
BASHLOG_FILE_PATH=platform.log
10+
11+
# Interoperability Layer - OpenHIM
12+
13+
OPENHIM_CORE_INSTANCES=3
14+
OPENHIM_CONSOLE_INSTANCES=3
15+
OPENHIM_CORE_MEDIATOR_HOSTNAME=openhimcomms.domain
16+
OPENHIM_MEDIATOR_API_PORT=443
17+
MONGO_SET_COUNT=3
18+
OPENHIM_MONGO_URL=mongodb://mongo-1:27017,mongo-2:27017,mongo-3:27017/openhim?replicaSet=mongo-set
19+
OPENHIM_MONGO_ATNAURL=mongodb://mongo-1:27017,mongo-2:27017,mongo-3:27017/openhim?replicaSet=mongo-set
20+
21+
# FHIR Datastore - HAPI FHIR
22+
23+
HAPI_FHIR_INSTANCES=3
24+
REPMGR_PRIMARY_HOST=postgres-1
25+
REPMGR_PARTNER_NODES=postgres-1,postgres-2,postgres-3
26+
POSTGRES_REPLICA_SET=postgres-1:5432,postgres-2:5432,postgres-3:5432
27+
28+
# Reverse Proxy - Nginx
29+
30+
REVERSE_PROXY_INSTANCES=3
31+
INSECURE=false
32+
INSECURE_PORTS=5001:5001-80:80-8080:8080-5601:5601-5488:5488
33+
DOMAIN_NAME=domain
34+
SUBDOMAINS=openhimcomms.domain,openhimcore.domain,openhimconsole.domain,kibana.domain,reports.domain
35+
RENEWAL_EMAIL=dummy@jembi.org
36+
STAGING=true
37+
38+
# Analytics Datastore - Elastic Search
39+
40+
ES_HEAP_SIZE=-Xms8192m -Xmx8192m
41+
ES_LOGSTASH_SYSTEM=dev_password_only
42+
ES_APM_SYSTEM=dev_password_only
43+
ES_REMOTE_MONITORING_USER=dev_password_only
44+
ES_ELASTIC=dev_password_only
45+
ES_KIBANA_SYSTEM=dev_password_only
46+
ES_BEATS_SYSTEM=dev_password_only
47+
ES_SSL=false
48+
49+
ES_LEADER_NODE=analytics-datastore-elastic-search-01
50+
ES_HOSTS="analytics-datastore-elastic-search-01:9200","analytics-datastore-elastic-search-02:9200","analytics-datastore-elastic-search-03:9200"
51+
52+
# Dashboard Visualiser - Kibana
53+
54+
# ES_KIBANA_SYSTEM - Required for Kibana, set in the "Analytics Datastore - Elastic Search" section
55+
KIBANA_INSTANCES=1
56+
KIBANA_SSL=false
57+
58+
# Data Mapper - Logstash
59+
60+
# ES_ELASTIC - Required for Logstash, set in the "Analytics Datastore - Elastic Search" section
61+
LS_JAVA_OPTS=-Xmx6144m -Xms6144m
62+
63+
LOGSTASH_DEV_MOUNT=false
64+
LOGSTASH_PACKAGE_PATH=
65+
66+
# Dashboard Visualiser - JS Reports
67+
68+
JS_REPORT_INSTANCES=1
69+
JS_REPORT=dev_password_only
70+
JS_REPORT_USERNAME=admin
71+
JS_REPORT_SECRET=dev_secret_only
72+
JS_REPORT_SSL=false
73+
JS_REPORT_CONFIG_FILE=export.jsrexport
74+
JS_REPORT_LICENSE_KEY=
75+
76+
# MAKE SURE YOU HAVE RUN 'set-permissions.sh' SCRIPT BEFORE AND AFTER RUNNING JS REPORT
77+
JS_REPORT_DEV_MOUNT=false
78+
JS_REPORT_PACKAGE_PATH=
79+
80+
# Reprocess Mediator
81+
82+
REPROCESS_MEDIATOR_VERSION=v1.2.2
83+
REPROCESS_SERVER_PORT=3000
84+
REPROCESS_LOG_LEVEL=info
85+
REPROCESS_OPENHIM_MEDIATOR_URL=https://openhim-core:8080
86+
REPROCESS_OPENHIM_TRANSACTION_URL=http://openhim-core:5001
87+
REPROCESS_OPENHIM_USERNAME=root@openhim.org
88+
REPROCESS_OPENHIM_PASSWORD=instant101
89+
REPROCESS_OPENHIM_CLIENT_CUSTOM_TOKEN=test
90+
REPROCESS_TRUST_SELF_SIGNED=true
91+
REPROCESS_ES_URL=http://analytics-datastore-elastic-search:9200
92+
REPROCESS_ES_USERNAME=elastic
93+
REPROCESS_ES_PASSWORD=dev_password_only
94+
REPROCESS_ES_HIT_SIZE=1000
95+
REPROCESS_LOGSTASH_URL=http://data-mapper-logstash:5056
96+
REPROCESS_LOGSTASH_CONCURRENCY=2
97+
98+
# Resource limits
99+
100+
OPENHIM_MEMORY_LIMIT=4G
101+
OPENHIM_CONSOLE_MEMORY_LIMIT=2G
102+
OPENHIM_MONGO_MEMORY_LIMIT=3G
103+
104+
HAPI_FHIR_MEMORY_LIMIT=2500M
105+
HF_POSTGRES_MEMORY_LIMIT=3G
106+
HAPI_PROXY_MEMORY_LIMIT=1G
107+
108+
NGINX_MEMORY_LIMIT=1G
109+
110+
ES_MEMORY_LIMIT=20G
111+
LOGSTASH_MEMORY_LIMIT=8G
112+
KIBANA_MEMORY_LIMIT=3G
113+
114+
JS_REPORT_MEMORY_LIMIT=3G
115+
116+
ZOOKEEPER_MEMORY_LIMIT=4G
117+
KAFKA_MEMORY_LIMIT=8G
118+
KAFDROP_MEMORY_LIMIT=500M
119+
120+
FILE_BEAT_MEMORY_LIMIT=500M
121+
METRIC_BEAT_MEMORY_LIMIT=500M

.env.local

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ MONGO_SET_COUNT=1
1818
OPENHIM_MONGO_URL=mongodb://mongo-1:27017/openhim
1919
OPENHIM_MONGO_ATNAURL=mongodb://mongo-1:27017/openhim
2020

21+
# FHIR Datastore - HAPI FHIR
22+
23+
HAPI_FHIR_INSTANCES=1
24+
REPMGR_PRIMARY_HOST=postgres-1
25+
REPMGR_PARTNER_NODES=postgres-1,postgres-2,postgres-3
26+
POSTGRES_REPLICA_SET=postgres-1:5432,postgres-2:5432,postgres-3:5432
27+
2128
# Reverse Proxy - Nginx
2229

2330
REVERSE_PROXY_INSTANCES=1

.github/workflows/ci-cluster.yml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: platform-e2e-tests-clustered
2+
on:
3+
pull_request:
4+
types: [ready_for_review]
5+
push:
6+
tags:
7+
- "*"
8+
workflow_dispatch:
9+
inputs:
10+
debug_enabled:
11+
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
12+
required: false
13+
default: false
14+
jobs:
15+
provision-e2e-server:
16+
runs-on: ubuntu-20.04
17+
timeout-minutes: 15
18+
env:
19+
TF_VAR_PROJECT_NAME: platform-e2e-tests-${{ github.run_id }}
20+
TF_VAR_PUBLIC_KEY_PATH: key.pub
21+
TF_VAR_HOSTED_ZONE_ID: Z00782582NSP6D0VHBCMI
22+
TF_VAR_DOMAIN_NAME: ${{ github.run_id }}.jembi.cloud
23+
TF_VAR_INSTANCE_TYPE: r5.2xlarge
24+
TF_VAR_SUBNET_ID: subnet-0004b0dacb5862d59
25+
TF_VAR_VPC_ID: vpc-067ab69f374ac9f47
26+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
27+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
28+
defaults:
29+
run:
30+
working-directory: ./infrastructure/terraform
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: hashicorp/setup-terraform@v2
34+
- run: 'pwd && echo "$SSH_KEY" > key.pub'
35+
shell: bash
36+
env:
37+
SSH_KEY: ${{ secrets.DEPLOY_KEY_PUB }}
38+
- run: terraform init
39+
- run: terraform apply -auto-approve
40+
- name: Upload terraform state
41+
if: always()
42+
uses: actions/upload-artifact@v3
43+
with:
44+
name: tfstate
45+
path: infrastructure/terraform/terraform.tfstate
46+
configure-e2e-server:
47+
runs-on: ubuntu-20.04
48+
needs: provision-e2e-server
49+
timeout-minutes: 15
50+
steps:
51+
- uses: actions/checkout@v3
52+
- name: Run playbook
53+
uses: dawidd6/action-ansible-playbook@v2
54+
with:
55+
playbook: playbooks/provision.yml
56+
directory: ./infrastructure/ansible
57+
key: ${{ secrets.DEPLOY_KEY }}
58+
vault_password: ${{ secrets.VAULT_PASSWORD }}
59+
inventory: |
60+
[leader]
61+
node-1.${{ github.run_id }}.jembi.cloud name=node-1
62+
63+
[managers]
64+
node-2.${{ github.run_id }}.jembi.cloud name=node-2
65+
node-3.${{ github.run_id }}.jembi.cloud name=node-3
66+
67+
[workers]
68+
options: |
69+
--become
70+
--user=ubuntu
71+
--extra-vars @./inventories/development/group_vars/all.yml
72+
launch-platform:
73+
runs-on: ubuntu-20.04
74+
needs: configure-e2e-server
75+
timeout-minutes: 15
76+
steps:
77+
- uses: actions/checkout@v3
78+
- run: ./get-cli.sh linux
79+
- run: ./build-image.sh
80+
- run: sudo sh -c 'echo " ServerAliveInterval 30" >> /etc/ssh/ssh_config'
81+
- run: sudo sh -c 'echo " ServerAliveCountMax 999" >> /etc/ssh/ssh_config'
82+
- run: sudo service ssh restart
83+
- uses: webfactory/ssh-agent@v0.5.4
84+
with:
85+
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
86+
- run: ssh-keyscan -H ${{ github.run_id }}.jembi.cloud >> ~/.ssh/known_hosts
87+
- run: ./remote-img-load.sh ${{ github.run_id }}.jembi.cloud
88+
- run: sed -i 's/domain/${{ github.run_id }}.jembi.cloud/g' .env.cluster
89+
# TODO: (PLAT-385, rcrichton) add 'client-registry-santempi' add santempi once it works in cluster mode
90+
- run: DOCKER_HOST=ssh://ubuntu@${{ github.run_id }}.jembi.cloud ./platform-linux --env-file=.env.cluster init reverse-proxy-nginx interoperability-layer-openhim fhir-datastore-hapi-fhir message-bus-kafka analytics-datastore-elastic-search dashboard-visualiser-kibana data-mapper-logstash dashboard-visualiser-jsreport fhir-datastore-helper-hapi-fhir message-bus-helper-hapi-proxy
91+
destroy-e2e-server:
92+
runs-on: ubuntu-20.04
93+
if: always()
94+
needs: [provision-e2e-server, configure-e2e-server, launch-platform]
95+
timeout-minutes: 15
96+
env:
97+
TF_VAR_PROJECT_NAME: platform-e2e-tests-${{ github.run_id }}
98+
TF_VAR_INSTANCE_COUNT: 1
99+
TF_VAR_PUBLIC_KEY_PATH: key.pub
100+
TF_VAR_HOSTED_ZONE_ID: Z00782582NSP6D0VHBCMI
101+
TF_VAR_DOMAIN_NAME: ${{ github.run_id }}.jembi.cloud
102+
TF_VAR_INSTANCE_TYPE: r5.2xlarge
103+
TF_VAR_SUBNET_ID: subnet-0004b0dacb5862d59
104+
TF_VAR_VPC_ID: vpc-067ab69f374ac9f47
105+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
106+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
107+
defaults:
108+
run:
109+
working-directory: ./infrastructure/terraform
110+
steps:
111+
- uses: actions/checkout@v3
112+
- uses: hashicorp/setup-terraform@v2
113+
- run: 'echo "$SSH_KEY" > key.pub'
114+
shell: bash
115+
env:
116+
SSH_KEY: ${{secrets.DEPLOY_KEY_PUB}}
117+
- name: Download terraform state
118+
uses: actions/download-artifact@v3
119+
with:
120+
name: tfstate
121+
path: infrastructure/terraform/
122+
- run: terraform init
123+
- run: terraform destroy -auto-approve

.github/workflows/ci.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,24 @@ on:
66
tags:
77
- "*"
88
workflow_dispatch:
9-
concurrency: e2e
9+
inputs:
10+
debug_enabled:
11+
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
12+
required: false
13+
default: false
1014
jobs:
1115
provision-e2e-server:
1216
runs-on: ubuntu-20.04
1317
timeout-minutes: 15
1418
env:
15-
TF_VAR_PROJECT_NAME: platform-e2e-tests
19+
TF_VAR_PROJECT_NAME: platform-e2e-tests-${{ github.run_id }}
1620
TF_VAR_INSTANCE_COUNT: 1
1721
TF_VAR_PUBLIC_KEY_PATH: key.pub
18-
TF_VAR_SUB_DOMAIN_NAME_CREATION_ENABLED: true
19-
TF_VAR_DOMAIN_NAME_CREATION_ENABLED: false
2022
TF_VAR_HOSTED_ZONE_ID: Z00782582NSP6D0VHBCMI
21-
TF_VAR_DOMAIN_NAME: jembi.cloud
22-
TF_VAR_SUBDOMAIN_NAMES: ${{ github.run_id }}.jembi.cloud *.${{ github.run_id }}.jembi.cloud
23+
TF_VAR_DOMAIN_NAME: ${{ github.run_id }}.jembi.cloud
2324
TF_VAR_INSTANCE_TYPE: r5.2xlarge
25+
TF_VAR_SUBNET_ID: subnet-0004b0dacb5862d59
26+
TF_VAR_VPC_ID: vpc-067ab69f374ac9f47
2427
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
2528
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
2629
defaults:
@@ -81,23 +84,25 @@ jobs:
8184
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
8285
- run: ssh-keyscan -H ${{ github.run_id }}.jembi.cloud >> ~/.ssh/known_hosts
8386
- run: ./remote-img-load.sh ${{ github.run_id }}.jembi.cloud
84-
- run: sed -i 's/domain/${{ github.run_id }}.jembi.cloud/g' .env.ci
85-
- run: DOCKER_HOST=ssh://ubuntu@${{ github.run_id }}.jembi.cloud ./platform-linux --env-file=.env.ci init
87+
- run: sed -i 's/OPENHIM_CORE_MEDIATOR_HOSTNAME=localhost/OPENHIM_CORE_MEDIATOR_HOSTNAME=openhimcomms.domain/g' .env.local
88+
- run: sed -i 's/OPENHIM_MEDIATOR_API_PORT=8080/OPENHIM_MEDIATOR_API_PORT=443/g' .env.local
89+
- run: sed -i 's/INSECURE=true/INSECURE=false/g' .env.local
90+
- run: sed -i 's/domain/${{ github.run_id }}.jembi.cloud/g' .env.local
91+
- run: DOCKER_HOST=ssh://ubuntu@${{ github.run_id }}.jembi.cloud ./platform-linux --env-file=.env.local init
8692
destroy-e2e-server:
8793
runs-on: ubuntu-20.04
8894
if: always()
8995
needs: [provision-e2e-server, configure-e2e-server, launch-platform]
9096
timeout-minutes: 15
9197
env:
92-
TF_VAR_PROJECT_NAME: platform-e2e-tests
98+
TF_VAR_PROJECT_NAME: platform-e2e-tests-${{ github.run_id }}
9399
TF_VAR_INSTANCE_COUNT: 1
94100
TF_VAR_PUBLIC_KEY_PATH: key.pub
95-
TF_VAR_SUB_DOMAIN_NAME_CREATION_ENABLED: true
96-
TF_VAR_DOMAIN_NAME_CREATION_ENABLED: false
97101
TF_VAR_HOSTED_ZONE_ID: Z00782582NSP6D0VHBCMI
98-
TF_VAR_DOMAIN_NAME: jembi.cloud
99-
TF_VAR_SUBDOMAIN_NAMES: ${{ github.run_id }}.jembi.cloud *.${{ github.run_id }}.jembi.cloud
102+
TF_VAR_DOMAIN_NAME: ${{ github.run_id }}.jembi.cloud
100103
TF_VAR_INSTANCE_TYPE: r5.2xlarge
104+
TF_VAR_SUBNET_ID: subnet-0004b0dacb5862d59
105+
TF_VAR_VPC_ID: vpc-067ab69f374ac9f47
101106
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
102107
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
103108
defaults:

0 commit comments

Comments
 (0)