Recently, several friends read my article asking how to make Jenkins distributed. I have explained this for a long time and found that this is also a good topic, so I will continue to read it on the blog.
This is very simple, so this article also introduces the simple points.
First, let's talk about several build frameworks supported by Jenkins:
1. I built and collectedMaster onlyFramework.
The Master-only framework mainly relies on Jenkins itself to operate on the server (databases on the server or not belong to the Framework), and builds (compile, package, test ). What it can do: A: allows the job to run on the master. B: allows a job to write data to the database. C: allows the job to update/Schedule Data and display it. 2. You built and collectedMaster-single slaveFramework.
This framework is used to solve the problem that a single server runs Jenkins and compiles, affecting the normal operation of Jenkins. This framework enables the Jenkins agent to reside on another server and change it to the Jenkins slave. The slave is used to run the job. Master to collect, transmit, and display data. 3. You built, I collectedMaster-Multi-slaveFramework.
The framework change mainly solves the problem of low efficiency when a single slave simultaneously compiles multiple branch software. N Jenkins agents reside on N servers, and the master uniformly schedules jobs to run on different slave servers. In this way, branch compilation does not affect each other, accelerating compilation and package preparation. The master is only used to collect and display data. 4. You build, we collect variousMulti-master-Multi-slaveFramework.
This framework is used to solve Jenkins performance problems caused by heavy Jenkins load. Multiple Jenkins are used as different masters and jobs are assigned to build on different slave instances. each master is responsible for different job fields and types. For example, Master 1 is a SCM package, master2 is dedicated for compiling, and master 3 is used for automated testing. The masters are still used to collect data and display information. This framework is the foundation of the next cloud build.
5. Cloud build This framework is a dynamic framework, one of which is 1-4. So there is no matching diagram here. When there are not many tasks, it may be 1-2. When there are many tasks, it may be 3. When the task is huge, it may be 4.
With cloud, server resources can be deployed at will, so you can apply for several instances on the cloud as the master, and apply for thousands of CPU slave for compilation at the same time. Compile the resources used to release the instance. The master only collects and displays data. When the master completes the task, the instance can also release the resources used.
The cloud build framework is used to save HW resources. A cloud service company can provide many other companies to use its services, thus reducing the total number of HW. The Compilation speed of thousands of CPUs is not comparable to that of servers.
After talking so much, do you see Cloud (dizzy?