Skip to content

Build bundle OCI image as zstd-compressed EROFS - #491

Closed
rahultee wants to merge 2 commits into
mainfrom
optional-erofs-zstd
Closed

rahultee wants to merge 2 commits into
mainfrom
optional-erofs-zstd

Conversation

@rahultee

@rahultee rahultee commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Why

Prebuild the bundle filesystem so image unpacking does not need to construct it from a tar stream. Use zstd for transport compression.

What changed

  • Change the existing bundle-oci output to one application/vnd.oci.image.layer.v1.erofs+zstd layer. Keep the output name, full revision provenance and copy helper unchanged.
  • Build deterministic EROFS with filesystem compression and inline file data disabled, fixed timestamps and ownership. Compress it with zstd level 15, a 128 MiB window and eight compression threads.
  • Record the compressed digest and size in the layer descriptor, the raw EROFS digest in the config diffID, and raw size in the layer annotation.
  • Update the small fixture to check filesystem contents, metadata, modes, hardlinks, extended attributes, reproducibility, invalid inputs and digest-preserving OCI copying.

Test plan

Passed on the final tree:

  • nix build .#bundle-oci-check --no-link
  • scripts/ci_check.sh, including repository-wide formatting, module evaluation and the fixture build
  • Nix parsing, Python compilation, shell syntax and whitespace checks

The fixture verifies the custom media type, layer annotations, manifest digest and every blob survive Skopeo copying. It checks raw and compressed digests, actual plain EROFS inode layout, filesystem extraction, hardlinks and fixed ownership. Extended attributes are tested through a PAX fixture because the build sandbox filesystem does not support them.

The first draft CI failed on a fixture mode assertion: Nix normalizes executable store files. The fixture now compares the actual source mode. Timestamp reproducibility also explicitly clears SOURCE_DATE_EPOCH before applying fixed filesystem times. Local final-tree checks pass. Full cold-start performance is not qualified: correctness checks do not establish compliance with the startup budget.

Rollout

This PR remains draft. Do not publish or roll out this format until end-to-end startup meets the required time limit under the target resource constraints.

This changes the existing output format and is not compatible with consumers that only support tar+gzip layers. Deploy consumer support for the new media type before publishing images from this output. No images are published or deployed by this PR. Reverting this producer restores the previous format; consumers must retain support for any new-format images already published.

  • This is fully backward and forward compatible

~ written by ⠕ Replit

Keep the existing output name and provenance. Fix fixture mode and timestamp checks.

Assisted-by: Replit
@rahultee rahultee changed the title Add optional zstd-compressed EROFS bundle image Build bundle OCI image as zstd-compressed EROFS Oct 15, 2026
@rahultee rahultee closed this Oct 19, 2026
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.

1 participant