Skip to content

skopeo: Get uncompressed layer when pulling from containers-storage - #210

Merged
jeckersb merged 2 commits into
composefs:mainfrom
Johan-Liebert1:containers-storage-fix
Jan 29, 2026
Merged

jeckersb merged 2 commits into
composefs:mainfrom
Johan-Liebert1:containers-storage-fix

Conversation

@Johan-Liebert1

Copy link
Copy Markdown
Collaborator

When pulling from containers storage we were requesting a layer using the compressed sha digest for that particular layer which caused skopeo to throw the error

failed to invoke method GetBlob: locating item named "sha256:<snip>" for
image with ID "<snip>" (consider removing the image to resolve the issue):
file does not exist

To remedy this, when pulling from containers storage we now query using the get_blob method using the uncompressed sha digest for the layer

Related: bootc-dev/bootc#1703

@Johan-Liebert1
Johan-Liebert1 force-pushed the containers-storage-fix branch 2 times, most recently from 282f2a7 to 3614a62 Compare January 21, 2026 11:29
Comment thread crates/composefs-oci/src/skopeo.rs Outdated

/// A backend/transport for OCI/Docker images.
#[derive(Debug)]
pub enum Transport {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ref youki-dev/oci-spec-rs#205 and we have some duplicate code in ostree-rs-ext too

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In the short term I'd probably say we try to lower this to containers-image-proxy-rs ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Or at the very least, this probably shouldn't be pub since we're not exposing it via any API, and it would avoid confusion with the duplicate in ostree-ext.

let blob_reader = blob_reader.take(descriptor.size());
let blob_reader = blob_reader.take(size);

let bar = self.progress.add(ProgressBar::new(descriptor.size()));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be updated to use size as above, right? Otherwise the progress bar is going to scale based on the compressed size even in the uncompressed case.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Right, I missed that

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated

Comment thread crates/composefs-oci/src/skopeo.rs Outdated
let permit = Arc::clone(&sem).acquire_owned().await?;
let descriptor = mld.clone();

// SAFETY: We get descriptor from the manifest_layers itself

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I haven't looked at the surrounding context of this function, but just based on the local information manifest_layers is passed into the function as &[Descriptor], which could easily be an empty slice and makes this unwrap() safety assumption incorrect.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I think that's fair. Better to print an error than crash

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated

@cgwalters

Copy link
Copy Markdown
Collaborator

This one also relates to bootc-dev/containers-image-proxy-rs#114 and I think it might clean things up a lot to push down into the proxy the handling for decompression too.

@Johan-Liebert1

Copy link
Copy Markdown
Collaborator Author

Opened bootc-dev/containers-image-proxy-rs#120 moving the Transport enum

@Johan-Liebert1
Johan-Liebert1 force-pushed the containers-storage-fix branch 3 times, most recently from eff4067 to e3b8ac2 Compare January 27, 2026 06:36
@Johan-Liebert1

Copy link
Copy Markdown
Collaborator Author

Requires a release for containers-image-proxy bootc-dev/containers-image-proxy-rs#124, so we don't have to specify package using git revision

Signed-off-by: Pragyan Poudyal <[email protected]>
Comment thread crates/composefs-oci/src/skopeo.rs Resolved
Comment thread crates/composefs-oci/src/skopeo.rs Resolved
Comment thread crates/composefs-oci/src/skopeo.rs Resolved
Comment thread crates/composefs-oci/src/skopeo.rs Resolved
@Johan-Liebert1
Johan-Liebert1 force-pushed the containers-storage-fix branch 3 times, most recently from dd25c1f to fe40918 Compare January 27, 2026 15:08

@cgwalters cgwalters left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks good, but I think in a future refactoring we should change things so OpenImage always grabs both the stock and uncompressed manifest and then have the operations default to using it.

When pulling from containers storage we were requesting a layer using
the compressed sha digest for that particular layer which caused skopeo
to throw the error

```
failed to invoke method GetBlob: locating item named "sha256:<snip>" for
image with ID "<snip>" (consider removing the image to resolve the issue):
file does not exist
```

To remedy this, when pulling from containers storage we now query using
the `get_blob` method using the uncompressed sha digest for the layer

Related: bootc-dev/bootc#1703

Signed-off-by: Pragyan Poudyal <[email protected]>
@cgwalters

Copy link
Copy Markdown
Collaborator

@jeckersb blocked on your change request

@cgwalters

Copy link
Copy Markdown
Collaborator

ping @jeckersb

@jeckersb jeckersb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Doh sorry, still catching up on mail/notifications...

Ship it! 🚢

hanthor added a commit to tuna-os/tromso that referenced this pull request Dec 2, 2026
BuildStream's oci-builder writes layers with no tar end-of-archive
marker. bootc's composefs importer stops on them with "Unexpected EOF
in splitstream" (bootc-dev/bootc#1703, composefs/composefs-rs#210), so
`bootc switch`/`upgrade` from the published image fails on composefs
systems. #601 squashes the export with podman, which writes the marker;
nothing checked it.

scripts/check-layer-tar-eof.py reads `podman save --format
docker-archive` as a stream and checks the last 1024 bytes of every
layer. podman replays each layer from its tar-split record, so a layer
that came in without the marker goes out without it. build-final.yml
runs it after the Secure Boot layer and before the push.

On ghcr.io/tuna-os/tromso@sha256:31d0084f... it reports 5 of 7 layers
without the marker (the five oci-builder ones). An oci-builder-like
layer fails as pulled and passes after `podman build --squash-all`.

Refs #600

Signed-off-by: James Reilly <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

3 participants