Overview
This topic explains the mechanics involved in scaling cloud helpers automatically using Autoscaling Groups, for Incredibuild for Windows and Incredibuild for Linux. The process involves these steps:- Create Security Groups
- Select or create a Helper AMI
- Create a Helper Startup Script (one or more)
- Create a Launch Template (one or more)
- Create an Autoscaling Group (one or more)
Requirements
To use autoscaling you must have:- An EC2 account, with enough permissions (see Permissions Required later).
- Access between your Coordinator and Initiators to the VPC where the helpers will run, over all relevant TCP ports (see System Requirements)
- If your environment is hybrid, see specific network requirements in Hybrid Environment Considerations.
- You have a working Incredibuild environment, either on-prem or in your VPC.
- You have a network connection between your Coordinator and Initiators to/from your VPC.
- You are experienced with Incredibuild technology.
- You are well versed in managing Amazon EC2 instances.
Step 1: Create Security Groups
The Helper you spin up needs to allow incoming traffic from the Coordinator and Initiators. The command below creates a dedicated Security Group which allows access to the necessary ports. You can remove RDP (3389), SSH (22) and ICMP if the environment is operational.Incredibuild for Windows
Use the following command: CopyIncredibuild for Linux
Use the following command: CopyStep 2: Select or Create a Helper AMI
Incredibuild for Windows using Windows-based Helpers
Use the Windows Server 2022 Base AMI for new instances (amazon/Windows_Server-2022-English-Full-Base-2024.10.09).
Instances launched using the Amazon AMI for Windows have unique host names, which is problematic for Incredibuild. If you want to use your own AMI, the launched instances inherit the host name from the AMI - make sure to include some method for renaming the instances.
Copy
Incredibuild for Windows using Linux-based Helpers (with SCL)
To improve performance, you will need a custom AMI that has Docker and the SCL container image.-
Create a small instance based on Linux with Docker, for example,
amzn2-ami-ecs-hvm-2.0.20241120-x86_64-ebs. -
SSH into the instance, and pull the Incredibuild container image. Do not create (run) a container as this will be done by the Autoscaling Group. Use the following command:
Copy
-
Shutdown the instance, and create an AMI (replace
BASE_INSTANCE_IDwith the ID of your helper): Copy -
Wait until the image is ready (should take about 15 minutes):
Copy
Incredibuild for Linux
Use the Ubuntu Server 24.04 LTS AMI for new instances (amazon/Windows_Server-2022-English-Full-Base-2024.10.09).
Copy
Step 3: Create a Helper Startup Script
The Launch Template you create will include the details about the image (Windows or Linux), the Security Groups for the Helper instances (so they can communicate with the Coordinator and Initiators) and a startup script (that downloads Incredibuild and installs the Helper software). Use the following example to create a startup script for Windows or Linux and convert it to base64 encoding (stored in the USERDATA environment variable). Then create the Launch Template. The following scripts assumes that COORD contains the persistent IP address or FQDN of the Coordinator.Incredibuild for Windows using Windows-based Helpers
Prepare the details for the template (the startup PowerShell script must be in base64 format). Starting with Incredibuild 10.24, add the option /Agent:SingleUse=True to the ibsetup command. Starting with Incredibuild 10.24, add the option /Agent:HelperAssignmentPriority to the ibsetup command, for support of hybrid setups (where Helpers exist both on-premises and in AWS). CopyIncredibuild for Windows using Linux-based Helpers (with SCL)
Prepare the details for the template (the startup PowerShell script must be in base64 format). CopyIncredibuild for Linux
Prepare the details for the template (the startup bash script must be in base64 format). CopyStep 4: Create a Launch Template
Create a Launch Template, using the following sample EC2 CLI command. The following script assumes thatUSERDATA contains the base64-encoded (as defined above), and AMI is the image ID for the helper instances you want to spin up (as defined above).
In the following script, replace the value of KEY with the name of the key pair to set the authentication to the Helper instances, replace the value of SEC with a list of security group IDs that allow access to the Helpers, and VOL with the size of the Helper disk (in GB).
Copy
Step 5: Create an Autoscaling Group
The Autoscaling Group you create will control the instance types you want (minimum/maximum vCPUs, memory, etc.), the distribution between on-demand and spot instances (including further options for selecting the instance types for spot instances to balance cost vs. performance), the range of vCPUS in the group (including thresholds when to spin up/down), and optionally a warm pool. Create an Autoscaling Group, using the following sample EC2 CLI command. The following scripts assume thatTMPLID contains the Launch Template ID (as defined above).
In the following script, replace the value of SUBNET with the ID of a network subnet where your helpers can be reached from the Coordinator and Initiators, and change the various Autoscaling Group options to match your grid acceleration requirements.
Copy
Hybrid Environment Considerations
If your Coordinator and Initiators run on-premises, then your environment is hybrid. There are a few key things to take care of so that your cloud Helpers will be able to function correctly and efficiently.Open TCP Access to the Coordinator
The Helpers running in the cloud need access to your on-premises Coordinator via TCP ports 8000, and one of 32103 (if to set communication to be encrypted, recommended) or port 31104 (if you choose to leave the communication unencrypted). Make sure to open these ports for incoming traffic in your network firewall.Set Helper Assignment Priority
To achieve the highest efficiency and save on cloud costs, give on-prem Helpers lower assignment priority than Helpers launches in the cloud VPC. A lower priority value means that the Coordinator would choose to use the on-prem Helpers over cloud Helpers. The simplest way to do this, is to use the Coordinator Manager and set the Helper Assignment Priority of the on-prem Helpers to There are additional policies that you can apply to the Autoscaling group. Alternatively, the Incredibuild installer includes the option to set the priority during the installation. Instead of the above, change the installation command above (in the Launch Template definition) to set their priority to 5.Performance Considerations
When you upgrade your Coordinator, update the Launch Template to install the same version on the Helper, and update the Autoscaling Group to use the new Template version. There are several ways to balance cost vs. performance (i.e. acceleration):- Reducing the instance warmup time means new instances will launch more quickly, which means they will be available to accelerate more quickly but may exceed the needs of the current build jobs.
- Likewise, reducing the CPU threshold will behave similarly.