In this project, you will build a Github repository from scratch and create a scaffolding that will assist you in performing both Continuous Integration and Continuous Delivery. You'll use Github Actions along with a Makefile, requirements.txt and application code to perform an initial lint, test, and install cycle. Next, you'll integrate this project with Azure Pipelines to enable Continuous Delivery to Azure App Service.
This repository contains project resources that I've created and the submissions folder contains:
project_plan
: Contains Project Plan Excel file.screenshots
: Contains required screenshot files.
It is critical to have an effective project plan and task tracking.
- Trello board for task tracking
- An Excel spreadsheet that includes the original and final project plan>
- Download project code into Azure Cloud Shell Go to Azure Portal and open Azure Cloud Shell then clone this repository
- Create and Activate Python virtual environment
$ python -m venv ~/.myenv
$ source ~/.myenv/bin/activate
- Install and execute test locally (Make sure you have
make
command installed)
$ make all
$ az webapp up -g Azuredevops -n <Your global unique web app name>
After execute above command the app will be deployed and result is displayed as following example:
Execute test against deployed application
Edit the host in file ./make_predict_azure_app.sh
to your application URL after successfully deployed. Then execute below command to test.
$ ./make_predict_azure_app.sh
Please follow this instructions to set up Azure Pipeline for the project. In general, the following steps need to be done:
-
Go to dev.azure.com and create an Azure Devops project.
-
Create a service connection to your Azure resources.
-
Create a pipeline with existing azure-pipeline.yaml file and change following variables:
azureServiceConnectionId
: '[YOUR SERVICE CONNECTION ID]'webAppName
: '[YOUR DEPLOYED AZURE WEB APP NAME]'environmentName
: '[ENV NAME THAT YOU WANT]'- Change the Azure Pipeline agent pool name of
pool: myAgentPool
The pipeline will be looked like this: Exammple of the run detail:
Successfull prediction after pipeline deploy the app:
$ locust -H <YOUR WEB APP URL>
Example:
$ locust -H https://flask-ml-service-258964.azurewebsites.net/
$ az webapp log tail
This pipeline can be enhanced as following:
- Deploy to multiple deployment slot for Dev, Test, Prod.
- Integrate with GitHub Action for CD.