Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
12de5e6
added artifact upload role for oci oss
ddevadat Dec 22, 2022
ea2c778
overwrite file in oss if the file exists
ddevadat Dec 22, 2022
852a610
added artifact download for oci role
ddevadat Dec 22, 2022
3ee3b85
added role to install oci-cli
ddevadat Dec 23, 2022
3ee652e
added csp choice based cloud cli installation
ddevadat Dec 23, 2022
4ffea4d
added env variables for oci cli for analytics user
ddevadat Dec 23, 2022
8a70a47
install oci cli as analytics user
ddevadat Dec 23, 2022
69f2e83
adding oci cli in PATH variable for analytics user
ddevadat Dec 23, 2022
4ce637d
install oci-cli in analytics home location
ddevadat Dec 23, 2022
2733374
disabled cloud cli temporarlily
ddevadat Dec 23, 2022
2e4cf61
setting env variable with double quotes
ddevadat Dec 23, 2022
2bbab17
placed oci cli env variables in /etc/environment file
ddevadat Dec 23, 2022
d0d1b1d
added jinja2 template for oci cli config
ddevadat Dec 23, 2022
cc11113
renamed dir templates to template
ddevadat Dec 23, 2022
2e11eaf
disabled only oci cli temporarily
ddevadat Dec 23, 2022
054d9db
testing idempotency for oci cli
ddevadat Dec 23, 2022
b1de737
change Spark provision task with Ruby 2.6
heungheung Dec 25, 2022
07d4e5e
added apiversion selector
ddevadat Dec 27, 2022
17de1fa
Merge branch 'oci-5.1.0' of https://github.com/ocisunbird/sunbird-dat…
ddevadat Dec 27, 2022
9ba6497
added the oci oss bucket upload
ddevadat Dec 29, 2022
5fa0e00
added full path of oci from analaytics home
ddevadat Dec 29, 2022
329e820
correction in oci cli location
ddevadat Dec 29, 2022
86b024d
check bucket existence before creating
ddevadat Dec 29, 2022
51894db
testing the logic for register variable
ddevadat Dec 29, 2022
cbb93c1
using full path for oci cli
ddevadat Dec 29, 2022
47ccff0
testing the bucket check
ddevadat Dec 29, 2022
d3b24a9
added the always tag individually
ddevadat Dec 29, 2022
3c79310
place an oci os upload command for every upload
ddevadat Dec 29, 2022
5e4749e
corrected typo for oci cli command
ddevadat Dec 29, 2022
b7daec6
corrected typo for oci cli command
ddevadat Dec 29, 2022
4dbefc9
testing secor changes for oci oss
ddevadat Dec 30, 2022
7b7854d
added oci-bv as the storage class
ddevadat Dec 30, 2022
8fd5084
added storageclass selection
ddevadat Dec 30, 2022
6a4f551
added a condition to include secor.azure.properties
ddevadat Dec 30, 2022
ea1e665
using S3UploadManager in common.properties
ddevadat Dec 30, 2022
b80f4d0
update flink-conf for telemetry-extractor
ddevadat Jan 1, 2023
e46a818
hardcoding base.url
ddevadat Jan 1, 2023
0ec7478
hardcode base.url with double quotes
ddevadat Jan 1, 2023
61c4c17
updated flink-conf for telemetry extractor
ddevadat Jan 1, 2023
b9ddecd
removed changes from flink-conf
ddevadat Jan 1, 2023
e83136b
temporary change
ddevadat Jan 1, 2023
5ced039
temporary change
ddevadat Jan 1, 2023
426036f
temporary change
ddevadat Jan 1, 2023
3ffd0e4
added hard code value for region
ddevadat Jan 1, 2023
9a8e39f
removed the hardcode region for flink
ddevadat Jan 1, 2023
6d0fb19
added a trailing /
ddevadat Jan 1, 2023
4f6a9b0
removed trailing slash
ddevadat Jan 1, 2023
7c24828
changed base.url for s3
ddevadat Jan 1, 2023
d149abc
hardcode base.url
ddevadat Jan 1, 2023
3b55ac1
debug level only for hadoop
ddevadat Jan 1, 2023
ac6d377
using s3a
ddevadat Jan 2, 2023
60a50c3
using s3 url
ddevadat Jan 2, 2023
033b160
removed hadoop logging
ddevadat Jan 2, 2023
2a5050f
testing with sse-c values
ddevadat Jan 2, 2023
58dec82
corrected the typo
ddevadat Jan 2, 2023
f53d043
hardcoded endpoint
ddevadat Jan 2, 2023
898177c
hard coded endpoint url
ddevadat Jan 2, 2023
8a64d3e
endpoint as variable
ddevadat Jan 2, 2023
f451d45
removed hadoop specific logging
ddevadat Jan 2, 2023
0a4380a
added explicit region
ddevadat Jan 2, 2023
06a5bad
removed region flag
ddevadat Jan 2, 2023
bb5fa35
changed oci specific end point for s3
ddevadat Jan 2, 2023
0394d1b
removed customization from flink-conf.yaml
ddevadat Jan 2, 2023
bf7d6b6
Merge pull request #2 from ocisunbird/oci-5.1.0-secor
heungheung Jan 12, 2023
746aada
Merge pull request #1 from ocisunbird/oci-5.1.0-dp-flinkpipeline-jobs
heungheung Jan 12, 2023
14f2a40
Added oci instance prinicipal env var
subhashchandrab Feb 13, 2023
24920cc
Added oci instance prinicipal env var
subhashchandrab Feb 14, 2023
4bddaab
Merge pull request #3 from ocisunbird/oci-5.1.0-JAPACCOE-2924
ddevadat Feb 19, 2023
6813a3b
python version upgrade for Ubuntu 22.04
subhashchandrab Feb 23, 2023
3970257
python version upgrade for Ubuntu 22.04
subhashchandrab Feb 23, 2023
e743f81
python version upgrade for Ubuntu 22.04
subhashchandrab Feb 23, 2023
0cd35ac
removing virtualenv_python value in install package to pick the defau…
subhashchandrab Feb 23, 2023
61a7fa8
secor bucket name as template
ddevadat Mar 20, 2023
de2f266
Merge pull request #6 from ocisunbird/oci-5.1.0-github-issue-33
ddevadat May 3, 2023
8d93c06
Merge pull request #7 from ocisunbird/oci-5.1.0-secor
ddevadat May 14, 2023
6b364e3
Merge remote-tracking branch 'upstream/release-5.1.1' into oci-5.1.0
ddevadat May 18, 2023
dd68bd0
Updated es_backup.yml with oci line num 13 & 14
venudiksha Apr 4, 2024
f0b1dce
Updated es_backup.yml by reverting the changes
venudiksha Apr 5, 2024
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
14 changes: 14 additions & 0 deletions ansible/artifacts-download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,17 @@
aws_access_key_id: "{{ cloud_artifact_storage_accountname }}"
aws_secret_access_key: "{{ cloud_artifact_storage_secret }}"
when: cloud_service_provider == "aws"


