Milestone 1: Microservices with DevOps - airavata-courses/TeamAurora GitHub Wiki

Team Aurora - Project Milestone 1: Microservices with DevOps

Team Members:

Kushal Sheth (kmsheth)

Pratik Sanghvi (psanghvi)

Srikanth Srinivas Holavanahalli (sriksrin)

Vikrant Kaushal (vkaushal)

Instructions Manual:

The application is regarding the Weather Forecast System. It has been developed in multiple languages with REST APIs. Here you will find a complete step-by-step guide to install the application and to get up and running.

Prerequisites:

EC2 instance access

Tomcat8, Python3.4, pip3.4 installed on EC2 instance

Tools used:

Java: Maven, Jersey for REST APIs

Python: FLASK for python

CI/CD: TRAVIS CI, AWS S3, AWS CodeDeploy, AWS EC2

Database: PostgreSQL

Aim:

The aim of this milestone was to design a system that can be used for Weather Forecast System using web services in multiple languages. We used TRAVIS CI and AWS CodeDeploy for continuous integration and continuous deployment. We developed following web services to support the system:

API Gateway:

It is the main controller for the entire application. In our architecture style, once the user is authenticated via a login form, all the calls to other micro services will go through API Gateway.

Data Ingestor:

The data from “client.jsp” form will go to Data Ingestor service. This will also be entered into the registry. The dataingestor service will make a URL from the data and send the data back to the API Gateway and the registry.

Storm Detection:

The Storm Detection service will get the URL data from the API gateway and will extract the “.kml” file for the given location. It will send the “.kml” file as a string object back to API Gateway and make entry to the registry.

Storm Clustering:

The Storm Clustering service will get the kml data from API Gateway and and it will form the clusters from available data. This service will send this data back to API Gateway and also make entry to registry.

Forecast Trigger:

Forecast Trigger will get the clustered data from the API Gateway. Currently as a mock service, it will use a random function to decide whether the storm exists or not. Whether or not, if storm exists, it will send the message to API Gateway and make appropriate entries in registry.

Registry:

This is the database that will log all the activities for the user. It will have a userid, requestid, service name, input and output fields.

How to RUN:

In our architecture all the services are independent, and only the service that has some change in it will be deployed again and there won’t be any effect on other services. Each service has its own ‘.travis.yml’ and ‘appspec.yml’ file

Step 1:

Go to https://github.com/airavata-courses/TeamAurora. In branches menu, open feature-apigateway branch. Make edit to ‘Edit Me.txt’ file inside the branch. This will trigger the TRAVIS CI and it will start deploying the service. It will upload the zip folder to S3. Along with this, AWS CodeDeploy is configured to deploy the service on EC2 instance.

Once the TRAVIS CI successfully build the service, go to branch Feature-DataIngestor and make some changes to ‘Edit Me.txt’ and commit the changes. This will trigger the TRAVIS CI.

After successful build, go to Feature-StormDetector branch and make changes to ‘Edit Me.txt’ and commit the changes. This will trigger the TRAVIS CI.

After successful build, go to Feature-StormClustering branch and make changes to ‘Edit Me.txt’ and commit the changes. This will trigger the TRAVIS CI.

After successful build, Feature-ForecastTrigger branch and make changes to ‘Edit Me.txt’ and commit the changes. This will trigger the TRAVIS CI.

NOTE: DO NOT MAKE CHANGE TO ‘Edit Me.txt’ UNTILL THE PREVIOUS SERVICE IS SUCCESSFULLY BUILD AND DEPLOYED BY TRAVIS AND CODEDEPLOY.

Step 2:

On EC2 instance, install following:

Tomcat8:

sudo yum install tomcat8

Python3.4:

sudo yum install python34

Pip3.4:

sudo yum install python34-pip

Step 3:

At the end of this cycle, the entire system is up and running on the AWS EC2 instance. You can visit the service at http://52.25.98.23:8080/apigateway/jsp/login.jsp

The user credentials for authentication are:

Username : Teamaurora

Password : Teamaurora

All the services will run one after another and make appropriate entries into the registry. At the end a page saying “Storm Exists” or “No Storm” will be displayed.