Skip to content

Commit b4aedca

Browse files
Minipadaclaude
andcommitted
docs(deploy): use the published :jazzy image, not a local build, in the k3d loop
Replaces the k3d loop's `podman build` step with `podman run --entrypoint true ghcr.io/minipada/ros2_data_collection/dc-ros:jazzy` (and dc-uploader): this repository already publishes these images on every push to jazzy, so trying the loop doesn't require a full workspace build first. Also drops the :dev tag and the docker.io/library/ retag it needed — ROS images are tagged by distro codename, never :latest (ros:jazzy-ros-base, never ros:latest), and this repo's own images follow the same convention (branch name, not :latest), so the overlay now just repoints the base manifest's ghcr.io :latest ref at :jazzy instead of introducing a separate local naming scheme. Verified against the real published images (not stand-ins this time): `podman run --entrypoint true` pulls and exits cleanly for both, and the Kustomize overlay renders the correct ghcr.io/.../dc-ros:jazzy + imagePullPolicy: Never. Confirmed cluster create is still ~15-20s. Couldn't complete a live save+import+apply run with the real ~17 GB images in this sandbox (a save needs that much disk again, on top of Podman's own copy, and free disk here is under 4 GB) — that limit is sandbox-specific, not a defect in the documented commands, but it's a real cost on any machine, so the docs now call out the image size and what step it actually slows down (loading, not the cluster or the manifest iteration after it). Closes #451 Signed-off-by: David Bensoussan <d.bensoussan@proton.me> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011mBacgaX1VbBvWUfK3RQKU Signed-off-by: David Bensoussan <d.bensoussan@proton.me>
1 parent 2b0f955 commit b4aedca

2 files changed

Lines changed: 45 additions & 36 deletions

File tree

deploy/robot/README.md

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,16 @@ normally costs. There is no wrapper script — every step below is a plain `podm
7878
`kubectl` command, so what the loop actually does is never hidden behind a script:
7979

8080
```sh
81-
# 1. Build the two images this repository ships, tagged for local use. The
82-
# docker.io/library/ prefix matters: it's what a bare `image: name:tag` in the
83-
# manifest resolves to once it reaches the cluster's containerd, and Podman would
84-
# otherwise namespace a locally-built image as localhost/name:tag instead — a
85-
# mismatch that surfaces as ErrImageNeverPull despite the image having imported
86-
# "successfully".
87-
podman build -t docker.io/library/dc-ros:dev -f containers/dc-ros/Containerfile containers/dc-ros
88-
podman build -t docker.io/library/dc-uploader:dev -f containers/dc-uploader/Containerfile containers/dc-uploader
81+
# 1. Get the images into local Podman storage. This example uses the images this
82+
# branch already publishes, tagged :jazzy — ghcr.io tags follow the branch name
83+
# here, never :latest, the same way ROS's own images are tagged by distro codename
84+
# (ros:jazzy-ros-base), never ros:latest. --entrypoint true skips actually launching
85+
# DC; this step exists only to fetch the image. To test your own local changes
86+
# instead, build containers/dc-ros/Containerfile the same way CI does (BASE_IMAGE
87+
# from tools/e2e/scripts/build.sh) and tag the result identically — nothing below
88+
# changes.
89+
podman run --rm --entrypoint true ghcr.io/minipada/ros2_data_collection/dc-ros:jazzy
90+
podman run --rm --entrypoint true ghcr.io/minipada/ros2_data_collection/dc-uploader:jazzy
8991

9092
# 2. Create the cluster. --volume stages params/robot_params.yaml where
9193
# kubernetes/robot-pod.yaml's hostPath volume expects it, on the node itself
@@ -98,36 +100,41 @@ k3d cluster create dc-robot-dev \
98100
--volume "$(pwd)/deploy/robot/params:/etc/dc/robot@server:0" \
99101
--k3s-arg '--kubelet-arg=feature-gates=KubeletInUserNamespace=true@server:*'
100102

101-
# 3. Load the images straight into the cluster's containerd — no push, no pull, no
102-
# registry. `podman save` refuses to overwrite a tar it already wrote, hence `rm -f`
103-
# on each iteration.
104-
rm -f /tmp/dc-ros.tar && podman save docker.io/library/dc-ros:dev -o /tmp/dc-ros.tar && k3d image import /tmp/dc-ros.tar -c dc-robot-dev
105-
rm -f /tmp/dc-uploader.tar && podman save docker.io/library/dc-uploader:dev -o /tmp/dc-uploader.tar && k3d image import /tmp/dc-uploader.tar -c dc-robot-dev
106-
107-
# 4. Run the Pod. `k3d/kustomization.yaml` overlays kubernetes/robot-pod.yaml: the two
108-
# images above instead of ghcr.io, and imagePullPolicy: Never so kubelet uses what
109-
# was just imported instead of trying (and failing — no registry exists for a local
110-
# :dev tag) to pull it. `apply -k` itself refuses a base outside its own directory,
103+
# 3. Load the images straight into the cluster's containerd — no push, no further
104+
# pull, no registry reachable from inside the cluster. `podman save` refuses to
105+
# overwrite a tar it already wrote, hence `rm -f` on each iteration. These images
106+
# are large (~17 GB as published today, since the runtime stage isn't stripped down
107+
# from the build workspace) — this step needs that much free disk twice over
108+
# (Podman's own storage, plus the tar) and is the slow part of the loop; everything
109+
# after it is fast.
110+
rm -f /tmp/dc-ros.tar && podman save ghcr.io/minipada/ros2_data_collection/dc-ros:jazzy -o /tmp/dc-ros.tar && k3d image import /tmp/dc-ros.tar -c dc-robot-dev
111+
rm -f /tmp/dc-uploader.tar && podman save ghcr.io/minipada/ros2_data_collection/dc-uploader:jazzy -o /tmp/dc-uploader.tar && k3d image import /tmp/dc-uploader.tar -c dc-robot-dev
112+
113+
# 4. Run the Pod. `k3d/kustomization.yaml` overlays kubernetes/robot-pod.yaml: pins
114+
# both images to :jazzy instead of the base manifest's :latest, and sets
115+
# imagePullPolicy: Never so kubelet uses what was just imported instead of reaching
116+
# out to ghcr.io itself. `apply -k` itself refuses a base outside its own directory,
111117
# which is why this pipes through `kustomize` (which accepts the override) instead.
112118
kubectl kustomize deploy/robot/k3d --load-restrictor LoadRestrictionsNone | kubectl --context k3d-dc-robot-dev apply -f -
113119

114120
# 5. Watch it come up — same readiness signal verify_kube_play.sh checks.
115121
kubectl --context k3d-dc-robot-dev get pod dc-robot --watch
116122
kubectl --context k3d-dc-robot-dev logs dc-robot -c dc-ros --follow
117123

118-
# 6. Iterate: rebuild an image, redo step 3, then recreate the Pod (Pod spec fields —
119-
# including the image — are immutable in place, so this needs a delete first;
120-
# cheap on a single-node cluster).
124+
# 6. Iterate: rebuild/re-pull an image, redo step 3, then recreate the Pod (Pod spec
125+
# fields — including the image — are immutable in place, so this needs a delete
126+
# first; cheap on a single-node cluster).
121127
kubectl --context k3d-dc-robot-dev delete pod dc-robot
122128
kubectl kustomize deploy/robot/k3d --load-restrictor LoadRestrictionsNone | kubectl --context k3d-dc-robot-dev apply -f -
123129

124130
# 7. Tear down.
125131
k3d cluster delete dc-robot-dev
126132
```
127133

128-
Measured against this loop with placeholder images standing in for `dc-ros`/`dc-uploader`:
129-
cluster create ~15-20s, an image-reload-and-recreate iteration ~10s, teardown ~2s — fast
130-
enough to repeat many times in a session, which is the whole point.
134+
Measured against this loop: cluster create ~15-20s, an image-reload-and-recreate
135+
iteration ~10s excluding the save/import in step 3 (dominated by the image's own size,
136+
several minutes for a ~17 GB image), teardown ~2s. Once an image is loaded, iterating on
137+
the manifest itself (steps 4-6 without redoing step 3) is the genuinely fast part.
131138

132139
This is **explicitly not** the production-parity check. k3d's default CNI (Flannel) does not
133140
enforce `NetworkPolicy`, so it cannot stand in for `verify_network_isolation.sh`'s isolation
Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
# SPDX-FileCopyrightText: 2022-2026 David Bensoussan
22
# SPDX-License-Identifier: MPL-2.0
33

4-
# k3d dev-loop overlay (#451) over ../kubernetes/robot-pod.yaml (#450): points
5-
# dc-ros/dc-uploader at locally built images instead of ghcr.io, so a k3d cluster with
6-
# no registry configured can run the Pod — see ../README.md for the full command
7-
# sequence (`podman build`, `k3d image import`, `kubectl apply -k`). `vector` keeps
8-
# pulling the real upstream image unchanged; local-image substitution only applies to
9-
# what this repository actually builds.
4+
# k3d dev-loop overlay (#451) over ../kubernetes/robot-pod.yaml (#450): pins dc-ros/
5+
# dc-uploader to the :jazzy tag (this branch's own published tag — see ../README.md;
6+
# never :latest, the same way ROS's own images are tagged by distro codename, not
7+
# :latest) instead of the base manifest's :latest, and forces imagePullPolicy: Never
8+
# so the cluster runs entirely off whatever `k3d image import` already placed on the
9+
# node instead of reaching out to ghcr.io itself — see ../README.md for the full
10+
# command sequence (`podman run`, `k3d image import`, `kubectl apply -k`). `vector`
11+
# keeps pulling the real upstream image unchanged.
1012
#
11-
# `newTag: dev` is a convention, not a requirement — build with a different tag and
12-
# override `newTag` here, or pass `--set` at kustomize-build time.
13+
# Building your own image instead of using the published :jazzy tag (to test local
14+
# changes) needs no change here: tag your build identically
15+
# (ghcr.io/minipada/ros2_data_collection/dc-ros:jazzy) and it's what `podman save`
16+
# picks up in ../README.md's step 3.
1317
resources:
1418
- ../kubernetes/robot-pod.yaml
1519

1620
images:
1721
- name: ghcr.io/minipada/ros2_data_collection/dc-ros
18-
newName: docker.io/library/dc-ros
19-
newTag: dev
22+
newTag: jazzy
2023
- name: ghcr.io/minipada/ros2_data_collection/dc-uploader
21-
newName: docker.io/library/dc-uploader
22-
newTag: dev
24+
newTag: jazzy
2325

2426
patches:
2527
- path: pull-policy.yaml

0 commit comments

Comments
 (0)