-
Notifications
You must be signed in to change notification settings - Fork 237
Description
https://issues.redhat.com/browse/KFLUXSPRT-6743
https://issues.redhat.com/browse/STONEBLD-4276
Description
Add COMPRESSION_FORMAT and FORCE_COMPRESSION parameters to the buildah tasks (buildah-oci-ta, buildah-remote-oci-ta) to enable zstd:chunked compression for container images.
Motivation
Large container images (especially CUDA/GPU images that can be 10-15GB+) take a long time to pull. Using zstd:chunked compression provides significant benefits:
- Faster pulls: zstd:chunked enables lazy pulling and partial layer downloads
- Reduced startup time: Container runtimes can start containers before fully downloading all layers
- Better deduplication: Chunked format enables file-level deduplication across layers
For CUDA-based images, the --force-compression flag is crucial because base layers from upstream (e.g., nvidia/cuda) are typically gzip-compressed and need to be re-compressed to zstd:chunked format.
And when my Red Hat-provided base image is not on zstd:chunked yet, I want to still recompress it for myself.
Proposed Solution
Add two new parameters to buildah tasks:
- name: COMPRESSION_FORMAT
description: The compression format for image layers (e.g., gzip, zstd, zstd:chunked)
type: string
default: ""
- name: FORCE_COMPRESSION
description: Force re-compression of all layers, including base image layers. Required when converting gzip layers to zstd:chunked.
type: string
default: "false"These would be passed to the buildah push command:
buildah push \
${COMPRESSION_FORMAT:+--compression-format "$COMPRESSION_FORMAT"} \
${FORCE_COMPRESSION:+--force-compression} \
...Use Case
We build GPU-accelerated notebook images for OpenDataHub/RHODS. Our CUDA images inherit from nvidia/cuda base images (gzip compressed) and grow to 10-15GB. Enabling zstd:chunked compression would significantly improve user experience when launching workbenches.
For testing the CUDA-enabled images, it will help reduce the 10+ minute wait for pull.
References
- buildah-push man page - documents --compression-format and --force-compression
- Fedora zstd:chunked change
- containers/buildah#4613 - related issue about layer reuse behavior