Skip to content

Commit

Permalink
Merge pull request #85 from project-sunbird/release-7.0.0
Browse files Browse the repository at this point in the history
Release 7.0.0
  • Loading branch information
ravismula authored Jan 27, 2025
2 parents 15b8cce + 6ca9d52 commit e5a2948
Show file tree
Hide file tree
Showing 147 changed files with 9,986 additions and 1,463 deletions.
138 changes: 138 additions & 0 deletions Adding Support for New Cloud Provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Adding Support for a New Cloud Provider

## Requirements

### Cluster Specifications
- **Minimum Requirements:**
- CPU: 48 vCPUs
- Memory: 192 GB
- **Recommended Node Size:**
- 3 nodes of `Standard_B16as_v2` (16 vCPUs, 64 GB RAM)

### Networking
- Public Subnet

### Storage Buckets
Create the following buckets:
1. `storage_container_private`
2. `storage_container_public`
3. `reports_container_private`
4. `telemetry_container_private`
5. `backups_container_private`
6. `flink_state_container_private`
7. `dial_state_container_public`

### Additional Requirements
1. Storage Account
2. Random String
3. Encryption String
4. JWT Tokens
5. RSA Keys

---

## Steps to Add a New Cloud Provider

### Step 1: Create a New Folder
- Navigate to the `terraform` directory and create a folder for the new cloud provider.
Example: `terraform/gcp/`

### Step 2: Recommended Folder Structure
Organize the folder as follows:
```plaintext
terraform/<cloud_provider>/
├── _common
│ ├── kubernetescluster.hcl
│ ├── keys.hcl
│ ├── network.hcl
│ ├── output-file.hcl
│ ├── serviceaccount.hcl
│ ├── storage.hcl
│ └── upload-files.hcl
├── modules
│ ├── kubernetescluster
│ ├── keys
│ ├── network
│ ├── output-file
│ ├── serviceaccount
│ ├── storage
│ └── upload-files
└── template/
├── kubernetescluster
│ └── terragrunt.hcl
├── create_tf_backend.sh
├── environment.hcl
├── global-values.yaml
├── install.sh
├── keys
│ └── terragrunt.hcl
├── network
│ └── terragrunt.hcl
├── output-file
│ └── terragrunt.hcl
├── postman.env.json
├── storage
│ └── terragrunt.hcl
├── terragrunt.hcl
└── upload-files
└── terragrunt.hcl
```

### Step 3: Copy Template Files
Copy the template files from the Azure configuration:
```sh
cp sunbird-ed-installer/terraform/azure/template/{environment.hcl,global-values.yaml,install.sh} sunbird-ed-installer/terraform/gcp/template/
In global-values.yaml, add this variable:
cloud_provider: "REPLACE_ME" # for configuring GCP and AWS installations
```

### Step 4: Structuring Output Files
This will become the input for Helm bundles:
```plaintext
global-cloud-values.yaml
environment.hcl
global-values.yaml
```

### Step 5: Helm Changes
In Helm charts, wherever cloud values are being referred to, use the following format:
```yaml
{{- if eq .Values.global.cloud_provider "aws" }}
# AWS Specific Values
{{- else if eq .Values.global.cloud_provider "gcp" }}
# GCP Specific Values
{{- end }}
```

#### Example:
In **Helm charts**, using a direct reference for **Azure**:
```yaml
container_name: "{{ .Values.global.azure_telemetry_container_name }}"
```
Using an `if-else` condition for multiple cloud providers:
```yaml
container_name:
{{- if eq .Values.global.cloud_provider "aws" }}
"{{ .Values.global.aws_public_bucket_name }}"
{{- else if eq .Values.global.cloud_provider "gcp" }}
"{{ .Values.global.gcp_public_bucket_name }}"
{{- else }}
"{{ .Values.telemetry_container_private }}"
{{- end }}
```

### Step 6: Enable Service Account and Add Annotations
When using storage buckets, ensure the appropriate service account is enabled and annotated
For example:
```yaml
serviceAccount:
create: true
name: <created at step 2>
annotations:
iam.gke.io/gcp-service-account: iam.gke.io/gcp-service-account: <service-account-name>@<project-id>.iam.gserviceaccount.com
```

For **Azure installation**, please refer to the documentation:
`/sunbird-ed-installer/README.md`

44 changes: 28 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,28 @@

#### Pre-requisites

1. Domain Name
2. SSL Certificate(FullChain -> private key and Certificate+CA_Bundle). **Fullchain is mandatory**, else installation will fail.

#### Required CLI tools
1. Azure CLI (https://learn.microsoft.com/en-us/cli/azure/install-azure-cli)
2. jq (https://jqlang.github.io/jq/download/)
3. rclone (https://rclone.org/)
4. Terraform (https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli)
5. Terragrunt (https://terragrunt.gruntwork.io/docs/getting-started/install/)
7. Linux / Macos / Gitbash (Windows)
8. Python 3
9. PyJwt python package (you can using using pip)
10. [kubectl](https://kubernetes.io/docs/tasks/tools/)
11. [helm](https://helm.sh/docs/intro/quickstart/#install-helm)
12. Postman CLI (https://learning.postman.com/docs/getting-started/installation/installation-and-updates/)
1. **Domain Name**
2. **SSL Certificate**: The FullChain, consisting of the private key and Certificate+CA_Bundle, is mandatory for installation.
3. **Google OAuth Credentials**: [Create credentials](https://developers.google.com/workspace/guides/create-credentials#oauth-client-id)
4. **Google V3 ReCaptcha Credentials**: [Create credentials](https://www.google.com/recaptcha/admin)
5. **Email Service Provider**
6. **MSG91 SMS Service Provider API Token** (Optional): Required for sending OTPs to registered email addresses during user registration or password reset.
7. **YouTube API Token** (Optional): Necessary for uploading video content directly via YouTube URL.

#### Required CLI Tools

1. [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli)
2. [jq](https://jqlang.github.io/jq/download/)
3. [rclone](https://rclone.org/)
4. [Terraform](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli)
5. [Terragrunt](https://terragrunt.gruntwork.io/docs/getting-started/install/)
6. Linux / MacOS / GitBash (Windows)
7. Python 3
8. PyJWT Python Package (install via pip)
9. [kubectl](https://kubernetes.io/docs/tasks/tools/)
10. [helm](https://helm.sh/docs/intro/quickstart/#install-helm)
11. [Postman CLI](https://learning.postman.com/docs/getting-started/installation/installation-and-updates/)


**Note:**

Expand All @@ -39,7 +46,6 @@ We will copy your existing files in the below location with a `.bak` extension a
| Name | Description |
|----------------|------------------|
|`environment` | Environment name (between 1 - 9 charcaters). Example: *dev*, *stage* |
|`random_string` | Alphanumeric random string (between 12 - 24) characters. Example: *U2PNfwcz6rb9756ZwAwZ* |

#### Mandatory variables in `global-values.yaml`
| Name | Description |
Expand All @@ -60,6 +66,11 @@ cd dev
2. Update required values in `environment.hcl` and `global-values.yaml` files
3. Run `bash install.sh`

## Client form setup
To setup client forms - Run the install.sh with the function create_client_forms

`bash install.sh create_client_forms`

## Default users in the instance
This installation setup creates the following default users with different roles. Feel free to update the password using "Forgot password" option or create new users using API's

Expand All @@ -72,3 +83,4 @@ This installation setup creates the following default users with different roles
|Book Reviewer | [email protected] | bookReviewer@123|
|Public User 1 | [email protected] | User1@123|
|Public User 2 | [email protected] | User2@123|

2 changes: 1 addition & 1 deletion helmcharts/edbb/charts/bot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ replicaCount: 1

image:
repository: sunbirded.azurecr.io/bot
tag: "release-3.9.0_RC1_30_bot"
tag: "release-5.1.0_RC1_29_bot"
pullPolicy: IfNotPresent
pullSecrets: []

Expand Down
8 changes: 5 additions & 3 deletions helmcharts/edbb/charts/knowledgemw/configs/env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sunbird_portal_base_url: "https://{{.Values.global.domain}}"
sunbird_content_plugin_base_url: "https://{{.Values.global.domain}}"
sunbird_keycloak_auth_server_url: "https://{{.Values.global.domain}}/auth"
sunbird_data_service_api_base_url: "https://{{.Values.global.domain}}/api"
sunbird_dial_code_registry_url: "https://{{.Values.global.domain}}/dail/"
sunbird_dial_code_registry_url: "https://{{.Values.global.domain}}/dial/"
sunbird_language_service_api_base_url: "https://{{.Values.global.domain}}/api/language"
sunbird_cache_store: memory
sunbird_cache_ttl: "1800"
Expand Down Expand Up @@ -44,6 +44,8 @@ sunbird_dial_repo_api_key: "{{ .Values.global.sunbird_admin_api_token }}"
sunbird_search_service_api_key: "{{ .Values.global.sunbird_admin_api_token }}"
sunbird_plugin_repo_api_key: "{{ .Values.global.sunbird_admin_api_token }}"
sunbird_data_service_api_key: "{{ .Values.global.sunbird_admin_api_token }}"
sunbird_learner_service_local_base_url: "{{ .Values.sunbird_learner_service_local_base_url | default "http://learner-service:9000"}}"
sunbird_learner_service_local_base_url: "{{ .Values.sunbird_learner_service_local_base_url | default "http://userorg-service:9000"}}"
# spell check - https://github.com/Sunbird-Knowlg/knowledge-mw-service/blob/07c2cb26cc200df4c644d482a01eff299a37ad39/src/app.js#L33
sunbird_contnet_service_base_url: "{{ .Values.sunbird_contnet_service_base_url | default "http://content-service:9000"}}"
sunbird_contnet_service_base_url: "{{ .Values.sunbird_contnet_service_base_url | default "http://content-service:9000"}}"
# release-7.0.0
sunbird_taxonomy_service_api_base_url: http://taxonomy-service:9000
10 changes: 8 additions & 2 deletions helmcharts/edbb/charts/knowledgemw/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ replicaCount: 1

image:
repository: sunbirded.azurecr.io/knowledge-mw-service
tag: "release-5.2.0_RC1_d110f8f_3"
tag: "release-5.6.0_RC1_f24f1dd_10"
pullPolicy: IfNotPresent
pullSecrets: []

Expand Down Expand Up @@ -37,7 +37,13 @@ ingress:
paths:
- /

resources: {}
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 1
memory: 1G

autoscaling:
enabled: false
Expand Down
Loading

0 comments on commit e5a2948

Please sign in to comment.