We’ve already seen what is Jenkins, In this post we will deep dive into Jenkins Architecture and understand Jenkins Architecture Diagram which is also called standalone Jenkins Architecture and Jenkins master slave architecture diagram which is also called Jenkins Distributed Architecture. If you haven’t read my previous tutorial Jenkins Introduction, I would suggest you to go through it if you are new to Jenkins. So let’s get started.
We can also define Jenkins as open source automated CI/CD tool written in Java for building and delivering the Software Product.
Jenkins Standalone Architecture
Let us understand how this Jenkins Architecture works,
In this a developer commits the code in source repository, and as soon as Jenkins server detects the change it will prepare the build, If the build gets failed it will notify the developer through Notifications or Emails about the failure of the build. If the build gets generated it goes through the series of testing After testing, Jenkins generates a feedback and then notifies the developers about the build and test results through Notifications or Emails.
But sometimes you need to test the build in multiple environment and we need multiple server for that or if the project is huge and multiple commits are happening in a day single server will not suffice our requirement we might need to generate multiple parallel builds. Hence for this Jenkins uses master/slave architecture to manage distributed builds.
Jenkins master slave architecture
Now we understood the requirement of distributed builds, So let us see what is Jenkins master slave architecture.
Jenkins master slave architecture has 2 components Jenkins Server which is Master and other component is Slave, Master and Slave communicate through TCP/IP protocol.
- Jenkins Server/ Master
- Jenkins Node/Slave/Build Server
- Jenkins Master schedules a build job.
- Master dispatches the build to the slave for execution of job.
- It monitors the slaves and record the build result.
- Master can also independently executes the job.
- Slave is a separate program called slave agent which is a java executable which runs on a separate machine.
- Slave gets request from the Jenkins master to run jobs.
- Jenkins is developed using Java and Java is platform independent thus Jenkins servers and nodes/slave can be configured in any servers including Windows, Linux and Mac, i.e OS Independent.
- You can always configure project to run on specific slave or let the master decide it.
In this Jenkins master slave, developer commits the code and each builds requires a different testing environment which is not possible for a single Jenkins server or In a huge project if multiple commits are happening we need to build parallel. So to perform testing in multiple environments or to run parallel builds Jenkins uses various Slaves.
So this was Jenkins Architecture in depth, let me know in the comment section if you have any doubts.