Do you understand deployment pipelines?

Abstract: This article will take you to experience the deployment pipeline practice.

This article is shared from the HUAWEI CLOUD community " Do you understand the deployment pipeline? ", Author: Agile Xiaozhi.

What is a deployment pipeline

Deployment pipeline, also known as continuous integration pipeline and construction pipeline, refers to the automated delivery process of software from product library to users. It usually includes code submission, build, deployment, testing, and release. The deployment pipeline realizes the orchestration and automatic execution of continuous development, continuous testing, continuous integration, continuous deployment and continuous monitoring activities in the DevOps mode, obtains timely feedback of results, and achieves business agility.

How to build a pipeline

pipeline design

To build a deployment pipeline, we must first determine the content of each link of the pipeline according to the software architecture and business characteristics. The following is the process design of a product development. From the big framework, it needs to include the links of building, deploying, testing and releasing. The construction includes code submission, local construction, cloud construction, static inspection, and unit testing; deployment includes the deployment of the test environment, and the deployment of α, β, and γ environments. Test implementation in various environments, among which "Dog food" is a culture of Internet companies, which refers to self-development and self-use, that is, deploying to the intranet environment for everyone to use; publishing includes implementing according to the publishing strategy. release. As shown below.

Automatic realization of each link

After the process is determined, it is necessary to realize the automation of integration, delivery, deployment and release. Automation does not mean that human participation is not required, but it turns complex, error-prone and repetitive steps into reliable automated steps.

Create a pipeline

Finally, all links are unified into an assembly line, and quality access control is set to realize the function of triggering automatic deployment after submitting code.

To realize the construction pipeline, the team needs to have good basic service support, including configuration management, scripts that can realize automatic configuration, etc. Many industry-leading Internet companies have adopted cloud-based basic support services, and the frequency of server-side program deployment is very fast. According to the records in the book "Phoenix Project", the website deployment frequencies of the top Internet companies in the industry are as follows:

In addition, team members must abide by common rules. For example, code changes will be added to the pipeline. If errors occur, they should be suspended in time, and then continue to wait until the problem is solved. Team members need to brake and abide by them together.

The advantages of pipeline

Improve delivery efficiency

The pipeline orchestration customer realizes the seamless combination of CI and CD, and iterates quickly, allowing the value flow to flow quickly and adapting to frequent changes in market demand. The end-to-end pipeline makes each process transparent and visualized, and team members can obtain the required information at any time, which version has a problem and rollback, and the stage of the current version. At the same time, visualization can also find bottlenecks in the process, optimize and adjust, so as to make the pipeline evolve continuously and improve the delivery efficiency.

Guarantee quality

Each link of the pipeline will have feedback to achieve a complete and rapid feedback loop, and the team will get feedback, which is conducive to timely improvement and quality assurance; and each link can be set up with quality access control to achieve layer-by-layer quality assurance.

Strengthen team building and improve organizational culture

All aspects of the assembly line allow development, testing, and operation and maintenance personnel to participate and collaborate together to break down the barriers between departments, improve the company's organizational culture, and enhance employees' sense of participation.

DevCloud Practice

HUAWEI CLOUD DevCloud provides a one-stop end-to-end deployment pipeline: after a user submits code, the pipeline is automatically triggered to perform tasks such as compilation, build, and code inspection; configure multiple automated tasks such as build, code inspection, deployment, and testing to complete one-click The whole process of outsourcing, release and online production; regular execution every day to ensure the quality of the project.

Take the quick-start pipeline as an example. In this pipeline, there are three links: code inspection, construction, and quality access control settings. Code inspection and construction are already created tasks, and quality access control can be created at the same time as the pipeline is created. The following demonstrates how to create and execute a pipeline.

1. Go to the created project, click "Build & Publish > Pipeline" in the top navigation bar to enter the pipeline.

2. Click "New Pipeline" in the upper right corner to enter the "Create Pipeline" page. Fill in the basic information, select a template, and select a code source according to the interface prompts, and then click Next.

3. Enter the workflow configuration page, in the build phase, select the type as "Code Inspection", and then add the created code inspection task.

Then follow the same method to add the created build task.

4. Click Quality Access Control under Quality Access Control, select the "Access Control Task" type, and then click "Click to Create".

5. Fill in the access control name (eg: test01 ), turn on the “CodeCheck Questions” switch of the access control item corresponding to the code inspection task, save and select the created access control.

6. After the task configuration is complete, click "Save" to enter the pipeline details page, click "New Execution", and execute the pipeline with one click.

7. After the execution is complete, view the execution result. Click the symbol next to the build task to download the build package automatically built by the pipeline.

8. Configure Codehub source code repository triggers to automatically trigger pipeline execution after submitting code. Go to the Create Pipeline > Select Code Source page or the Pipeline Configuration > Add Code Source page to configure Codehub triggers and Codecloud triggers respectively.

Expand "More Settings" and select the specified branch of the associated warehouse in the trigger branch, such as "master". The trigger takes effect immediately after saving the pipeline. When code is submitted in the specified warehouse branch, the associated pipeline will be automatically triggered to execute.

Usually, the pipeline of a project is not only the above items. According to the business characteristics and software architecture, the arrangement of the workflow is different from each other, but basically it includes the construction, deployment, testing, release links, and the tasks of each link. Settings will vary. The following figure shows an example of a team's deployment pipeline.

Status Quo of Domestic Enterprise Deployment

According to the Survey Report on the Status Quo of DevOps in China (2021), about 60% of the respondents are located in enterprises whose deployment frequency is 1 week to 1 month, an increase of nearly 10% compared to 2020. Only 16.21% of enterprises can deploy in production environment multiple times a day; in addition, 9.33% of enterprises deploy more than 1 month.

Data source: China Academy of Information and Communications Technology

From the above survey data, it can be seen that the deployment frequency of domestic enterprises in 2021 has increased compared with 2020. In the current VUCA era, in order to cope with uncertainty, we need to improve our business agility, run small steps, and get timely feedback. Therefore, it is essential to increase the frequency and efficiency of deployment through automation and pipeline technology. It is a general trend to introduce a cloud platform, simplify deployment and orchestration operations, and allow teams to focus more on business research and development.

 

Click Follow to learn about HUAWEI CLOUD's new technologies for the first time~

{{o.name}}
{{m.name}}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324069637&siteId=291194637