Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Deployment Document 

Table of Content

Table of Contents
minLevel1
maxLevel7
stylenone

...

Objective:  1

AWS - Network Architecture: 1

Ec2 Instance 2

IAM user and Role creation for S3 connectivity 3

cQube Deployment Process: 4

Objective:  

This document mainly focuses on the hardware requirements/ AWS network architecture for installing cQube and the deployment process step-by-step.

...

The cQube network setup process is described in the block diagram below:

Image RemovedImage Added

Ec2 Instance

Create   Create an EC2 instance with below configurations to install all the cQube micro services.

  • Ubuntu 22.04 (supported) 

  • 16 GB of System RAM (minimum requirement)

  • 4 core CPU (minimum requirement)

  • 250GB HDD

...

  • Create a domain name

  • Configure cname of ec2 instance to the domain name

  • Create a SSL certificate for the domain name.

Following  Following are the details of the microservices which get installed in the cqube server.

  • Ingestion-ms: The ingestion-ms is used to upload the data of the events, datasets, dimensions, transformers and pipeline. All these apis will be to ingesting the data into the cQube.

  • Spec-ms: The spec-ms is used to import schema of the events, datasets, dimensions, transformers and pipeline. All these specs will be defined by the cQube platform prior to ingesting the data into the cQube. These specifications are derived by considering the KPIs as the Indicator.

  • Generator-ms: The generator-ms is used to create the specs & transformers for the derived datasets. Performed aggregation logics, updating data to datasets based on transformation. Status update of file processing

  • Nifi-ms: Apache NiFi is used as a real-time integrated data logistics and simple event processing platform

  • Postgres-ms: Postgres microservice contains the schema and tables

  • Nginx-ms: It is commonly used as a reverse proxy and load balancer to manage incoming traffic and distribute it to slower upstream servers

  • Kong-ms: It is a lightweight API Gateway that secures, manages, and extends APIs and microservices.

...

An AWS Identity and Access Management (IAM) user is an entity that is created in AWS to represent the person or application that uses it to interact with AWS. A user in AWS contains a name and credentials. An IAM user with administrator permissions is different from the AWS account root user. One has to create an IAM user with a supported role to provide the connectivity between EC2 and S3. The role should have list, read and write permissions

S3 Buckets:
Create following s3 buckets

  • Archiving Archiving 

  • Error logging

IAM User:

  • Create a IAM user

  • Assign IAM policy to the user

  • Download the access key and secret key

...

cQube Deployment Process:

Step - 1: Connect to the cqube ec2 instance

...

Open terminal

Step - 2: Clone the cqube-devops repository using following command

git clone https://github.com/Sunbird-cQube/cqube-devops.git      

...

Step - 3: Navigate to the directory where cqube is cloned or downloaded and checkout to the desired branch

cd cqube-devops/

...

Checkout to the required branch

&& git checkout dev

...

Step - 4: Give the following permissions to the install.sh file

sudo chmod u+x install.sh

Step - 5: Install cqube with non root user with sudo privileges

sudo ./install.sh

...

          

Install   Install.sh sh file contains a shell script where it will run following shell scripts and ansible-playbook to setup the cqube

Basic_requirements.sh:

This      This script basically updates and upgrades the software packages in the server and installs the basic softwares such as as 

  • Python3

  • Pip3

  • Ansible

  • Docker

  • Docker compose

...

Config_file_generator.sh:

      This script is used to generate a configuration file which contains some constant values and few required variables should be entered by the user. Following are the variables which get added in the config file.

 

Note: Users should follow the Hints provided in the description and should enter the variables accordingly. Constant If the entered value is wrong then an error message gets displayed and the user should modify the variable value accordingly.

      Constant Variables: These variables are auto generated

  • System_user_name

  • base_dir

  • Private_ip

  • aws_default_region

Optional_variables: Database credentials contain default values. If the user wishes to enter their own credentials then the user should opt for yes to enter their credentials otherwise can opt for no when the question pops up

  • db_user_name

  • db_name

  • db_password

User Input Variables: Step - 6: User Input Variables-These are variables which need to be entered by the user by following the Hint provided

  • state_name ( Enter the required state code by referring to the state list provided )

  • api_end_point ( Enter the url in which cqube to be configured )

  • s3_access_key

  • s3_secret_key

  • s3 archived bucket name

  • s3 error bucket name

Image Removed

Note: Users should follow the Hints provided in the description and should enter the variables accordingly. If the entered value is wrong then an error message gets displayed and the user should modify the variable value accordingly.

Image Added

         

Step - 7: Optional_variables- Database credentials contain default values. If the user wishes to enter their own credentials then the user should opt for yes to enter their credentials otherwise can opt for no when the question pops up

  • db_user_name ( Enter the postgres database username ) 

  • db_name ( Enter the postgres database name )

  • db_password ( Enter the postgres password )

...

Step - 8: Once the config file is generated, A preview of the config file is displayed followed by a question where the user gets an option to re enter the configuration values on choosing yes. If option no is selected then the install.sh moves to the next section.

Image RemovedImage Added

Repository_clone.sh:

   This script clones the following repositories in the microservices directory and checkout to the required release branch

...

Image Added

Note    Note: If the repository is already cloned then the script will pull the updated code.

...

Ansible-playbook:

Install.yml

      An install.yml ansible playbook gets triggered where it triggers the required roles to build the following microservices images.

  • Ingestion-ms

  • Spec-ms

  • Generator-ms

  • Postgres-ms

  • Nifi-ms

  • Kong-ms

  • Nginx-ms

Image RemovedImage Added

compose.yml:

A       A docker compose ansible script gets triggered where it will up all the containers to running state.

      Note: The following commands can be used from the Ansible directory to down the containers and to start the containers, respectively.

  • docker-compose -f docker-compose.yml down

  • docker-compose -f docker-compose.yml up -d

Once      Once the installation is completed, You will be prompted with the following messages and required reference urls.

cQube Installed Successfully

Image RemovedImage Added

 We can check the containers running status by using following command

  • sudo docker ps

Image Removed

---------------- end -----------------------

Step - 1: Run install.sh on

<Image of what you will see>

Step - 2: There will a few configurations that need to be set up: <<Some description of configurations>>

<Image of what will be shown>>Image Added