Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Please note that in order to run a TeamCity build agent, user account that is running the agent should have the privileges described below.

Network

  • Agent should be able to open HTTP connections to the server (to the same URL as server web UI)
  • Server should be able to open HTTP connections to the agent. The port is determined by "ownPort" property of buildAgent.properties file (9090 by default) and the following hosts are tried:
    • host specified in the "ownAddress" property of buildAgent.properties file (if any)
    • source host of the request received by the server when agent establishes connection to the server
    • address of the network interfaces on the agent machine

If the agent is behind NAT and cannot be accessed by any of addresses of agent machine network interfaces, please specify ownAddress in the agent config.

Common

  • agent process (java) should be able to open outbound HTTP connections to the server address (the same address you use in the browser to view TeamCity UI) and accept inbound HTTP connections from the server to the port specified as "ownPort" property in "<TeamCity agent home>/conf/buildAgent.properties" file (9090 by default). Please ensure that any firewalls installed on agent, server machine or in the network and network configuration comply with these requirements.
  • have full permissions (read/write/delete) to the following directories: <agent home> (necessary for automatic agent upgrade), <agent work>, and <agent temp>.
  • launch processes (to run builds).

Anchor
WindowsServicePermissions
WindowsServicePermissions

Windows

  • Log on as a service (to run as Windows service)
  • Start/Stop service (to run as Windows service, necessary for agent upgrade to work, see also Microsoft KB article)
  • Debug programs (for take process dump functionality to work)
  • Reboot the machine (for agent reboot functionality to work)

For granting necessary permissions for unprivileged users, see Microsoft SubInACL utility. For example, to grant Start/Stop rights you might need to execute subinacl.exe /service browser /grant=<login name>=PTO command.

Linux

  • user should be able to run shutdown command (for agent machine reboot functionality and machine shutdown functionality when running in Amazon EC2)

Build-related Permissions
The build process is launched by TeamCity agent and thus shares the environment and is executed under the same OS user that TeamCity agent runs under. Please ensure that TeamCity agent is configured accordingly.
See Known Issues for related Windows Service Limitations.

...

You can install build agents using any of the following installation options available:

After installation, please configure the agent specifying it's name and address of TeamCity server in it's conf/buildAgent.properties file.
Then start the agent.

When the newly installed agent connects to the server for the first time, it appears on the Unauthorized agents tab under Agents, where administrators can authorize it. This will connect the agent to the server for the first time.

...

  1. Make sure JDK 1.6+ is properly installed on the computer.
  2. On the agent computer, set up the JAVA_HOME environment variable to point to the JDK 1.6+ installation directory.
  3. Navigate to the Agents tab in the TeamCity web UI.
  4. Click the "Install Build Agents" link and then click "Via Java Web Start".
  5. Follow the instructions.
    Info

    You can install the build agent Windows service during the installation process or manually.

Anchor
installingBuildAgentsViaMSWindowsInstaller
installingBuildAgentsViaMSWindowsInstaller

...

  1. Navigate to the Agents tab in the TeamCity web UI.
  2. Click the "Install Build Agents" link and then click MS Windows Installer link to download the installer.
  3. Run the agentInstaller.exe Windows Installer and follow the installation instructions.
    Note

    Please ensure the user under whom the agent service is running has appropriate permissions

    Anchor
    installingBuildAgentsZip
    installingBuildAgentsZip

...

  1. In TeamCity Web UI, navigate to the Agents tab
  2. Click the Install Build Agents link and then click download zip file
  3. Unzip the downloaded file into the desired directory.
  4. Make sure that you have a JDK or JRE 1.6+ installed (You will need JDK (not JRE) for some build runners like IntelliJ IDEA, Java Inspections and Duplicates). Please ensure that the JRE_HOME or JAVA_HOME environment variables are set (pointing to the installed JRE or JDK directory respectively) for the shell in which the agent will be started.
  5. Navigate to the <installation path>\conf directory, locate the file called buildAgent.dist.properties and rename it to buildAgent.properties.
  6. Edit the buildAgent.properties file to specify the TeamCity server URL and the name of the agent. Please refer to Build Agent Configuration section for more details on agent configuration
  7. Under Linux, you may need to give execution permissions to the bin/agent.sh shell script.
    Info

    On Windows you may also want to install the build agent windows service instead of manual agent startup.

...

To configure agent to be started automatically, see corresponding sections:
Windows
Mac OS X
Linux: configure daemon process with agent.sh start command to start it and agent.sh stop command to stop it.

...

To run agent automatically on machine boot under Windows you can either setup agent to be run as Windows service or use another way of automatic process start.
Using Windows service approach is the easiest way, but Windows applies some constraints to the processes run in this way.
TeamCity agent can work OK under Windows service (provided all the requirements are met), but is often not the case for the build processes that you will configure to be run on the agent.

...

Warning
titleService system account

To run builds, the build agent should be started under a user with enough permissions for performing a build and managing the service.By default, Windows service in started under SYSTEM ACCOUNT. To change it, use the Services applet (Control Panel|Administrative Tools|Services)

...

TeamCity Agent is a Java application and it requires JDK version 1.5 or later to work (JDK 1.6 is recommended as further TeamCity versions will require 1.6 for the agent).
.exe TeamCity distribution comes with appropriate Java bundled.
For .zip agent installation you need to have Java installed (available via PATH) or available in one of the following places:

  • <Agent home>/jre
  • in the directory pointed to by JAVA_HOME or JRE_HOME environment variables.

Upgrading Java on Agents

If a build agent uses a Java version older than it is required by agent version, you will see the corresponding warning at the agent's page. This may happen when upgrading to a newer TeamCity version, which doesn't support an old Java version anymore. To update Java on agents you can do one of the following:

...

TeamCity treats equally all agents no matter if they are installed on the same or on different machines. However, before installing several TeamCity build agents on the same machine, please consider the following:

  • Builds running on such agents should not conflict by any resource (common disk directories, OS processes, OS temp directories).
  • Depending on the hardware and the builds you may experience degraded builds' performance. Ensure there are no disk, memory, or CPU bottlenecks when several builds are run at the same time.

After having one agent installed, you can install additional agents by following the regular installation procedure (see exception for the Windows service below), but make sure that:

  • The agents are installed in the separate directories.
  • The agents have distinctive workDir and tempDir directories in buildAgent.properties file.
  • Values for name and ownPort properties of buildAgent.properties are unique.
  • No builds running on the agents have absolute checkout directory specified.

Moreover, make sure you don't have build configurations with absolute checkout directory specified (alternatively, make sure such build configurations have "clean checkout" option enabled and they cannot be run in parallel).

...

If you want to install additional agents as services under Windows, do not opt for service installation during installer wizard or install manually (see also a feature request), then
modify the <agent>\launcher\conf\wrapper.conf file so that wrapper.console.title, wrapper.ntservice.name, wrapper.ntservice.displayname and wrapper.ntservice.description properties have unique values within the computer. Then run <agent>\bin\service.install.bat script under user with sufficient privileges to register the new agent service.
See above for the service start/stop instructions.



See also:

Panel
bgColor#FFFFFF
borderStyledashed

Concepts: Build Agent