Skip to content

Service Bamboo

cintiadr edited this page Jun 29, 2025 · 35 revisions

Setup

Agents are using ansible and puppet. Both are in this repository. Follow the readme in both to update machines.

Bamboo server machine has OpenStack security group configured to only accept the IPs from bamboo agents.

Users are managed in Bamboo Server, with no integration whatoever with OpenMRS ID or crowd.

Bamboo artefacts are stored in S3.

License

Free license renewed every year.

Description of the service

Continuous Integration tool.

How to access it

(Agents are not accessible from any screen. The can be seen connected to Bamboo on https://ci.openmrs.org/admin/agent/configureAgents!default.action).

How to restart it

Server

$ service bamboo restart

If Bamboo Server is down for more than one hour, the agents need to be restarted as well.

Agents

$ service bamboo-agent1 restart

OR:

$ sudo su - bamboo-agent
$ ./bamboo-agent/bin/bamboo-agent.sh restart

Always use 'su -' instead of 'su', otherwise npm based builds will start failing due to https://github.com/npm/npm/issues/7563

Logs location

Server

/opt/bamboo/logs/catalina.out <- service logs /data/bamboo_home/logs <- application logs

Agents

/home/bamboo-agent/bamboo-agent/atlassian-bamboo-agent.log  # wrapper logs
/home/bamboo-agent/bamboo-agent/logs/atlassian-bamboo.log   # agent logs
/home/bamboo-agent/bamboo-agent/conf/wrapper.conf  <- configuration

Increasing agent storage

  • Disable the bamboo agent in bamboo, so it doesn’t run any builds
  • In terraform, change the vm.tf file to temporary allow destroying the data volume
  • Change the size volume for that instance in the variables file
  • Terraform plan/apply should destroy the volume, create a new one, and attach it to the VM
  • Fix your data volume to have the folders you want (e.g., rerunning puppet), and reenable the agent
  • Update VM terraform docs via ./build.rb docs && ./build.rb plan docs && ./build.rb apply docs to ensure Terraform'd VMs - OpenMRS community infrastructure is updated.

Troubleshooting

Bamboo server files

  • Bamboo is installed under /opt/bamboo/
  • The Bamboo home directory is /data/bamboo_home/

Agents running out of disk

  • Remove older kernels with apt autoremove
  • Remove older log files in /data/bamboo-agent/logs/atlassian-bamboo.log.*
  • Check cache files and delete:
    • du -sh /data/.cache
    • du -sh /data/.nvm
  • Clean docker space
    • Stop containers running: docker kill $(docker ps -q)
    • Prune docker data docker system prune -a --volumes

Agents - Maven file permissions

This arises because certain jobs run on Docker will mount the Bamboo agent's Maven cache, causing artifacts to be owned by the wrong user to be written to the cache. Bamboo then will be unable to remove these artifacts.

To diagnose:

  • List all affected files: find /data/.m2/repository -user root -exec ls -lsad {} \;

To fix:

  • sudo chown -R bamboo-agent:bamboo-agent /data/.m2/repository
Clone this wiki locally