- name: download artifact from oci oss
include_role:
name: oci-cloud-storage
apply:
environment:
OCI_CLI_AUTH: "instance_principal"
tasks_from: download.yml
vars:
local_file_or_folder_path: "{{ artifact_path }}"
oss_bucket_name: "{{ cloud_storage_artifacts_bucketname }}"
oss_object_name: "{{ artifact }}"
when: cloud_service_provider == "oci"
13 changes: 13 additions & 0 deletions ansible/artifacts-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,16 @@
aws_access_key_id: "{{ cloud_artifact_storage_accountname }}"
aws_secret_access_key: "{{ cloud_artifact_storage_secret }}"
when: cloud_service_provider == "aws"

- name: upload artifact to oci oss
include_role:
name: oci-cloud-storage
apply:
environment:
OCI_CLI_AUTH: "instance_principal"
tasks_from: upload.yml
vars:
local_file_or_folder_path: "{{ artifact_path }}"
oss_bucket_name: "{{ cloud_storage_artifacts_bucketname }}"
oss_path: "{{ artifact }}"
when: cloud_service_provider == "oci"
3 changes: 2 additions & 1 deletion ansible/roles/analytics-bootstrap-always/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
dependencies:
- { role: jdk11 , become: yes }
- { role: azure-cli , become: yes }
- { role: azure-cli , become: yes, when: cloud_service_provider == "azure" }
- { role: oci-cli , become: yes, when: cloud_service_provider == "oci" }


30 changes: 30 additions & 0 deletions ansible/roles/analytics-bootstrap-spark/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,36 @@
with_items:
- {var: 'azure_storage_key', value: '{{ sunbird_private_storage_account_name }}'}
- {var: 'azure_storage_secret', value: '{{ sunbird_private_storage_account_key }}'}


- name: Adding PATH for oci cli Vars to bashrc file of spark.
become: yes
become_user: "{{ analytics_user }}"
lineinfile:
path: '{{ analytics_user_home }}/.bashrc'
line: 'export PATH={{ analytics_user_home }}/bin:$PATH'
regexp: "export PATH={{ analytics_user_home }}/bin.*"
when: cloud_service_provider == "oci"

- name: Configure OCI cli
become: yes
become_user: "{{ analytics_user }}"
file:
path: "{{ analytics_user_home }}/.oci"
state: directory
when: cloud_service_provider == "oci"

- name: Create OCI cli config location
become: yes
become_user: "{{ analytics_user }}"
template: src=oci-key.j2 dest={{ analytics_user_home }}/.oci/oci-key.pem mode=600 owner={{ analytics_user }} group={{ analytics_group }}
when: cloud_service_provider == "oci"

- name: Create OCI cli config file
become: yes
become_user: "{{ analytics_user }}"
template: src=oci-cli-config.j2 dest={{ analytics_user_home }}/.oci/config mode=600 owner={{ analytics_user }} group={{ analytics_group }}
when: cloud_service_provider == "oci"

- name: Adding ENV Vars to spark servers environment.
become: yes
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[DEFAULT]
user={{oci_cli_user_ocid }}
fingerprint={{oci_cli_fingerprint}}
key_file=/home/analytics/.oci/oci-key.pem
tenancy={{oci_cli_tenancy}}
region={{oci_cli_region}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ oci_cli_key_content }}
9 changes: 6 additions & 3 deletions ansible/roles/analytics-spark-provision/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,28 +117,31 @@
recurse: yes
become: yes

# kenneth changed to install Ruby 2.6 as per R.4.6.0
- name: Install latest ruby
become: yes
become_user: "{{ analytics_user }}"
shell: "export PATH=$PATH:/home/analytics/.rvm/bin && rvm install ruby-2.5"
shell: "export PATH=$PATH:/home/analytics/.rvm/bin && rvm install ruby-2.6"

- name: Add ruby repository
become: yes
apt_repository:
repo: ppa:brightbox/ruby-ng

# kenneth changed to install ruby-dev 2.6 as per R.4.6.0 - there is no ruby2.2-dev in bionic
- name: Install latest ruby-dev
become: yes
apt:
name: "ruby2.5-dev"
name: "ruby2.6-dev"
state: installed
update_cache: true
cache_valid_time: 3600

# changed to ruby 2.6 as per R.4.6.0
- name: Install ruby-kafka
become: yes
become_user: "{{ analytics_user }}"
shell: "bash -ilc 'export PATH=$PATH:/home/analytics/.rvm/bin && rvm --default use ruby-2.5 && gem install ruby-kafka'"
shell: "bash -ilc 'export PATH=$PATH:/home/analytics/.rvm/bin && rvm --default use ruby-2.6 && gem install --user-install --no-document ruby-kafka'"

- name: Download Kafka-2.11
become: yes
Expand Down
60 changes: 59 additions & 1 deletion ansible/roles/data-products-deploy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@
tags:
- always

- name: Ensure oci oss bucket exists
command: "/home/{{analytics_user}}/bin/oci os bucket get --name {{ bucket }}"
register: check_bucket
when: dp_object_store_type == "s3" and cloud_service_provider == "oci"
tags:
- always

- name: Create oci oss bucket
command: "/home/{{analytics_user}}/bin/oci os bucket create -c {{oci_bucket_compartment}} --name {{bucket}}"
when: dp_object_store_type == "s3" and cloud_service_provider == "oci" and check_bucket.rc !=0
tags:
- always

- name: Copy Core Data Products
copy: src={{ analytics_batch_module_artifact }} dest={{ analytics.home }}/models-{{ model_version }}
tags:
Expand All @@ -14,6 +27,15 @@
command: az storage blob upload --overwrite -c {{ bucket }} --name models-{{ model_version }}/{{ analytics_batch_module_artifact }} -f {{ analytics.home }}/models-{{ model_version }}/{{ analytics_batch_module_artifact }}
async: 3600
poll: 10
when: dp_object_store_type == "azure"
tags:
- dataproducts-spark-cluster

- name: Copy Core Data Products to oci oss
command: /home/{{analytics_user}}/bin/oci os object put -bn {{ bucket }} --name models-{{ model_version }}/{{ analytics_batch_module_artifact }} --file {{ analytics.home }}/models-{{ model_version }}/{{ analytics_batch_module_artifact }} --force
async: 3600
poll: 10
when: dp_object_store_type == "s3" and cloud_service_provider == "oci"
tags:
- dataproducts-spark-cluster

