Skip to content

feat: add urunc-ready OCI image for helloworld-c#89

Merged
danbugs merged 5 commits into
mainfrom
feat/urunc-hello-image
Jun 3, 2026
Merged

feat: add urunc-ready OCI image for helloworld-c#89
danbugs merged 5 commits into
mainfrom
feat/urunc-hello-image

Conversation

@danbugs
Copy link
Copy Markdown
Contributor

@danbugs danbugs commented Jun 3, 2026

Add a urunc-compatible OCI image for the helloworld-c example, enabling hyperlight-unikraft workloads to run on Kubernetes via urunc (CNCF unikernel container runtime).

urunc treats hyperlight-unikraft as a host-level VMM (like QEMU), with the OCI image carrying the Unikraft kernel + initrd payload. This follows the same pattern as hello-qemu-unikraft and hello-firecracker-unikraft in the urunc ecosystem.

  • Add urunc.Dockerfile, urunc.json, and URUNC.md to examples/helloworld-c/
  • Add just urunc-image recipe for local builds
  • Add publish-urunc-hello CI job to publish to GHCR
  • Sync Cargo.lock with 0.9.0 version bump

Related: urunc-dev/urunc#140, urunc-dev/urunc#632

danbugs added 5 commits June 3, 2026 00:33
Signed-off-by: danbugs <danilochiarlone@gmail.com>
Signed-off-by: danbugs <danilochiarlone@gmail.com>
Signed-off-by: danbugs <danilochiarlone@gmail.com>
Signed-off-by: danbugs <danilochiarlone@gmail.com>
Signed-off-by: danbugs <danilochiarlone@gmail.com>
Copilot AI review requested due to automatic review settings June 3, 2026 00:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a urunc-compatible OCI image packaging flow for the examples/helloworld-c Unikraft workload, enabling it to be run under Kubernetes/containerd using the urunc unikernel runtime while also syncing the host crate lockfile to the 0.9.0 version bump.

Changes:

  • Added urunc.Dockerfile, urunc.json, and URUNC.md to package and document a minimal urunc OCI image (kernel + initrd + metadata).
  • Added a just urunc-image recipe to build the urunc-ready image locally.
  • Added a publish-urunc-hello GitHub Actions job to build and publish the image to GHCR; updated host/Cargo.lock for the 0.9.0 bump.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
host/Cargo.lock Updates the lockfile entry to reflect hyperlight-unikraft-host version 0.9.0.
examples/helloworld-c/URUNC.md Adds end-user documentation for building/importing/running the image with urunc + containerd.
examples/helloworld-c/urunc.json Adds urunc metadata file (base64-encoded values) for runtimes that don’t propagate annotations.
examples/helloworld-c/urunc.Dockerfile Adds the OCI image build (scratch image containing kernel + initrd + metadata).
examples/helloworld-c/Justfile Adds urunc-image target to build the urunc image locally.
.github/workflows/publish-examples.yml Adds CI job to build and publish the urunc-ready image to GHCR.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +190 to +195
- name: Install kraft-hyperlight
if: steps.kraft-cache.outputs.cache-hit != 'true'
run: |
git clone --branch hyperlight-platform --depth 1 https://github.com/danbugs/kraftkit.git /tmp/kraftkit
cd /tmp/kraftkit && go build -o /usr/local/bin/kraft-hyperlight ./cmd/kraft

Comment on lines +8 to +11
FROM scratch
COPY .unikraft/build/helloworld-hyperlight_hyperlight-x86_64 /unikernel/kernel
COPY --from=build /output.cpio /unikernel/initrd.cpio
COPY urunc.json /urunc.json
- `/unikernel/initrd.cpio` — CPIO archive containing `/bin/hello` (static-PIE C binary)
- `/urunc.json` — urunc annotations identifying this as a `hyperlight` + `unikraft` workload

When urunc runs the image, it finds `hyperlight-unikraft` on the host, bind-mounts it along with `/dev/kvm` into an isolated rootfs, and exec's:
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linux Benchmarks

Details
Benchmark suite Current: 66143d4 Previous: 05c79a7 Ratio
hello_world (median) 20 ms 20 ms 1
pandas (median) 90 ms 110 ms 0.82
density (per VM) 11 MB 11 MB 1
snapshot (disk) 656 MiB 656 MiB 1

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows Benchmarks

Details
Benchmark suite Current: 66143d4 Previous: 05c79a7 Ratio
hello_world (median) 343 ms 310 ms 1.11
pandas (median) 1039 ms 832 ms 1.25
density (per VM) 656 MB 656 MB 1
snapshot (disk) 664 MiB 664 MiB 1

This comment was automatically generated by workflow using github-action-benchmark.

@danbugs danbugs merged commit f51e9da into main Jun 3, 2026
80 checks passed
@danbugs danbugs deleted the feat/urunc-hello-image branch June 3, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants