Skip to content

tmt: Add test switching to a zstd:chunked image - #2503

Open
cgwalters-bot wants to merge 1 commit into
bootc-dev:mainfrom
cgwalters-forge:bot/test-zstd-chunked
Open

cgwalters-bot wants to merge 1 commit into
bootc-dev:mainfrom
cgwalters-forge:bot/test-zstd-chunked

Conversation

@cgwalters-bot

Copy link
Copy Markdown
Contributor

The composefs backend used to fail to pull zstd:chunked images ("unexpected
EOF reading tar entry", #2408): a zstd:chunked layer is a multi-frame zstd
stream, with skippable frames for the table of contents, and the decoder
stopped after the first frame. composefs-rs fixed that and main already pins
a fixed version, but none of our tests would catch a regression, since they
all pull from containers-storage, which hands out uncompressed layers.

This adds a tmt test (number 50) that builds a derived image, pushes it with
podman push --compression-format zstd:chunked to an OCI directory
(avoiding the need for a registry; composefs-rs reads OCI directories
directly rather than via skopeo, but the layers go through the same
decompressor as a registry pull), and bootc switches to it, then checks
the new data after reboot. Layers already in the repository (all the base
image ones) are skipped on pull, so the single new layer has to be
multi-frame on its own for this to test anything: it gets 64 small random
files, which zstd:chunked compresses into separate frames, plus checksums to
catch silent truncation. The test also asserts that every layer in the
pushed manifest is zstd with the zstd:chunked annotation, so it can't
silently degrade into testing plain zstd or gzip. It runs on both backends,
since it's cheap coverage for ostree too.

Testing, on a 16-core RHEL 10 devspace, rebased on current main (centos-bootc
stream10 base): just test-tmt switch-zstd-chunked passed on the composefs
backend (systemd-boot, BLS, ext4, unsealed) and on ostree, including the
post-reboot checksum and bootc internals fsck checks; cargo xtask update-generated direct --check and just validate pass. In an earlier
run, reverting the composefs-rs fix (zstd multiple_members(true)) made
this test fail with the original "unexpected EOF reading tar entry", so it
does catch the bug.

It also drops the note in experimental-composefs.md saying zstd:chunked
pulls fail, since the composefs-rs bump in 3024fa2 fixed that.

Closes: #2408

The Signed-off-by: Colin Walters <walters@verbum.org> on these commits was added on cgwalters's approval of the review draft: cgwalters-forge#7 (review)

Generated-by: https://github.com/cgwalters/#llms

The composefs backend used to fail to pull zstd:chunked images,
because a zstd:chunked layer is a multi-frame zstd stream (with
skippable frames for the table of contents) and the decoder stopped
after the first frame. That was fixed in composefs-rs, but nothing
here would have caught it or would catch a regression, since all our
tests pull from containers-storage, which hands out uncompressed
layers.

Push a derived image with `--compression-format zstd:chunked` to an
OCI directory and switch to it, which avoids needing a registry.
composefs-rs reads OCI directories directly rather than via skopeo,
but the layers go through the same decompressor as a registry pull.
Layers already in the repository (i.e. all the base image ones) are
skipped, so the one new layer must itself be multi-frame for this to
test anything; it gets a bunch of small files, which zstd:chunked
compresses into separate frames, and checksums to catch silent
truncation. The test also checks the pushed manifest, so that it
can't silently degrade into testing plain zstd or gzip. It runs for
both backends, since it's cheap coverage for ostree too.

Also drop the known-issue note about zstd:chunked pulls failing from the
composefs docs, since the composefs-rs bump in 3024fa2 fixed that.

Closes: bootc-dev#2408
Generated-by: AI
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters-bot

Copy link
Copy Markdown
Contributor Author

Rebased onto main; 1 commit, no content change.

Generated-by: https://github.com/cgwalters/#llms

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation Updates to the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

composefs backend: zstd:chunked images fail to pull with "unexpected EOF reading tar entry"

2 participants