Limitations
- Only the Incredibuild Coordinator and Initiator Agents can be run in K8S . The Incredibuild Coordinator can be either in or outside of K8S. Incredibuild Helper Agents cannot be in K8S.
- Build Cache is not supported for Initiators running in K8S.
- Initiators spun up using K8S will automatically be associated with the Default Build Group. Using other Build Groups for K8S machines can be done using the CLI.
-
Typically, build servers running in CI are torn down (i.e. destroyed) when the build job is finished, which means:
- The build history database and the build logs are lost, unless you collect these and store them in some log collection repository.
- The build monitor is only available during the build, and the agent will disappear from the coordinator agent list once the container is terminated.
Setup the Incredibuild Environment
-
Obtain SUVM licenses.
- Since build servers running in CI are typically torn down (i.e. destroyed) when the build job is finished, you will need SUVM licenses for enough cores to support the maximum concurrent build jobs. For details, see Single-Use Virtual Machine (SUVM) Licenses.
-
Deploy Incredibuild in your environment:
- Deploy an Incredibuild Coordinator (can be in or outside of K8S).
- Deploy a set of Incredibuild Helper machines, AKA the helper grid outside the K8S cluster (can be bare metal, VM, or cloud).
- The Incredibuild initiator agents (inside K8S) need network access to the Coordinator and all Helper agents. Make sure that the relevant TCP/IP ports are open, see Hardware and Network Requirements
Modify or Create a Kubernetes Image to Deploy an Incredibuild Initiator
You probably already have a build-server golden image, with a Linux distribution, compilers, and make system. The following Dockerfile represents a typical build-server golden-image (without Incredibuild): Copy-
Add the following lines to the Dockerfile to install Incredibuild before the compilation command, but change IB_VERSION and IB_COORDINATOR to match your Incredibuild Coordinator:
Copy
- If you want to use the user interfaces of the Initiator Agents on containers (build monitor, build history, etc.), make sure the HTTP and/or HTTPS ports are open on the container for external access. For more information, see Modifying Ports.
-
Add the following line to the compilation command (this will start the Incredibuild agent when the pod is run during the CI). These commands make sure that the Incredibuild agent you start consume a fixed number of CPU cores from your SUVM license limit. Change the value 8 in the 1st command to match the number of cores you want your containerized build server to really use for building (typically this should match the number of CPUs you allocate to the container).
Copy
-
Wrap the
makecommand with the followingib_consolecommand, and increase the build parallelism according to the potential of your project and Helper cores availability: Copy - In order to allow Incredibuild to diagnose build operation, follow the instructions in Collecting Build Logs to upload build outputs to a location outside of Kubernetes (e.g. your log collection repository). Without exporting and saving the logs, Incredibuild will not be able to provide support for failed or under-performing builds.
Sample Complete Dockerfile with Incredibuild
Every environment is different so this example will probably need to be adjusted for your environment. CopyBuilding the Golden Image
Build the container golden image and push it to the image repository. See the following sample Docker command: Copyulimit build option.
Upgrading Incredibuild
- Upgrade your Incredibuild Coordinator. At the end of this process, any Helper Agents connected to the Coordinator will be automatically upgraded.
-
Update your Kubernetes golden image so that future Helper Agents will be installed using the latest version of Incredibuild.
If this is not done, they will upgraded as soon as they are connected to the Coordinator. However, this will greatly slow down their deployment.