Skip to content

Commit 4e9c333

Browse files
committed
Add composefs backend disk image build support
Wire bcvk --composefs-backend through the build system and CI so both ostree and composefs disk images are built and pushed to the registry. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Alice Frosi <afrosi@redhat.com>
1 parent 944bfdf commit 4e9c333

3 files changed

Lines changed: 41 additions & 4 deletions

File tree

.github/workflows/build-node-image.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,27 @@ jobs:
9797
podman push ${PUSH_DEST}:${TAG}-disk
9898
podman tag ${DISK_SRC} ${PUSH_DEST}:latest-disk
9999
podman push ${PUSH_DEST}:latest-disk
100+
101+
- name: Build composefs disk image
102+
working-directory: node-images/fedora
103+
run: |
104+
BOOTC_DIGEST="${{ steps.push-bootc.outputs.digest }}"
105+
PUSH_DEST="${{ steps.push-bootc.outputs.push_dest }}"
106+
if [ -n "${BOOTC_DIGEST}" ] && [ -n "${PUSH_DEST}" ]; then
107+
make build-disk-image-composefs BOOTC_IMAGE="${PUSH_DEST}" BOOTC_DIGEST="${BOOTC_DIGEST}"
108+
else
109+
make build-disk-image-composefs
110+
fi
111+
112+
- name: Push composefs disk image
113+
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push)
114+
working-directory: node-images/fedora
115+
run: |
116+
TAG=${{ steps.meta.outputs.tag }}
117+
DISK_SRC=$(make -s print-node-image-composefs)
118+
PUSH_DEST=${{ env.PUSH_REGISTRY }}/${{ env.PUSH_IMAGE }}
119+
120+
podman tag ${DISK_SRC} ${PUSH_DEST}:${TAG}-disk-composefs
121+
podman push ${PUSH_DEST}:${TAG}-disk-composefs
122+
podman tag ${DISK_SRC} ${PUSH_DEST}:latest-disk-composefs
123+
podman push ${PUSH_DEST}:latest-disk-composefs

node-images/fedora/Containerfile.disk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ARG STORAGE_PATH
99
ARG BOOTC_IMAGE
1010
ARG DISK_SIZE=10G
1111
ARG MEMORY=4G
12+
ARG BCVK_EXTRA_ARGS=""
1213
ENV CONTAINERS_STORAGE_CONF=/tmp/storage.conf
1314
RUN mkdir -p /output && \
1415
printf "[storage]\ndriver = \"overlay\"\ngraphroot = \"${STORAGE_PATH}\"\n" > $CONTAINERS_STORAGE_CONF && \
@@ -19,6 +20,7 @@ RUN mkdir -p /output && \
1920
--format qcow2 \
2021
--memory ${MEMORY} \
2122
--disk-size ${DISK_SIZE} \
23+
${BCVK_EXTRA_ARGS} \
2224
${BOOTC_IMAGE} \
2325
/output/disk.qcow2
2426
RUN podman run --rm ${BOOTC_IMAGE} kubeadm config images list > /output/images.txt

node-images/fedora/Makefile

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
.PHONY: build-bootc-image build-disk-image clean help
1+
.PHONY: build-bootc-image build-disk-image build-disk-image-composefs clean help
22

33
KUBE_MINOR ?= 1.35
44
FEDORA_VERSION ?= 44
55
DISK_SIZE ?= 10G
66
BUILD_MEMORY ?= 4G
7+
BCVK_EXTRA_ARGS ?=
78

89
IMAGE_TAG ?= v$(KUBE_MINOR)-fedora-$(FEDORA_VERSION)
910
REGISTRY ?= ghcr.io/alicefr/bink
1011
BOOTC_IMAGE ?= $(REGISTRY)/node:$(IMAGE_TAG)
1112
NODE_IMAGE ?= $(REGISTRY)/node:$(IMAGE_TAG)-disk
13+
NODE_IMAGE_COMPOSEFS ?= $(REGISTRY)/node:$(IMAGE_TAG)-disk-composefs
1214
BOOTC_DIGEST ?=
1315

1416
# Build the OCI bootc image (k8s + cri-o)
@@ -47,13 +49,17 @@ build-disk-image:
4749
--build-arg MEMORY="$(BUILD_MEMORY)" \
4850
--build-arg KUBE_MINOR="$(KUBE_MINOR)" \
4951
--build-arg BOOTC_DIGEST="$$BOOTC_DIGEST" \
52+
--build-arg BCVK_EXTRA_ARGS="$(BCVK_EXTRA_ARGS)" \
5053
-t $(NODE_IMAGE) \
5154
-f Containerfile.disk \
5255
.
5356
@echo "✅ Node image built: $(NODE_IMAGE)"
5457
@echo ""
5558
@echo "This image can be used with: bink cluster start --node-image $(NODE_IMAGE)"
5659

60+
build-disk-image-composefs:
61+
$(MAKE) build-disk-image BCVK_EXTRA_ARGS="--composefs-backend" NODE_IMAGE="$(NODE_IMAGE_COMPOSEFS)"
62+
5763
print-image-tag:
5864
@echo $(IMAGE_TAG)
5965

@@ -63,6 +69,9 @@ print-bootc-image:
6369
print-node-image:
6470
@echo $(NODE_IMAGE)
6571

72+
print-node-image-composefs:
73+
@echo $(NODE_IMAGE_COMPOSEFS)
74+
6675
clean:
6776
@echo "=== Cleaning up ==="
6877
podman rmi -f $(BOOTC_IMAGE) $(NODE_IMAGE) 2>/dev/null || true
@@ -72,9 +81,10 @@ help:
7281
@echo "Makefile for building bink node images (Fedora)"
7382
@echo ""
7483
@echo "Targets:"
75-
@echo " build-bootc-image - Build the OCI bootc image"
76-
@echo " build-disk-image - Build the OCI disk image with qcow2 (default)"
77-
@echo " clean - Remove built images"
84+
@echo " build-bootc-image - Build the OCI bootc image"
85+
@echo " build-disk-image - Build the OCI disk image with qcow2 (default, ostree backend)"
86+
@echo " build-disk-image-composefs - Build the OCI disk image with composefs backend"
87+
@echo " clean - Remove built images"
7888
@echo ""
7989
@echo "Variables:"
8090
@echo " BOOTC_IMAGE - Bootc OCI image name (default: $(BOOTC_IMAGE))"
@@ -83,3 +93,4 @@ help:
8393
@echo " FEDORA_VERSION - Fedora version (default: $(FEDORA_VERSION))"
8494
@echo " DISK_SIZE - VM disk size (default: $(DISK_SIZE))"
8595
@echo " BUILD_MEMORY - Memory for bcvk build (default: $(BUILD_MEMORY))"
96+
@echo " BCVK_EXTRA_ARGS - Extra arguments passed to bcvk to-disk (default: none)"

0 commit comments

Comments
 (0)