Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Csp changes #1630

Merged
merged 34 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c56b13f
Added cloud storage services AWS and GCP
SadanandGowda Nov 17, 2022
43e5743
Added cloud storage services AWS and GCP
SadanandGowda Nov 17, 2022
09bb4d7
updated common vars
SadanandGowda Nov 28, 2022
0c9b763
common variable changes in data-pipeline
SadanandGowda Dec 15, 2022
9e3ddd4
common variable changes in data-pipeline
SadanandGowda Dec 16, 2022
645db59
updated secor csp variables
SadanandGowda Dec 19, 2022
0c5f8ce
updated analytics spark csp variables
SadanandGowda Dec 19, 2022
b9658df
common variable changes in datapipeline/flink-jobs
SadanandGowda Dec 19, 2022
72bae4d
common variable changes in datapipeline/flink-jobs
SadanandGowda Dec 21, 2022
2003a18
Release 5.1.0 - CSP changes (#1591)
santhosh-tg Dec 21, 2022
aa4982e
csp migration variables update
SadanandGowda Dec 23, 2022
0b4ac59
csp migration variables update
SadanandGowda Dec 23, 2022
5ecb513
Merge pull request #1590 from SadanandGowda/csp_changes
manjudr Dec 26, 2022
e930804
csp migration variables update
SadanandGowda Dec 26, 2022
41e58c1
csp migration variables update
SadanandGowda Dec 26, 2022
aceeb5d
csp migration variables update
SadanandGowda Dec 26, 2022
fb46299
csp migration variables update
SadanandGowda Dec 26, 2022
a24203f
Merge branch 'dp-csp-changes' into csp_changes
manjudr Dec 27, 2022
adb2783
csp migration variables update
SadanandGowda Dec 30, 2022
b6eac94
Merge branch 'csp_changes' of https://github.com/SadanandGowda/sunbir…
SadanandGowda Dec 30, 2022
5faa25b
csp migration variables update
SadanandGowda Jan 17, 2023
5a24334
csp migration variables update
SadanandGowda Jan 18, 2023
d575aec
csp migration variables update
SadanandGowda Jan 18, 2023
214c977
Update main.yml
SadanandGowda Jan 18, 2023
f4696c7
Updated cloud service provider changes
SadanandGowda Nov 6, 2023
7517485
LR-539 | Encryption key length update added
kumarks1122 May 17, 2023
0cde617
LR-539 | Encryption key length update added
kumarks1122 May 17, 2023
1268b30
LR-539 | Encryption key length update added
kumarks1122 Sep 14, 2023
c3c8870
LR-539 | Testcase fixes added
kumarks1122 Sep 14, 2023
4518d61
Fix analytics user dir permission issue
santhosh-tg Sep 28, 2023
94678a0
Update zookeeper download url
santhosh-tg Sep 28, 2023
910635e
Fix docker creds secrets issue when having specialcharacters
santhosh-tg Sep 29, 2023
141c51f
Fix erorr - no matches for kind RoleBinding in version rbac.authoriza…
santhosh-tg Sep 29, 2023
b08aa1f
Updated cloud service provider changes
SadanandGowda Nov 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 35 additions & 5 deletions ansible/artifacts-download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,38 @@
become: yes
vars_files:
- "{{inventory_dir}}/secrets.yml"
environment:
AZURE_STORAGE_ACCOUNT: "{{sunbird_artifact_storage_account_name}}"
AZURE_STORAGE_SAS_TOKEN: "{{sunbird_artifact_storage_account_sas}}"
roles:
- artifacts-download-azure
tasks:
- name: download artifact from azure storage
include_role:
name: azure-cloud-storage
tasks_from: blob-download.yml
vars:
blob_container_name: "{{ cloud_storage_artifacts_bucketname }}"
blob_file_name: "{{ artifact }}"
local_file_or_folder_path: "{{ artifact_path }}"
storage_account_name: "{{ cloud_artifact_storage_accountname }}"
storage_account_key: "{{ cloud_artifact_storage_secret }}"
when: cloud_service_provider == "azure"

- name: download artifact from gcloud storage
include_role:
name: gcp-cloud-storage
tasks_from: download.yml
vars:
gcp_bucket_name: "{{ cloud_storage_artifacts_bucketname }}"
gcp_path: "{{ artifact }}"
local_file_or_folder_path: "{{ artifact_path }}"
when: cloud_service_provider == "gcloud"

- name: download artifact from aws s3
include_role:
name: aws-cloud-storage
tasks_from: download.yml
vars:
local_file_or_folder_path: "{{ artifact_path }}"
s3_bucket_name: "{{ cloud_storage_artifacts_bucketname }}"
s3_path: "{{ artifact }}"
aws_default_region: "{{ cloud_public_storage_region }}"
aws_access_key_id: "{{ cloud_artifact_storage_accountname }}"
aws_secret_access_key: "{{ cloud_artifact_storage_secret }}"
when: cloud_service_provider == "aws"
41 changes: 36 additions & 5 deletions ansible/artifacts-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,39 @@
become: yes
vars_files:
- "{{inventory_dir}}/secrets.yml"
environment:
AZURE_STORAGE_ACCOUNT: "{{sunbird_artifact_storage_account_name}}"
AZURE_STORAGE_SAS_TOKEN: "{{sunbird_artifact_storage_account_sas}}"
roles:
- artifacts-upload-azure
tasks:
- name: upload artifact to azure storage
include_role:
name: azure-cloud-storage
tasks_from: blob-upload.yml
vars:
blob_container_name: "{{ cloud_storage_artifacts_bucketname }}"
container_public_access: "off"
blob_file_name: "{{ artifact }}"
local_file_or_folder_path: "{{ artifact_path }}"
storage_account_name: "{{ cloud_artifact_storage_accountname }}"
storage_account_key: "{{ cloud_artifact_storage_secret }}"
when: cloud_service_provider == "azure"

- name: upload artifact to gcloud storage
include_role:
name: gcp-cloud-storage
tasks_from: upload.yml
vars:
gcp_bucket_name: "{{ cloud_storage_artifacts_bucketname }}"
gcp_path: "{{ artifact }}"
local_file_or_folder_path: "{{ artifact_path }}"
when: cloud_service_provider == "gcloud"

- name: upload artifact to aws s3
include_role:
name: aws-cloud-storage
tasks_from: upload.yml
vars:
local_file_or_folder_path: "{{ artifact_path }}"
s3_bucket_name: "{{ cloud_storage_artifacts_bucketname }}"
s3_path: "{{ artifact }}"
aws_default_region: "{{ cloud_public_storage_region }}"
aws_access_key_id: "{{ cloud_artifact_storage_accountname }}"
aws_secret_access_key: "{{ cloud_artifact_storage_secret }}"
when: cloud_service_provider == "aws"
151 changes: 80 additions & 71 deletions ansible/inventory/env/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ log4j_appender_kafka_topic: "{{env}}.telemetry.backend"
# Shall we change the value to telemetry-data-store in dev also?
# What's the implication
# Is it azure blob or s3 bucket??
channel_data_exhaust_bucket: dev-data-store
secrets_path: '{{inventory_dir}}/secrets.yml'
artifacts_container: "{{dp_vault_artifacts_container}}"
cloud_storage_telemetry_bucketname: dev-data-store
secrets_path: "{{inventory_dir}}/secrets.yml"
cloud_storage_artifacts_bucketname: "{{dp_vault_artifacts_container}}"

report_azure_account_name: "{{sunbird_private_storage_account_name}}"
report_azure_storage_secret: "{{sunbird_private_storage_account_key}}"
report_azure_account_name: "{{cloud_private_storage_accountname}}"
report_azure_storage_secret: "{{cloud_private_storage_secret}}"

redis_host: "{{ groups['redis'][0] }}"
metadata_redis_host: "{{ groups['redis'][0] }}"
Expand All @@ -34,7 +34,7 @@ telemetry_schema_directory: /etc/{{env}}/telemetry
telemetry_schema_path: /etc/{{env}}/telemetry/schemas
schema_repo_url: https://github.com/project-sunbird/sunbird-data-pipeline.git
# Create learningall group with LP ips
cassandra_host: "{{ groups['cassandra'][0] }}"
cassandra_host: "{{ groups['cassandra'][0] }}"
core_cassandra_host: "{{ groups['core-cassandra'][0] }}"
lp_cassandra_host: "{{ groups['lp-cassandra'][0] }}"
report_cassandra_host: "{{ groups['report-cassandra'][0] }}"
Expand All @@ -46,36 +46,45 @@ sbin_path: "{{ analytics_user_home }}/sbin"

# Secor vars
secor:
properties: ['secor.azure', 'secor.common', 'secor', 'secor.partition', 'log4j']
artifact_dir: /mount/secor
artifact_ver: "0.29"
azure:
account_name: "{{sunbird_private_storage_account_name}}"
account_key: "{{sunbird_private_storage_account_key}}"
container_name: "{{channel_data_exhaust_bucket}}"
paths: ['/mount/secor', '/mount/secor/reports', '/mount/secor/logs', '/home/analytics/sbin', '/mount/data/analytics']
channel: "{{secor_alerts_slack_channel}}"
properties:
["secor.azure", "secor.common", "secor", "secor.partition", "log4j"]
artifact_dir: /mount/secor
artifact_ver: "0.29"
azure:
account_name: "{{cloud_private_storage_accountname}}"
account_key: "{{cloud_private_storage_secret}}"
container_name: "{{cloud_storage_telemetry_bucketname}}"

paths:
[
"/mount/secor",
"/mount/secor/reports",
"/mount/secor/logs",
"/home/analytics/sbin",
"/mount/data/analytics",
]
channel: "{{secor_alerts_slack_channel}}"

# postgres
# list of databases to be created
# Can move this dictionary to postgres role; but incase we want to generalize roles!!
postgresql_databases:
- name: analytics
owner: analytics
- name: analytics
owner: analytics

postgresql_users:
- name: analytics
password: "{{dp_vault_pgdb_password}}"
- name: analytics
password: "{{dp_vault_pgdb_password}}"

postgres:
db_url: "{{ groups['postgres'][0] }}"
db_username: analytics
db_name: analytics
db_password: "{{dp_vault_pgdb_password}}"
db_table_name: "{{env}}_consumer_channel_mapping"
db_port: 5432
db_admin_user: analytics
db_admin_password: "{{dp_vault_pgdb_admin_password}}"
db_url: "{{ groups['postgres'][0] }}"
db_username: analytics
db_name: analytics
db_password: "{{dp_vault_pgdb_password}}"
db_table_name: "{{env}}_consumer_channel_mapping"
db_port: 5432
db_admin_user: analytics
db_admin_password: "{{dp_vault_pgdb_admin_password}}"

postgres_address_space: 0.0.0.0/0 # Postgres trust address space

Expand All @@ -84,9 +93,9 @@ lp_composite_search_host: "{{ groups['composite-search-cluster'][0] }}"
lp_search: "http://{{private_ingressgateway_ip}}/search"
lp_url: http://{{ groups['learning'][0] }}:8080/learning-service
service:
search:
url: http://{{private_ingressgateway_ip}}/search
path: /v3/search
search:
url: http://{{private_ingressgateway_ip}}/search
path: /v3/search

cassandra_hierarchy_store_prefix: "{{env}}_"
data_exhaust_token: "{{dp_vault_data_exhaust_token}}"
Expand All @@ -106,46 +115,46 @@ CONTAINER_NAME_SAMZA: samza-logs
script_path: /usr/local/hadoop

job_names:
DeDuplication_1:
job_file_name: 'de-duplication'
DeNormalization_1:
job_file_name: 'de-normalization'
DruidEventsValidator_1:
job_file_name: 'druid-events-validator'
EventsRouter_1:
job_file_name: 'events-router'
TelemetryExtractor_1:
job_file_name: 'telemetry-extractor'
TelemetryLocationUpdater_1:
job_file_name: 'telemetry-location-updater'
TelemetryRouter_1:
job_file_name: 'telemetry-router'
TelemetryRedacter_1:
job_file_name: 'telemetry-redacter'
TelemetryValidator_1:
job_file_name: 'telemetry-validator'
DeviceProfileUpdater_1:
job_file_name: 'device-profile-updater'
AssessmentAggregator_1:
job_file_name: 'assessment-aggregator'
DerivedDeDuplication_1:
job_file_name: 'derived-de-duplication'
UserCacheUpdater_1:
job_file_name: 'user-cache-updater'
ContentCacheUpdater_1:
job_file_name: 'content-cache-updater'
ShareEventsFlattener_1:
job_file_name: 'share-events-flattener'
DeDuplication_1:
job_file_name: "de-duplication"
DeNormalization_1:
job_file_name: "de-normalization"
DruidEventsValidator_1:
job_file_name: "druid-events-validator"
EventsRouter_1:
job_file_name: "events-router"
TelemetryExtractor_1:
job_file_name: "telemetry-extractor"
TelemetryLocationUpdater_1:
job_file_name: "telemetry-location-updater"
TelemetryRouter_1:
job_file_name: "telemetry-router"
TelemetryRedacter_1:
job_file_name: "telemetry-redacter"
TelemetryValidator_1:
job_file_name: "telemetry-validator"
DeviceProfileUpdater_1:
job_file_name: "device-profile-updater"
AssessmentAggregator_1:
job_file_name: "assessment-aggregator"
DerivedDeDuplication_1:
job_file_name: "derived-de-duplication"
UserCacheUpdater_1:
job_file_name: "user-cache-updater"
ContentCacheUpdater_1:
job_file_name: "content-cache-updater"
ShareEventsFlattener_1:
job_file_name: "share-events-flattener"

druid_ingestion_specs:
telemetry-events:
ingestion_file_name: 'telemetry_index_kafka'
summary-events:
ingestion_file_name: 'summary_index_kafka'
telemtry-feedback-events:
ingestion_file_name: 'telemetry_feedback_index_kafka'
pipeline-metrics:
ingestion_file_name: 'pipeline_metrics_index_kafka'
telemetry-events:
ingestion_file_name: "telemetry_index_kafka"
summary-events:
ingestion_file_name: "summary_index_kafka"
telemtry-feedback-events:
ingestion_file_name: "telemetry_feedback_index_kafka"
pipeline-metrics:
ingestion_file_name: "pipeline_metrics_index_kafka"

#Druid Proxy APi service
sunbird_druid_broker_host: "http://{{ groups['raw-broker'][0] }}"
Expand All @@ -154,9 +163,9 @@ sunbird_learner_service_url: "http://{{private_ingressgateway_ip}}/learner"
location_search_url: "{{ domain_name }}/api/data/"
location_search_token: "Bearer {{ sunbird_api_auth_token }}"

druid_report_url_endpoint : "{{ proto}}://{{domain_name}}/api/data/v1/report/jobs"
druid_report_url : "{{ proto}}://{{domain_name}}/api/data/v1/"
druid_report_token : "Bearer {{ sunbird_api_auth_token }}"
druid_report_url_endpoint: "{{ proto}}://{{domain_name}}/api/data/v1/report/jobs"
druid_report_url: "{{ proto}}://{{domain_name}}/api/data/v1/"
druid_report_token: "Bearer {{ sunbird_api_auth_token }}"

#redis multiprocess config
content_port: 6379
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ spec:
workingDir: /opt/flink
command: ["/opt/flink/bin/standalone-job.sh"]
{{- $job-config-key := .Release.Name }}

args: ["start-foreground",
"--job-classname={{ index .Values $job-config-key.job_classname }}",
"-Djobmanager.rpc.address={{ .Release.Name }}-jobmanager",
Expand All @@ -29,7 +30,20 @@ spec:
"-Dblob.server.port=6124",
"-Dqueryable-state.server.ports=6125",
"-Djobmanager.heap.size={{ index .Values $job-config-key.job_manager_heap_size }}",
"-Dfs.azure.account.key.{{ .Values.azure_storage_account }}.blob.core.windows.net: {{ .Values.azure_storage_secret }}",
{{- if eq .Values.checkpoint_store_type "azure" }}
"-Dfs.azure.account.key.{{ .Values.cloud_storage_key }}.blob.core.windows.net: {{ .Values.cloud_storage_secret }}",
{{- end }}
{{- if eq .Values.checkpoint_store_type "aws" }}
"-Ds3.access-key={{ .Values.cloud_storage_key }}",
"-Ds3.secret-key={{ .Values.cloud_storage_secret }}",
"-Ds3.endpoint={{ .Values.cloud_private_endpoint }}",
"-Ds3.path.style.access={{ .Values.s3_path_style_access }}",
{{- end }}
{{- if eq .Values.checkpoint_store_type "gcloud" }}
"-Dfs.gs.auth.client.id={{ .Values.cloud_storage_key }}",
"-Dfs.gs.auth.client.secret={{ .Values.cloud_storage_secret }}",
"-Dfs.gs.project.id={{ .Values.cloud_storage_project_id }}"
{{- end }}
"-Dconfig.file=/opt/flink/conf/{{ .Release.Name }}.conf"]
ports:
- containerPort: 6123
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,20 @@ spec:
"-Djobmanager.rpc.address={{ .Release.Name }}-jobmanager",
"-Dtaskmanager.rpc.port=6122",
"-Dtaskmanager.heap.size={{ index .Values $job-config-key.task_manager_heap_size }}",
"-Dfs.azure.account.key.{{ .Values.azure_storage_account }}.blob.core.windows.net: {{ .Values.azure_storage_secret }}",
{{- if eq .Values.checkpoint_store_type "azure" }}
"-Dfs.azure.account.key.{{ .Values.cloud_storage_key }}.blob.core.windows.net: {{ .Values.cloud_storage_secret }}",
{{- end }}
{{- if eq .Values.checkpoint_store_type "aws" }}
"-Ds3.access-key={{ .Values.cloud_storage_key }}",
"-Ds3.secret-key={{ .Values.cloud_storage_secret }}",
"-Ds3.endpoint={{ .Values.cloud_storage_endpoint }}",
"-Ds3.path.style.access={{ .Values.cloud_storage_path_style_access }}",
{{- end }}
{{- if eq .Values.checkpoint_store_type "gcloud" }}
"-Dfs.gs.auth.client.id={{ .Values.cloud_storage_key }}",
"-Dfs.gs.auth.client.secret={{ .Values.cloud_storage_secret }}",
"-Dfs.gs.project.id={{ .Values.cloud_storage_project_id }}",
{{- end }}
"-Dconfig.file=/opt/flink/conf/{{ .Release.Name }}.conf"]
ports:
- containerPort: 6122
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ dockerhub: {{ dockerhub }}
repository: {{ datapipeline_repository|default('data-pipeline') }}
image_tag: {{ image_tag }}

azure_storage_account={{ sunbird_private_storage_account_name }}
azure_storage_secret={{ sunbird_private_storage_account_key }}
checkpoint_store_type: {{ cloud_service_provider }}
cloud_storage_key: {{ cloud_private_storage_accountname }}
cloud_storage_secret: {{ cloud_private_storage_secret }}
cloud_storage_endpoint: {{ cloud_private_storage_endpoint }}
cloud_storage_path_style_access: {{ cloud_storage_pathstyle_access }}
cloud_storage_project_id: {{ cloud_private_storage_project }}

telemetry-extractor:
job_name=telemetry-extractor
Expand Down
4 changes: 2 additions & 2 deletions ansible/lpa_data-products_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
become: yes
become_user: "{{ analytics_user }}"
environment:
AZURE_STORAGE_ACCOUNT: "{{sunbird_private_storage_account_name}}"
AZURE_STORAGE_KEY: "{{sunbird_private_storage_account_key}}"
AZURE_STORAGE_ACCOUNT: "{{cloud_private_storage_accountname}}"
AZURE_STORAGE_KEY: "{{cloud_private_storage_secret}}"
roles:
- data-products-deploy
4 changes: 4 additions & 0 deletions ansible/roles/analytics-bootstrap-always/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
createhome: yes
group: "{{ analytics_group }}"

- name: change permission
become: yes
command: chown -R "{{ analytics_user }}":"{{ analytics_user }}" /home/"{{ analytics_user }}"


- name: Installing packages
become: yes
Expand Down
Loading
Loading