Why it is not advisable to share a common build working directory for Bamboo Remote agents
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
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.
環境
The article has been written with testing done on Bamboo 9.6.2 version but it is applicable for other supported versions as well.
ソリューション
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.