NEWAI chat: ask your fleet anything, in plain language. Chat with your fleet Read more →

The production software stack for AI-powered robots

An opinionated reference stack for AI robots in production. Linux, ROS 2, Docker Compose, models outside the image, real health checks and one agent.

Illustration for "The production stack for AI robots": a robot arm, with the label "ROS 2 · containers · models"

Most robot software stacks are born in a lab. Someone gets a policy working on one arm, the code lives in a home directory, the weights sit next to it, and deploying means git pull over SSH. That's fine for a demo. It falls apart the day you have twenty robots at three sites and one of them needs a fix at 2 a.m.

The stack also has a harder job than it used to. Machines used to run fixed programs: same input, same output. An AI-powered robot runs a learned model that makes decisions many times a second from what its cameras see. That model changes every few weeks, the room around the robot changes every day, and the robot is in production, far from the team. So the stack has to make it cheap and safe to change the most important part of the machine, over and over, without anyone standing next to it.

This post is the stack I'd use today. It's opinionated on purpose. You can disagree with any layer, but you should have a reason.

The short answer: Use a boring Linux base, ROS 2 for the robot graph, and put every process in a container described by one Docker Compose file. Keep model weights, config and secrets outside the image, give each service a health check that means it can do its job, and run one agent for operations. That way every part of the robot has a version and a way back.

The stack in one list

  • A boring Linux base. The OS is the part you change least.
  • ROS 2 for the robot graph. Drivers, perception, control and the policy talk over topics and services.
  • Everything in containers, run by Docker Compose. One compose project per robot, versions in one place.
  • Models as versioned artifacts outside the image. Weights live on disk in versioned folders, mounted into the container.
  • Config and secrets outside the image too. One image for the whole fleet, site details injected at runtime.
  • Health checks that mean "doing its job", not "process alive".
  • One agent for operations. One thing on the robot that observes, updates and reports. Not a pile of scripts.

The rest of the post is why, and what an update looks like when you put it together.

Start with a boring Linux

Pick Ubuntu LTS, or JetPack on Jetson, and leave it alone as much as you can. Every customization you make to the base OS is something you have to reproduce on every new robot and carry through every OS upgrade.

A few habits that pay off:

  • Keep OS updates separate from app updates. A kernel or driver change and a new policy in the same release means that when it goes wrong, you don't know which one did it. Ship them as separate releases, on separate days.
  • Cap your logs. Set a size limit for journald and for Docker's log driver. A chatty node writing debug logs will fill a 32 GB SD card faster than you think, and a full disk breaks the next update in confusing ways.
  • Watch the storage. SD cards and cheap eMMC wear out. A robot that starts failing updates at random is often a dying card, not a bad release.

Use ROS 2

If you're starting today, use ROS 2. If you're on ROS 1, plan the move. ROS 1 Noetic reached end of life in May 2025, which means no more security fixes and a shrinking set of packages that support it.

The end of life is the least interesting reason, though. ROS 2 fits production better:

  • No single master. ROS 1 needs roscore. If it dies, the graph stops finding itself. ROS 2 uses DDS for discovery, so nodes find each other with no central process to lose.
  • QoS you can actually tune. A camera stream can be best effort, so a dropped frame is dropped instead of queued. A command topic can be reliable. On a robot with a flaky Wi-Fi bridge, this matters.
  • Lifecycle nodes. A managed node has states: unconfigured, inactive, active. That's exactly what a policy node needs. Load the weights and warm up in configure, start acting in activate. An update can bring a new model to inactive, check it, and only then let it drive.
  • Introspection for free. Every topic has a rate you can measure, every node shows up in the graph, /rosout and /diagnostics give you structured logs and health. That's a monitoring layer you don't have to build. A camera publishing at 11 Hz instead of 30 is visible from outside the code.
  • The ecosystem. ros2_control, MoveIt 2, Nav2 and most hardware vendors' drivers are on ROS 2 now.

Two rules I'd add. Pick one LTS distro (Humble or Jazzy) and one RMW implementation (Fast DDS or Cyclone DDS) for the whole fleet, and pin them. Mixed distros and mixed RMWs across a fleet are a source of bugs that only show up at one site. And set ROS_DOMAIN_ID deliberately per robot when several robots share a network, or they'll discover each other's nodes.

Put everything in containers, and run them with Docker Compose

Put every process in a container. Drivers, perception, the policy server, the behavior or task layer. Then describe the whole robot in one compose file.

Why containers:

  • Reproducible. The image that passed testing is byte for byte the image on the robot. No "works on robot 3" because someone ran pip install there last month.
  • Atomic swaps. Starting a new container from a new image and stopping the old one is close to atomic. Updating packages in place is not.
  • Rollback to exact images. If you keep the previous image on the robot, going back is starting the old image again. Not rebuilding it, not hoping the registry still has the same tag.
  • Per-component versions. The camera driver can stay on 1.8 while perception moves to 2.3. You update the part that changed.

Why Compose, and not a set of docker run lines in a script: the compose file is the definition of the robot. Healthchecks, restart policies, start order with depends_on: condition: service_healthy, device mappings, volumes. All in one file you can review in a pull request. And docker compose up --wait gives you a clear answer to "did the update work": every service running and healthy, or not.

Don't build one giant container with everything in it. Split by how often things change and what they need from the hardware. Something like this:

services:

drivers: { image: "reg/acme/drivers:${DRIVERS_TAG}", network_mode: host, devices: ["/dev/ttyACM0"] }

perception: { image: "reg/acme/perception:${PERCEPTION_TAG}", network_mode: host, ipc: host }

policy: { image: "reg/acme/policy:${POLICY_TAG}", network_mode: host, ipc: host, volumes: ["/opt/models:/models:ro"] }

task: { image: "reg/acme/task:${TASK_TAG}", network_mode: host }

The versions live in .env next to the file. An update to perception is a one-line change to PERCEPTION_TAG. Some practical notes:

  • Host networking for DDS. DDS discovery uses multicast, which Docker's bridge network doesn't pass well. network_mode: host is the simple answer. ipc: host lets Fast DDS use shared memory between containers for large messages like images.
  • Never deploy `:latest`. Use immutable tags or digests. A mutable tag means two robots with the "same" version can run different images.
  • Map devices, don't run everything privileged. Give the driver container the serial ports and cameras it needs. Keep privileged: true for the rare case that truly needs it.
  • Give every service a healthcheck. Without one, "healthy" just means "started". More on that below.

Keep models out of the image

This is the decision I see teams get wrong most often. They bake the weights into the policy image because it feels clean: one artifact, one version. Then a fine-tune that changes nothing but weights becomes a multi-gigabyte image push to every robot.

Keep the model as its own versioned artifact, on disk, outside the image:

  • Size. A VLA checkpoint is gigabytes. The code that runs it is much smaller. Shipping them together means every code fix moves the weights again, and every weights change moves the code.
  • Cadence. Code changes when you change it. Weights change when you retrain, which might be weekly, and might be per site or per task. Different rhythms deserve different artifacts.
  • Atomic switch. Put each version in its own folder, /opt/models/picker/v13, /opt/models/picker/v14, with a current symlink pointing at one of them. Switching is one atomic rename of that link. Going back is the same rename in the other direction, and the old weights are still on disk.

The policy container mounts /opt/models read-only and loads /models/picker/current at start. It doesn't know or care which version that is, and it logs the resolved path so you always know what's actually running.

One thing to be careful about: the weights are not the whole model. The normalization stats, the action config, the processor or tokenizer files all have to match the weights. Version them together in the same folder, or one day you'll ship new weights with old normalization stats and the robot will move just a little wrong, with no error anywhere. I go into this in how to update a VLA model on robots remotely.

Config and secrets outside the image too

Same principle. One image runs on every robot. Everything that differs per robot or per site comes from outside:

  • Site config. Camera serial numbers, workcell coordinates, which task this robot runs, speed limits for this customer.
  • Calibration. Camera intrinsics, hand-eye calibration, joint offsets. This belongs to the physical robot, not to the release. An update should never overwrite it.
  • Secrets. Registry credentials, API keys for a remote policy server. Never in the image, never in the compose file in git.

If config is baked into the image, you end up with an image per site, then an image per robot, and then nobody knows which image is supposed to be where.

Health checks that mean something

A container that's running isn't a container that's working. A policy server can be up, listening on its port, and still have failed to load the weights. Or loaded them onto the CPU because CUDA didn't initialize, and now inference takes 900 ms instead of 60.

Write health checks for each service that answer "can this do its job right now":

  • Policy: weights loaded, warm-up inference done, last inference under the latency budget, no NaN in the output.
  • Drivers: the topic is publishing at the expected rate, and the hardware answered recently.
  • Perception: frames are arriving and not frozen. A camera that sends the same frame over and over looks alive to everything except a check that compares frames.

Health checks also have a second job: they're what make safe updates possible. An updater can only decide "this update worked, keep it" or "this failed, roll back" if something tells it what working means. If your health check is "the process exists", every update succeeds.

One agent for operations

The last layer is the one most teams build by accident: a cron job that ships logs, a script that pulls images over SSH, a VPN for remote access, a separate exporter for metrics. Each one works. Together they're a second product nobody owns, and each one needs inbound access or credentials on the robot.

Run one agent instead. It should connect out only, so robots behind NAT and cellular work without a public IP. It should see the whole machine: the OS, the containers, the ROS graph, the models. And it should run updates as a sequence of steps that it can undo, because it's the only thing on the robot that knows both what changed and whether the robot is still healthy afterwards.

What an update looks like in this stack

Here's where the layers pay off. Say you're shipping a new picking policy, v14, together with a perception container at 2.3. With the stack above, the release is a short workflow:

  1. Check preconditions. Enough free disk for the new weights, not on a metered link, and the robot isn't in the middle of a pick. If any of these don't hold, wait, and if they never hold, fail without changing anything.
  2. Download the weights with a sha256 check, resuming if the link drops.
  3. Deploy the model into /opt/models/picker/v14 and switch current atomically. v13 stays on disk.
  4. Bring up the compose stack with PERCEPTION_TAG=2.3 and the policy restarted so it loads the new weights. The step only succeeds when every service is healthy.
  5. Wait for the ROS graph to be back: the expected nodes present, the camera and action topics at their usual rates.
  6. Run a final health check on the policy: inference latency inside budget.

If step 5 fails, the agent undoes in reverse: the compose stack goes back to exactly the images it ran before, and current points back at v13. The robot is on the old version, not somewhere in between.

That's one robot. A fleet needs more: a model test before it acts, rollouts in phases, and a way to tell whether the new version is actually better once it's out. Those are their own topics. Start with the OTA checklist for robot fleets for every way this workflow can fail in the field, and phased rollouts and automatic rollback for how to take it from one robot to all of them.

What I'd avoid

  • Weights inside the image. Covered above. It makes every model update heavier than it needs to be.
  • Updating in place. apt upgrade or pip install on a running robot, or colcon build into the workspace the robot is running from. There's a window where the robot is half old, half new.
  • Deploying with SSH scripts. They work until the link drops at step 4 of 7, and then you have a robot in a state nobody planned for.
  • Different stacks per site. A different distro here, a hand-patched driver there. Every difference is a test you didn't run.

How we do this at PhysicalFleet

This stack is what we built PhysicalFleet around. The agent observes the ROS 2 graph, containers and models with nothing to install in your workspace, and a release is a workflow of steps like model.deploy, compose.up and ros.launch.restart, each with its own undo. More on OTA updates for robots.

If your stack looks different and it works for you in production, I'd really like to hear what you chose and why.

Common questions

Should robots run ROS 2 or ROS 1 in production?

ROS 2. ROS 1 Noetic reached end of life in May 2025, so it gets no more security fixes. ROS 2 also fits production better: there's no single master to lose, QoS can be tuned per topic, lifecycle nodes let a policy load and warm up before it acts, and ros2_control, MoveIt 2, Nav2 and most hardware drivers are on ROS 2 now.

Should model weights be baked into the Docker image?

No. Keep the weights as their own versioned artifact on disk and mount them into the policy container read-only. Weights are gigabytes and change on a different schedule than code, so baking them in turns every fine-tune into a huge image push. Separate versioned folders with a symlink to the current one also make switching and rolling back a single atomic rename.

Why use Docker Compose on a robot instead of docker run scripts?

The compose file becomes the definition of the whole robot: images, health checks, restart policies, start order, devices and volumes, in one file you can review. Versions live in one .env file, so updating one component is a one-line change. And docker compose up --wait tells you clearly whether an update worked, because it only succeeds when every service is running and healthy.

Is it OK to deploy the latest tag to robots?

No. Use immutable tags or image digests. With a mutable tag like latest, two robots that claim to run the same version can be running different images, and you can't be sure that going back to the old tag gives you what the robots ran before.

What should a health check test on a robot?

Whether the service can do its job right now, not whether the process exists. For a policy, that means weights loaded, a warm-up inference done, recent inference under the latency budget and no NaN in the output. For drivers and cameras, it means topics publishing at the expected rate and frames that actually change. Safe updates depend on this, because an updater can only roll back a bad release if something tells it what working means.

#ROS 2#Docker Compose#containers#robot software architecture#VLA#edge AI#OTA updates
Eitan ChudnovskyCo-founder, PhysicalFleet

From the lab bench. To the entire fleet.

Connect your first machine in minutes, develop it in the lab and run your whole fleet in production from one place.

Free for up to 3 machines · Then pay as you go