Deploy, and roll back with a pull
You will: Ship the robot image by digest, and make rollback something that cannot fail to build.
Builds on A release is a tag plus evidence and A pipeline for a machine with motors.
A robot is a deployment target with awkward properties. It may be on a flaky home network. It cannot be scaled horizontally. Restarting it has physical consequences. A bad web deploy serves errors; a bad robot deploy moves something.
Most of what you know still applies, and the most important piece is
the oldest: if the only way back is a successful build, you do not
have a rollback — you have a hope. Every push to main publishes the
robot image under an immutable sha- tag, for both architectures, so
the same image runs on a mini PC or a Raspberry Pi next to the arm.
Rolling back is pulling an older tag and starting it. Nothing is
rebuilt, so the version you return to is the version that was tested.
Deployment is deliberately asymmetric. The robot pulls a published
image, because it is remote and rollback has to be a pull. The small
fleet view is designed to be built on the shared server from a
checkout, like every other product on that box, because a second
deployment model there would buy nothing. That half is a design, not a
running service: the fleet view has not been deployed anywhere yet, and
deploy/README.md is the procedure for when it is.
And nothing reaches into the robot. Robots sit behind home routers where inbound connections do not work — but the real reason is that a robot must never wait on a server. Each robot pushes a small report every ten seconds, one way. This was demonstrated rather than asserted: killing the fleet service mid-run left the robot reporting ready and its scenarios passing, while its reporter logged a single, throttled warning. Losing the network degrades what you can see. It must never degrade what the robot can do.
In the simulation
The robot-side counterpart of a pull: Record keeps a motion exactly as it ran, and Replay brings that same motion back without working anything out again. Nothing is rebuilt, so what you return to is what you saw.
Kinematic: joints move at their real speed limit, but there is no gravity, no load and no physics. That is what the steps below are for.
The SO-101 loads as you reach it.
make drive keysIn this lesson
- Press Record, send the arm to
readywith its button, and press Record again there to stop. - Move on to something else. Send the arm to
rest. - Roll back. Press Replay and let it finish at
ready, the version you recorded.
Joints · SO-101 follower
1–5 joint · , . jog · [ ] jaw · - + step · h home · f frames
the keys of make drive
The buttons do what the keys do: hold one to repeat.
Limits from the description; speed capped at 1.7434 rad/s, the servo's datasheet derated. Poses from the profile.
Inspector
Code
The repository's own code behind what you do here appears once you move the arm.
Do it
Build the robot image if you have not, and read what it says about itself.
make runtime docker inspect --format '{{json .Config.Labels}}' threevn-robotics-runtime:localExpect: Source, licence, revision, creation time and title — answerable without starting it.
Read the rollback procedure. It is four commands.
grep -n -A10 "### Rolling back is a pull" docs/deployment.mdRehearse it locally: tag your current image as "previous", build a change, then roll back to "previous" without building anything.
docker tag threevn-robotics-runtime:local threevn-robotics-runtime:previous docker run --rm threevn-robotics-runtime:previous bash -lc 'echo "$THREEVN_GIT_COMMIT"'
When it goes wrong
A deploy failed halfway and the robot is down.
Why: The old container was stopped before the new image had finished downloading.
Fix: Pull first, then replace. A failed pull leaves the old version running.
The robot "rolled back" but is behaving like the broken version.
Why: Rolled back to a moving tag, like latest, that someone had already moved.
Fix: Roll back to an immutable sha- tag, or a digest.
Terms
- Immutable tag
- An image tag that is never moved once pushed — here
sha-<commit>. Safe to roll back to. - Pull-based rollback
- Returning to a previous version by pulling an image that already exists, never by rebuilding.
- Push telemetry
- The robot sending reports outwards on its own schedule, so it never waits on, or is reachable from, a server.
Every term in the course: glossary.
Check yourself
Answer in your head first, then open it.
Why must rollback never depend on a build?
The moment you need a rollback is the moment something is broken, possibly the build itself. And a rebuilt image is not the image that was tested.
Why does the robot push, rather than the server pulling from it?
Robots are behind home routers that block inbound connections — and more fundamentally, a robot must never wait on a server.
Stretch
Write the rollback runbook for your own robot in five lines or fewer: how you find the last good version, how you bring it back, and how you know it worked. Which line depends on something that does not exist yet?