Containers makes it easy to deploy Docker containers to your robots from public and private container registries through a REST API.

How it works

  1. The containers you want to run on your robots are defined in a compose file, which must be uploaded to Airbotics. If the compose file contains containers from a private registry the credentials for the registry should be set as environment variables on the robot. You should also ensure any other environment variables, devices, etc. are set correctly on the robot.

  2. Assign a compose file to robots through the dashboard or the API, it will be in a pending_up state.

  3. If the agent on the robot is connected, it will immediately receive a message to update the containers. It will firstly down any existing compose file on the robot, write the new compose file to the disk, and run up on it. This will move the state to up or error. If it is not online, the agent will receive the update as soon as it reconnects.

  4. Containers can be removed from robots through the dashboard or API. This will move the container to a pending_down state. When the agent is connected it will run down on the compose file and delete it from the disk, it will confirm this action with the backend and move the containers to a down or error state.

Private registries

The agent can pull from private registries. For this, the AIR_CONTAINER_REGISTRY_URL, AIR_CONTAINER_REGISTRY_USERNAME and AIR_CONTAINER_REGISTRY_PASSWORD environment variables must be set on the robot. The agent will read them and use them to authenticate, their values never leaves the robot.

Without setting these environment variables only images from public registries can be pulled. An error will be produced if the agent tries to pull from a private registry without setting them.

States

A compose file can be in one of the following states on a robot:

StateDescription
pending_upA user has assigned a compose file to a robot, but the agent hasn’t confirmed they have been brought up.
pending_downA user has removed a compose file from a robot, but the agent hasn’t confirmed they have been brought down.
upThe agent has confirmed the assigned compose file have been successfully brought up.
downThe agent has confirmed the assigned compose file have been successfully brought down.
errorThe agent has encountered an error bringing up or down the assigned compose file.

Yaml vs. Json

The Airbotics REST API uses JSON format. Docker compose files in YAML format can be converted to JSON with the following command:

docker compose -f docker-compose.yaml convert --format json > docker-compose.json

When you add a compose file through the dashboard this conversion will be done for you. If you add a compose file through the API you will need to provide it in JSON format.

FAQ