Skip to content

Add support for larger number of larger using GPT#181

Merged
dmcgowan merged 2 commits into
containerd:mainfrom
dmcgowan:gpt
Jun 9, 2026
Merged

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

Conversation

@dmcgowan

@dmcgowan dmcgowan commented May 7, 2026

Copy link
Copy Markdown
Member

close #111

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

Copilot AI review requested due to automatic review settings May 7, 2026 06:26

Copilot AI left a comment

Copy link
Copy Markdown

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 thread internal/erofs/no_copy_check_test.go

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 73 changed files in this pull request and generated 2 comments.

Comment thread internal/shim/task/mount.go
Comment thread internal/shim/task/mount.go
@dmcgowan dmcgowan force-pushed the gpt branch 2 times, most recently from b9946ac to 669ca9a Compare June 7, 2026 01:29
Copilot AI review requested due to automatic review settings June 7, 2026 01:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 71 changed files in this pull request and generated 3 comments.

Comment thread internal/shim/task/mount.go Outdated
Comment thread internal/shim/task/mount.go
Comment thread test/shim/shim_test.go Outdated
Comment thread internal/erofs/gpt.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 71 changed files in this pull request and generated 3 comments.

Comment thread internal/erofs/vmdk.go
Comment thread test/shim/shim_test.go Outdated
Comment thread internal/shim/task/mount.go

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread Dockerfile
Comment thread internal/erofs/vmdk.go
Comment thread internal/erofs/vmdk.go
@dmcgowan dmcgowan marked this pull request as ready for review June 8, 2026 18:30
Copilot AI review requested due to automatic review settings June 8, 2026 18:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread internal/shim/task/mount.go
Signed-off-by: Derek McGowan <derek@mcg.dev>

@hsiangkao hsiangkao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Otherwise it looks good to me.

Comment thread internal/erofs/gpt.go Outdated
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>
Copilot AI review requested due to automatic review settings June 9, 2026 03:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread internal/shim/task/mount.go
@dmcgowan dmcgowan requested a review from hsiangkao June 9, 2026 03:18
@dmcgowan dmcgowan merged commit 9f321b7 into containerd:main Jun 9, 2026
15 checks passed
@dmcgowan dmcgowan deleted the gpt branch June 9, 2026 05:49
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.

Consider generating GPT partition table if EROFS fsmerge is disabled

3 participants