GithubHelp home page GithubHelp logo

storeagles / building_cicd_pipeline Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 3.2 MB

This repo is for building CI/CD pipeline

Makefile 0.41% Python 5.70% Dockerfile 0.87% Jupyter Notebook 88.88% Shell 4.14%

building_cicd_pipeline's Introduction

Building_CICD_Pipeline

Overview

Python application test with Github Actions

This project will demonstrate Continuous Integration and Continuous Delivery (CI/CD) for a Python-based machine learning application using the Flask web framework. Automated code testing has been implemented using GitHub Actions. An Azure DevOps pipeline has been created to test and deploy to an Azure App Service.

Using this guide you will be able to perform the following:

  • Use Azure Cloud Shell to run the application
  • Deploy the application as an Azure App Service
  • Setup an Azure Pipeline
  • Load test the application using Locust

Project Plan

  • A link to a Trello board for the project
  • A link to a spreadsheet that includes the original and final project plan

Instructions

Architecture

alt text

Once the source code is pushed to GitHub, it triggers GitHub Action for testing. Meanwhile, Azure Pipeline is triggered to build and deploy the application to Azure App Service.

Set up Azure Cloud Shell

1. Launch Azure Cloud Shell from portal.azure.com

2. Create SSH-keys and copy to GitHub account

ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub
  • In GitHub, click on you profile, then click Settings | SSH and GPG Keys.
  • Click New SSH Key
  • Paste in the SSH key and give it a title.
  • Click Add SSH Key

3. Create project Scaffolding

alt text

git clone [email protected]:storeagles/Building_CICD_Pipeline.git

In order to create project scaffolding you should clone your GitHub repository to the Azure CLI. Then you can create Makefile, requirements.txt, virtual environment and project script file.

alt text

4. Make all

alt text

alt text

5. Configure GitHub Actions

alt text

Configuring SaaS build server like GitHub Actions is an essential step for any software project that wants to apply DevOps best practices. By automating build server with GitHub actions you complete the process of Continuous Integration.

6. Use Azure CLI to Deploy and Manage

alt text

alt text

This prediction script is responsible for sending some data to our application via the appropriate port. Each numerical value in here represents some feature that is important for determining the price of a house. This prediction also indicates that your application is running.

7. Load Test an Application using Locust

This locust test script is running a test against the deployed application.

alt text

CI/CD

Creating an Agent into AgentPool for a Pipeline

alt text

Virtual Machine service in Azure Portal is an agent. And this agent is associated with an Self-hosted AgentPool. The association is provided by personal access token (PAT).

Create Pipeline

alt text

alt text

alt text

Enhancements

We can also deploy our infrastructure as code by deploying terraform infrastructure with packer template.

Demo

A link Screencast on YouTube

building_cicd_pipeline's People

Contributors

storeagles avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.