OTA updates for robot fleets: how to ship releases safely
Build releases from reversible steps and follow every change with a check that proves the robot works. Preview on a real robot, then roll out in phases behind a health gate that compares updated robots with ones not yet updated. Use pf busy and maintenance windows, and pin every version.
Build every release from reversible steps
A robot that fails an update in the field can mean a site visit. The first rule of a safe release is that every change can be undone on the robot itself, without a network connection or a person nearby.
In PhysicalFleet a release describes an update once: what to install, how to check it worked and how to undo it. Each robot runs it as a signed job. Every step saves what it needs to undo itself before it changes anything. If a step or its check fails, the completed steps are undone in reverse order, then the release's own If the release fails lane runs. Jobs survive reboots and power cuts: after a cut the agent finishes or rolls back the release cleanly, and steps that may not be safe to repeat (commands, scripts, webhooks) are not run twice unless you mark them safe.
| You ship | Step | What undo does |
|---|---|---|
| A Docker Compose stack | compose.up | The old compose file and .env come back, and the stack returns to exactly the images it ran before, without pulling |
| One container | container.replace | The old container comes back |
| A model | model.deploy | The current link points back at the previous version (two previous versions are kept by default) |
| A ROS workspace | ros.workspace.deploy | current points back. A failed build never switches |
| Code from Git | git.checkout | current points back, or the previous commit is checked out again |
| Files and archives | download, archive.extract, file.write | The previous file or folder returns |
| System packages | package.install, package.upgrade | Removed again, or the previous versions reinstalled while the package manager still offers them |
| A service restart | service.restart | Restarted again last, after every other undo, so it runs on its old files |
| A command or script | exec, script | Nothing. Add an undo command or rollback steps |
| A webhook | http.request | Only with an undo_request |
Commands and scripts are the gap. In the release builder (OTA Updates › Releases), each block can carry an undo command for the rollback lane: give every command block one. On every save the review warns about a command with no undo, a change with no check after it, an image tagged :latest and a password typed in plain text. Errors block publishing and warnings don't, so read the warnings.
How to verify: each block in the builder says what undoes it. Go through them before you publish and make sure nothing says it can't be undone unless you accept that on purpose.
Check that the robot works, not that the step finished
A container that started is not a robot that works. Follow every change with a check that proves the new version is doing its job. A failed check fails the release on that robot and rolls it back.
- An HTTP check (
health.waitwith typehttp): the status, and text the body must contain. Point it at an endpoint that reports the running version, so it fails while the old version is still answering. - ROS nodes and topic rates:
ros.launch.restartrestarts a service, container, Compose service or launch, then waits until the nodes you list are up and the topics you list publish atmin_rate_hz, as the agent's own ROS observer sees them. Restarted then means working. - Healthy containers:
compose.upwithwait(on by default) succeeds only when every service is running, healthy and has stayed up for 10 seconds. A crash-looping service fails the step with its last error line. - A service, a container, a TCP port or a command:
health.waitwith typeservice_active,container_running,tcporexec.
{"id": "launch", "type": "ros.launch.restart", "service": "arm-bringup",
"nodes": ["/planner", "/arm_driver"], "topics": ["/joint_states"],
"min_rate_hz": 30, "timeout_s": 180}Give service and ROS steps generous timeouts. A busy robot can take 30 seconds or more for one service call, and a check that times out rolls back a good release.
In the builder, add the check as a linked part of the block it checks. During a rollout, a failed check shows on that machine's row with the step's output, and its run ends rolled back.
Write the release once: a complete example
The builder writes releases for you, and its JSON view shows the same release as text you can review, diff and keep in your repository. This one updates a picking model in a night window. It puts the cell into maintenance mode, deploys the model, restarts the app, checks that the app reports the new version and turns maintenance mode off. If anything fails, everything is undone and your own system is told.
{
"variables": {"VERSION": "2.4.1"},
"preconditions": {
"min_free_mb": 4096,
"min_free_path": "/opt/models",
"min_battery_pct": 50,
"network": "unmetered",
"window": {"start": "22:00", "end": "05:00"}
},
"on_failure": "rollback",
"steps": [
{"id": "pause-cell", "type": "http.request",
"request": {"method": "POST", "url": "http://127.0.0.1:9000/maintenance/on"},
"undo_request": {"method": "POST", "url": "http://127.0.0.1:9000/maintenance/off"}},
{"id": "model", "name": "Picker model {{var:VERSION}}", "type": "model.deploy",
"url": "https://models.example.com/picker-{{var:VERSION}}.tar.gz",
"sha256": "<sha256 of the archive>",
"dest": "/opt/models/picker", "version": "{{var:VERSION}}"},
{"id": "restart", "type": "service.restart", "service": "picker"},
{"id": "check", "type": "health.wait",
"check": {"type": "http", "url": "http://127.0.0.1:8080/version", "contains": "{{var:VERSION}}"},
"timeout_s": 180},
{"id": "resume-cell", "type": "http.request", "rerun_on_resume": true,
"request": {"method": "POST", "url": "http://127.0.0.1:9000/maintenance/off"}}
],
"rollback": [
{"id": "notify", "type": "http.request", "continue_on_error": true,
"request": {"method": "POST", "url": "https://ops.example.com/ota-failed", "body": "{{device:name}}"}}
]
}What happens on each robot: it waits for the window, 4 GB free under /opt/models, at least 50 % battery and a network that isn't cellular, downloading the model ahead of time. In the window it enters maintenance mode and switches the model atomically, so the app never reads half a model. If /version doesn't report 2.4.1 within three minutes, the model link points back at the previous version, the service restarts on it, the maintenance request is undone and the webhook in the rollback lane runs. The run counts as a failure in the rollout.
Placeholders: {{var:NAME}} comes from the release's variables; {{device:name}} is a fact about the machine (also arch, id, group, os_id and hostname); {{secret:NAME}} is fetched on the machine when the step runs, never stored in the job and shown as *** in output.
Add a service restart after a model deploy, because apps keep the model they loaded. To serve a mixed fleet with one release, give a step a when condition (architecture, OS, tags, a file that exists or not, or a command that succeeds). Machines that don't match skip it.
Respect the robot's work: busy locks, windows and preconditions
An update that lands in the middle of a pick can drop a part or stop an arm mid-move. Tell PhysicalFleet when the robot must not be interrupted, and let releases wait for the right moment.
pf busy --reason "picking order 1182" --for 30m # for a while
pf busy --reason "assembly cycle" -- ./run_cycle.sh # while a command runs
pf busy # list busy locks
pf busy --clear # release themA lock held around a command is released when the command exits, or about a minute after it crashes, so a dead app never blocks updates forever. A lock lasts at most 7 days. pf needs root or membership of the physicalfleet group.
#!/bin/sh
# Defer updates while the battery is low. Read the level however your robot exposes it.
pct=$(cat /run/my-robot/battery_pct 2>/dev/null || echo 100)
if [ "$pct" -lt 40 ]; then
echo "battery at ${pct}%, waiting to charge"
exit 75
fi
exit 0What you see: the rollout shows the machine as deferred, with the reason (busy, the hook's line, outside the window, battery, disk or a cellular link). If the preconditions still don't hold after the release's Wait at most time (24 hours by default), the release fails on that machine without changing anything. A machine that holds a busy lock is not interrupted.
Preview on a real robot before you publish
Validation in the dashboard can't see that one robot is short of disk, that a secret isn't set for its group or that an image tag doesn't exist. Preview on a machine runs a dry run of the release on one real machine and changes nothing.
It reports which steps would run or be skipped and why, what each would change, missing images, secrets or disk space, unreachable URLs and the values your variables take on that machine. A preview isn't held back by pf busy, and because it installs nothing it isn't billed as an update.
Preview on one machine of each kind you run: each architecture, OS and image. Anyone in the organization can build drafts and preview. Owners and admins publish. A published release never changes: New version copies it for the next change, and the release page shows what changed against the previous version.
How to verify: the preview ends with a one-line summary, such as "2 of 3 steps would run (1 skipped: /opt/ros does not exist); no problems". Fix every problem it lists before you publish.
Pin every version: artifacts and newest-version sources
If two robots in one rollout can install different bytes, a rollback can't be trusted and a regression can't be traced. Never ship :latest. Ship exact versions.
v2.* and choose whether newest means most recently pushed or the highest version number. latest is never treated as a version.Each source gives you variables. For an image source named VISION, {{var:VISION_IMAGE}} is repo:tag@sha256:…, pinned by digest. In a Compose step:
# compose.yaml on the robot
services:
vision:
image: ${VISION_IMAGE}
# the compose.up step's env, written to .env next to it
VISION_IMAGE={{var:VISION_IMAGE}}When a rollout starts, every source is pinned: an image by its digest, a file by its SHA-256. Every machine in the rollout gets the same bytes, even if a new build is pushed halfway through. If a newer version appears between your review and Start, the wizard shows the review again, so nothing is installed unseen. Retry keeps the rollout's versions, and Roll back can reinstall the versions the release installed before.
Roll out in phases, canary first
A release that passed on one machine can still fail on a different board, OS or network. Phases limit how many robots one mistake reaches. OTA Updates › Rollouts › New rollout walks you through it:
- Release, and for a release with sources, which versions: the newest or ones you pick.
- Machines: a fleet filter (location, group, type, tags, status, health, architecture, OS, agent version) or picks by hand. A filter that matches nothing means no machine, never all. The plan shows each machine's phase and anything that would stop it: an agent too old for a step, a missing secret or another rollout.
- Phases and safety: the phases, the failure threshold, an optional wait after each phase and the health gate.
- When: now, or at a set time up to 90 days ahead. Nothing is sent until it starts.
| Preset | Phases | Use it for |
|---|---|---|
| All at once | 100 % | A test fleet or a single machine |
| Canary, then everyone | 1 machine, then 100 % | Small, low-risk changes |
| Careful | 10 %, 50 %, 100 % | Medium fleets |
| Canary, then careful | 1 machine, 10 %, 50 %, 100 % | Anything that touches motion, models or the network |
You can also set up to 20 phases of your own, as percentages or numbers of machines. Machines that are online now go first, and the first machines cover every architecture, OS and init system you have, so a problem on one kind shows in the first phase.
| Safety setting | Default |
|---|---|
| Stop when more than this share of a phase fails (judged continuously) | 20 % |
| Wait after each phase | 0 minutes |
| Health gate | Off. Turn it on (next section) |
| Machines updating at once | At most 200 |
| Offline machines can still install for | 7 days |
While it runs, offline machines don't hold their phase back: they keep the job and install when they return. A machine that goes silent for 30 minutes after starting counts as failing, because a release that breaks the network makes machines silent. Machines whose agent is too old for a step are skipped and don't count as failures.
Turn on the health gate, and give it something to measure
Failures aren't the only way a release goes wrong. A new model can install cleanly and make every robot slower or less accurate. The health gate stops the release that works but makes robots worse.
With the gate on, after each phase the rollout waits a soak time (30 minutes by default, at least 10), then compares the updated machines before and after against machines not updated yet. A fleet-wide change such as the time of day or a site's network isn't blamed on the release. It halts the rollout when:
- a guarded measurement gets worse by more than 20 %: model inference time, round trip or rate, control-loop rate, ROS topic rates, RL success, cycle yield and cycle time
- error events rise noticeably above the comparison machines
- more than 25 % of the updated machines get a new issue
A canary of one or two machines is also judged machine by machine: going silent after the update, or a guarded measurement stopping or moving the wrong way, fails it. Set On a regression, install to a known good published release, and a halt creates an automatic rollback rollout to it.
The gate only guards what your robots report. If none of the guarded measurements exist, its verdict is insufficient and the rollout continues. ROS topic rates need no code. For the rest, instrument the app once:
import physicalfleet as pf
policy = pf.instrument_policy(policy) # inference time and rate (always reassign)
loop = pf.loop("control", hz=30) # control-loop rate
with pf.episode(task="pick") as ep: # cycle yield and cycle time
while not done:
loop.tick()
with loop.phase("infer"):
action = policy.select_action(obs)
...
ep.set(success=grasped)Or start the app with pf run --name picker -- python3 app.py, which traces supported policy frameworks with no code changes. On ROS robots the agent can also count cycles from a result topic you already publish: it asks which one in Fleet › Agent requests.
What you see: each phase gets a one-sentence verdict on the rollout page, such as "inference time 200% higher (p50 10 ms → 30 ms)", and a halt notifies your alert channels.
When something fails: rollback, steering and rehearsal
On the robot, a failed step or check undoes the completed steps in reverse, restarts services last so they come back on their old files, then runs the release's rollback lane. Keep If a step fails at its default, Roll back. Use stop only on a test machine you want to inspect as it failed.
On the rollout, crossing the failure threshold or the health gate stops it, with the reason in one sentence. Machines that hadn't started never run the release.
| Action | Who | What happens |
|---|---|---|
| Pause | Everyone | Machines that started finish; nobody new gets it until you resume |
| Resume | Owners and admins | Continues a paused or stopped rollout |
| Cancel | Owners and admins | Machines that haven't started never get it |
| Retry | Owners and admins | A new rollout of the same release to the machines that failed or were held back |
| Roll back | Owners and admins | Installs another published release on the machines that installed this one |
| Explain with AI | Everyone | Which machines failed or wait, why, and what to do |
Afterwards, the alerts Inbox names the release that reached a problem's machines up to an hour before it started. Release impact on the release and rollout pages compares the machines that got the release with those that didn't, over equal windows before and after, and gives a verdict: improved, regressed, mixed, no change or insufficient.
Rehearse rollback. Every so often, roll a release that you know fails its check out to one test machine. Watch it roll back and confirm your undo commands do what you expect. Trust in rollback is what lets a team ship during the day.
Change network settings without stranding a robot
Editing Wi-Fi or netplan over a remote shell is a classic way to lose a robot: the change cuts the connection you made it over. Use the Network block (network.apply) instead.
It works like netplan try, but survives reboots. Before touching anything it arms a revert on the machine, applies the change, and keeps it only if the machine reaches PhysicalFleet over the new network within confirm_timeout_s (120 seconds by default). Otherwise the previous configuration is restored by the step, the agent or the Guardian. It takes a netplan, NetworkManager, systemd-networkd or wpa_supplicant config, a Wi-Fi network or a cellular APN, and runs one network change at a time.
{"id": "wifi", "type": "network.apply", "interface": "wlan0",
"wifi": {"ssid": "robots", "psk": "{{secret:WIFI_PSK}}"}}It is one of the newest step types, so be conservative with it. Preview it, try it first on a machine on your bench that you can reach with a keyboard, then roll it to a single canary with a long soak before the rest of the fleet. Keep Wi-Fi passwords and APN credentials in secrets, never in the release.
Keep the agent current, safely
The agent is what rolls everything else back, so its own updates are built to fail safe:
- Verified before it runs: the download's SHA-256 and the release's cryptographic signature are checked. A build not signed for your environment never installs.
- Installed beside the running version (A/B) and started once to confirm it reports the expected version before anything switches.
- Confirmed or rolled back: the new version must reach PhysicalFleet within two minutes, or the Guardian puts the previous version back. For the next ten minutes it is on probation, and a crash loop or a stopped heartbeat also switches back.
- A separate Guardian checks every 30 seconds. It restarts a hung agent, falls back to the last good or factory copy and reverts a network change that cut the machine off. After 10 minutes without the platform it checks in over HTTPS and accepts a few signed rescue actions (restart, roll back, reinstall, reboot), never a shell.
- No accidental downgrades: an older version installs only when someone asks for it explicitly.
This path is tested with simulated power cuts during agent updates, Compose and container deploys and rollbacks, as well as a full disk, a damaged state database and a 256 kbit/s link.
When a new agent is ready, OTA Updates › Releases shows Agent X is ready for N machines. One approval (owners and admins) starts a rollout to exactly the machines that are behind, in waves sized to your fleet, which stops on its own if more than one machine in ten fails. Agent updates wait for pf busy and the pre-update hook, for up to a day by default, and offline machines update when they're back. Agent updates are free.
Update agents before big releases: the builder says whether every machine's agent can run the release, with Update their agent when some can't.
- Every block has an automatic undo or an undo command, or the release has rollback steps.
- Every change is followed by a check that proves the new version works: a version endpoint, nodes and topic rates, or healthy containers.
- Preconditions are set: free disk, battery where it matters, an unmetered network for large downloads and a maintenance window for disruptive updates.
- Work that must not be interrupted is wrapped in pf busy, or guarded by a pre-update hook.
- Preview on a machine passed on one machine of each architecture, OS and image.
- No :latest anywhere: images pinned by digest and files by SHA-256, through Artifacts or newest-version sources.
- Secrets are used as {{secret:NAME}}, never typed into the release.
- The rollout uses Canary, then careful, with the 20 % failure threshold.
- The health gate is on with a 30-minute soak and a known good release named for automatic rollback.
- The guarded measurements exist: traced policies, pf.loop, episodes or a cycle topic, ROS topic rates.
- Rollback was rehearsed recently on a test machine.
- Agents are current through the one-click agent update.
Commands with no undo
A script that changes a config file can't be reversed automatically. Add an undo command to the block or a step in the rollback lane, or use a step type that undoes itself, such as file.write or compose.up.
Checking that it started, not that it works
A running service can still serve the old model or publish nothing. Check a version endpoint with contains, or let ros.launch.restart wait for the nodes and topic rates you expect.
Shipping :latest
A moving tag means robots in one rollout can run different code, and a rollback may pull the same broken image. Use exact tags, or newest-version sources that pin by digest when the rollout starts.
A health gate with nothing to measure
Without policy tracing, a control loop, episodes or ROS topics, the gate's verdict is insufficient and the rollout carries on. Instrument once with pf run or the Python library before relying on it.
Updating in the middle of a task
Without pf busy or a maintenance window, an update can restart the app mid-cycle. Hold a busy lock around each cycle, and put disruptive releases in a window.
Large downloads over cellular
A multi-gigabyte model over a SIM plan is slow and expensive. Add the unmetered-network precondition and let download-ahead fetch it on Wi-Fi or Ethernet.
Editing the network by hand
A typo in netplan over the remote terminal can cut the robot off for good. Use the Network block, which reverts the change if the robot can't reach PhysicalFleet over the new network.
Skipping the canary on a mixed fleet
All at once sends a release that only breaks one board or OS to every robot of that kind. Canary, then careful puts one of each kind first.
Written for PhysicalFleet as of December 3, 2026.
How do I roll back an OTA update on a robot?
Each robot rolls back by itself when a step or its check fails: completed steps are undone in reverse, services restart on their old files and the release's rollback steps run. For a release that installed fine but turned out to be bad, use Roll back on the rollout, which installs another published release on the machines that got this one. With the health gate on, that can happen automatically.
What happens if a robot loses power during an update?
Each step is journaled and saves what it needs to undo itself before it acts. When the robot comes back, the agent finishes the release or rolls it back cleanly. Commands, scripts and webhooks are not run a second time unless you mark them safe to repeat.
What does the health gate compare?
After each phase and a soak time (30 minutes by default), it compares the updated robots before and after against robots not updated yet: model inference time and rate, control-loop rate, ROS topic rates, RL success, cycle yield and cycle time, errors and new issues. It halts the rollout when a measurement gets worse by more than 20 % or more than a quarter of the updated robots get a new issue.
How do I stop an update from interrupting a robot mid-task?
Wrap the work in pf busy on the robot, for example pf busy --reason "assembly cycle" -- ./run_cycle.sh. Updates and reboots wait until the lock is released. You can also give releases a maintenance window and other preconditions, or add a pre-update hook that defers with exit code 75.
How do I update robots on cellular without using up the data plan?
Add the unmetered-network precondition to the release. The robot then waits for Wi-Fi or Ethernet before downloading or installing. Pin large files in Artifacts so retries and rollbacks reuse what is already on the robot.
Do I need a new release for every build?
No. Add newest-version sources to one release, such as a container image, an S3 folder, a GitHub release, a Hugging Face file or a Git branch. Each rollout installs the newest version, or one you pick, pinned by digest or SHA-256, so every robot in that rollout gets the same bytes.
Can I preview an update before it reaches the fleet?
Yes. Preview on a machine runs the release as a dry run on one real robot and changes nothing. It says which steps would run or be skipped and why, and flags missing secrets, images, disk space and unreachable URLs.
How much do OTA updates cost?
An update is one release installed on one machine: $0.10 each (free on the Free plan). Agent updates and health-gate rollbacks are free, and files linked from GitHub, S3, Hugging Face or a container registry download free.
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