Skip to content

Commit

Permalink
Merge pull request sunbird-cb#251 from KB-iGOT/cbrelease-4.8.18
Browse files Browse the repository at this point in the history
Cbrelease 4.8.18
  • Loading branch information
Haritest authored Nov 28, 2024
2 parents c1301d5 + 51722b9 commit 07bcd5d
Show file tree
Hide file tree
Showing 12 changed files with 445 additions and 4 deletions.
6 changes: 4 additions & 2 deletions ansible/inventory/env/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ service_ml_template_validation_backend_service_service: ml-template-validation-b
service_public_assessment: public-assessment-service
service_cb_comment_service: cb-comment-service
service_thumbnail_generation_service: thumbnail-generation-service

service_cb_discussion_service: cb-discussion-service

# Ports
service_bulk_upload_port: 3009
Expand Down Expand Up @@ -822,6 +822,7 @@ service_ml_template_validation_backend_service_port: 5000
service_public_assessment_port: 8090
service_cb_comment_port: 8099
service_thumbnail_generation_port: 8000
service_cb_discussion_port: 7001

# Network alias names, so that one service can talk to another
network_alias_content_service: private-content-service
Expand Down Expand Up @@ -882,6 +883,7 @@ network_alias_ml_template_validation_backend_service_service: ml-template-valida
network_alias_public_assessment: public-assessment-service
network_alias_cb_comment_service: cb-comment-service
network_alias_thumbnail_generation_service: thumbnail-generation-service
network_alias_cb_discussion_service: cb-discussion-service

# Image names, this is used by the service alone, but since we want to have all the images in one place, we are oncfiguring the images here
image_ui_static: ui-static
Expand Down Expand Up @@ -939,6 +941,6 @@ image_ml_template_validation_backend_service_service: ml-template-validation-bac
image_public_assessment_service: public-assessment-service
image_cb_comment_service: cb-comment-service
image_thumbnail_generation_service: thumbnail-generation-service

image_cb_discussion_service: cb-discussion-service
#####################bulk-upload-spv#########
host_bulk_upload: /mydata/bulk_upload
166 changes: 165 additions & 1 deletion ansible/roles/kong-api/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ organisation_prefix: /organisation
public_assessment_prefix: /public/assessment
event_progress_prefix: /eventprogress
blended_program_prefix: /bp
discussionfeed_prefix: /feedDiscussion

# Service URLs
knowledge_mw_service_url: "http://knowledge-mw-service:5000"
Expand Down Expand Up @@ -188,6 +189,7 @@ cb_service_registry_url: "http://cb-service-registry:8096"
ml_template_validation_survey_service_url: "http://ml-template-validation-backend-service:5000"
cb_comment_service_url: "http://cb-comment-service:8099"
public_assessment_service_url : "http://public-assessment-service:8090"
cb_discussion_service_url : "http://cb-discussion-service:7001"

premium_consumer_rate_limits:
- api: createContent
Expand Down Expand Up @@ -18548,4 +18550,166 @@ kong_apis:
config.hour: "{{ medium_rate_limit_per_hour }}"
config.limit_by: credential
- name: request-size-limiting
config.allowed_payload_size: "{{ medium_request_size_limit }}"
config.allowed_payload_size: "{{ medium_request_size_limit }}"

- name: discussionCreate
uris: "{{ discussionfeed_prefix }}/create"
upstream_url: "{{ cb_discussion_service_url }}/discussion/create"
strip_uri: true
plugins:
- name: jwt
- name: cors
- "{{ statsd_pulgin }}"
- name: acl
config.whitelist:
- 'contentCreate'
- name: rate-limiting
config.policy: local
config.hour: "{{ medium_rate_limit_per_hour }}"
config.limit_by: credential
- name: request-size-limiting
config.allowed_payload_size: "{{ medium_request_size_limit }}"

- name: discussionUpdate
uris: "{{ discussionfeed_prefix }}/update"
upstream_url: "{{ cb_discussion_service_url }}/discussion/update"
strip_uri: true
plugins:
- name: jwt
- name: cors
- "{{ statsd_pulgin }}"
- name: acl
config.whitelist:
- 'contentCreate'
- name: rate-limiting
config.policy: local
config.hour: "{{ medium_rate_limit_per_hour }}"
config.limit_by: credential
- name: request-size-limiting
config.allowed_payload_size: "{{ medium_request_size_limit }}"

- name: discussionRead
uris: "{{ discussionfeed_prefix }}/read"
upstream_url: "{{ cb_discussion_service_url }}/discussion/read"
strip_uri: true
plugins:
- name: jwt
- name: cors
- "{{ statsd_pulgin }}"
- name: acl
config.whitelist:
- 'contentAccess'
- name: rate-limiting
config.policy: local
config.hour: "{{ medium_rate_limit_per_hour }}"
config.limit_by: credential
- name: request-size-limiting
config.allowed_payload_size: "{{ medium_request_size_limit }}"

- name: deleteDiscussion
uris: "{{ discussionfeed_prefix }}/delete"
upstream_url: "{{ cb_discussion_service_url }}/discussion/delete"
strip_uri: true
plugins:
- name: jwt
- name: cors
- "{{ statsd_pulgin }}"
- name: acl
config.whitelist:
- 'contentUpdate'
- name: rate-limiting
config.policy: local
config.hour: "{{ medium_rate_limit_per_hour }}"
config.limit_by: credential
- name: request-size-limiting
config.allowed_payload_size: "{{ medium_request_size_limit }}"

- name: searchDiscussion
uris: "{{ discussionfeed_prefix }}/search"
upstream_url: "{{ cb_discussion_service_url }}/discussion/search"
strip_uri: true
plugins:
- name: jwt
- name: cors
- "{{ statsd_pulgin }}"
- name: acl
config.whitelist:
- 'contentAccess'
- name: rate-limiting
config.policy: local
config.hour: "{{ medium_rate_limit_per_hour }}"
config.limit_by: credential
- name: request-size-limiting
config.allowed_payload_size: "{{ medium_request_size_limit }}"

- name: voteDiscussion
uris: "{{ discussionfeed_prefix }}/upvote"
upstream_url: "{{ cb_discussion_service_url }}/discussion/upvote"
strip_uri: true
plugins:
- name: jwt
- name: cors
- "{{ statsd_pulgin }}"
- name: acl
config.whitelist:
- 'contentCreate'
- name: rate-limiting
config.policy: local
config.hour: "{{ medium_rate_limit_per_hour }}"
config.limit_by: credential
- name: request-size-limiting
config.allowed_payload_size: "{{ medium_request_size_limit }}"

- name: orgExtendedUpdate
uris: "{{ org_service_prefix }}/ext/v1/update"
upstream_url: "{{ sb_cb_ext_service_url }}/org/ext/v1/update"
strip_uri: true
plugins:
- name: jwt
- name: cors
- "{{ statsd_pulgin }}"
- name: acl
config.whitelist:
- 'dataAccess'
- name: rate-limiting
config.policy: local
config.hour: "{{ small_rate_limit_per_hour }}"
config.limit_by: credential
- name: request-size-limiting
config.allowed_payload_size: "{{ small_request_size_limit }}"

- name: listAllQRCodesForCustomSelfRegistration
uris: "/customselfregistration/listallqrs"
upstream_url: "{{ sb_cb_ext_service_url }}/listAllQRCodes"
strip_uri: true
plugins:
- name: jwt
- name: cors
- "{{ statsd_pulgin }}"
- name: acl
config.whitelist:
- 'dataAccess'
- name: rate-limiting
config.policy: local
config.hour: "{{ medium_rate_limit_per_hour }}"
config.limit_by: credential
- name: request-size-limiting
config.allowed_payload_size: "{{ medium_request_size_limit }}"

- name: getLikedCommentsByUserIDAndCourseId
uris: "{{ comment_prefix }}/v1/likedComments"
upstream_url: "{{ cb_comment_service_url }}/comment/v1/likedComments"
strip_uri: true
plugins:
- name: jwt
- name: cors
- "{{ statsd_pulgin }}"
- name: acl
config.whitelist:
- 'contentAccess'
- name: rate-limiting
config.policy: local
config.hour: "{{ medium_rate_limit_per_hour }}"
config.limit_by: credential
- name: request-size-limiting
config.allowed_payload_size: "{{ medium_request_size_limit }}"
1 change: 1 addition & 0 deletions kubernetes/ansible/roles/deploy-igot/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"cb-enrollment-service",
"mentoring-service",
"cb-comment-service",
"cb-discussion-service",
]

- name: helm upgrade
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: cb-discussion-service
version: 0.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
# vars file for deploy-lex-core-service

