Skip to content

oci: Add fast path for oci: transport using ocidir crate#233

Open
cgwalters wants to merge 5 commits intocomposefs:mainfrom
cgwalters:fastpath-oci-import
Open

oci: Add fast path for oci: transport using ocidir crate#233
cgwalters wants to merge 5 commits intocomposefs:mainfrom
cgwalters:fastpath-oci-import

Conversation

@cgwalters
Copy link
Collaborator

When importing from local OCI layout directories (oci: transport), read
the layout directly instead of going through skopeo; this path
is faster.

But another motivation here is that right now the skopeo proxy
always peels manifest lists, but I want to add proper support
for storing those. Fetching from local oci helps us write
unit/integration tests for that without blocking on patching
skopeo.

@cgwalters cgwalters force-pushed the fastpath-oci-import branch 2 times, most recently from 168de92 to 256bd97 Compare February 26, 2026 19:26
@cgwalters
Copy link
Collaborator Author

OK this now depends on bootc-dev/ocidir-rs#57 which cleans this up a lot.

@cgwalters cgwalters force-pushed the fastpath-oci-import branch from 33304b6 to cec8563 Compare March 5, 2026 16:49
@cgwalters cgwalters marked this pull request as ready for review March 5, 2026 16:51
@cgwalters cgwalters closed this Mar 5, 2026
@cgwalters cgwalters reopened this Mar 5, 2026
@cgwalters cgwalters force-pushed the fastpath-oci-import branch from f1be28a to cc11746 Compare March 6, 2026 02:08
@cgwalters cgwalters enabled auto-merge (rebase) March 6, 2026 12:25
@jeckersb
Copy link
Collaborator

jeckersb commented Mar 6, 2026

Looks like this needs rebased after #248 landed

Extract decompression, tar import, blob storage, and media type
checking from skopeo.rs and oci_image.rs into a reusable layer module.
This prepares for adding a direct OCI layout import path that needs the
same functionality without going through the skopeo proxy.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Colin Walters <walters@verbum.org>
ocidir 0.7.1 adds open_image_this_platform() for resolving manifest
lists, which is needed for the upcoming OCI layout fast path. Move both
ocidir and cap-std-ext to workspace dependencies so they stay in sync
across composefs-oci and integration-tests.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Colin Walters <walters@verbum.org>
Use containers_image_proxy::ImageReference to parse the image
reference once in pull_image() and pass it through to ImageOp::new(),
which now takes &ImageReference instead of re-parsing the transport
from the raw string. This also lets us use open_image_ref() instead
of open_image().

This prepares for transport-based dispatch (e.g. fast-pathing oci:
references) without manual string prefix matching.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Colin Walters <walters@verbum.org>
For local OCI layout directories (oci: transport), read the layout
directly using the ocidir crate instead of going through the
containers-image-proxy / skopeo subprocess. This avoids subprocess
spawning, IPC overhead, and proxy protocol parsing for local imports.

The new oci_layout module handles manifest list resolution for the
current platform via ocidir's open_image_this_platform(), imports
layers in parallel using the shared layer module, and produces
identical splitstream output to the proxy path.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Colin Walters <walters@verbum.org>
Ensure all import paths add named stream refs in the order that
layers appear in the OCI image config (diff_ids), rather than in
whatever order the import happens to process them (e.g. sorted by
size for parallel fetching, or non-deterministic HashMap iteration).

The skopeo, oci_layout, and write_config paths now iterate the
config diff_ids array and look up layer verities by key, returning
an error if any layer verity is missing. The write_manifest
signature changes from HashMap to an ordered slice so callers
control the order structurally.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters force-pushed the fastpath-oci-import branch from cc11746 to 2af7a01 Compare March 6, 2026 23:14
@cgwalters
Copy link
Collaborator Author

Looks like this needs rebased after #248 landed

Done

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