Skip to content

Add compression-format and force-compression parameters to buildah tasks #3188

@jiridanek

Description

@jiridanek

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:

  1. Faster pulls: zstd:chunked enables lazy pulling and partial layer downloads
  2. Reduced startup time: Container runtimes can start containers before fully downloading all layers
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions