Why it is not advisable to share a common build working directory for Bamboo Remote agents

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

This article explain why it is not advisable to share a common build working directory for Remote agents in Bamboo. It covers the potential challenges which the customers can face.

To understand how to change a build working directory for Bamboo Remote agents please refer How to change the build working directory location on a remote agent

There is a potential feature request raised for this, please refer BAM-25797 - Getting issue details... STATUS for more details. 

Environment

The article has been written with testing done on Bamboo 9.6.2 version but it is applicable for other supported versions as well. 

Solution

Below are the possible issues which we can foresee. 

Performance issue on the shared path

Multiple I/O operation by different Remote agent on the same shared path can cause performance issues, the way Remote agent works like copying and moving artifacts is different then local agents.

Issue with git_repository_cache path

If you have enabled caching on your linked repositories each agent maintains it's own version of cache for the repository and refresh it when the builds are trigerred, there might be a possibility where multiple builds for the same repository are running on multiple agents at the same time and trying to refresh the same cache folder because with common build working directory each agent will share the same repository cache folder. This might cause failure with repository cache refresh and can cause build failures. 

Problem with concurrent Builds

For Remote agent if you define a common build directory and multiple Remote agents are building the same build ( concurrent builds ), the build directory would not be distinguished in case of remote agents, it can cause problem because the same build directory would be updated by different agent at the same time, in case of local agents this is distinguished, see below

Local agent

/xml-data/build-dir/47972353/SCRIP-TIC-JOB1
/xml-data/build-dir/51347457/SCRIP-TIC-JOB1

In the above example there is agent_id populated before the job key, this is done by Bamboo internally. 

Remote agent

/xml-data/build-dir/SCRIP-TIC-JOB1
Problem with build-result.xml file

The build-result.xml is used when the agent is assigned a build and also when it can’t communicate with the server (build resiliency) so it can store its build state to be sent later to the server. with a common build working directory this file will be shared across multiple agents and the build status which needs to be transmitted to the Bamboo server will not be right. Currently this path is hardcoded in Bamboo and there is a feature request raised BAM-25624 - Getting issue details... STATUS to allow users to modify this path. 




Last modified on Jun 7, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.