Article: XO Platform Botkit installation on AWS environment

This document outlines the procedure for installing the Kore.ai Experience Optimization Platform Botkit on AWS environment.

Steps to be followed for Installing Botkit on AWS:
To achieve complete automation of deployment within an AWS environment using the VM model, the following steps need to be adhered to:

  • Golden Image
  • Load Balancer
  • Elasticache (Optional)
  • DNS Requirements
  • Launch Templates
  • AutoScaling Group
  • Configuration Repository
  • Code Repository
  • CI/CD Automation

Golden Image:

  1. Initialize a fresh server with the following specifications, using either Amazon Linux 2 or a certified Base OS like CentOS / RedHat 7.x or newer:
    a. 4 vCPUs
    b. 16 GB RAM
    c. OS Disk (20 GB)
    d. Data Disk (50 GB)
    For AWS, it is recommended to choose the instance type m5.xlarge as it fulfils the mentioned criteria.
  2. Update all the OS-level packages using the command “yum update”
  3. Install Node.js by referring to the provided link for downloading and installing the compatible versions.

4. Install the most recent version of Nginx by following the installation instructions provided in the link below.
https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-open-sourc e/
5. Verify the successful installation of both packages by running the following commands:
Confirm Node.js installation with: node -v

Verify Nginx installation with: nginx –version
6. Create a DeployScript for fetching the build from the central repository and
extracting it to the data disk.
7. Establish the necessary startup scripts to initialize the services for both Botkit and
Nginx.
8. Configure Nginx to listen on port 80 and incorporate upstream configuration for
directing traffic to the corresponding Botkit instance.
9. Create the Golden Image.

LoadBalancer:

  1. Create a External(Internet-facing) ALB.
  2. Add Listener 443 & offload the respective SSL certificate (Preferably using ACM).
  3. Create a target group to configure the backend instances over port 80 and assign the
    same to the listener.

DNS Creation:

  1. Create an “A/CNAME Record” under your external facing domain & map it to the LB
    Elasticache (Optional)
  2. In case of Botkit having a Redis requirement, launch an AWS ElasticCache service for
    Redis with the respective capacity requirements.

Launch Template:

  1. Create a AWS Launch template with the Golden image.
  2. Configure the required VPC settings including the subnets, Security Groups, etc.,
  3. Under the “USER_DATA”, invoke the deployment script to deploy the latest build & start
    the services.
  4. Set the current version as the default.

AutoScaling Group:

  1. Create a new AutoScaling Group with the launch template with the default version.
  2. Configure all the other required settings as per your internal policies.
  3. Attach the target group to automatically attach the instance to the LB.
  4. Recommend to enable the SNS notifications for the launch/termination of the instances.
  5. Configure autoscaling policies to scale up with the CPU utilization threshold as per your
    internal policies.

Configuration Repository:

Maintain a configuration repository for the configurations for Botkit, Nginx, etc

CI/CD Automation:

  1. Create a CI/CD pipeline using Jenkins or any other automation tools as per your internal policies.
  2. Below are the steps for the deployments
    ● Checkout of the Botkit codebase to the local workspace.
    ● Check out the configuration files from the configuration repository.
    ● Install the NPM dependencies. (Optional)
    ● Create an Archive & push it to the central repository. (S3 Bucket / Artifactory, etc)
    ● Invoke the Deploy Script to deploy the bundle to the target systems in a rolling fashion.
    (i.e) Remove one of the servers from the LB, deploy the build, restart the services &
    attach it back to LB. Repeat the same to the other server.
    ● Additionally, you can configure the vulnerability scans in your pipeline before pushing the build to the target systems & add a condition based on the vulnerability report to proceed further.

Security Patching:

  1. Update your Golden image with the respective patches.
  2. Validate the application by launching a standalone server.
  3. Upon successful validation, launch new servers using the AutoScaling Group & terminate the old servers.