DevOps

This project is maintained by iankurgarg

CSC 519 Devops Milestone 3

Team Members

Deployment:

This task required us to set up a Jenkins server that will deploy iTrust and checkbox.io to remote servers.

Rolling Updates for iTrust:

Checkbox.io Production/Canary Server

This task required us to deploy checkbox.io on two different servers. One with production branch and one with some changes (a canary server).

We have created two different branches (production and canary)for this in the checkbox.io repository. The jenkins job for checkbox.io deploys these two versions on two different machines.

In total we have created 3 AWS EC2 instances for this task. (This is done in a single run of ansible script which also generates instances for itrust deployement)

The first server runs production branch code, the second server runs canary branch code. Each of them also run redis-slaves (explained below)
The third server runs the following things:

We also have a canary flag setup in redis which can also be used to enable/disable the traffic routing to canary server by load_balancer.

The files for load balancer are at ./roles/canary_load_balancer/files

Redis Setup + Feature Flags:

Feature Flag toggling has been implemented in this milestone through redis master-slave architecure topology. We have used 3 AWS EC2 instances designating 1 as the master and 2 as read-only slaves. The master-slave architecture has been configured in such a way that user can write data on Redis master only and Redis slaves will get the replica of the master data after authenticating themselves with master authentication password.

Redis master is run on one server and redis slaves are run on both production and canary nodes.

Redis is also being used to enable/disable a CanaryServer Flag which starts/stops routing of traffic to canary by load balancer.

Redis master and redis salve roles are present in: ./roles/redis-master
./roles/redis-slave

Nomad Server Setup:

We have setup up a 3 node nomad cluster (1 master and 2 client nodes) The inventory file for this is also generated automatically using ansible when the ec2 instacnces are provisioned.

We have used an ansible-galaxy role for setting up nomad: brianshumate.nomad
To run the checkbox.io server.js script as a nomad, we have used raw_exec driver of nomad. We have created a bash script run_job.sh which runs node server.js for checkbox.io.

We have created a common mongodb server for checkbox.io in the nomad master. Both client nodes connect to this server for database access.
This is done to ensure that when a client node dies and nomad restarts the job on another node, the database is still the same and no data is lost.

The mongo db setup role is at ./roles/mongo-setup/files
The files service.nomad, run_job.sh are present in ./roles/nomad-cluster-setup/files

Screencasts:

Contributions