# For script
release_name: "{{ network_alias_cb_discussion_service }}"
template_compose_file_name: cb-discussion-service.j2
template_env_file_name: cb-discussion-service-env.j2
compose_file_name: "{{ service_cb_discussion_service }}.yml"
env_file_name: "{{ service_cb_discussion_service }}.env"
helm_env_file_location: "../helm_charts/igot-deploy/templates/"
helm_env_file_name: "{{ helm_env_file_location }}/{{ service_cb_discussion_service }}.env"
#chart_path: "../kubernetes-deploy/cb-discussion-service"

env_file_deployment_location: "{{ env_files_dir }}/{{ env_file_name }}"
compose_file_deployment_location: "{{ compose_files_dir }}/{{ compose_file_name }}"
user_friendly_name: content validation service

# For service
application_port: "{{ service_cb_discussion_port }}"
image_name: "{{ image_cb_discussion_service }}"
tag: "{{ tags_cb_discussion_service }}"
host_port: "{{ application_port }}"
docker_port: "{{ application_port }}"
replicas: "{{ service_replicas_cb_discussion_service }}"
reserved_memory: "{{ service_mem_reserved_cb_discussion_service }}"
limited_memory: "{{ service_mem_limit_cb_discussion_service }}"
#limited_memory: 2048M
health_check_endpoint: http://127.0.0.1:{{ docker_port }}/contentValidation/actuator/health
network_alias_name: "{{ network_alias_cb_discussion_service }}"
docker_service_stack_name: lms
docker_service_name: "{{ service_cb_discussion_service }}"
force_reload: "{{ force_reload_cb_discussion_service }}"

# For application
server_connection_timeout: 5000
tomcat_max_threads: 400
tomcat_min_spare_threads: 20
servlet_multipart_max_file_size: 100Mb
servlet_multipart_max_request_size: 100Mb

content_service_url: http://{{ network_alias_content_service }}:{{ service_content_service_port }}

infosys_lex_core_ip: http://{{ network_alias_sb_cb_ext_service }}:{{ service_sb_cb_ext_port }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
server.connection-timeout=5000
server.tomcat.max-threads=2048
server.tomcat.min-spare-threads=20
server.tomcat.max-connections=15000
server.tomcat.accept-count=500
server.port={{ application_port }}

#spring data jpa for postgres
spring.datasource.url=jdbc:postgresql://{{ postgresql_host }}:{{ postgresql_port }}/sunbird
spring.datasource.username={{postgresql_username_sunbird }}
spring.datasource.password={{ postgresql_password_sunbird }}
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.show-sql=false
# Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto=update

spring.data.cassandra.startupTimeoutInSeconds=100000
spring.data.cassandra.contact-points={{ sunbird_cassandra_db_host }}
spring.data.cassandra.port=9042
spring.data.cassandra.keyspace-name={{ keyspace_sunbird }}
spring.data.cassandra.username={{ cassandra_username }}
spring.data.cassandra.password={{ cassandra_password }}
spring.data.cassandra.local-datacenter=DC1

cassandra.config.host={{ sunbird_cassandra_db_host }}

spring.redis.host={{ kp_redis_ip }}
spring.redis.port=6379
spring.redis.password=
spring.redis.cacheTtl=60000
search.result.redis.ttl=600

elasticsearch.host={{ elasticsearch_host }}
elasticsearch.port={{ elasticsearch_http_port }}
elasticsearch.username={{ elasticsearch_username }}
elasticsearch.password={{ elasticsearch_password }}
elastic.required.field.discussion.json.path=/EsFieldsmapping/discussionEsMapping.json

#kafka Server
spring.kafka.bootstrap.servers={{ kafka_servers_list }}
#kafka properties
kakfa.offset.reset.value=latest
kafka.max.poll.interval.ms=15000
kafka.max.poll.records=100
kafka.auto.commit.interval.ms=10000

sso.url=https://{{ domain_name }}/auth/
sso.realm={{ keycloak_sso_realm }}
sso.connection.pool.size=20
sso.enabled=true

accesstoken.publickey.basepath=/keys/
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
{{- $keys := .Files.Glob "keys/*" }}
{{ if $keys }}
apiVersion: v1
kind: Secret
metadata:
name: cb-discussion-access-keys
type: Opaque
data:
{{ (.Files.Glob "keys/*").AsSecrets | indent 2 }}
{{ end }}
Loading

0 comments on commit 07bcd5d

Please sign in to comment.