Add support for larger number of larger using GPT#181
Draft
dmcgowan wants to merge 2 commits into
Draft
Conversation
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>
There was a problem hiding this comment.
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
imagocrate 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use gpt to layout erofs partitions into a single vmdk device to attach
all erofs devices in a single block device.