Jenkins Jenkins Distributed Builds 1 — Questions and Answers
Question 1: What is a Jenkins agent (formerly called a slave)?
- A machine that runs build jobs delegated by the Jenkins controller (Correct answer)
- A user account with limited permissions
- A secondary Jenkins installation
- A Docker container on the controller
Correct answer: A machine that runs build jobs delegated by the Jenkins controller
A Jenkins agent is a separate machine (physical, VM, or container) that the Jenkins controller connects to and delegates build execution.
Question 2: What are the two primary methods for connecting a Jenkins agent to the controller?
- JNLP (inbound/WebSocket) and SSH (Correct answer)
- HTTP and FTP
- SMTP and IMAP
- REST API and CLI
Correct answer: JNLP (inbound/WebSocket) and SSH
Jenkins agents connect either via SSH (controller initiates connection) or JNLP/WebSocket (agent initiates inbound connection to the controller).
Question 3: What is a Jenkins 'label' used for in the context of distributed builds?
- Tags agents with capabilities so pipeline stages can target the right agent type (Correct answer)
- Names the agent for display in the UI
- Sets the agent priority in the build queue
- Defines the agent's workspace path
Correct answer: Tags agents with capabilities so pipeline stages can target the right agent type
Labels are tags assigned to agents (e.g., 'linux', 'docker', 'windows') that allow pipeline stages to request a specific type of agent using `agent { label 'linux' }`.
Question 4: What happens to a Jenkins build when no agent matching the requested label is available?
- The build stays in the queue until a matching agent becomes available (Correct answer)
- The build fails immediately
- The build runs on the controller
- The build is reassigned to any available agent
Correct answer: The build stays in the queue until a matching agent becomes available
Jenkins queues builds that cannot find a matching agent and starts them as soon as an agent with the required label becomes available.
Question 5: What is the difference between an online and offline Jenkins agent?
- Online agents are connected and available for builds; offline agents are disconnected and cannot accept builds (Correct answer)
- Online agents run 24/7; offline agents run only during business hours
- Online agents use cloud; offline agents are on-premises
- Online agents are faster than offline agents
Correct answer: Online agents are connected and available for builds; offline agents are disconnected and cannot accept builds
An online agent has an active connection to the Jenkins controller and can be assigned builds, while an offline agent is disconnected and will cause builds to wait in the queue.
Question 6: What is the purpose of setting a 'Remote Root Directory' when configuring a Jenkins agent?
- Defines the file system path on the agent where Jenkins stores workspaces and temp files (Correct answer)
- Sets the root of the agent's SCM checkout
- Defines the Jenkins controller's URL from the agent's perspective
- Sets the user home directory on the agent
Correct answer: Defines the file system path on the agent where Jenkins stores workspaces and temp files
The Remote Root Directory is the base path on the agent machine where Jenkins creates workspaces, archives, and temporary files during builds.
What is a Jenkins agent (formerly called a slave)?