oci: Add fast path for oci: transport using ocidir crate#233
oci: Add fast path for oci: transport using ocidir crate#233cgwalters wants to merge 5 commits intocomposefs:mainfrom
Conversation
168de92 to
256bd97
Compare
|
OK this now depends on bootc-dev/ocidir-rs#57 which cleans this up a lot. |
256bd97 to
33304b6
Compare
33304b6 to
cec8563
Compare
f1be28a to
cc11746
Compare
|
Looks like this needs rebased after #248 landed |
cc11746 to
2af7a01
Compare
Done |
|
Conflicts again, and while I was looking at doing the rebase it's not totally clear to me what needs to happen since this intersects with the recent tar changes |
|
More concretely, I think we're losing the parts that added |
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 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 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 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 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>
2af7a01 to
bf7932e
Compare
I think with this new resolution it's right - we're using the bufread changes in decompression (and when doing OCI artifact storage) but the tar parsing code is using the Bytes abstraction. |
|
While not blocking this PR directly it'd be helpful to land bootc-dev/ocidir-rs#64 since I think as we head towards #224 we will need good support for referrers. |
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
ocihelps us writeunit/integration tests for that without blocking on patching
skopeo.