Skip to content

[Bug] Can't uncompress nydus blob with zstd #1763

@Fricounet

Description

@Fricounet

Problem Description

I'm trying to decompress a nydus blob to understand better how it's formed.
From my understanding nydus blobs are by default zstd compressed and have a TAR header (for OCI compatibility?) as shown in the features when I inspect a blob with nydus-image

Features:               ALIGNED | INLINED_CHUNK_DIGEST | HAS_TAR_HEADER | HAS_TOC | CAP_TAR_TOC

However, I can't seem to be able to decompress the original zstd blob.

Any idea why this is the case?

Expected Behavior

I expect to be able to decompression the zstd blob in a layer

Actual Behavior

zstd -d command on the blob fails

How to reproduce

Reproduction:

  • get manifest from the images used in integration tests
crane manifest ghcr.io/dragonflyoss/image-service/wordpress:nydus-nightly-v6@sha256:087d16e0920bbb36f0ad43c3b5aab63c42adcb010db33d4ce3e915dd5ea0cd4a | jq
{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  "config": {
    "mediaType": "application/vnd.docker.container.image.v1+json",
    "digest": "sha256:5f81e0893293218a44620c7096511a7f9b04d696a7d062d240ec1768e462f2a3",
    "size": 16679
  },
  "layers": [
    {
      "mediaType": "application/vnd.oci.image.layer.nydus.blob.v1",
      "digest": "sha256:75f7ed74939756c174e01899a694ce5a539b3e1e073baa977325d1ea39545cbc",
      "size": 33053658,
      "annotations": {
        "containerd.io/snapshot/nydus-blob": "true"
      }
    },
 ...
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "digest": "sha256:df31ef1327fb36fdc9a3184d31942cc45dbc312bb7c9a26cc61601449def9a22",
      "size": 1289133,
      "annotations": {
        "containerd.io/snapshot/nydus-bootstrap": "true",
        "containerd.io/snapshot/nydus-fs-version": "6"
      }
    }
  ],
  "annotations": {
    "containerd.io/snapshot/nydus-fs-version": "6",
    "containerd.io/snapshot/nydus-source-digest": "sha256:42d21dc7fbb52a9cf175cf4717a624520bcd334e54ee4d7b932f0b371335ef57",
    "containerd.io/snapshot/nydus-source-reference": "docker.io/library/wordpress:latest"
  }
}
  • download blob from 1st layer
crane blob ghcr.io/dragonflyoss/image-service/wordpress:nydus-nightly-v6@sha256:75f7ed74939756c174e01899a694ce5a539b3e1e073baa977325d1ea39545cbc > blob.zst
  • blob has zstd headers
file blob.zst
blob.zst: Zstandard compressed data (v0.8+), Dictionary ID: None
  • but uncompression fails as if it was not a real zstd compression
zstd -d blob.zst
blob.zst             : 0 MB...     zstd: blob.zst: unsupported format

Environment Details

  • Nydus-snapshotter version:
  • Nydus version:
  • Container runtime:
  • Operating System:
  • Kernel version:

Additional Information

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions