Skip to content

elsahib/DevOps

Repository files navigation

Soccer Players Tracker

A solo project to fulfill the DevOps Fundamentals Project Specifications

Index

Brief

The client ( My Step-Son ) wanted an application to help him keep track of certain premier league players and save some details that he will later on perform statistical calculations on to help him predict the player’s future performance,He wanted the freedom to add or remove players as needed and also the freedom to edit or remove certain stats on certain dates for certain players.

Solution

To workout the solution utilising the supporting tools, technologies and methodologies covered during the training in the academy, I’ve decided the following:

  • Adopt Agile methods to manage my project
  • Perform risk assessment using the outline covered during the training
  • Implement kanban method using Trello
  • Build database ERD using Draw.io
  • Create Git repository to be my VCS
  • Use MySQL server, HTML5, CSS3 , Python, Flask and a few more python modules to build and test the application (refer to the requirements.txt for more details )
  • Host the Application ( MySQL Database Server, Linux Web Application Server and Linux server hosting the automated deployment server for continuous integration ‘Jenkins’ ) on Google Cloud Platform ( free tier )
  • Test the application
  • Deploy the application

Let's cover as much as possible from above

Risk Assessment

Risks Likelihood Impact
Wrong interpretation of client needs Low High
Lack of Technical knowledge Medium Medium
Automation causing issues Low High
Exposure of sensitive information Low High
Running out of GCP credit Low High
Wrong interpretation of client needs

This risk was mitigated by having regular meetings with the client throughout the development cycle to ensure that the product is meeting the client expectations.

Lack of Technical knowledge

This risk was mitigated by constantly reviewing each step and referring to documentations and best practices provided in the training and from other sources

Automation causing issues

This risk was mitigated by testing the automation process with a simple ‘Hello World’ application to ensure that the CI Pipeline is functional, Also keeping the server on to avoid having the IP address change

Exposure of sensitive information

This risk was mitigated by using the best practice of exporting sensitive information as variables for each administration session only. This way sensitive information will not be part of the application code on git hub ( although currently it shows on Jenkins console log, trying to figure out a way to hide it from there also )

Running out of GCP free Balance

This one was mitigated by using micro VM instances as they don’t cost much

Kanban Board

To create a back-log for the application and to also keep track of my progress while developing the application, I used Trello Board. It contained all the user stories and my To Do list. It gets updated regularly.

Trello Board

Entity Relationship Diagrams

Initial ERD plan

Initial ERD

Delivered ERD solution

Final ERD

Testing

The Testing for the application was done using pytest in conjunction with selenium module, the test only covered the pages that didn't require login using the backend test. but using selenium a test to the login protected was performed successfully although it doesn't show on the coverage report. Coverage Report

Deployment

Application deployment is automated using a webhook from github to the CI server Jenkins. Whenever a commit is made to the master branch, the CI server is notified and it will grab a copy of the changes build and deploy it to the application server, it can be better visualised looking at the diagram below.

CI Pipeline

Relevant information and links

To get this app running locally on an ubuntu machine below are extra things to consider.

  • Install Python 3.
  • Install Python3-venv.
  • A secret Key exported to your terminal session.
  • MySQL Server 5.7 contains an empty database.
  • A Database URI exported to your terminal session.
  • Install Requirements.txt in a virtual environment and activate it.
  • Run the Application.

User Web Interface

Home Page without Login

Coverage Report

Home Page for a Logged in user

Coverage Report

Stats View Page

Coverage Report

Players View Page

Coverage Report

Update

you can now run it on docker using the image which is alreayd on docker hub 'elsahib/devops' use this command to have it running in development server:

    1. export your Database URI and secret key to your shell session
    1. run the commnad docker run -d -p 5000:5000 -e SECRET_KEY -e DATABASE_URI --name devops elsahib/devops
    1. visit in your browser visit 'http://you_docker_server_IP:5000/'

You can also deploy it on AKS unsing the devops.yaml file. you will need to substitute the values for the DATABASE_URI and SECRET_KEY with your exported values using this command sed -e "s,{{DATABASE_URI}},$DATABASE_URI,g" -e "s,{{SECRET_KEY}},$SECRET_KEY,g" devops.yaml | kubectl apply -f -

Author

Osman Elsahib

Acknowledgements

My deepest regards and appreciation goes to the QA Academy team, and even more special regards goes to my direct trainers for their wonderful delivery of the training materials and their non-stop support.

About

Solo Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •