Skip to content

Mount an OCI image read-only into an actor - #2

Open
ronlv10 wants to merge 5 commits into
mainfrom
actortemplate-image-volume
Open

Mount an OCI image read-only into an actor#2
ronlv10 wants to merge 5 commits into
mainfrom
actortemplate-image-volume

Conversation

@ronlv10

@ronlv10 ronlv10 commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Adds an image source to ActorTemplate's VolumeSource: a container can mount the contents of an OCI image it does not run. This is how tooling gets into images built by third parties without rebuilding them — for example, an agent binary into a benchmark image.

spec:
  containers:
  - name: sandbox
    image: docker.io/example/benchmark@sha256:...
    command: ["/ate/agent"]
    volumeMounts:
    - name: agent
      mountPath: /ate
  volumes:
  - name: agent
    image:
      reference: registry.example.com/agent@sha256:...

How it works

atelet pulls the image through the existing layer cache and records the volume's layers in the bundle's overlay spec, next to the rootfs layers. ateom composes the volume inside the bundle — the cached layers with no writable layer on top, so the mount is read-only — and the container binds it at the declared path. The volume is composed per container: containers of one actor may mount the same volume, and each gets its own mount point inside its own bundle, all backed by the same shared layers. On resume the volume is re-composed the same way.

References must be digest-pinned, the same rule as container images: a snapshot is only valid against the exact bytes it was taken with.

On micro-VMs the volume rides the same read-only virtio-fs share as the container rootfs: ateom stages each composed volume beside the rootfs on the host, and the guest binds it into the container at the declared path.

@ronlv10
ronlv10 force-pushed the actortemplate-image-volume branch 6 times, most recently from ad1714b to 385e8a0 Compare August 13, 2026 19:32
A volume can name an OCI image; the reference must be digest-pinned and
mounted by at least one container. ateapi projects it into the workload
spec on its own volume type.
@ronlv10
ronlv10 force-pushed the actortemplate-image-volume branch from 385e8a0 to 776ec1d Compare August 13, 2026 20:42
The bundle overlay spec gains ImageVolumes; ateom composes each at
ateompath.ImageVolumeMountPath — a bind for one layer, an upperless
overlay for several, FinalizeLayer first so whiteouts hold.
resolveImageVolumes pulls each mounted image through the layer cache and
records its layers in the overlay spec; the OCI spec binds the composed
volume read-only at the declared path.
The micro-VM runtime builds its own guest OCI spec, so image volumes are
carried explicitly: ateompb.Container gains image_volume_mounts, staging
binds each composed volume into the read-only share beside the rootfs,
and the guest re-adds the binds at the declared paths.
A three-layer fixture pushed at test time: every layer visible, an upper
layer shadows a lower one, a whiteout hides a file, writes are refused,
and the volume survives suspend/resume.
@ronlv10
ronlv10 force-pushed the actortemplate-image-volume branch from 776ec1d to 416ac52 Compare August 13, 2026 21:48
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.

1 participant