Milestone 2: OAuth, Containerization, Testing - airavata-courses/TeamAurora GitHub Wiki

Team Aurora - Project Milestone 2: OAuth, Containerization, Testing

Team Members:

Kushal Sheth (kmsheth)

Pratik Sanghvi (psanghvi)

Srikanth Srinivas Holavanahalli (sriksrin)

Vikrant Kaushal (vkaushal)

Instructions Manual:

Here we have provided the details regarding the Milestone 2 and how the run and execute the micro-services on EC2. We have also listed the points regarding what tools and methods we have used for this Milestone.

Prerequisites:

EC2 instance access

Valid Google account

Tools used:

Java: Maven, Jersey for REST APIs

Python: FLASK for python

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

Database: PostgreSQL

Testing: SOAP UI

OAuth: Google Services

Aim:

In continuation with the project, this milestone focuses on implementing an OAuth authentication, containerizing the micro-services and performing different tests such as unit testing, UI testing and capacity testing.

OAuth:

We have used Google services for implementing Open Authentication.

Generate a project in google console and enable the required services. For e.g. Google+ API.

Generate a Client ID by providing appropriate credentials.

Use this Client ID in the code to access the google services.

Once the user clicks on the “Sign in with Google” button, a google interface will come up asking for user authentication. It will ask the user regarding what details should be provided to the application and on allowing the certain details, user will be logged into the application.

Once logged in, if the user is new, the user details will be inserted into the database. System will verify whether the user has logged in through Google Services or by using the personal credentials.

Testing:

Here we have performed Unit Testing and Load/Capacity Testing.

For Unit testing, unit test cases are written for each services.

Also we perform unit testing using SOAP UI

For API testing, we are using SOAP UI

The results and plots for the Load Testing are in the issues. Issue is raised for each Micro-service Capacity testing

Containerization:

Each micro-service is contained in separate Docker. Whenever the service will be deployed on a fresh machine, it will first install Docker and then will run inside that Docker instance.

Dockers for different services are linked such that each service will communicate with the API Gateway.

##How to RUN: ##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.

Docker for each service will be deployed on the EC2 instance.

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

Step 2:

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://ec2-35-161-35-175.us-west-2.compute.amazonaws.com:8081/apigateway/jsp/login.jsp

The user credentials for authentication are:

Username : Teamaurora

Password : Teamaurora

Or user can use “Sign in with Google”

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.