From 0cae0d0a06dca71a4daa7731c55b395befebfec7 Mon Sep 17 00:00:00 2001 From: Pradyumna Nagendra Date: Thu, 18 Jun 2020 16:43:54 +0530 Subject: [PATCH 01/11] Issue #TG-234 feat: Added logback configuration for lms-service --- ansible/roles/stack-sunbird/defaults/main.yml | 4 +- .../templates/lms-service_logback.xml | 60 +++++++++++++++++++ .../core/lms/templates/deployment.yaml | 7 +++ 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 ansible/roles/stack-sunbird/templates/lms-service_logback.xml diff --git a/ansible/roles/stack-sunbird/defaults/main.yml b/ansible/roles/stack-sunbird/defaults/main.yml index 3ef9b60d51..37f4b56697 100644 --- a/ansible/roles/stack-sunbird/defaults/main.yml +++ b/ansible/roles/stack-sunbird/defaults/main.yml @@ -255,7 +255,9 @@ sunbird_cert_qr_container_name: "certqr" service_env: learner: ../../../../ansible/roles/stack-sunbird/templates/sunbird_learner-service.env - lms: ../../../../ansible/roles/stack-sunbird/templates/sunbird_lms-service.env + lms: + - ../../../../ansible/roles/stack-sunbird/templates/sunbird_lms-service.env + - ../../../../ansible/roles/stack-sunbird/templates/lms-service_logback.xml knowledgemw: ../../../../ansible/roles/stack-sunbird/templates/sunbird_knowledge-mw-service.env apimanager: ../../../../ansible/roles/stack-api-manager/templates/api-manager.env cert: ../../../../ansible/roles/stack-sunbird/templates/sunbird_cert-service.env diff --git a/ansible/roles/stack-sunbird/templates/lms-service_logback.xml b/ansible/roles/stack-sunbird/templates/lms-service_logback.xml new file mode 100644 index 0000000000..95da934f0c --- /dev/null +++ b/ansible/roles/stack-sunbird/templates/lms-service_logback.xml @@ -0,0 +1,60 @@ + + + + + + + + + + %d %msg%n + + + + + + + + + + + + + + + + + + + + %msg + + + ${sunbird_environment}.telemetry.raw + + + + + + + + + bootstrap.servers=${kafka_urls} + + acks=0 + + linger.ms=15000 + + max.block.ms=0 + + client.id=${HOSTNAME}-${CONTEXT_NAME}-logback-relaxed + + + + + + + + + + \ No newline at end of file diff --git a/kubernetes/helm_charts/core/lms/templates/deployment.yaml b/kubernetes/helm_charts/core/lms/templates/deployment.yaml index e953a1d0da..e252ccbb16 100644 --- a/kubernetes/helm_charts/core/lms/templates/deployment.yaml +++ b/kubernetes/helm_charts/core/lms/templates/deployment.yaml @@ -24,6 +24,10 @@ spec: imagePullSecrets: - name: {{ .Values.imagepullsecrets }} {{- end }} + volumes: + - name: {{ .Chart.Name }}-xml-config + configMap: + name: {{ .Chart.Name }}-xml-config containers: - name: {{ .Chart.Name }} image: "{{ .Values.dockerhub }}/{{ .Values.repository }}:{{ .Values.image_tag }}" @@ -49,6 +53,9 @@ spec: volumeMounts: - mountPath: {{ .Values.lms_device_basepath }} name: access-keys + - name: {{ .Chart.Name }}-xml-config + mountPath: /home/sunbird/lms/lms-service-1.0-SNAPSHOT/config/logback.xml + subPath: lms-service_logback.xml volumes: - name: access-keys secret: From 46dfc3ea6d6d0cad12b6b58e49cb0df8f92ebf99 Mon Sep 17 00:00:00 2001 From: Pradyumna Nagendra Date: Thu, 18 Jun 2020 16:56:46 +0530 Subject: [PATCH 02/11] Issue #TG-234 feat: Added logback configuration for lms-service --- .../helm_charts/core/lms/templates/deployment.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/kubernetes/helm_charts/core/lms/templates/deployment.yaml b/kubernetes/helm_charts/core/lms/templates/deployment.yaml index e252ccbb16..dd396bb303 100644 --- a/kubernetes/helm_charts/core/lms/templates/deployment.yaml +++ b/kubernetes/helm_charts/core/lms/templates/deployment.yaml @@ -48,19 +48,20 @@ spec: readinessProbe: {{ toYaml .Values.readinessProbe | indent 10 }} {{- end }} + volumeMounts: + - name: {{ .Chart.Name }}-xml-config + mountPath: /home/sunbird/lms/lms-service-1.0-SNAPSHOT/config/logback.xml + subPath: lms-service_logback.xml {{- $keys := .Files.Glob "keys/*" }} {{- if $keys }} volumeMounts: - mountPath: {{ .Values.lms_device_basepath }} name: access-keys - - name: {{ .Chart.Name }}-xml-config - mountPath: /home/sunbird/lms/lms-service-1.0-SNAPSHOT/config/logback.xml - subPath: lms-service_logback.xml volumes: - name: access-keys secret: secretName: lms-access-keys -{{ end }} +{{- end }} --- apiVersion: v1 From 50c1bd2857827704ef4db41902a7e8daf83d5092 Mon Sep 17 00:00:00 2001 From: Pradyumna Nagendra Date: Fri, 19 Jun 2020 17:20:18 +0530 Subject: [PATCH 03/11] Issue #TG-234 feat: Added logback configuration for lms-service --- kubernetes/helm_charts/core/lms/templates/deployment.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kubernetes/helm_charts/core/lms/templates/deployment.yaml b/kubernetes/helm_charts/core/lms/templates/deployment.yaml index dd396bb303..41b4498a86 100644 --- a/kubernetes/helm_charts/core/lms/templates/deployment.yaml +++ b/kubernetes/helm_charts/core/lms/templates/deployment.yaml @@ -48,10 +48,6 @@ spec: readinessProbe: {{ toYaml .Values.readinessProbe | indent 10 }} {{- end }} - volumeMounts: - - name: {{ .Chart.Name }}-xml-config - mountPath: /home/sunbird/lms/lms-service-1.0-SNAPSHOT/config/logback.xml - subPath: lms-service_logback.xml {{- $keys := .Files.Glob "keys/*" }} {{- if $keys }} volumeMounts: @@ -62,6 +58,10 @@ spec: secret: secretName: lms-access-keys {{- end }} +volumeMounts: + - name: {{ .Chart.Name }}-xml-config + mountPath: /home/sunbird/lms/lms-service-1.0-SNAPSHOT/config/logback.xml + subPath: lms-service_logback.xml --- apiVersion: v1 From 6e26cbcf15b697fa2381449e702fcf03233ab6a5 Mon Sep 17 00:00:00 2001 From: Pradyumna Nagendra Date: Fri, 19 Jun 2020 17:30:08 +0530 Subject: [PATCH 04/11] Issue #TG-234 feat: Added logback configuration for lms-service --- .../core/lms/templates/deployment.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/kubernetes/helm_charts/core/lms/templates/deployment.yaml b/kubernetes/helm_charts/core/lms/templates/deployment.yaml index 41b4498a86..17f14d901d 100644 --- a/kubernetes/helm_charts/core/lms/templates/deployment.yaml +++ b/kubernetes/helm_charts/core/lms/templates/deployment.yaml @@ -24,10 +24,6 @@ spec: imagePullSecrets: - name: {{ .Values.imagepullsecrets }} {{- end }} - volumes: - - name: {{ .Chart.Name }}-xml-config - configMap: - name: {{ .Chart.Name }}-xml-config containers: - name: {{ .Chart.Name }} image: "{{ .Values.dockerhub }}/{{ .Values.repository }}:{{ .Values.image_tag }}" @@ -48,6 +44,10 @@ spec: readinessProbe: {{ toYaml .Values.readinessProbe | indent 10 }} {{- end }} + volumeMounts: + - name: {{ .Chart.Name }}-xml-config + mountPath: /home/sunbird/lms/lms-service-1.0-SNAPSHOT/config/logback.xml + subPath: lms-service_logback.xml {{- $keys := .Files.Glob "keys/*" }} {{- if $keys }} volumeMounts: @@ -58,10 +58,10 @@ spec: secret: secretName: lms-access-keys {{- end }} -volumeMounts: - - name: {{ .Chart.Name }}-xml-config - mountPath: /home/sunbird/lms/lms-service-1.0-SNAPSHOT/config/logback.xml - subPath: lms-service_logback.xml + volumes: + - name: {{ .Chart.Name }}-xml-config + configMap: + name: {{ .Chart.Name }}-xml-config --- apiVersion: v1 From 765cf9dd046cb663c30091c5f904e66e8618a015 Mon Sep 17 00:00:00 2001 From: Pradyumna Nagendra Date: Fri, 19 Jun 2020 17:47:54 +0530 Subject: [PATCH 05/11] Issue #TG-234 feat: Added logback configuration for lms-service --- kubernetes/helm_charts/core/lms/templates/deployment.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kubernetes/helm_charts/core/lms/templates/deployment.yaml b/kubernetes/helm_charts/core/lms/templates/deployment.yaml index 17f14d901d..8ecc577e14 100644 --- a/kubernetes/helm_charts/core/lms/templates/deployment.yaml +++ b/kubernetes/helm_charts/core/lms/templates/deployment.yaml @@ -44,10 +44,6 @@ spec: readinessProbe: {{ toYaml .Values.readinessProbe | indent 10 }} {{- end }} - volumeMounts: - - name: {{ .Chart.Name }}-xml-config - mountPath: /home/sunbird/lms/lms-service-1.0-SNAPSHOT/config/logback.xml - subPath: lms-service_logback.xml {{- $keys := .Files.Glob "keys/*" }} {{- if $keys }} volumeMounts: @@ -62,6 +58,10 @@ spec: - name: {{ .Chart.Name }}-xml-config configMap: name: {{ .Chart.Name }}-xml-config + volumeMounts: + - name: {{ .Chart.Name }}-xml-config + mountPath: /home/sunbird/lms/lms-service-1.0-SNAPSHOT/config/logback.xml + subPath: lms-service_logback.xml --- apiVersion: v1 From abb5cd2fcbc96c767da649f7d64ca58718463792 Mon Sep 17 00:00:00 2001 From: Pradyumna Nagendra Date: Fri, 19 Jun 2020 18:06:14 +0530 Subject: [PATCH 06/11] Issue #TG-234 feat: Added logback configuration for lms-service --- .../core/lms/templates/deployment.yaml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/kubernetes/helm_charts/core/lms/templates/deployment.yaml b/kubernetes/helm_charts/core/lms/templates/deployment.yaml index 8ecc577e14..7335314903 100644 --- a/kubernetes/helm_charts/core/lms/templates/deployment.yaml +++ b/kubernetes/helm_charts/core/lms/templates/deployment.yaml @@ -44,25 +44,25 @@ spec: readinessProbe: {{ toYaml .Values.readinessProbe | indent 10 }} {{- end }} + volumeMounts: + - name: {{ .Chart.Name }}-xml-config + mountPath: /home/sunbird/lms/lms-service-1.0-SNAPSHOT/config/logback.xml + subPath: lms-service_logback.xml {{- $keys := .Files.Glob "keys/*" }} {{- if $keys }} - volumeMounts: - mountPath: {{ .Values.lms_device_basepath }} name: access-keys - volumes: - - name: access-keys - secret: - secretName: lms-access-keys {{- end }} volumes: - name: {{ .Chart.Name }}-xml-config configMap: name: {{ .Chart.Name }}-xml-config - volumeMounts: - - name: {{ .Chart.Name }}-xml-config - mountPath: /home/sunbird/lms/lms-service-1.0-SNAPSHOT/config/logback.xml - subPath: lms-service_logback.xml - +{{- $keys := .Files.Glob "keys/*" }} +{{- if $keys }} + - name: access-keys + secret: + secretName: lms-access-keys +{{- end }} --- apiVersion: v1 kind: Service From 8b7ced2915ed87988e7b5632a48b2933a2e4e24d Mon Sep 17 00:00:00 2001 From: Pradyumna Nagendra Date: Thu, 16 Jul 2020 11:36:32 +0530 Subject: [PATCH 07/11] Issue #TG-375 feat: Added logback changes for cassandra query events --- .../templates/lms-service_logback.xml | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/ansible/roles/stack-sunbird/templates/lms-service_logback.xml b/ansible/roles/stack-sunbird/templates/lms-service_logback.xml index 95da934f0c..a855472779 100644 --- a/ansible/roles/stack-sunbird/templates/lms-service_logback.xml +++ b/ansible/roles/stack-sunbird/templates/lms-service_logback.xml @@ -53,8 +53,40 @@ + + + %msg + + + ${sunbird_environment}.db.query.events + + + + + + + + + bootstrap.servers=${kafka_urls} + + acks=0 + + linger.ms=15000 + + max.block.ms=0 + + client.id=${HOSTNAME}-${CONTEXT_NAME}-logback-relaxed + + + + + + + + + \ No newline at end of file From 81e1734efedf6eec60c35a38422f80e08673d175 Mon Sep 17 00:00:00 2001 From: Pradyumna Nagendra Date: Thu, 16 Jul 2020 15:44:38 +0530 Subject: [PATCH 08/11] Issue #TG-375 feat: Added kafka topic for query events logging --- ansible/roles/setup-kafka/defaults/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ansible/roles/setup-kafka/defaults/main.yml b/ansible/roles/setup-kafka/defaults/main.yml index 8a5a797bca..cb02677920 100644 --- a/ansible/roles/setup-kafka/defaults/main.yml +++ b/ansible/roles/setup-kafka/defaults/main.yml @@ -13,6 +13,9 @@ processing_kafka_overriden_topics: - name: lms.notification retention_time: 172800000 replication_factor: 1 + - name: db.query.events + retention_time: 172800000 + replication_factor: 1 processing_kafka_topics: - name: lms.audit.events @@ -27,4 +30,7 @@ processing_kafka_topics: - name: lms.notification num_of_partitions: 1 replication_factor: 1 + - name: db.query.events + num_of_partitions: 1 + replication_factor: 1 From 7dcfc47f70977320551bef2cd635ebca276f952d Mon Sep 17 00:00:00 2001 From: Pradyumna Nagendra Date: Thu, 16 Jul 2020 15:49:21 +0530 Subject: [PATCH 09/11] Revert "Issue #TG-375 feat: Added kafka topic for query events logging" This reverts commit 81e1734efedf6eec60c35a38422f80e08673d175. --- ansible/roles/setup-kafka/defaults/main.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ansible/roles/setup-kafka/defaults/main.yml b/ansible/roles/setup-kafka/defaults/main.yml index cb02677920..8a5a797bca 100644 --- a/ansible/roles/setup-kafka/defaults/main.yml +++ b/ansible/roles/setup-kafka/defaults/main.yml @@ -13,9 +13,6 @@ processing_kafka_overriden_topics: - name: lms.notification retention_time: 172800000 replication_factor: 1 - - name: db.query.events - retention_time: 172800000 - replication_factor: 1 processing_kafka_topics: - name: lms.audit.events @@ -30,7 +27,4 @@ processing_kafka_topics: - name: lms.notification num_of_partitions: 1 replication_factor: 1 - - name: db.query.events - num_of_partitions: 1 - replication_factor: 1 From a49bef8b64c8faec016c6b94bee90998c20f75f0 Mon Sep 17 00:00:00 2001 From: Pradyumna Nagendra Date: Wed, 22 Jul 2020 00:45:07 +0530 Subject: [PATCH 10/11] Issue #TG-375 feat: Updated logback configuration --- ansible/roles/stack-sunbird/templates/lms-service_logback.xml | 2 +- ansible/roles/stack-sunbird/templates/sunbird_lms-service.env | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ansible/roles/stack-sunbird/templates/lms-service_logback.xml b/ansible/roles/stack-sunbird/templates/lms-service_logback.xml index a855472779..42f1405219 100644 --- a/ansible/roles/stack-sunbird/templates/lms-service_logback.xml +++ b/ansible/roles/stack-sunbird/templates/lms-service_logback.xml @@ -58,7 +58,7 @@ %msg - ${sunbird_environment}.db.query.events + ${sunbird_env_name}.db.query.events diff --git a/ansible/roles/stack-sunbird/templates/sunbird_lms-service.env b/ansible/roles/stack-sunbird/templates/sunbird_lms-service.env index 7466383b92..aaba7f4ca3 100644 --- a/ansible/roles/stack-sunbird/templates/sunbird_lms-service.env +++ b/ansible/roles/stack-sunbird/templates/sunbird_lms-service.env @@ -121,3 +121,5 @@ sunbird_user_qrcode_courses_limit={{sunbird_user_qrcode_courses_limit|default(50 accesstoken.publickey.basepath={{lms_device_basepath | default('/keys/')}} accesstoken.publickey.keyprefix={{ adminutil__access_keyprefix | default('accessv1_key_public')}} accesstoken.publickey.keycount={{ adminutil__access_keycount | default(10)}} + +sunbird_env_name={{env_name}} \ No newline at end of file From e93bc4bfdd903f1ab30a4f4d69daf68b0332ffed Mon Sep 17 00:00:00 2001 From: Pradyumna Nagendra Date: Wed, 22 Jul 2020 00:50:48 +0530 Subject: [PATCH 11/11] Issue #TG-375 feat: Updated logback configuration --- ansible/roles/stack-sunbird/templates/lms-service_logback.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/stack-sunbird/templates/lms-service_logback.xml b/ansible/roles/stack-sunbird/templates/lms-service_logback.xml index 42f1405219..9e0a7f41c4 100644 --- a/ansible/roles/stack-sunbird/templates/lms-service_logback.xml +++ b/ansible/roles/stack-sunbird/templates/lms-service_logback.xml @@ -30,7 +30,7 @@ %msg - ${sunbird_environment}.telemetry.raw + ${sunbird_env_name}.telemetry.raw