Update node image#48
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the Fedora node image build to record the bootc image digest as a build-arg and install vim in the node image, enabling labeling of the node image with the underlying bootc image digest and providing a minimal editor in the image. Flow diagram for updated Fedora node image build with BOOTC_DIGESTflowchart TD
A[make build-disk-image] --> B[podman info to set STORAGE_PATH]
B --> C[podman inspect to set BOOTC_DIGEST]
C --> D[podman build Containerfile.disk]
D --> E[--build-arg BOOTC_DIGEST]
D --> F[Resulting node image labeled with bootc digest]
subgraph Containerfile
G[bootc-base-imagectl build-rootfs]
G --> H[Install vim-minimal]
end
F --> G
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="node-images/fedora/Makefile" line_range="29-31" />
<code_context>
build-disk-image: build-bootc-image
@echo "=== Building node image with qcow2 disk ==="
STORAGE_PATH=$$(podman info --format '{{.Store.GraphRoot}}') && \
+ BOOTC_DIGEST=$$(podman inspect --format '{{.Digest}}' $(BOOTC_IMAGE)) && \
podman build \
--cap-add=SYS_ADMIN \
</code_context>
<issue_to_address>
**suggestion:** Consider using a more robust inspect format for the image digest or handling the case where `.Digest` is empty.
`{{.Digest}}` may be empty for some locally-built images, which would pass an empty `BOOTC_DIGEST` into the build and hide the failure. Consider using something like `{{index .RepoDigests 0}}` or at least checking that `BOOTC_DIGEST` is non-empty before continuing, so failures are explicit instead of silently losing the digest.
```suggestion
STORAGE_PATH=$$(podman info --format '{{.Store.GraphRoot}}') && \
BOOTC_DIGEST=$$(podman inspect --format '{{index .RepoDigests 0}}' $(BOOTC_IMAGE)) && \
test -n "$$BOOTC_DIGEST" || { echo "ERROR: Failed to determine BOOTC_DIGEST for $(BOOTC_IMAGE)"; exit 1; } && \
podman build \
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| STORAGE_PATH=$$(podman info --format '{{.Store.GraphRoot}}') && \ | ||
| BOOTC_DIGEST=$$(podman inspect --format '{{.Digest}}' $(BOOTC_IMAGE)) && \ | ||
| podman build \ |
There was a problem hiding this comment.
suggestion: Consider using a more robust inspect format for the image digest or handling the case where .Digest is empty.
{{.Digest}} may be empty for some locally-built images, which would pass an empty BOOTC_DIGEST into the build and hide the failure. Consider using something like {{index .RepoDigests 0}} or at least checking that BOOTC_DIGEST is non-empty before continuing, so failures are explicit instead of silently losing the digest.
| STORAGE_PATH=$$(podman info --format '{{.Store.GraphRoot}}') && \ | |
| BOOTC_DIGEST=$$(podman inspect --format '{{.Digest}}' $(BOOTC_IMAGE)) && \ | |
| podman build \ | |
| STORAGE_PATH=$$(podman info --format '{{.Store.GraphRoot}}') && \ | |
| BOOTC_DIGEST=$$(podman inspect --format '{{index .RepoDigests 0}}' $(BOOTC_IMAGE)) && \ | |
| test -n "$$BOOTC_DIGEST" || { echo "ERROR: Failed to determine BOOTC_DIGEST for $(BOOTC_IMAGE)"; exit 1; } && \ | |
| podman build \ |
| build-disk-image: build-bootc-image | ||
| @echo "=== Building node image with qcow2 disk ===" | ||
| STORAGE_PATH=$$(podman info --format '{{.Store.GraphRoot}}') && \ | ||
| BOOTC_DIGEST=$$(podman inspect --format '{{.Digest}}' $(BOOTC_IMAGE)) && \ |
There was a problem hiding this comment.
Hmm, the problem with this is that we haven't pushed the bootc image yet so we don't have the actual pushed digest. At push time, layers are compressed which will yield a different manifest digest than what we get here.
So I think this would require building the bootc image, pushing it (use podman push --digestfile foo ...) and then build the disk image (and the BOOTC_DIGEST would be $(cat foo)).
Alternatively... don't worry about digests, and just use tags. Derive the tag name from the date.
There was a problem hiding this comment.
mmh maybe I'm missing something but the label is correct and matches what bootc reports. Example:
podman inspect --format '{{index .Config.Labels "bink.bootc-image-digest"}}' ghcr.io/alicefr/bink/node:v1.35-fedora-44-disk
sha256:903caa303fbf9db5250c7943b63a44f774b9c52b825d0e7865672e9cf11ce09dOn a booted node started with --node-image corresponding to the one we just inspected:
[root@controller ~]# bootc status
● Booted image: registry.cluster.local:5000/node:latest
Digest: sha256:903caa303fbf9db5250c7943b63a44f774b9c52b825d0e7865672e9cf11ce09d (amd64)
Timestamp: 2026-06-04T12:33:32Z
Add
vimand the label with the cluster node image and digestSummary by Sourcery
Update the Fedora node image build to embed the bootc image digest and include vim in the node image.
New Features:
Enhancements: