Skip to content

Add support for larger number of larger using GPT#181

Draft
dmcgowan wants to merge 2 commits into
containerd:mainfrom
dmcgowan:gpt
Draft

Add support for larger number of larger using GPT#181
dmcgowan wants to merge 2 commits into
containerd:mainfrom
dmcgowan:gpt

Conversation

@dmcgowan
Copy link
Copy Markdown
Member

@dmcgowan dmcgowan commented May 7, 2026

Use gpt to layout erofs partitions into a single vmdk device to attach
all erofs devices in a single block device.

dmcgowan added 2 commits May 6, 2026 23:22
Use gpt to layout erofs partitions into a single vmdk device to attach
all erofs devices in a single block device.

Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Derek McGowan <derek@mcg.dev>
Copilot AI review requested due to automatic review settings May 7, 2026 06:26
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

Adds a new strategy for handling many EROFS layer mounts by packing plain (single-device) EROFS mounts into a single GPT-partitioned VMDK, reducing virtio-blk device consumption while preserving existing behavior for multi-device EROFS mounts.

Changes:

  • Defer and batch plain EROFS mounts in the shim; above a threshold, generate/attach one GPT VMDK and mount partitions (e.g., /dev/vda1, /dev/vda2, …).
  • Introduce GPT layout generation (header/tail blobs, partition table) and a GPT-aware VMDK descriptor writer that can use ZERO extents (or a padding-file fallback).
  • Add unit tests covering GPT layout/descriptor generation and mount transformation behavior; patch libkrun build to use a locally patched imago crate for VMDK extent-boundary correctness.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/shim/task/mount.go Defers plain EROFS mounts and conditionally packs them into a GPT-partitioned VMDK; keeps multi-device EROFS behavior inline.
internal/shim/task/mount_test.go Adds coverage for plain vs multi-device EROFS and GPT packing threshold behavior.
internal/erofs/vmdk.go Adds GPT VMDK descriptor emission (ZERO extents / padding fallback) and helper blob/pad writers.
internal/erofs/gpt.go Implements deterministic GPT layout computation and header/tail blob writers for partitioned layer disks.
internal/erofs/gpt_test.go Tests GPT layout correctness, determinism, CRCs, and header/tail structure.
internal/erofs/vmdk_gpt_test.go Tests GPT VMDK descriptor extent ordering and the to-file writer (aux file generation).
internal/erofs/no_copy_check_test.go Adds an informational “no data copy” test that currently runs as a normal unit test.
Dockerfile Patches imago in the libkrun build stage to fix extent-boundary reads for GPT VMDKs.

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

Comment on lines +28 to +36
// TestNoLayerDataCopy is a manual / informational test: it builds a GPT
// VMDK from 30 sparse 64-MiB layer files and reports the actual disk usage
// of every file produced. It demonstrates that the auxiliary files are
// tiny (a few KiB) and independent of layer count; layer data is referenced
// in place rather than copied.
//
// Run with: go test -run TestNoLayerDataCopy -v ./internal/erofs/
func TestNoLayerDataCopy(t *testing.T) {
const numLayers = 30
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