Skip to content

Commit

Permalink
[PHEE-569] Configure tenants (#374)
Browse files Browse the repository at this point in the history
* create tenants

* Configure new tenants

* Configure new tenants

* Configure new tenants

* Configure new tenants in properties file

* Configure new tenants with global variable

* Configure new tenants with global variable

* Configure new tenants with global variable

* Configure new tenants with global variable

* enable access to minikube

* ams_local_host updated

* ams_local_host updated

* update

* disable minikube access

---------

Co-authored-by: Somanath Hugar <[email protected]>
  • Loading branch information
somanath21 and Somanath Hugar authored Feb 13, 2024
1 parent b33c1ce commit 5131c0c
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 24 deletions.
9 changes: 5 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ jobs:
kubectl create namespace paymenthub
kubectl get -A namespace

# For remote access to minikube uncomment the following lines.
#---------------------minikube remote aceess start---------------------
# # For remote access to minikube uncomment the following lines.
# #---------------------minikube remote aceess start---------------------
# sudo apt install nginx
# sudo touch /etc/nginx/conf.d/minikube.conf
# echo "create nginx conf"
Expand Down Expand Up @@ -280,7 +280,8 @@ jobs:
# curl -u minikube:minikube http://localhost:8080

# curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok
# ngrok config add-authtoken $AUTH_TOKEN
# # ngrok config add-authtoken $AUTH_TOKEN
# ngrok config add-authtoken 2bd1gKwm6rye7Pz3CtgrF7kzB1G_4xn4KChGhrwdBjhrNpm9x
# echo "web_addr: $LOCAL_PORT" >> /home/circleci/.config/ngrok/ngrok.yml
# ngrok http 8080 > /dev/null &

Expand All @@ -294,7 +295,7 @@ jobs:
# sleep 1
# echo -n "."
# done

# echo ---------copy the below public_URL for NGrok----------
# echo "https://$NGROK_PUBLIC_URL"
# echo "https://$NGROK_PUBLIC_URL"

Expand Down
8 changes: 4 additions & 4 deletions helm/g2p-sandbox/config/application-tenants.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
bpmns.tenants[0].id= lion
bpmns.tenants[0].id= rhino
bpmns.tenants[0].flows.payment-transfer= minimal_mock_fund_transfer_account_lookup-{dfspid}
bpmns.tenants[1].id= rhino
bpmns.tenants[1].id= gorilla
bpmns.tenants[1].flows.payment-transfer= minimal_mock_fund_transfer-{dfspid}
bpmns.tenants[1].flows.outbound-transfer-request= minimal_mock_transfer_request-{dfspid}
bpmns.tenants[2].id= gorilla
bpmns.tenants[2].id= wakanda
bpmns.tenants[2].flows.payment-transfer= PayerFundTransfer-{dfspid}
bpmns.tenants[2].flows.outbound-transfer-request= {ps}_flow_{ams}-{dfspid}
bpmns.tenants[2].flows.outbound-transfer-request= {ps}_flow_{ams}-{dfspid}
84 changes: 81 additions & 3 deletions helm/g2p-sandbox/config/application-tenantsConnection.properties
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ tenants.connections[2].deadlock_max_retry_interval=1
tenants.connections[2].driver_class=com.mysql.cj.jdbc.Driver
tenants.connections[2].jdbcProtocol=jdbc
tenants.connections[2].jdbcSubProtocol=mysql
tenants.connections[2].name=lion
tenants.connections[2].name=wakanda
tenants.connections[2].pool_abandon_when_percentage_full=50
tenants.connections[2].pool_initial_size=5
tenants.connections[2].pool_log_abandoned=1
Expand All @@ -71,8 +71,86 @@ tenants.connections[2].pool_test_on_borrow=1
tenants.connections[2].pool_time_between_eviction_runs_millis=34000
tenants.connections[2].pool_validation_interval=30000
tenants.connections[2].schema_connection_parameters=null
tenants.connections[2].schema_name=lion
tenants.connections[2].schema_name=wakanda
tenants.connections[2].schema_password=password
tenants.connections[2].schema_server=operationsmysql
tenants.connections[2].schema_server_port=3306
tenants.connections[2].schema_username=mifos
tenants.connections[2].schema_username=mifos
tenants.connections[3].auto_update=true
tenants.connections[3].deadlock_max_retries=0
tenants.connections[3].deadlock_max_retry_interval=1
tenants.connections[3].driver_class=com.mysql.cj.jdbc.Driver
tenants.connections[3].jdbcProtocol=jdbc
tenants.connections[3].jdbcSubProtocol=mysql
tenants.connections[3].name=pluto
tenants.connections[3].pool_abandon_when_percentage_full=50
tenants.connections[3].pool_initial_size=5
tenants.connections[3].pool_log_abandoned=1
tenants.connections[3].pool_max_active=40
tenants.connections[3].pool_max_idle=10
tenants.connections[3].pool_min_evictable_idle_time_millis=60000
tenants.connections[3].pool_min_idle=20
tenants.connections[3].pool_remove_abandoned=1
tenants.connections[3].pool_remove_abandoned_timeout=60
tenants.connections[3].pool_suspect_timeout=60
tenants.connections[3].pool_test_on_borrow=1
tenants.connections[3].pool_time_between_eviction_runs_millis=34000
tenants.connections[3].pool_validation_interval=30000
tenants.connections[3].schema_connection_parameters=null
tenants.connections[3].schema_name=pluto
tenants.connections[3].schema_password=password
tenants.connections[3].schema_server=operationsmysql
tenants.connections[3].schema_server_port=3306
tenants.connections[3].schema_username=mifos
tenants.connections[4].auto_update=true
tenants.connections[4].deadlock_max_retries=0
tenants.connections[4].deadlock_max_retry_interval=1
tenants.connections[4].driver_class=com.mysql.cj.jdbc.Driver
tenants.connections[4].jdbcProtocol=jdbc
tenants.connections[4].jdbcSubProtocol=mysql
tenants.connections[4].name=venus
tenants.connections[4].pool_abandon_when_percentage_full=50
tenants.connections[4].pool_initial_size=5
tenants.connections[4].pool_log_abandoned=1
tenants.connections[4].pool_max_active=40
tenants.connections[4].pool_max_idle=10
tenants.connections[4].pool_min_evictable_idle_time_millis=60000
tenants.connections[4].pool_min_idle=20
tenants.connections[4].pool_remove_abandoned=1
tenants.connections[4].pool_remove_abandoned_timeout=60
tenants.connections[4].pool_suspect_timeout=60
tenants.connections[4].pool_test_on_borrow=1
tenants.connections[4].pool_time_between_eviction_runs_millis=34000
tenants.connections[4].pool_validation_interval=30000
tenants.connections[4].schema_connection_parameters=null
tenants.connections[4].schema_name=venus
tenants.connections[4].schema_password=password
tenants.connections[4].schema_server=operationsmysql
tenants.connections[4].schema_server_port=3306
tenants.connections[4].schema_username=mifos
tenants.connections[5].auto_update=true
tenants.connections[5].deadlock_max_retries=0
tenants.connections[5].deadlock_max_retry_interval=1
tenants.connections[5].driver_class=com.mysql.cj.jdbc.Driver
tenants.connections[5].jdbcProtocol=jdbc
tenants.connections[5].jdbcSubProtocol=mysql
tenants.connections[5].name=jupiter
tenants.connections[5].pool_abandon_when_percentage_full=50
tenants.connections[5].pool_initial_size=5
tenants.connections[5].pool_log_abandoned=1
tenants.connections[5].pool_max_active=40
tenants.connections[5].pool_max_idle=10
tenants.connections[5].pool_min_evictable_idle_time_millis=60000
tenants.connections[5].pool_min_idle=20
tenants.connections[5].pool_remove_abandoned=1
tenants.connections[5].pool_remove_abandoned_timeout=60
tenants.connections[5].pool_suspect_timeout=60
tenants.connections[5].pool_test_on_borrow=1
tenants.connections[5].pool_time_between_eviction_runs_millis=34000
tenants.connections[5].pool_validation_interval=30000
tenants.connections[5].schema_connection_parameters=null
tenants.connections[5].schema_name=jupiter
tenants.connections[5].schema_password=password
tenants.connections[5].schema_server=operationsmysql
tenants.connections[5].schema_server_port=3306
tenants.connections[5].schema_username=mifos
21 changes: 11 additions & 10 deletions helm/g2p-sandbox/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ ph-ee-engine:
imagePullPolicy: "Always"
LOGGING_LEVEL_ROOT: "INFO"
LOGGING_PATTERN_CONSOLE: "%d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlight(%-5level) %logger.%M - %msg%n"
tenants: "rhino,gorilla,lion"
DFSPIDS: "gorilla,lion"
tenants: "rhino,gorilla,wakanda,pluto,venus,jupiter"
DFSPIDS: "wakanda,pluto,venus,jupiter"

zeebe-operate-helm:
enabled: true
Expand Down Expand Up @@ -117,16 +117,23 @@ ph-ee-engine:
CREATE DATABASE messagegateway;
CREATE DATABASE `rhino`;
CREATE DATABASE `gorilla`;
CREATE DATABASE `lion`;
CREATE DATABASE `wakanda`;
CREATE DATABASE `identity_account_mapper`;
CREATE DATABASE `voucher_management`;
CREATE DATABASE `pluto`;
CREATE DATABASE `venus`;
CREATE DATABASE `jupiter`;
GRANT ALL PRIVILEGES ON `rhino`.* TO 'mifos';
GRANT ALL PRIVILEGES ON `gorilla`.* TO 'mifos';
GRANT ALL PRIVILEGES ON `lion`.* TO 'mifos';
GRANT ALL PRIVILEGES ON `wakanda`.* TO 'mifos';
GRANT ALL ON *.* TO 'root'@'%';
GRANT ALL PRIVILEGES ON messagegateway.* TO 'mifos';
GRANT ALL PRIVILEGES ON `identity_account_mapper`.* TO 'mifos';
GRANT ALL PRIVILEGES ON `voucher_management`.* TO 'mifos';
GRANT ALL PRIVILEGES ON `pluto`.* TO 'mifos';
GRANT ALL PRIVILEGES ON `venus`.* TO 'mifos';
GRANT ALL PRIVILEGES ON `jupiter`.* TO 'mifos';
ph_ee_connector_ams_mifos:
enabled: true
Expand Down Expand Up @@ -161,7 +168,6 @@ ph-ee-engine:
image: docker.io/openmf/ph-ee-connector-mojaloop:latest
SPRING_PROFILES_ACTIVE: "bb"
hostname: "mojaloop.sandbox.mifos.io"
DFSPIDS: "gorilla,lion"
ingress:
enabled: false
annotations:
Expand Down Expand Up @@ -203,7 +209,6 @@ ph-ee-engine:
hostname: "channel.sandbox.mifos.io"
stub_hostname: "channel-gsma.sandbox.mifos.io"
SPRING_PROFILES_ACTIVE: "bb,tenants"
DFSPIDS: "rhino,gorilla,lion"
tenantPrimary:
clientId: "mifos"
clientSecret: "password"
Expand Down Expand Up @@ -245,7 +250,6 @@ ph-ee-engine:
operations_app:
enabled: true
image: docker.io/openmf/ph-ee-operations-app:latest
tenants: "rhino,gorilla"
hostname: "ops-bk.sandbox.mifos.io"
datasource:
username: "mifos"
Expand Down Expand Up @@ -388,7 +392,6 @@ ph-ee-engine:
enabled: true
image: docker.io/openmf/ph-ee-zeebe-ops:latest
hostname: "zeebeops.sandbox.mifos.io"
tenants: "rhino,gorilla"
ingress:
enabled: false
annotations:
Expand Down Expand Up @@ -513,7 +516,6 @@ ph-ee-engine:
hostname: "bill-pay.sandbox.mifos.io"
stub_hostname: "bill-pay.sandbox.mifos.io"
SPRING_PROFILES_ACTIVE: "bb,tenants"
DFSPIDS: "rhino,gorilla,lion"
ingress:
enabled: false
tls:
Expand All @@ -537,7 +539,6 @@ ph-ee-engine:
hostname: "crm.sandbox.mifos.io"
stub_hostname: "crm.sandbox.mifos.io"
SPRING_PROFILES_ACTIVE: "bb,tenants"
DFSPIDS: "rhino,gorilla,lion"
ingress:
enabled: false
tls:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
- name: "ZEEBE_BROKER_CONTACTPOINT"
value: "{{ .Release.Name }}-zeebe-gateway:26500"
- name: "DFSPIDS"
value: "{{ .Values.DFSPIDS }}"
value: "{{ .Values.global.DFSPIDS }}"
- name: "CONNECTOR_CONTACTPOINT"
value: "{{ .Values.connector.contactpoint }}"
- name: "BILLPAY_CONTACTPOINT"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
- name: "ZEEBE_BROKER_CONTACTPOINT"
value: "{{ .Release.Name }}-zeebe-gateway:26500"
- name: "DFSPIDS"
value: "{{ .Values.DFSPIDS }}"
value: "{{ .Values.global.DFSPIDS }}"
- name: "TRANSACTION-ID-LENGTH"
value: "{{ .Values.TRANSACTION_ID_LENGTH }}"
- name: "MPESA_NOTIFICATION_SUCCESS_ENABLED"
Expand Down
2 changes: 1 addition & 1 deletion helm/ph-ee-engine/connector-crm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
- name: "ZEEBE_BROKER_CONTACTPOINT"
value: "{{ .Release.Name }}-zeebe-gateway:26500"
- name: "DFSPIDS"
value: "{{ .Values.DFSPIDS }}"
value: "{{ .Values.global.DFSPIDS }}"
{{- if .Values.extraEnvs | default .Values.deployment.extraEnvs }}
{{ toYaml ( .Values.extraEnvs | default .Values.deployment.extraEnvs ) | indent 10 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions helm/ph-ee-engine/zeebe-ops/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ spec:
value: "{{ .Release.Name }}-zeebe-gateway:26500"
- name: "TENANTS"
value: "{{ .Values.global.tenants }}"
- name: "DFSPIDS"
value: "{{ .Values.global.DFSPIDS }}"
- name: "elasticsearch_url"
value: "{{ .Values.elasticsearch_url }}"
- name: "LOGGING_LEVEL_ROOT"
Expand Down

0 comments on commit 5131c0c

Please sign in to comment.