TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

Build Agent

Last modified: 20 April 2023

A TeamCity Build Agent is a piece of software which listens for the commands from the TeamCity server and starts the actual build processes. It is installed and configured separately from the TeamCity server. An agent can be installed on the same computer as the server or on a different machine (the latter is a preferred setup for server performance reasons); an agent can run the same operating system (OS) as the TeamCity server or a different OS.

A TeamCity build agent contains two processes:

  • Agent Launcher — a Java process that launches the agent process

  • Agent — the main process for a Build Agent; runs as a child process for the agent launcher

An Agent typically checks out the source code, downloads artifacts of other builds and runs the build process. An agent can run a single build at a time. The number of agents basically limits the number of parallel builds and environments in which your build processes are run. An Agent can run builds of any compatible build configuration.

The TeamCity server monitors all the connected agents and assigns queued builds to the agents based on compatibility requirements, Agent Pools, Build Configuration restrictions configured for an agent and the selection algorithm described here.

Build Agent Status



In TeamCity, a build agent can have following statuses:

All agents connected to the server must have unique agent names.

Only users with certain roles can manage agents. See Role and Permission for more information.

For a build agent configuration, refer to the Build Agent Configuration section.

Agent Upgrade



A TeamCity agent is upgraded automatically when necessary. The process involves downloading new agent files from the TeamCity server and restarting the agent on the new files. In order to successfully accomplish this, the user under whose account the agent runs should have enough permissions.

Typically, an agent upgrade happens when: