Agent Capabilities and Requirements in Bamboo - Bamboo Tutorial

Welcome to the Agent Capabilities and Requirements in Bamboo tutorial. Bamboo agents are the worker machines that execute build and deployment tasks. Understanding agent capabilities and requirements is essential for efficient build distribution and resource utilization. In this tutorial, you'll learn how to configure agent capabilities, set up requirements for build plans, and avoid common mistakes related to this topic.

Introduction to Agent Capabilities and Requirements

Agent capabilities are attributes or features of an agent that Bamboo uses to determine which agent is suitable for executing a particular build plan. On the other hand, requirements define the characteristics that a build plan demands from an agent. By configuring capabilities and requirements, you can ensure that builds are assigned to agents with the necessary resources and software.

Step-by-Step Guide to Configuring Agent Capabilities and Requirements

Step 1: Set Up Agent Capabilities

The first step is to define agent capabilities on each Bamboo agent. Capabilities include software, tools, and resources available on the agent. To add capabilities, go to "Bamboo Dashboard" → "Overview" → "Agents," and click "Edit" next to the agent. Add relevant capabilities based on the agent's environment.


<agent>
  <name>My Bamboo Agent</name>
  <capabilities>
    <capability type="system.builder.command.Bash">/bin/bash</capability>
    <capability type="system.jdk.JDK">JDK 11</capability>
  </capabilities>
  <link name="<BAMBOO_SERVER_URL>/agentServer/agentDetails/viewAgentProperties.action?agentId=12345">http://<BAMBOO_SERVER_URL>/agentServer/agentDetails/viewAgentProperties.action?agentId=12345</link>
</agent>
  

Step 2: Configure Build Plan Requirements

Once agent capabilities are defined, you can set up build plan requirements to specify what a build plan requires from an agent. Go to "Bamboo Dashboard" → "Plan Configuration," select your build plan, and click "Configure." Under the "Requirements" tab, add the necessary requirements for the build plan.


<requirements>
  <requirement type="system.jdk.JDK">JDK 11</requirement>
  <requirement type="system.builder.command.Bash">/bin/bash</requirement>
</requirements>
  

Common Mistakes

  • Not properly defining agent capabilities, leading to incorrect build plan assignments.
  • Forgetting to set up requirements for build plans, causing builds to run on unsuitable agents.
  • Ignoring agent health checks, resulting in failed builds on malfunctioning agents.

FAQs

  1. Q: Can an agent have multiple capabilities?

    Yes, an agent can have multiple capabilities, such as different JDK versions or build tools.

  2. Q: What happens if a build plan has conflicting requirements?

    If there are conflicting requirements, Bamboo will try to select an agent that meets as many requirements as possible.

  3. Q: Can I assign specific build plans to dedicated agents?

    Yes, you can set up requirements to dedicate specific build plans to particular agents.

  4. Q: How can I monitor agent capabilities and requirements?

    Bamboo provides reports and logs to track agent capabilities, requirements, and build plan assignments.

  5. Q: Can I automatically install missing capabilities on agents?

    Yes, you can use Bamboo's automatic capability detection to install missing capabilities on agents.

Summary

Congratulations! You have successfully learned how to configure agent capabilities and requirements in Bamboo. By understanding these concepts, you can ensure that your build plans run on suitable agents with the required resources, optimizing build distribution and improving overall efficiency in your CI/CD process.