Jenkins Architecture with Diagrams Tutorial (Explained). In this article blog we will explain what is Jenkins, its features and then move onto its architecture with diagrams phase.
Shall we start with Jenkins Architecture with Diagrams Tutorial (Explained).
What is Jenkins?
Firstly Jenkins is an open source automation tool written in Java with plug ins created for continuous integration purposes. It also allows you to deliver your software by integrating it with a wide range of test and implementation technologies. In addition Jenkins enables organizations to accelerate the software development process through automation.
With Jenkins it integrates all types of development lifecycle processes, including build, document, test, package, phase, deploy, static analysis and more. In addition Jenkins realizes seamless integration using plug ins.
For example, Git, Maven 2 project, Amazon EC2, HTML editor, etc.
The Jenkins is an open source automation server that allows you to build and test your software. It is a very popular tool in the DevOps community because it allows you to automate your software development process, thereby reducing the cost of manual testing and increasing quality.
Equally Jenkins is an open source tool with over 1000 plugins which makes it easy to configure and customize for any project. The best thing about Jenkins is that it is free, and there are no fees for using it.
There are over a thousand plugins you can use to extend Jenkins’ capabilities and make it user specific. All these plugins and extensions are developed in Java.
The companies Netflix and Google also use Jenkins with very little downtime. These companies have thousands of servers that need to be monitored by a single person or team of people who can maintain them at all times to ensure they run smoothly.
Features of Jenkins
- Well Jenkins is an open source automation server. It is designed to build, test and deploy software projects by automating all of the tedious or time consuming phases of a software project.
- More benefit is that Jenkins is completely free and open source (Apache Software Foundation). It runs on any operating system that supports Java Virtual Machine (JVM), including Windows, Linux, Mac OS X and Solaris.
- This tool has become an important part of modern DevOps teams due to its ease of use and extensibility. It can be used with any programming language or platform such as PHP or Ruby on Rails with no configuration required other than installing Jenkins itself.
3 Key Components of Jenkins Architecture are:
- Jenkins Agent Nodes.
- Jenkins Web Interface
The Jerkins master server is responsible to hold all key configurations.
It’s job is to handle
- Sending builds to slaves for actual execution.
- Recording and presentation results.
- A master instance of Jenkins can also run build jobs directly.
Jenkins Agent Nodes
Next are Jenkins Agents. They are the worker nodes that actually perform all the steps mentioned in a job. They are assigned to a job when you create it and they run the actual tasks.
For example: if you have an agent with Java 8 configurations, you can assign jobs that require a Java 8 environment to those agents. There is no uniform standard for the use of agents; you can configure a workflow and strategy based on your project needs.
Jenkins Web Interface
- Hear the requests from the Jenkins Master instance.
- Slaves can run on different operating systems.
- A slave’s job is to do as he is told, which involves carrying out tasks sent by the master.
You can configure a project to always run on a particular Slave machine or type of Slave machine, or you can just let Jenkins choose the next available Slave.
Refer to the diagram below for more better clarity:
Jenkins Master Slave Architecture
Example of Jenkins showing testing in different environment like MAC, windows etc.
The example above represents:
- What happens is Jenkins periodically checks the Git repository for any changes to the source code.
- Each build requires a different test environment, which is not possible for a single Jenkins server. To run tests in different environments, Jenkins uses different Slaves as shown in the diagram.
- Jenkins Master requires these Slaves to run tests and generate test reports.
How does Jenkins Master and Slave Architecture work?
Step 1. Click on “manage jenkins” and scroll to section of “manage nodes” section.
Step 2. Click on “New Node” in the left panel.
Step 3. Name the Node, select the “Permanent Agent” option and click on Ok.
Step 4. Enter the details of the node slave machine. Number of jobs that this slave can perform in parallel. Here we have kept it at 2. Labels whose name is entered as “Slave1” can be used to configure jobs to use this slave machine.
Select Use to use this node as much as possible. For the boot method, we select the option “Start agent by connecting it to the master”. If not visible, go to the Jenkins home page -> Manage Jenkins -> Configure global security.
Here, in the Agents section, click on Random and save it. You will now find the option you want. Enter the Custom WorkDir path as the slave node working space. Under Availability, select “Keep this agent online as long as possible” and Click on the Save.
After completing the above steps, the new node computer will initially be offline, but will come back online if all settings are entered correctly in the previous screen. You can disconnect the node slave machine whenever necessary.
Step 5. Now that your slave is operational, you can run a task on the slave. For this I already have an existing job and I will run this job on this slave.
Open this job and click Configure. Now, in the “General” section, click on “Restrict where this project can run”. Enter here the slave name in Label Expression and save it.
Now click on Build now and watch the output of this job. If everything is correct, you will see the output as Success.
Thank you for reading Jenkins Architecture with Diagrams Tutorial (Explained).
Jenkins Architecture with Diagrams Tutorial (Explained) Conclusion
It looks like a tree structure, but it’s not totally a tree structure. This makes it a little complicated to understand for the beginners.
So I have tried my best to explain each and every diagram and component with easy words for the beginners as well as advanced users also.