Bamboo Remote Agent - Capability Auto Detection
Asked by Adam Myatt:

I've got a remote agent running on Linux that I use a custom bamboo-capabilities.properties file in the agent's bin directory to define numerous capabilities local to the agent. This seems to work fine. I can't locate it at the moment, but previously saw documentation somewhere that said if you want to do this, and prevent Bamboo agent from automatically detecting capabilities to use a switch in the wrapper.conf of the agent like this :

wrapper.java.additional.4=-DDISABLE_AGENT_AUTO_CAPABILITY_DETECTION=true

When I view the agent in the Bamboo Admin agent panel it detects an old Ant install at /usr

I delete this capability from the admin agent page and add this to bamboo-capabilities.properties :

system.builder.ant.Ant=/opt/tools/apache-ant-1.8.3

and restart the agent. Yet it resets the "Ant" capability to /usr and not to the custom defined option.

Is using DISABLE_AGENT_AUTO_CAPABILITY_DETECTION correct? Am i missing something else?

Environment :

Bamboo 4.1 : JDK 1.6 and Linux for both Bamboo and agents.


Answers:
author: Sultan Maiyaki
body: Hi Adam,

Thanks for the d info and detailed test. I have actually faced this issue recently and it appears the -DDISABLE_AGENT_AUTO_CAPABILITY_DETECTION=true property should be added to the Bamboo server and not the agent. This is a kind of misunderstanding. place it in the wrapper.conf file of bamboo server and restart both server and agent and see if it works.

comments: author: Adam Myatt
body: Yup, that did it. I set that property in the SERVER's wrapper.conf, restarted Bamboo, then deleted the capabilities for agent3 and restarted the agent. The capabilities were NOT auto detected.

That being said I think there is value to having the flag at the server level, but also HUGE value to having it at the AGENT level. If you're running 25-100 remote agents (we run 100) we have multiple teams running agents and some want auto-detected capabilities and don't care to manage them; other teams want explicit control of the capabilities defined on their agents they operate and want NO auto-detection. I'm going to log a Jira request improvement for this. Thanks for following up.


author: Sultan Maiyaki
body: You are most welcome Adam and I cant agree more than that. Please do paste the improvement request URL here for future reference by other users


author: Sultan Maiyaki
body: Hi Adam,

Can you try another approach of re-installing the agent with this command:  
`java -Ddisable_agent_auto_capability_detection=``true` `-jar atlassian-bamboo-agent-installer-``2.2``-SNAPSHOT.jar http:``//bamboo-host-server:8085/agentServer/`

comments: author: Adam Myatt
body: Sultan - the flag doesn't make a difference. I am now trying on Bamb00 4.4.

I installed a remote agent (agent1) as a control without any special flags. It started and showed up in the agent list and had fully detected the JDK, GIT, etc I had on my system, as expected.

I installed a remote agent (agent2) passing the flag you mentioned, -Ddisable_agent_auto_capability_detection=`true` The agent installed and started fine, showed up in the agent list, but it also had fully detected all my system's capabilities. I looked in the wrapper.conf and it did NOT have the flag anywhere specified in it.

I installed a remote agent (agent3) passing the flag on the command line as you mentioned, and then going into the agent3's wrapper.conf and manually adding :

wrapper.java.additional.3=-DDISABLE_AGENT_AUTO_CAPABILITY_DETECTION=true

to ensure it was there. I then started that agent3 fore the first time and went into admin agent section. Viewing the agent I can see it too auto detected all the capabilities. As a test, I manually used the Delete link to delete all the capabilities then restarted the agent3. After restart it still auto-detected all the capabilities.

I then used the command line install process to run a new remote agent (agent4) but did NOT pass the 'install' or 'installntservice' flag so that the agent would start and DID pass the -DDISABLE_AGENT_AUTO_CAPABILITY_DETECTION=true flag on that same command line. The agent started as expected and in the agent details I could it too fully auto detected the capabilities.

All this testing was done on Windows 7, but I have observed this with Bamboo running on Windows Server 2008 with Agents installed both on Windows 2008 and Linux. Seems the flag in general doesn't work.


author: Adam Myatt
body: Jira Improvement Ticket : <https://jira.atlassian.com/browse/BAM-12894>


Tags: ant

capability

remote-agent