converter: add dual EROFS image conversion#3
Conversation
Source containerd commit: 36f8999b946ed1e078d46496796ca54401423e3f Signed-off-by: Yifan Zhao <stopire@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds support for generating an OCI image index that contains both a “legacy” manifest (tar layers) and a corresponding EROFS manifest, connected via an annotation on the legacy manifest’s first layer.
Changes:
- Introduces
DualManifestConverterto build a dual-manifest OCI index and to convert per-platform entries in an existing index. - Adds
--erofs-dualtoctr-erofs images convertto enable dual-manifest output (mutually exclusive with--erofs). - Adds a native image format spec doc and comprehensive unit tests for dual-manifest behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
pkg/converter/dual_manifest.go |
Implements dual-manifest conversion logic and JSON (index/manifest/config) rewriting. |
pkg/converter/dual_manifest_test.go |
Adds tests for manifest/index conversion, platform handling, and GC label behavior. |
pkg/converter/converter.go |
Centralizes EROFS layer media type / legacy-layer annotation constants; uses constant in layer conversion. |
cmd/ctr-erofs/commands/convert.go |
Adds --erofs-dual flag and wires index-conversion mode into containerd’s converter pipeline. |
docs/erofs-native-image-spec.md |
Documents the dual-manifest index format, EROFS layer media type, and legacy-layer annotation contract. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
how do we append |
The EROFS descriptor inherits the platform from the original index/legacy config and append "erofs" to |
12f176b to
660d12f
Compare
|
how about renaming |
Add an --erofs-dual conversion mode that publishes an OCI image index containing both the original legacy manifest and a corresponding EROFS manifest for each selected platform. The legacy manifest is kept first for fallback compatibility, while the EROFS one is marked with the erofs OS feature. The dual converter rewrites EROFS configs with diff IDs for the generated EROFS blobs, stores EROFS layers using the native EROFS media type, and adds an annotation on the first legacy layer pointing to the matching EROFS manifest digest. It also preserves GC references for the generated index, manifests, configs, and layers. Assisted-by: Codex:GPT-5.4 Signed-off-by: Yifan Zhao <stopire@gmail.com>
660d12f to
0a26a59
Compare
| carry this annotation: | ||
|
|
||
| ```text | ||
| containerd.io/snapshot/erofs.native-image.manifest.digest |
There was a problem hiding this comment.
containerd.io/snapshot/erofs.native.manifest.digest
| @@ -0,0 +1,115 @@ | |||
| # EROFS Native Image Format | |||
There was a problem hiding this comment.
I think we need some compatible-format words in the subject; since it's just used for containerd which don't have native erofs support, so we need to explicitly point it out in the subject.
There was a problem hiding this comment.
the docs file name needs adoption too.
Add
--erofs-dualconversion support to generate an OCI image index that contains both legacy OCI manifests and matching EROFS manifests. The first layer of each legacy OCI manifest contains an annotation pointing to the corresponding EROFS manifest.This dual-manifest image format helps support containerd versions without native EROFS snapshotter support through a proxy snapshotter, and also leaves room for future lazy-loading support, while preserving compatibility with traditional OCI image consumers.
Usage:
ctr-erofs images convert --erofs-dual --oci localhost:5000/busybox:latest localhost:5000/busybox:erofs-dual