Skip to content

group2gmca/groupProject

Repository files navigation

Prize Generator Application

Group Project Due 7th May 2020 at QA Academy Devops.

Index

Assignment Brief and Initial Solution

Risk Assessments

Architecture

ERD Diagram & Trello (Kanban Agile Methodologies)

Initial Plan

Implemented Solution

Deployment

Testing

Front-End & Build Design

Improvements

Assignment Brief

To create a micro-service orientated architecture for an application that composes of at least 4 services that work together incorporating core methodologies and technologies covered in our core modules during our time at the academy.

Solution

Our group solution is to create a Prize Generator application that allows the user to be assigned a username/account number when they visit the application, this username/account number can then be thrown into a prize generator to see if they have won a prize.

The prize generator will consist of 4 services running together. The first service will be the main API and be running the core application. This application will display a username/account no and will allow the user to navigate around via html pages.

The second service will be generating half of the username/account number, this service will generate a random object of a three or four character string that will be both uppercase and lowercase and will pass this back onto service 1.

The third service will be generating the second half of the username\account number which will be a selection of randomly generated numbers. This object will then be sent to back to service 1.

The fourth and final service will allow us to create 2 versions of the application, one version when it is feeling generous with the prize output and another where it is feeling less generous.

The output from service 2 and 3 will be concatenated to form one username/ account number. The backend will complete the logic to determine a prize and then this will be stored into a database along with a prize.

Risk Assessment

Initial Risk Assessment Risk

Risk Asessment 2 Risk

Architecture

Initial Architecture Plan Arch

Architecture V2 Arch2

Diagrams:

Entity Relationship Diagram erd2

Trello Kanban Agile Methodology erd2 Link to Trello

Initial plan:

The initial plan was to create our code in python using visual studio and use git as our version control system to be able to push to git as a team we were going to use the feature branch model to work together seamlessly. We planned on using Jenkins as our CI server which would autonomously push any changes made in our code linked to git using webhooks We also planned on using docker containers to run each of our micro services and link them together using docker swarm on master and worker nodes.
For testing we planned on using pytest to test the code and database. For the database section of the project we are going to use mysql/pymysql as it is commonly used and understood, other options available to us are to use CosmosDB.
For hosting our application we have two options Azure or GCP, also to spin up our application we have the ability to use Terraform and Kubernetes

Solution:

Following a revised look at the architecture (architecture V2 image) to create an app that satisfied the MVP first, we created a swarm of 1 manager and 2 worker VM's. The master created our 4 service application using a docker-compose file situated at the route. We then implemented crontab, which ran a script every 3 minutes checking if there had been new builds of our images in the docker registry. Our images would only be rebuilt if the source code on the master branch had been changed with a pull request. We used docker hub's functionality to create builds and configured this in our organisations build settings. Using all these together meant that each time there was a merge to the master branch, docker hub automated a build, our master vm searched for new images, updated images, replicated it across workers and because we had a load balancer- we had 0 downtime.

Deployment

DockerHub docker

CI PIPELINE CI This is our CI Pipeline

Testing

For the Testing we conducted tests on the code and database using Pytest. Here are some of our Coverage Reports coverage1 coverage2

Technologies Used:

  • Source code - Visual Studio Application
  • Languages - HTML CSS(BOOTSTRAP) PYTHON
  • Version Control - GIT
  • Project Tracking - Trello(Kanban System)
  • CI Server - Docker/Cron
  • Build Tool - Docker/Stack
  • VM - GCP
  • Database - Mysql container in Docker

Front end design:

Below are some screenshots of our Interface:

Main Page of our Interface

home

Prize Page showing No Prize Won

nowin

Prize Page Showing Small Prize Won

smallprize

Builds in Docker-Stack-Crontab

Screenshots of some of our builds in Docker-Stack-Crontab

jp1 Master VM with the docker stack deploy

jp2 Master showing the stack

jp3

jp4 Worker 2 VM with MY SQL on

jp5 Crontab using a 3 minute cycle to run .sh script to ensure stack is pulling latest images from Docker hub (organisational account – which in turn is puling source from git hub)

jp6 Sh file with script to run on times dictated by Crontab – added log files to monitor any issues

Improvements:

Improvements for the future (future sprints)

Although the application meets the MVP, In order to maximise the potential of our project there are a number of improvements/changes that can be made. Some of these changes are:

  • Use Jenkins as our CI server connected to a webhook as it is widely used and there is a lot of scope with CI Pipelines.
  • Use Kubernetes/Kubernetes Clusters - As it is a great orchestration tool, also there is a buzz surrounding Kubernetes at the moment and with its increased functionality the app would run efficiently and appeal to clients
  • Azure - Use Azure to host our application and use the built in functionality that Azure offers as it differs to GCP.
  • Spin up our application using Terraform to increase efficiency
  • Conduct futher Risk Assessments, User Stories and Testing

Authors:

Julie Pole - Fabia Fowler - Zahid Ali

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors