This repository contains the infrastructure configuration for the Ubiquity Robotics CI/CD system. It acts as the "Puppet Master", orchestrating the automated builds of Ubuntu/ROS 2 robot images.
Note: This repository only manages the infrastructure. The actual scripts and instructions to build the robot images are located in the rpi-image-gen repository.
The system uses a hybrid-cloud Master/Worker architecture:
- The Master (DigitalOcean): A Docker container running Buildbot. It hosts the Web UI (
https://build.ubiquityrobotics.com) and manages the build queue. It does not compile code itself. - The Workers (AWS EC2): When a build is triggered, the Master uses the
boto3API to dynamically spin up ephemeral AWS EC2 instances (e.g.,t4g.xlargeARM64 machines). - The Execution: The AWS workers clone
rpi-image-genand usepodmanandmmdebstrapto build the target images inside a secure user namespace sandbox. Once finished, the EC2 instances are permanently destroyed.
For a deep dive into exactly how this works under the hood, read the SYSTEM_ARCHITECTURE.md.
For information on scaling, caching, and modernization plans, see the modernization_plan.md and architecture_critique.md.
- Install Ansible on your local workstation:
sudo apt install ansible - Authenticate with the Ubiquity DigitalOcean container registry (Ask David or Rohan for the token):
docker login -u TOKEN -p TOKEN registry.digitalocean.com
- Clone this repository locally:
git clone https://github.com/UbiquityRobotics/ubiquity_buildbot.git - Run the deployment script:
What does
cd ubiquity_buildbot/deploying ./deploy.shdeploy.shactually do?- It runs an Ansible playbook (
ansible.yaml) that connects to the DigitalOcean droplet via SSH. - It copies the latest
master.cfgandworkers.pyfrom your local machine to the server. - It builds a new Docker image containing Buildbot and its Python dependencies (
boto3, etc.). - It tears down the old Master container and spins up a new one on host network mode, listening on port
8010(Web UI) and9989(Worker connections).
- It runs an Ansible playbook (
Highly sensitive AWS API keys and passwords are never committed to this repository.
When deployed on the DigitalOcean server, the master reads credentials from a local file mounted as a Docker volume at /opt/buildbot/creds/creds.py. If you need to update API keys, you must SSH into the DigitalOcean droplet and edit the file directly on the host.
Once deployed, the master will automatically listen for triggers. To manually force a build:
- Navigate to https://build.ubiquityrobotics.com
- Go to Builds -> Builders
- Select your target builder (e.g.,
MICHAEL-TEST-BASE-IMAGE) - Click Force Build in the top right.
If workers are hanging (e.g., waiting 60 minutes for a connection) or the Master is returning 502 Bad Gateway:
- Check Master Logs: SSH into the DigitalOcean server and view the Buildbot container logs (
docker logs ubiquity_buildbot). - Check Port Bindings: Ensure the Docker container is successfully binding to TCP port
9989so the AWS workers can connect. - Check AWS EC2 Boot: If a worker never connects, it usually means the
cloud_init_scriptfailed during boot. Log into the AWS console, find the specific EC2 instance, and check the System Log forapt-getor dependency installation errors.