JaiaBot development is done on Ubuntu Linux, with the version of Ubuntu supported aligned with the jaiabot release branch (see Repository page).
This section written by Claude
On a fresh clone there's no jaia tool yet to run jaia dev setup or jaia dev build, so init.sh bridges that gap: it runs the underlying setup and build steps directly, then puts build/<arch>/bin on PATH so jaia is available right away.
Source it (rather than running it) so the PATH change also applies to your current shell; future shells pick it up automatically, since init.sh also appends it to your shell rc file. Once it finishes, run jaia dev build to finish building the rest of the project.
The JaiaBot software depends on Goby3, MOOS, and other packages.
When using the jaiabot Debian packages (see the CI/CD section below), these dependencies are automatically installed by apt.
This section written by Claude
When building from source, these can be installed from the regular Ubuntu package repositories plus the packages.jaia.tech mirror of the packages.gobysoft.org repository (also reference the steps in jaiabot/.docker/resolute/amd64/Dockerfile). If you have the jaia tool already installed (e.g. from a package), jaia dev setup runs these steps for you (see below).
This section written by Claude
The jaiabot software is configured using CMake, which generates a Ninja build by default (Ninja is faster than, and otherwise a drop-in replacement for, the Makefiles CMake generates by default).
This process is summarized by:
This section written by Claude
This project provides a convenience script called build.sh that runs cmake to configure and build the project (using as many jobs as your machine has processors). The build.sh script segregates the CMake working directory by machine architecture (e.g. build/amd64, build/arm64, etc.). Additionally, you can set the environmental variables JAIABOT_CMAKE_FLAGS and/or JAIABOT_MAKE_FLAGS to pass command line parameters to CMake (during configure) or the underlying build tool, respectively. Pass --make to build.sh to use GNU Make instead of Ninja (e.g. if ninja-build isn't installed); switching between the two automatically discards the existing CMake cache, since CMake can't reconfigure a directory with a different generator than the one it was first configured with.
Running the build script will start a parallel build using a number of processors that is equal to the lesser of:
You can manually define the number of CPUs to use by setting the JAIA_BUILD_NPROC environment variable.
Some examples:
Basic build:
Build documentation as well:
This section written by Claude
build.sh is quiet by default: a successful build prints Ninja's progress line and little else, while warnings and errors are still shown. Build steps that run other tools (pip, npm, the STM32 firmware make, ...) only show their output when they fail or print a warning. To see more, pass these flags or set the matching environment variables (to 1):
| Flag | Environment variable | Shows |
|---|---|---|
| --configure-verbose | JAIA_CONFIGURE_VERBOSE | CMake's status messages (compiler checks, packages found, version) |
| --build-verbose | JAIA_BUILD_VERBOSE | Every build command (ninja -v) and the full output of each build step, including the STM32 firmware size report |
| --verbose | JAIA_VERBOSE | Both of the above |
JAIA_BUILD_VERBOSE is read when each build step runs, so it also works when running ninja or cmake --build directly in the build directory.
When running ninja directly, rerun cmake . (or build.sh) after adding a source file to the STM32 firmware or to the Python packages the dev venv installs, since those file lists are only gathered at configure time.
This section written by Claude
If you have the jaia tool available (from a package, or already built from this source tree), jaia dev provides a friendlier front end for the day-to-day build workflow:
jaia dev build checks for the tools jaia dev setup installs before invoking build.sh, so a missing setup step is reported clearly (e.g. "It looks like 'jaia dev setup' has not been (successfully) run on this machine") instead of failing partway through configuration.
jaia dev docker is a front end for docker scoped to the images and containers this repository creates (the cross-compile build image/container from container-image-build.sh / container-build-and-deploy.sh, and the simulator image/container from scripts/sim-docker), which are all tagged with the Docker label jaiabot_build=true. For docker commands that support --filter (ps, images, image ls, container ls, network ls, volume ls, the prune commands, etc.), jaia dev docker automatically adds --filter label=jaiabot_build=true so only this repository's images/containers are shown or affected; other commands (e.g. docker logs, docker exec, docker rm) are passed through to docker unmodified:
Continuous integration (CI) and continuous deployment (CD) are software best practices to ensure that code is quickly and easily integrated and tested. The CI part is managed by a standard Git workflow of committing regularly, pushing changes to Github.com, and integrating back to the 3.y "main" branch using the pull request feature on Github.
The CD part is managed by CircleCI, which is a cloud-based configurable build and test system. The .circleci/config.yml file configures the actions ("workflow") performed by the CircleCI servers. Open source projects get substantial free credits for building with CircleCI.
We use CircleCI to do two main types of builds:
The interaction between the developers and the automated CI/CD system is summarized in the following figure:

When the developer is working on a new feature or fixing a bug, he or she branches the code into a "feature branch", then incrementally commits and pushes these changes. Each commit that is pushed triggers a basic build on CircleCI to ensure that the committed code compiles correctly and the existing unit tests pass.
Once the developer has completed his or her feature or bug fix, he or she puts a "pull request" up on Github to be reviewed by another member of the software team. The pull request is generally set to merge the feature branch (e.g. "my-new-feature-xyz") into the "main" branch (3.y in our case). After review (using the GitHub UI), the reviewer merges the pull request and this automatically triggers the CircleCI system to do a package build of the code. These packages (.deb packages for installing on Ubuntu) are pushed the continuous repository on packages.jaia.tech. At this point, they can be installed using apt onto any system with that repository installed:
Once the decision has been made to release the software, a tag is made on the git repository and pushed to Github. The creation of a new tag automatically triggers a CircleCI build that is the same as the continuous build but is pushed to a different repository.
Depending on the tag structure, this may either be the beta/3.y or release/3.y. Beta releases are tagged as x.y.z_betaN (e.g., 1.0.5_beta3) which becomes Debian version x.y.z~betaN during the CircleCI build.
To use the release or beta repository, simply run the same commands as in the previous section, just substitute http://packages.jaia.tech/ubuntu/release/3.y/ or http://packages.jaia.tech/ubuntu/beta/3.y/for http://packages.jaia.tech/ubuntu/continuous/3.y/.
It is perfectly fine to have more than one of these repositories installed at once. In all cases the newest code will be installed (so if you have both release and continuous installed, you will always get packages from continuous, or if you have release and beta installed, you will get packages from beta).
Debian packages are given versions based on the git tag version (for "release" or "beta" packages) or the last tagged release plus the git hash (for "continuous" packages).
The ~ used by Debian that sorts before any other versions is not allowed as a symbol in git tags, so we substitute _ instead. For example git tag 1.0.0_beta1 becomes Debian version 1.0.0~beta1 which is treated as an earlier version than 1.0.0.
Additionally the Ubuntu version that the package is build for is appended to the version name as ~ubuntuXX.YY.Z
Examples:
This scheme ensures that continuous packages are considered to always be newer versions (by the rules of apt) than the last (beta or regular) release. This also ensures that each version can be tracked back to the git tag or git hash from which it was built.
The server packages.jaia.tech is created using the configuration in jaiabot/rootfs/cloud/aws/packages.
It can be rebuilt using:
This will build a new version of the packages.jaia.tech server with a temporary IP address while leaving the existing packages server running. Log into https://us-west-2.console.aws.amazon.com/ec2/home?region=us-west-2#Instances: to find the new public IP address (<new server IP address>).
If you want to copy the files from the existing server (recommended), you will first need to provide a public key (<public key>) corresponding to a private key on your current machine to login to the existing server (dput user):
Once this is complete you can swap the elastic IP (https://us-west-2.console.aws.amazon.com/ec2/home?region=us-west-2#Addresses:) for packages.jaia.tech by using "Disassociate Elastic IP Address" and "Associate Elastic IP address", chosing the new server on the second step (associate). When you are satisfied that the new server is working correctly, you can terminate the old one.
You will also need to update jaiabot/.circleci/config.yml to change the known_hosts entry for the new server for uploads (under the "Upload packages to packages.jaia.tech" task).
To control the version of the GobySoft packages used, we maintain a mirror of packages.gobysoft.org (for each release series: 1.y, 2.y, 3.y, etc. and two release levels: "release" and "staging") that can be manually updated as necessary using the update-gobysoft-mirror.sh script.
Two GobySoft mirrors are provided ("release" and "staging") so that new updates to GobySoft packages can be progressively tested and merged into the JaiaBot repository.
The script update-gobysoft-mirror.sh in jaiabot/scripts/packages (copied to /opt/jaia_packages on packages.jaia.tech) can be used to interactively manage the state of the GobySoft mirrors and their relation to the Jaiabot release distributions.
The script has three actions:
The general process for pulling in a new Goby release should be:
The default update path assumes a reasonably fast internet connection to the public Ubuntu repositories and packages.jaia.tech. This is not always the case, so two alternative update pathways are provided:

The Ansible playbook jaiabot/config/ansible/change-sources.yml can be used to change the update mode for a given fleet (this can also be run with the Liaison pre-launch UI with role == ADVANCED or higher).
Update many bots at once can place high demands on the internet connection as they all have to fetch the same .deb packages. To reduce this load, we can configure the hub to act as a caching proxy using the squid-deb-proxy package. In this case, the hub will cache any packages requested so that future requests are served locally by the hub rather than requiring another internet download.
To enable online mode with hub caching:
For some scenarios, the fleet must be updated without connecting it to the internet. For this reason, each CircleCI build of Debian packages also creates an .iso (CD image) that contains the jaiabot-embedded Debian package and all its dependencies (recursively, based of the base ubuntu Docker image). Additionally it includes the required Python wheels used by pip when installing jaiabot-python.
This .iso is then burned to a CD or dd'd to a USB key and connected to hub0 of the fleet. The /etc/fstab will already include the mount point (based off the ISO label: updates), so simply running sudo mount -a or rebooting the hub will mount this disk to /var/www/html/updates (which is served by Apache2 as http://hub0/updates).
To enable offline mode:
At this point each bot and hub in the fleet can be updated by simply running sudo apt update && sudo apt dist-upgrade, exactly as if it was connected to the internet.
Please keep in mind that the offline updates do not include the usual Ubuntu security patches so are not suitable for internet-connected machines (use the Online or Online update with Hub Caching in this case to ensure security updates are installed).
To revert to "normal" online updates after using one of the alternatives (or to switch the repo or version), you can use the same playbook:
This process is being deprecated in favor of using the continuous Debian packages described above. However, it still may be useful in some scenarios.
For rapid turnaround development where it is infeasible to wait for the CI/CD packages to complete, we can cross-compile for the jaiabot code for the ARM64 target (Raspberry Pi) using a Docker container that holds all the appropriate dependencies:
To create the docker image initially (should only need to be done initially and whenever there are updates to the dependencies):
This section written by Copilot
This generates the Dockerfile from .docker/${jaia_version_ubuntu_codename}/arm64/Dockerfile.in (or .../amd64/Dockerfile.in when jaiabot_machine_type=virtualbox) and builds an image tagged jaia_build_${distro}_${repo}_${version} (e.g. jaia_build_resolute_release_3.y). The jaiabot_repo, jaiabot_version and jaiabot_distro environmental variables can be used to override the defaults taken from scripts/common-versions.env.
Then to cross-compile using this image:
If you rsync the contents of jaiabot/build/bin and jaiabot/build/lib to the Raspberry Pi at /home/jaia/jaiabot you should be able to run them successfully.
(This assumes that /home/jaia/jaiabot/build exists on the Raspberry Pi, if not, mkdir it first):
This section written by Claude
Use jaia dev local_deploy from anywhere within your jaiabot source tree:
Each target is either a host code (b<bot_id>f<fleet_id> or h<hub_id>f<fleet_id>, as used by jaia ssh and jaia ip) or an inclusive range of them (b1f6..b3f6). At least one target is required; run jaia dev help local_deploy for the full list of options.
Whether the target is configured as a bot or a hub, and the rest of its configuration, is read from the target's own debconf database, so the systemd services generated on it match how it is provisioned.
A deploy generates its systemd units into /etc/systemd/system, which take precedence over the packaged units in /usr/lib/systemd/system. --clean reverses that: it removes those units and the deployed ~/jaiabot tree, then reruns the package's own configuration so the machine goes back to running the installed jaiabot-* packages. Log data in /var/log/jaiabot is kept.
jaia dev local_deploy is a wrapper around scripts/build/container-build-and-deploy.sh, which can also be called directly with a list of ssh hosts: