This project, 'Building a CI/CD Pipeline' is created as part of the Advanced Data Engineer Nano degree program offered by Shell as a scholarship program to train and hire data engineers
This project contains a python application that is designed to predict housing prices in Boston.
- Deploy the app in Azure CloudShell
- Deploy the app as an Azure App Service
Commiting to this repo will trigger
- Github Actions to run tests
- Azure Pipeline to Build and deploy flask app to Azure App service
Here is an architectural diagram:
Trello Board for task tracking : Trello
Spreadsheet for project planning : spreadsheet
Youtube link for the demo : link
Clone the repo to azure cloud shell:
git clone [email protected]:bobfoster1299/building-a-cicd-pipeline2.git
Change into the new directory:
cd cicd-pipeline-for-flask-azure-webapp
Create a virtual environment:
make setup
Activate the virtual environment:
source ~/.udacity-devops/bin/activate
Install dependencies in the virtual environment and run tests:
make all
Start the application in the local environment:
python app.py
Open a separate Cloud Shell and test that the app is working:
./make_prediction.sh
The output should match the below:
Create an App Service in Azure. In this example the App Service is called flaskapp-shankar and the resource group is called cloud-shell-storage-centralindia:
az webapp up -n flaskapp-shankar -g cloud-shell-storage-centralindia
Screenshot of the App Service in Azure:
Create a pipeline in Azure DevOps.The basic steps to set up the pipeline are:
- Go to https://dev.azure.com and sign in.
- Create a new project.
- Under Project Settings create a new service connection to Azure Resource Manager, scoped to your subscription and resource group.
- Create a new pipeline linked to your GitHub repo.
Screenshot of a successful run of the project in Azure Pipelines:
To test the app running in Azure App Service, edit line 28 of the make_predict_azure_app.sh script with the DNS name of your app. Then run the script:
./make_predict_azure_app.sh
If it's working you should see the following output:
You can also visit the URL of the App Service via the browser and you should see the following page:
- Separate deployments for development and production applications