Cloudbees Build Acceleration 13.0 introduces containerized agents, a new method for sandboxing agents running on the same host. Previously this was performed by LOFS (Loopback File System), but LOFS is incompatible with Linux kernel 6.x. Containerized agents is the new method going forward, and therefore LOFS is no longer updated. If LOFS is working for you, there is no need to configure containerized agents.
When installing agents, the installer attempts to compile and install the LOFS module. If that compilation fails, it prints a warning message and directs you here. If you have received that message, you must configure containerized agents to set up agents.
Setting up containerized agents requires installing Docker and configuring a Docker container, and registering that container’s ID with ecconfig, Cloudbees Build Acceleration’s configuration tool.
Setting up a suitable container is a manual process, but is not difficult. Follow these steps:
-
Install Docker.
Visit the official Install Docker Engine site and follow the instructions.
The official site recommends uninstalling any preexisting installed Docker packages and then using the official installation method. It is possible that such packages may work with Cloudbees Build Acceleration containerized agents, but that has not been tested. -
Create the Docker build directory contents.
-
Create a root directory for the Docker container (the name doesn’t matter), then change to that directory.
-
Download the agent container Docker tarball for your version of Cloudbees Build Acceleration. Visit the Cloudbees downloads site, select the version of Cloudbees Build Acceleration you are running, and download the
CloudBeesAccelerator-<version>-ContainerAgent.tar.gztarball. For example, for the 13.0 release, download theCloudBeesAccelerator-13.0.0.118211-ContainerAgent.tar.gztarball. -
Extract the tarball contents into the root directory using the
--strip-components=1flag:tar zxvf CloudBeesAccelerator-<version>-ContainerAgent.tar.gz --strip-components=1
This creates sample Dockerfiles (
Dockerfile-ag-ubuntu,Dockerfile-ag-rh), arulesdirectory with anautostartup script, and anecloud.tar.gztarball containing the agent software.Save this directory for future installations.
-
-
Create a Dockerfile.
Create a
Dockerfilein the root directory. Use the existing Dockerfiles (Dockerfile-ag-ubuntuorDockerfile-ag-rh) as templates, or create your own. To have the container run the agent, the Dockerfile must end with these lines:... ADD ecloud.tar.gz / COPY rules /opt/ecloud/rules CMD ["/opt/ecloud/rules/auto"]
These set up the agent software in the container, install the startup script, and run it. How the container is set up is up to you and the needs of your builds. Here is a simple, bare-bones Dockerfile for Ubuntu 20.04:
FROM ubuntu:20.04 RUN apt-get update && apt-get install -y gcc g++ netbase ADD ecloud.tar.gz / COPY rules /opt/ecloud/rules CMD ["/opt/ecloud/rules/auto"]
As another example, here is a more complicated Dockerfile for building Android (AOSP):
FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y gcc g++ netbase language-pack-en-base git-core gnupg flex bison build-essential zip curl zlib1g-dev libc6-dev-i386 x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig libncurses5 libncurses5-dev rsync ADD ecloud.tar.gz / COPY rules /opt/ecloud/rules CMD ["/opt/ecloud/rules/auto"]
For Yocto:
FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y gcc g++ netbase gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm python3-subunit mesa-common-dev liblz4-tool zstd libdrm-dev ADD ecloud.tar.gz / COPY rules /opt/ecloud/rules CMD ["/opt/ecloud/rules/auto"]
Any
FROMimage that is supported by Cloudbees Build Acceleration should work, including custom ones.If you’re not sure what packages your build depends on, start with a relatively simple Dockerfile with guesses as to what’s needed, try a build, check for what failed, and then iterate. -
Build the container.
Now build the container with
docker build:sudo docker build -t ecagent -f Dockerfile .
The repo name ecagentis merely a suggestion; you may name it what you wish. -
Register the container with
ecconfig.-
Find the container ID:
sudo docker image list
Identify the image ID in the output corresponding to the container you just built.
-
Register the container, substituting the image ID from the previous step:
sudo ecconfig -container <container-ID>
At present, only one container ID can be registered on a given agent host, meaning that all the agents on that host must have the same container configuration. To have varying Docker configurations for different agents, use different hosts and separate them by using resources.
-
-
Restart the agents.
The agents only check their configuration at startup. To make these changes effective, restart the agents:
sudo /etc/init.d/ecagent restart
The agents are now configured to use containerized agents.