Skip to Content
Publishing a moduleBuild and publish

Build and publish

How a module repo becomes an image on GHCR. This page assumes a machine that has been through Developer setup, or any arm64 host with Docker if the module does not need the GPU.

The module Dockerfile

RAMMP-docker ships a template. Copy two files into your repo root:

From RAMMP-dockerTo your repo
templates/module.DockerfileDockerfile
templates/dockerignore.txt.dockerignore

Then edit the Dockerfile:

Pin the base

FROM ghcr.io/rammp-org/rammp-cuda:2.0.0-jp6

rammp-base unless you need the GPU. Pin the full version, not :humble. The difference is on Base images.

Replace <your_module>

The template copies your repo into /module_ws/src/<your_module>/. colcon finds every package.xml under src/, so your node package and any task-specific interface package in the repo both build.

Set the command

CMD ["ros2", "launch", "<your_module>", "<your_module>.launch.py"]

Or a ros2 run target.

Your packages build into /module_ws, an overlay on the base’s /ros2_ws. The build does not recompile the interface contract, and cannot ship a modified copy of it.

What happens at container start

The entrypoint sources three layers in order, then runs the command:

  1. /opt/ros/humble, the ROS 2 underlay
  2. /ros2_ws/install, the interface contract from the base image
  3. /module_ws/install, your packages

With --network host --ipc host, Cyclone DDS finds the host’s real network interface and discovers nodes in other containers.

Build and test locally

docker build -t <your_module>:dev . docker run --rm --runtime nvidia --network host --ipc host <your_module>:dev

Drop --runtime nvidia for a rammp-base module. From a second terminal, ros2 topic list on the host lists what your node publishes.

Publish to GHCR

Images live at ghcr.io/rammp-org/<your-repo>. CI in your repo builds and pushes them; nothing is pushed by hand in the normal flow.

The pattern every module repo follows:

EventCI does
Pull requestBuild only
Push to mainBuild and push a moving :main tag
Push a v* tagBuild and push the version tag

Two worked examples to copy from:

  • rammp-suite-software : the short form. docker/metadata-action derives branch, semver and sha tags; docker/build-push-action builds for linux/arm64 and pushes on anything but a pull request.
  • RAMMP-CuRobo : the long form, for an image that takes an hour to build. It refuses to publish a v* tag that does not point at a commit on main.

Both run on GitHub’s arm64 runners, which are free for public repositories.

To cut a release:

git tag v0.1.0 git push origin v0.1.0

The deployment manifest pins an image tag. A :main tag moves with every push, so pin a release tag there once the module is stable. See Deploy it.

Run it on the robot

docker run --rm --runtime nvidia --network host --ipc host \ ghcr.io/rammp-org/<your-repo>:<version>
FlagWhy
--runtime nvidiaInjects the GPU driver. Required for any rammp-cuda image.
--network hostDDS discovery. On a bridge network, nodes in other containers never find each other.
--ipc hostLets Cyclone use shared memory between containers.

Running it by hand is for checking the image. On the chair, sheppy runs it from the manifest with the same flags.

Next

Edit this page on GitHub

Last updated on