Expand All @@ -27,8 +49,17 @@
command: az storage blob upload --overwrite -c {{ bucket }} --name models-{{ model_version }}/data-products-1.0.jar -f {{ analytics.home }}/models-{{ model_version }}/data-products-1.0/data-products-1.0.jar
async: 3600
poll: 10
when: dp_object_store_type == "azure"
tags:
- ed-dataproducts-spark-cluster

- name: Copy Ed Data Products to oci oss
command: /home/{{analytics_user}}/bin/oci os object put -bn {{ bucket }} --name models-{{ model_version }}/data-products-1.0.jar --file {{ analytics.home }}/models-{{ model_version }}/data-products-1.0/data-products-1.0.jar --force
async: 3600
poll: 10
when: dp_object_store_type == "s3" and cloud_service_provider == "oci"
tags:
- ed-dataproducts-spark-cluster
- ed-dataproducts-spark-cluster

- name: Copy Framework Library
copy: src={{ analytics_core_artifact }} dest={{ analytics.home }}/models-{{ model_version }}
Expand All @@ -39,6 +70,15 @@
command: az storage blob upload --overwrite --debug -c {{ bucket }} --name models-{{ model_version }}/{{ analytics_core_artifact }} -f {{ analytics.home }}/models-{{ model_version }}/{{ analytics_core_artifact }}
async: 3600
poll: 10
when: dp_object_store_type == "azure"
tags:
- framework-spark-cluster

- name: Copy Framework Library to oci oss
command: /home/{{analytics_user}}/bin/oci os object put -bn {{ bucket }} --name models-{{ model_version }}/{{ analytics_core_artifact }} --file {{ analytics.home }}/models-{{ model_version }}/{{ analytics_core_artifact }} --force
async: 3600
poll: 10
when: dp_object_store_type == "s3" and cloud_service_provider == "oci"
tags:
- framework-spark-cluster

Expand All @@ -51,6 +91,15 @@
command: az storage blob upload --overwrite -c {{ bucket }} --name models-{{ model_version }}/{{ scruid_artifact }} -f {{ analytics.home }}/models-{{ model_version }}/{{ scruid_artifact }}
async: 3600
poll: 10
when: dp_object_store_type == "azure"
tags:
- framework-spark-cluster

- name: Copy Scruid Library to oci oss
command: /home/{{analytics_user}}/bin/oci os object put -bn {{ bucket }} --name models-{{ model_version }}/{{ scruid_artifact }} --file {{ analytics.home }}/models-{{ model_version }}/{{ scruid_artifact }} --force
async: 3600
poll: 10
when: dp_object_store_type == "s3" and cloud_service_provider == "oci"
tags:
- framework-spark-cluster

Expand Down Expand Up @@ -100,9 +149,18 @@
command: az storage blob upload --overwrite -c {{ bucket }} -f {{ analytics.home }}/models-{{ model_version }}/application.conf --name models-{{ model_version }}/application.conf
async: 3600
poll: 10
when: dp_object_store_type == "azure"
tags:
- framework-spark-cluster

- name: Copy configuration file to oci oss
command: /home/{{analytics_user}}/bin/oci os object put -bn {{ bucket }} --file {{ analytics.home }}/models-{{ model_version }}/application.conf --name models-{{ model_version }}/application.conf --force
async: 3600
poll: 10
when: dp_object_store_type == "s3" and cloud_service_provider == "oci"
tags:
- framework-spark-cluster

- name: Copy log4j2 xml file
template: src=log4j2.xml.j2 dest={{ analytics.home }}/models-{{ model_version }}/log4j2.xml mode=755 owner={{ analytics_user }} group={{ analytics_group }}
tags: [ dataproducts, framework, ed-dataproducts ]
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/oci-cli/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oci_cli_url: https://github.com/oracle/oci-cli/releases/download/v3.22.0/oci-cli-3.22.0-Ubuntu-18.04-Offline.zip
24 changes: 24 additions & 0 deletions ansible/roles/oci-cli/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
- name: Download the installation file
get_url:
url: "{{ oci_cli_url }}"
dest: /tmp/ocicli.zip

- name: Installing unzip
apt:
name: "{{item}}"
state: latest
with_items:
- zip
- unzip

- name: Unzip the installer
unarchive:
src: /tmp/ocicli.zip
dest: /tmp/
remote_src: yes

- name: install oci cli
shell: ./oci-cli-installation/install.sh --install-dir {{ analytics_user_home }} --exec-dir {{ analytics_user_home }} --script-dir {{ analytics_user_home }} --accept-all-defaults
args:
chdir: /tmp/
3 changes: 3 additions & 0 deletions ansible/roles/oci-cloud-storage/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
oss_bucket_name: ""
oss_path: ""
local_file_or_folder_path: ""
5 changes: 5 additions & 0 deletions ansible/roles/oci-cloud-storage/tasks/delete-folder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: delete files and folders recursively
shell: "oci os object bulk-delete -ns {{oss_namespace}} -bn {{oss_bucket_name}} --prefix {{oss_path}} --force"
async: 3600
poll: 10
7 changes: 7 additions & 0 deletions ansible/roles/oci-cloud-storage/tasks/delete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: Ensure oci oss bucket exists
command: oci os bucket get --name {{ oss_bucket_name }}

- name: Upload to oci oss bucket
command: oci os object delete -bn {{ oss_bucket_name }} --name {{ oss_path }} --force
async: 3600
poll: 10
7 changes: 7 additions & 0 deletions ansible/roles/oci-cloud-storage/tasks/download.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: Ensure oci oss bucket exists
command: oci os bucket get --name {{ oss_bucket_name }}

- name: download files from oci oss bucket
command: oci os object get -bn {{ oss_bucket_name }} --name {{ oss_object_name }} --file {{ local_file_or_folder_path }}
async: 3600
poll: 10
18 changes: 18 additions & 0 deletions ansible/roles/oci-cloud-storage/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
- name: delete files from oci oss bucket
include: delete.yml

- name: delete folders from oci oss bucket recursively
include: delete-folder.yml


- name: download file from oss
include: download.yml

- name: upload files from a local to oci oss
include: upload.yml

- name: upload files and folder from local directory to oci oss
include: upload-folder.yml


8 changes: 8 additions & 0 deletions ansible/roles/oci-cloud-storage/tasks/upload-folder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: Ensure oci oss bucket exists
command: oci os bucket get --name {{ oss_bucket_name }}

- name: Upload folder to oci oss bucket
command: oci os object bulk-upload -bn {{ oss_bucket_name }} --prefix {{ oss_path }} --src-dir {{ local_file_or_folder_path }} --content-type auto
async: 3600
poll: 10
8 changes: 8 additions & 0 deletions ansible/roles/oci-cloud-storage/tasks/upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: Ensure oci oss bucket exists
command: oci os bucket get --name {{ oss_bucket_name }}

- name: Upload to oci oss bucket
command: oci os object put -bn {{ oss_bucket_name }} --name {{ oss_path }} --file {{ local_file_or_folder_path }} --content-type auto --force
async: 3600
poll: 10
2 changes: 1 addition & 1 deletion ansible/roles/portal-dashboard/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
pip:
name: "{{library_path}}"
virtualenv: "{{ virtualenv_path }}"
virtualenv_python: "python3.6"
# virtualenv_python: "python3.6"
tags:
- common

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{{- if and .Values.reloader.watchGlobally (.Values.reloader.rbac.enabled) }}
{{- if (.Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1") }}
apiVersion: rbac.authorization.k8s.io/v1
{{ else }}
apiVersion: rbac.authorization.k8s.io/v1beta1
{{- end }}
kind: ClusterRole
metadata:
labels:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{{- if and .Values.reloader.watchGlobally (.Values.reloader.rbac.enabled) }}
{{- if (.Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1") }}
apiVersion: rbac.authorization.k8s.io/v1
{{ else }}
apiVersion: rbac.authorization.k8s.io/v1beta1
{{- end }}
kind: ClusterRoleBinding
metadata:
labels:
Expand Down
4 changes: 4 additions & 0 deletions kubernetes/helm_charts/bootstrap/reloader/templates/role.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{{- if and (not (.Values.reloader.watchGlobally)) (.Values.reloader.rbac.enabled) }}
{{- if (.Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1") }}
apiVersion: rbac.authorization.k8s.io/v1
{{ else }}
apiVersion: rbac.authorization.k8s.io/v1beta1
{{- end }}
kind: Role
metadata:
labels:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{{- if and (not (.Values.reloader.watchGlobally)) (.Values.reloader.rbac.enabled) }}
{{- if (.Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1") }}
apiVersion: rbac.authorization.k8s.io/v1
{{ else }}
apiVersion: rbac.authorization.k8s.io/v1beta1
{{- end }}
kind: RoleBinding
metadata:
labels:
Expand Down
Loading