Search This Blog

Saturday, August 31, 2024

Share DevOps Experience

Q: Tell how is the pipeline setup done in your organization? Share real life experience. 
Q: Please tell me what you have done so far in DevOps. What all activity experience you have.

=====================================================================================
Q: Tell how is the pipeline setup done in your organization? Share real life experience. 

Answer: I build the answer after discussing with my friend Varun and Ravi. Here I will try to capture the real-life scenario.


So lets begin with the pushing code to GitHub repository 

Considering we have some Feature to be implemented. So below will the basic branching strategy we have in GitHub. 

1. Main Branch- CD pipeline will trigger on this code always. 
2. User Story branch
3. feature branch. 





=====================================================================================

Q: Please tell me what you have done so far in DevOps. What all activity experience you have.

Answer:

In my recent project, I got a chance to migrate the GIT repository to Azure repository. It was complete end to end setup of pipeline for that new project. 

Setting up of Project and Repositories
We had a project which was written in multiple languages. It was microservice based project. Microservice were written in python and dotnet. It was basically a voting application where users were supposed to vote against the medicines and Doctor in hospital. 

My Responsibility was to Create a CI for above project. 
1st I created Docker file for projects where docker file was not present. Docker file will be used for building and creating a publish project. 

2nd we created a project on Azure Devops portal i.e https://dev.azure.com*.
Then I import the code hosted GitHub to Azure Repos. Out of multiple cloned branches, I set the main branch as default branch by going to the branch option on the left. 

3rd important thing is creation of Azure Container Registry, Where my outfile code will be stored. 

Creating a CI Pipeline
So I start with creating a pipeline, I choose Azure Repo as source code. 
Then I choose the Template for pipeline "Build and push an image to Azure Container Registery"
There I fill the Template file with values of my pipeline Steps and Tasks. 
Here I put the trigger as well. 

For Agent: I crated our own VM. Then there was proper documentation on how to make a VM agent for CICD pipeline. So we have our VM as agent. So high level, we ssh to the ubuntu VM and is tall a package as mentioned on documentation. 

As we know CI pipeline can be built on trigger Pull request PR) or commit has been made. In our case it was on pull request PR. So, what happen when a developer raises a PR all steps like UT, Static Code analysis, build of application and integration happens and Review has to only do the analysis of code changes done. he then merges the code. 

When the PR is raised by Developer following CI will trigger.
1. Unit Test the changes, 
2. Do the Static Code analysis,
3. Build the application, 
4. Run the e2e integration test cases, 

when the PR will be merged following CI (2nd CI) will be trigger:
5. Create a docker image: I created a "Dockerfile" for project in which developer had not created it. This is the file required to make a docker image of code. I created that docker file in the root directory of the Microservice. 

6. Push the image to ACR (Azure Container Registry)
7. Usually this will trigger CD on a Dev/ QA test environment.




Creating a CD Pipeline
As a part of CD pipeline following job was done. 
1. Take the copy of software from ACR and deploy it on VMs or Azure Kubernetes cluster. 


* its different from https://portal.azure.com. 

No comments:

Post a Comment

Q31-Q35