Skip to content

Commit

Permalink
[PHEE-676] Wait for dependent service start using init conatiner. (#449)
Browse files Browse the repository at this point in the history
* [PHEE-676] Wait for dependent service start using init conatiner.

* change in config

* fix job

* TCs fix

* remove ngrok remote access
  • Loading branch information
logoutdhaval authored Jun 5, 2024
1 parent 7d8d972 commit b43bdf7
Show file tree
Hide file tree
Showing 36 changed files with 258 additions and 90 deletions.
35 changes: 17 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,30 +257,30 @@ jobs:

# sudo cat \<<EOF > /etc/nginx/conf.d/minikube.conf
# server {
# listen 8080;
# listen [::]:8080;
# server_name localhost;
# access_log /home/circleci/project/nginx_access.log;
# auth_basic "Administrators Area";
# auth_basic_user_file /home/circleci/project/.htpasswd;
# listen 8080;
# listen [::]:8080;
# server_name localhost;
# access_log /home/circleci/project/nginx_access.log;
# auth_basic "Administrators Area";
# auth_basic_user_file /home/circleci/project/.htpasswd;

# location / {
# proxy_pass https://$MINIKUBE_IP:8443;
# proxy_ssl_certificate /home/circleci/.minikube/profiles/minikube/client.crt;
# proxy_ssl_certificate_key /home/circleci/.minikube/profiles/minikube/client.key;
# }
# location / {
# proxy_pass https://$MINIKUBE_IP:8443;
# proxy_ssl_certificate /home/circleci/.minikube/profiles/minikube/client.crt;
# proxy_ssl_certificate_key /home/circleci/.minikube/profiles/minikube/client.key;
# }
# }
# EOF
# sudo service nginx restart || echo 'start nginx'
# #SYSTEMD_LESS=FRXMK systemctl status nginx.service
# SYSTEMD_LESS=FRXMK systemctl status nginx.service

# sleep 10

# echo "test-nginx-proxy"
# 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
# echo "web_addr: $LOCAL_PORT" >> /home/circleci/.config/ngrok/ngrok.yml
# ngrok http 8080 > /dev/null &

Expand All @@ -298,11 +298,10 @@ jobs:
# echo "https://$NGROK_PUBLIC_URL"
# echo "https://$NGROK_PUBLIC_URL"

# #echo "test ngrok "
# #curl -u minikube:minikube https://$NGROK_PUBLIC_URL
# echo "test ngrok "
# curl -u minikube:minikube https://$NGROK_PUBLIC_URL
# echo "https://$NGROK_PUBLIC_URL"

# # ---------------------minikube remote aceess end---------------------
# # ---------------------minikube remote access end---------------------

curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
sudo apt-get install apt-transport-https --yes
Expand Down Expand Up @@ -395,7 +394,7 @@ jobs:
helm repo update
echo "helm upgrade --install ${VALUES_TO_OVERRIDE} ${ORB_PARAM_RELEASE_NAME} ${ORB_PARAM_CHART} ${ORB_PARAM_NAMESPACE}"
echo helm chart install starts
helm upgrade --install --timeout=1h --set ph-ee-engine.kafka.global.storageClass=standard --set ph-ee-engine.kafka.provisioning.enabled=false --set ph-ee-engine.elasticsearch.volumeClaimTemplate.storageClassName=standard ${VALUES_TO_OVERRIDE} ${ORB_PARAM_RELEASE_NAME} ${ORB_PARAM_CHART} ${ORB_PARAM_NAMESPACE} --set ph-ee-engine.ph_ee_connector_ams_mifos.ams_local_interop_host="https://fynams.sandbox.fynarfin.io/",ph-ee-engine.ph_ee_connector_ams_mifos.ams_local_account_host="https://fynams.sandbox.fynarfin.io/",ph-ee-engine.ph_ee_connector_ams_mifos.ams_local_customer_host="https://fynams.sandbox.fynarfin.io/",ph-ee-engine.ph_ee_connector_ams_mifos.ams_local_auth_host="https://fynams.sandbox.fynarfin.io/" # --set ph-ee-engine.post_installation_job.enabled=false --set ph-ee-engine.kafka.provisioning.enabled=false
helm upgrade --install --timeout=1h --set ph-ee-engine.kafka.global.storageClass=standard --set ph-ee-engine.kafka.provisioning.enabled=false --set ph-ee-engine.elasticsearch.volumeClaimTemplate.storageClassName=standard ${VALUES_TO_OVERRIDE} ${ORB_PARAM_RELEASE_NAME} ${ORB_PARAM_CHART} ${ORB_PARAM_NAMESPACE} --set ph-ee-engine.ph_ee_connector_ams_mifos.ams_local_interop_host="https://fynams.sandbox.fynarfin.io/",ph-ee-engine.ph_ee_connector_ams_mifos.ams_local_account_host="https://fynams.sandbox.fynarfin.io/",ph-ee-engine.ph_ee_connector_ams_mifos.ams_local_customer_host="https://fynams.sandbox.fynarfin.io/",ph-ee-engine.ph_ee_connector_ams_mifos.ams_local_auth_host="https://fynams.sandbox.fynarfin.io/" #--set ph-ee-engine.kafka.provisioning.enabled=false
echo --------------------helm upgrade is done---------------------
Expand Down
12 changes: 9 additions & 3 deletions helm/g2p-sandbox/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ph-ee-engine:
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,wakanda,pluto,venus,jupiter"
DFSPIDS: "wakanda,pluto,venus,jupiter"
DFSPIDS: "wakanda,pluto,venus,jupiter,gorilla"

zeebe-operate-helm:
enabled: true
Expand Down Expand Up @@ -598,9 +598,15 @@ ph-ee-engine:

account_mapper:
enabled: true
image: docker.io/openmf/ph-ee-identity-account-mapper:v1.4.0
image: docker.io/openmf/ph-ee-identity-account-mapper:latest
hostname: "identity-mapper.sandbox.mifos.io"
LOGGING_LEVEL_ROOT: INFO
LOGGING_LEVEL_ROOT: INFO
livenessProbe:
initialDelaySeconds: 20
periodSeconds: 30
readinessProbe:
initialDelaySeconds: 180
periodSeconds: 30
ingress:
enabled: false
pathtype: Prefix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ spec:
{{ toYaml .Values.deployment.annotations | indent 8 }}
{{- end }}
spec:
initContainers:
#During this Pod's initialization, check that operationsmysql service is up and running before starting this pod
- name: check-operationsmysql-ready
image: busybox:latest
command: [ 'sh', '-c','until nc -vz operationsmysql 3306; do echo "Waiting for operationsmysql service"; sleep 2; done;' ]
containers:
- name: ph-ee-identity-account-mapper
image: "{{ .Values.image}}"
Expand All @@ -37,14 +42,14 @@ spec:
httpGet:
path: /actuator/health/liveness
port: 8080
initialDelaySeconds: 20
periodSeconds: 30
initialDelaySeconds: {{.Values.livenessProbe.initialDelaySeconds}}
periodSeconds: {{.Values.livenessProbe.periodSeconds}}
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8080
initialDelaySeconds: 20
periodSeconds: 30
initialDelaySeconds: {{.Values.readinessProbe.initialDelaySeconds}}
periodSeconds: {{.Values.readinessProbe.periodSeconds}}
env:
- name: "ZEEBE_BROKER_CONTACTPOINT"
value: "{{ .Release.Name }}-zeebe-gateway:26500"
Expand Down
6 changes: 6 additions & 0 deletions helm/identity-account-mapper/account-mapper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,9 @@ deployment:
apiVersion: "apps/v1"
annotations:
deployTime: "{{ .Values.deployTime }}"
livenessProbe:
initialDelaySeconds: 20
periodSeconds: 30
readinessProbe:
initialDelaySeconds: 20
periodSeconds: 30
10 changes: 5 additions & 5 deletions helm/ph-ee-engine/ams-paygops/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ spec:
httpGet:
path: /actuator/health/liveness
port: 8080
initialDelaySeconds: 20
periodSeconds: 30
initialDelaySeconds: {{.Values.livenessProbe.initialDelaySeconds}}
periodSeconds: {{.Values.livenessProbe.periodSeconds}}
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8080
initialDelaySeconds: 20
periodSeconds: 30
initialDelaySeconds: {{.Values.readinessProbe.initialDelaySeconds}}
periodSeconds: {{.Values.readinessProbe.periodSeconds}}
env:
- name: "SPRING_PROFILES_ACTIVE"
value: "{{ .Values.global.SPRING_PROFILES_ACTIVE }}"
Expand Down Expand Up @@ -66,4 +66,4 @@ spec:
requests:
memory: "{{ .Values.requests.memory }}"
cpu: "{{ .Values.requests.cpu }}"
{{- end }}
{{- end }}
8 changes: 7 additions & 1 deletion helm/ph-ee-engine/ams-paygops/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@ requests:
deployment:
apiVersion: "apps/v1"
annotations:
deployTime: "{{ .Values.deployTime }}"
deployTime: "{{ .Values.deployTime }}"
livenessProbe:
initialDelaySeconds: 20
periodSeconds: 30
readinessProbe:
initialDelaySeconds: 20
periodSeconds: 30
10 changes: 5 additions & 5 deletions helm/ph-ee-engine/ams-roster/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ spec:
httpGet:
path: /actuator/health/liveness
port: 8080
initialDelaySeconds: 20
periodSeconds: 30
initialDelaySeconds: {{.Values.livenessProbe.initialDelaySeconds}}
periodSeconds: {{.Values.livenessProbe.periodSeconds}}
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8080
initialDelaySeconds: 20
periodSeconds: 30
initialDelaySeconds: {{.Values.readinessProbe.initialDelaySeconds}}
periodSeconds: {{.Values.readinessProbe.periodSeconds}}
env:
- name: "SPRING_PROFILES_ACTIVE"
value: "{{ .Values.global.SPRING_PROFILES_ACTIVE }}"
Expand Down Expand Up @@ -66,4 +66,4 @@ spec:
requests:
memory: "{{ .Values.requests.memory }}"
cpu: "{{ .Values.requests.cpu }}"
{{- end }}
{{- end }}
8 changes: 7 additions & 1 deletion helm/ph-ee-engine/ams-roster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,10 @@ requests:
deployment:
apiVersion: "apps/v1"
annotations:
deployTime: "{{ .Values.deployTime }}"
deployTime: "{{ .Values.deployTime }}"
livenessProbe:
initialDelaySeconds: 20
periodSeconds: 30
readinessProbe:
initialDelaySeconds: 20
periodSeconds: 30
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ spec:
{{- if .Values.deployment.annotations }}
{{ toYaml .Values.deployment.annotations | indent 8 }}
{{- end }}
spec:
spec:
initContainers:
#During this Pod's initialization, check that zeebe-gateway service is up and running before starting this pod
- name: check-zeebe-gateway-ready
image: busybox:latest
command: [ 'sh', '-c','until nc -vz {{ .Release.Name }}-zeebe-gateway 26500; do echo "Waiting for zeebe-gateway service"; sleep 2; done;' ]
affinity: {{ toYaml .Values.deployment.affinity | nindent 8 }}
nodeSelector: {{ toYaml .Values.deployment.nodeSelector | nindent 8 }}
tolerations: {{ toYaml ( .Values.tolerations | default .Values.deployment.tolerations ) | nindent 8 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ spec:
{{ toYaml .Values.deployment.annotations | indent 8 }}
{{- end }}
spec:
initContainers:
#During this Pod's initialization, check that zeebe-gateway service is up and running before starting this pod
- name: check-zeebe-gateway-ready
image: busybox:latest
command: [ 'sh', '-c','until nc -vz {{ .Release.Name }}-zeebe-gateway 26500; do echo "Waiting for zeebe-gateway service"; sleep 2; done;' ]
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriod }}
containers:
- name: ph-ee-connector-bill-pay
Expand Down
5 changes: 5 additions & 0 deletions helm/ph-ee-engine/connector-bulk/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ spec:
{{ toYaml .Values.deployment.annotations | indent 8 }}
{{- end }}
spec:
initContainers:
#During this Pod's initialization, check that zeebe-gateway service is up and running before starting this pod
- name: check-zeebe-gateway-ready
image: busybox:latest
command: [ 'sh', '-c','until nc -vz {{ .Release.Name }}-zeebe-gateway 26500; do echo "Waiting for zeebe-gateway service"; sleep 2; done;' ]
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriod }}
containers:
- name: ph-ee-connector-bulk
Expand Down
17 changes: 13 additions & 4 deletions helm/ph-ee-engine/connector-channel/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ spec:
{{ toYaml .Values.deployment.annotations | indent 8 }}
{{- end }}
spec:
initContainers:
#During this Pod's initialization, check that zeebe-gateway service is up and running before starting this pod
- name: check-zeebe-gateway-ready
image: busybox:latest
command: [ 'sh', '-c','until nc -vz {{ .Release.Name }}-zeebe-gateway 26500; do echo "Waiting for zeebe-gateway service"; sleep 2; done;' ]
#During this Pod's initialization, check that redis is up and running before starting this pod
- name: check-redis-ready
image: busybox:latest
command: [ 'sh', '-c','until nc -vz {{ .Release.Name }}-redis-master 6379; do echo "Waiting for redis-master service"; sleep 2; done;' ]
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriod }}
containers:
- name: ph-ee-connector-channel
Expand All @@ -39,15 +48,15 @@ spec:
path: /actuator/health/liveness
port: 8443
scheme: HTTPS
initialDelaySeconds: 20
periodSeconds: 180
initialDelaySeconds: {{.Values.livenessProbe.initialDelaySeconds}}
periodSeconds: {{.Values.livenessProbe.periodSeconds}}
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8443
scheme: HTTPS
initialDelaySeconds: 20
periodSeconds: 180
initialDelaySeconds: {{.Values.readinessProbe.initialDelaySeconds}}
periodSeconds: {{.Values.readinessProbe.periodSeconds}}
env:
- name: "SPRING_PROFILES_ACTIVE"
value: "{{ .Values.SPRING_PROFILES_ACTIVE }}"
Expand Down
5 changes: 5 additions & 0 deletions helm/ph-ee-engine/connector-crm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ spec:
{{ toYaml .Values.deployment.annotations | indent 8 }}
{{- end }}
spec:
initContainers:
#During this Pod's initialization, check that zeebe-gateway service is up and running before starting this pod
- name: check-zeebe-gateway-ready
image: busybox:latest
command: [ 'sh', '-c','until nc -vz {{ .Release.Name }}-zeebe-gateway 26500; do echo "Waiting for zeebe-gateway service"; sleep 2; done;' ]
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriod }}
containers:
- name: ph-ee-connector-crm
Expand Down
7 changes: 6 additions & 1 deletion helm/ph-ee-engine/connector-gsma/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ spec:
{{ toYaml .Values.deployment.annotations | indent 8 }}
{{- end }}
spec:
initContainers:
#During this Pod's initialization, check that zeebe-gateway service is up and running before starting this pod
- name: check-zeebe-gateway-ready
image: busybox:latest
command: [ 'sh', '-c','until nc -vz {{ .Release.Name }}-zeebe-gateway 26500; do echo "Waiting for zeebe-gateway service"; sleep 2; done;' ]
containers:
- name: "ph-ee-connector-gsma-mm"
image: "{{ .Values.image }}"
Expand Down Expand Up @@ -50,4 +55,4 @@ spec:
- name: ph-ee-config
configMap:
name: ph-ee-config
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ spec:
{{ toYaml .Values.deployment.annotations | indent 8 }}
{{- end }}
spec:
initContainers:
#During this Pod's initialization, check that zeebe-gateway service is up and running before starting this pod
- name: check-zeebe-gateway-ready
image: busybox:latest
command: [ 'sh', '-c','until nc -vz {{ .Release.Name }}-zeebe-gateway 26500; do echo "Waiting for zeebe-gateway service"; sleep 2; done;' ]
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriod }}
containers:
- name: ph-ee-connector-mock-payment-schema
Expand All @@ -38,14 +43,14 @@ spec:
httpGet:
path: /actuator/health/liveness
port: 8080
initialDelaySeconds: 20
periodSeconds: 30
initialDelaySeconds: {{.Values.livenessProbe.initialDelaySeconds}}
periodSeconds: {{.Values.livenessProbe.periodSeconds}}
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8080
initialDelaySeconds: 20
periodSeconds: 30
initialDelaySeconds: {{.Values.readinessProbe.initialDelaySeconds}}
periodSeconds: {{.Values.readinessProbe.periodSeconds}}
env:
- name: "SPRING_PROFILES_ACTIVE"
value: "{{ .Values.global.SPRING_PROFILES_ACTIVE }}"
Expand Down
8 changes: 7 additions & 1 deletion helm/ph-ee-engine/connector-mock-payment-schema/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@ ingress:
tls: [ ]
# - secretName: sandbox-secret
# hosts:
# - chart-example.local
# - chart-example.local
livenessProbe:
initialDelaySeconds: 20
periodSeconds: 30
readinessProbe:
initialDelaySeconds: 20
periodSeconds: 30
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ spec:
{{ toYaml .Values.deployment.annotations | indent 8 }}
{{- end }}
spec:
initContainers:
#During this Pod's initialization, check that zeebe-gateway service is up and running before starting this pod
- name: check-zeebe-gateway-ready
image: busybox:latest
command: [ 'sh', '-c','until nc -vz {{ .Release.Name }}-zeebe-gateway 26500; do echo "Waiting for zeebe-gateway service"; sleep 2; done;' ]
containers:
- name: ph-ee-connector-mojaloop-java
image: "{{ .Values.image }}"
Expand Down Expand Up @@ -88,4 +93,4 @@ spec:
- name: ph-ee-config
configMap:
name: ph-ee-config
{{- end }}
{{- end }}
Loading

0 comments on commit b43bdf7

Please sign in to comment.