As part of the Bamboo 2.6 announcement earlier this week, we wanted to offer a deep dive on several of the new features and improvements in Bamboo 2.6. This is the first of several posts highlighting one of the latest improvements to Bamboo and elastic instances: Automatically Managed Elastic Instances.
Bamboo has the ability to work with agents in the Amazon Elastic Compute Cloud (EC2) which was introduced in Bamboo 2.2. This feature allows you to utilise computing resources from the Amazon Elastic Compute Cloud (EC2) to run builds. Elastic Bamboo uses a remote agent AMI (Amazon Machine Image) to create instances of remote agents in the Amazon EC2. Builds can be run on these ‘elastic agents‘ in the same way that builds are run on remote agents behind the firewall. However, there was a shortcoming with this feature, Bamboo did not automatically start elastic agents to meet build demands. Bamboo 2.6 improves Elastic Bamboo with Automatic Elastic Instance Management allowing more dynamic control over elastic agents.
Automatic Elastic Instance Management will make it easier for administrators to control the usage of elastic agents.
- Automatically start and stop elastics instances – there is no longer a need to manually start and shutdown elastic agents.
- Schedule the start up and shutdown of the instances in an effort to predict busy periods.
- Save time and money by configuring the process to work for your needs.
- Continuous Integration infrastructure can grow and shrink to adjust to your needs – with minimal cost.
- For those already using Elastic Bamboo the new feature will save you money and decrease feedback loop time.
How It Works
In a typical Continuous Integration environment there are busy and quiet periods. During busy periods constant code commits trigger many builds, the builds are put in the queue and executed by Bamboo agents. An agent can execute one build at a time. Because there are usually a limited number of agents connected to bamboo it can take a long time for a build to be executed. On the other hand, during quiet periods (e.g weekends) agents are not utilised at all because there are no builds to be run.
The new Automatic Elastic Instance Management feature helps to solve the problem using elastic agents. Bamboo now checks the build queue and when it grows above configured thresholds it automatically starts new elastic instances that can run builds in the queue. The agents on the elastic instance will run the builds in the queue therefore decreasing the time a build spends waiting to be executed and ultimately making results of the build available quicker. Bamboo also regularly checks elastic agents, if it notices that an elastic agent has been idle and has not run a build for a while it will shut down the elastic instance and the agent running on it. Effectively the new feature decreases the cost of having elastic agents by using agents more effectively and at the same time it improves the feedback loop time.
How To Configure
In order to make use of the new feature you need to enable and configure Elastic Bamboo. Once it is done you can then allow bamboo to manage the instances by choosing one of the 3 presets or specifying custom settings for the algorithm. The preset options provide an easy way of choosing the right balance between costs and feedback loop time.
- Aggressive – increase build queue clearance rates but with higher elastic instance usage (higher costs).
- Passive – decrease elastic instance usage but with lower build queue clearance rates (lower costs).
- Default – balance the queue clearance rates.
For fine grained control it is possible to plug custom values into the automatic instance management algorithm. Bamboo will automatically manage your elastic instances based on the following criteria:
- Bamboo will shut down elastic instances which have been idle for more than the configured number of minutes (Idle Agent Shutdown Delay value). Instances running in the Amazon EC2 compute cloud are paid for in hourly blocks from the time they are started. Hence, to maximise usage of elastic instances, Bamboo only performs these checks just prior to the expiry of each hourly block.
- A maximum of “N” elastic instances can be started each minute, where “N” is the value configured as the Maximum Number of Instances to Start at Once.
- New elastic instances will be started when all of the following conditions have been met:
- There are at least X builds in a queue (Number of Builds in Queue Threshold).
- There is at least Y build in a queue that are executable on elastic images (Number of Elastic Builds in Queue Threshold).
- The average time builds have been waiting in a queue is at least Z minutes (Average Queue Time Threshold)
Get it today
Download Bamboo 2.6 to upgrade or get started with a free 30-day trial.