Skip to content

Commit fd7eda8

Browse files
committed
feat: add dual-compression (zstd:chunked) to buildah task
Add COMPRESSION_FORMAT (gzip|zstd-chunked|dual) and FORCE_COMPRESSION params. In dual mode, push gzip and zstd:chunked variants bundled in a per-arch OCI index (gzip first). The IMAGES result exposes both child manifest refs for Chains provenance. SBOM generation, signing, and SBOM attachment run for each variant. Default stays gzip; dual requires BUILDAH_FORMAT=oci. Ref #1264 Ref https://github.com/konflux-ci/architecture/blob/main/ADR/0070-dual-compression-for-container-builds.md Signed-off-by: Amanyd <amaninsane139@gmail.com>
1 parent 50f1cc6 commit fd7eda8

15 files changed

Lines changed: 1486 additions & 523 deletions

File tree

pipelines/docker-build-multi-platform-oci-ta/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
6565
|BUILD_TIMESTAMP| Defines the single build time for all buildah builds in seconds since UNIX epoch. Conflicts with SOURCE_DATE_EPOCH.| ""| |
6666
|CACHI2_ARTIFACT| The Trusted Artifact URI pointing to the artifact with the prefetched dependencies.| ""| '$(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)'|
6767
|COMMIT_SHA| The image is built from this commit.| ""| '$(tasks.clone-repository.results.commit)'|
68+
|COMPRESSION_FORMAT| Compression format: gzip (default), zstd-chunked, or dual. In dual mode both gzip and zstd:chunked variants are bundled in a per-arch OCI index (gzip first). dual requires BUILDAH_FORMAT=oci.| gzip| |
6869
|CONTEXT| Path to the directory to use as context.| .| '$(params.path-context)'|
6970
|CONTEXTUALIZE_SBOM| Determines if SBOM will be contextualized.| true| |
7071
|DOCKERFILE| Path to the Dockerfile to build.| ./Dockerfile| '$(params.dockerfile)'|
7172
|ENTITLEMENT_SECRET| Name of secret which contains the entitlement certificates| etc-pki-entitlement| |
7273
|ENV_VARS| Array of --env values ("env=value" strings)| []| |
74+
|FORCE_COMPRESSION| Recompress all layers including base image layers, not just layers created by this build. Only applies to zstd-chunked and dual modes.| false| |
7375
|HERMETIC| Determines if build will be executed without network access.| false| '$(params.hermetic)'|
7476
|HTTP_PROXY| HTTP/HTTPS proxy to use for the buildah pull and build operations. Will not be passed through to the container during the build process.| ""| '$(tasks.init.results.http-proxy)'|
7577
|ICM_KEEP_COMPAT_LOCATION| Whether to keep compatibility location at /root/buildinfo/ for ICM injection| true| |
@@ -291,6 +293,7 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
291293
### buildah-remote-oci-ta:0.10 task results
292294
|name|description|used in params (taskname:taskrefversion:taskparam)
293295
|---|---|---|
296+
|IMAGES| Newline-separated image manifest references. In dual mode lists the gzip and zstd child manifest references for Chains provenance; otherwise the single manifest reference.| |
294297
|IMAGE_DIGEST| Digest of the image just built| |
295298
|IMAGE_REF| Image reference of the built image| build-image-index:0.3:IMAGES|
296299
|IMAGE_URL| Image repository and tag where the built image was pushed| |

pipelines/docker-build-oci-ta-min/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
5656
|BUILD_TIMESTAMP| Defines the single build time for all buildah builds in seconds since UNIX epoch. Conflicts with SOURCE_DATE_EPOCH.| ""| |
5757
|CACHI2_ARTIFACT| The Trusted Artifact URI pointing to the artifact with the prefetched dependencies.| ""| '$(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)'|
5858
|COMMIT_SHA| The image is built from this commit.| ""| '$(tasks.clone-repository.results.commit)'|
59+
|COMPRESSION_FORMAT| Compression format: gzip (default), zstd-chunked, or dual. In dual mode both gzip and zstd:chunked variants are bundled in a per-arch OCI index (gzip first). dual requires BUILDAH_FORMAT=oci.| gzip| |
5960
|CONTEXT| Path to the directory to use as context.| .| '$(params.path-context)'|
6061
|CONTEXTUALIZE_SBOM| Determines if SBOM will be contextualized.| true| |
6162
|DOCKERFILE| Path to the Dockerfile to build.| ./Dockerfile| '$(params.dockerfile)'|
6263
|ENTITLEMENT_SECRET| Name of secret which contains the entitlement certificates| etc-pki-entitlement| |
6364
|ENV_VARS| Array of --env values ("env=value" strings)| []| |
65+
|FORCE_COMPRESSION| Recompress all layers including base image layers, not just layers created by this build. Only applies to zstd-chunked and dual modes.| false| |
6466
|HERMETIC| Determines if build will be executed without network access.| false| '$(params.hermetic)'|
6567
|HTTP_PROXY| HTTP/HTTPS proxy to use for the buildah pull and build operations. Will not be passed through to the container during the build process.| ""| '$(tasks.init.results.http-proxy)'|
6668
|ICM_KEEP_COMPAT_LOCATION| Whether to keep compatibility location at /root/buildinfo/ for ICM injection| true| |
@@ -231,6 +233,7 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
231233
### buildah-oci-ta-min:0.10 task results
232234
|name|description|used in params (taskname:taskrefversion:taskparam)
233235
|---|---|---|
236+
|IMAGES| Newline-separated image manifest references. In dual mode lists the gzip and zstd child manifest references for Chains provenance; otherwise the single manifest reference.| |
234237
|IMAGE_DIGEST| Digest of the image just built| |
235238
|IMAGE_REF| Image reference of the built image| |
236239
|IMAGE_URL| Image repository and tag where the built image was pushed| build-image-index:0.3:IMAGES|

pipelines/docker-build-oci-ta/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
6464
|BUILD_TIMESTAMP| Defines the single build time for all buildah builds in seconds since UNIX epoch. Conflicts with SOURCE_DATE_EPOCH.| ""| |
6565
|CACHI2_ARTIFACT| The Trusted Artifact URI pointing to the artifact with the prefetched dependencies.| ""| '$(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)'|
6666
|COMMIT_SHA| The image is built from this commit.| ""| '$(tasks.clone-repository.results.commit)'|
67+
|COMPRESSION_FORMAT| Compression format: gzip (default), zstd-chunked, or dual. In dual mode both gzip and zstd:chunked variants are bundled in a per-arch OCI index (gzip first). dual requires BUILDAH_FORMAT=oci.| gzip| |
6768
|CONTEXT| Path to the directory to use as context.| .| '$(params.path-context)'|
6869
|CONTEXTUALIZE_SBOM| Determines if SBOM will be contextualized.| true| |
6970
|DOCKERFILE| Path to the Dockerfile to build.| ./Dockerfile| '$(params.dockerfile)'|
7071
|ENTITLEMENT_SECRET| Name of secret which contains the entitlement certificates| etc-pki-entitlement| |
7172
|ENV_VARS| Array of --env values ("env=value" strings)| []| |
73+
|FORCE_COMPRESSION| Recompress all layers including base image layers, not just layers created by this build. Only applies to zstd-chunked and dual modes.| false| |
7274
|HERMETIC| Determines if build will be executed without network access.| false| '$(params.hermetic)'|
7375
|HTTP_PROXY| HTTP/HTTPS proxy to use for the buildah pull and build operations. Will not be passed through to the container during the build process.| ""| '$(tasks.init.results.http-proxy)'|
7476
|ICM_KEEP_COMPAT_LOCATION| Whether to keep compatibility location at /root/buildinfo/ for ICM injection| true| |
@@ -288,6 +290,7 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
288290
### buildah-oci-ta:0.10 task results
289291
|name|description|used in params (taskname:taskrefversion:taskparam)
290292
|---|---|---|
293+
|IMAGES| Newline-separated image manifest references. In dual mode lists the gzip and zstd child manifest references for Chains provenance; otherwise the single manifest reference.| |
291294
|IMAGE_DIGEST| Digest of the image just built| |
292295
|IMAGE_REF| Image reference of the built image| |
293296
|IMAGE_URL| Image repository and tag where the built image was pushed| build-image-index:0.3:IMAGES|

pipelines/docker-build/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
6363
|BUILD_ARGS_FILE| Path to a file with build arguments, see https://www.mankier.com/1/buildah-build#--build-arg-file| ""| '$(params.build-args-file)'|
6464
|BUILD_TIMESTAMP| Defines the single build time for all buildah builds in seconds since UNIX epoch. Conflicts with SOURCE_DATE_EPOCH.| ""| |
6565
|COMMIT_SHA| The image is built from this commit.| ""| '$(tasks.clone-repository.results.commit)'|
66+
|COMPRESSION_FORMAT| Compression format: gzip (default), zstd-chunked, or dual. In dual mode both gzip and zstd:chunked variants are bundled in a per-arch OCI index (gzip first). dual requires BUILDAH_FORMAT=oci.| gzip| |
6667
|CONTEXT| Path to the directory to use as context.| .| '$(params.path-context)'|
6768
|CONTEXTUALIZE_SBOM| Determines if SBOM will be contextualized.| true| |
6869
|DOCKERFILE| Path to the Dockerfile to build.| ./Dockerfile| '$(params.dockerfile)'|
6970
|ENTITLEMENT_SECRET| Name of secret which contains the entitlement certificates| etc-pki-entitlement| |
7071
|ENV_VARS| Array of --env values ("env=value" strings)| []| |
72+
|FORCE_COMPRESSION| Recompress all layers including base image layers, not just layers created by this build. Only applies to zstd-chunked and dual modes.| false| |
7173
|HERMETIC| Determines if build will be executed without network access.| false| '$(params.hermetic)'|
7274
|HTTP_PROXY| HTTP/HTTPS proxy to use for the buildah pull and build operations. Will not be passed through to the container during the build process.| ""| '$(tasks.init.results.http-proxy)'|
7375
|ICM_KEEP_COMPAT_LOCATION| Whether to keep compatibility location at /root/buildinfo/ for ICM injection| true| |
@@ -272,6 +274,7 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
272274
### buildah:0.10 task results
273275
|name|description|used in params (taskname:taskrefversion:taskparam)
274276
|---|---|---|
277+
|IMAGES| Newline-separated image manifest references. In dual mode lists the gzip and zstd child manifest references for Chains provenance; otherwise the single manifest reference.| |
275278
|IMAGE_DIGEST| Digest of the image just built| |
276279
|IMAGE_REF| Image reference of the built image| |
277280
|IMAGE_URL| Image repository and tag where the built image was pushed| build-image-index:0.3:IMAGES|

pipelines/fbc-builder/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
6363
|BUILD_TIMESTAMP| Defines the single build time for all buildah builds in seconds since UNIX epoch. Conflicts with SOURCE_DATE_EPOCH.| ""| |
6464
|CACHI2_ARTIFACT| The Trusted Artifact URI pointing to the artifact with the prefetched dependencies.| ""| '$(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)'|
6565
|COMMIT_SHA| The image is built from this commit.| ""| '$(tasks.clone-repository.results.commit)'|
66+
|COMPRESSION_FORMAT| Compression format: gzip (default), zstd-chunked, or dual. In dual mode both gzip and zstd:chunked variants are bundled in a per-arch OCI index (gzip first). dual requires BUILDAH_FORMAT=oci.| gzip| |
6667
|CONTEXT| Path to the directory to use as context.| .| '$(params.path-context)'|
6768
|CONTEXTUALIZE_SBOM| Determines if SBOM will be contextualized.| true| |
6869
|DOCKERFILE| Path to the Dockerfile to build.| ./Dockerfile| '$(params.dockerfile)'|
6970
|ENTITLEMENT_SECRET| Name of secret which contains the entitlement certificates| etc-pki-entitlement| |
7071
|ENV_VARS| Array of --env values ("env=value" strings)| []| |
72+
|FORCE_COMPRESSION| Recompress all layers including base image layers, not just layers created by this build. Only applies to zstd-chunked and dual modes.| false| |
7173
|HERMETIC| Determines if build will be executed without network access.| false| '$(params.hermetic)'|
7274
|HTTP_PROXY| HTTP/HTTPS proxy to use for the buildah pull and build operations. Will not be passed through to the container during the build process.| ""| '$(tasks.init.results.http-proxy)'|
7375
|ICM_KEEP_COMPAT_LOCATION| Whether to keep compatibility location at /root/buildinfo/ for ICM injection| true| |
@@ -216,6 +218,7 @@ This pipeline is pushed as a Tekton bundle to [quay.io](https://quay.io/reposito
216218
### buildah-remote-oci-ta:0.10 task results
217219
|name|description|used in params (taskname:taskrefversion:taskparam)
218220
|---|---|---|
221+
|IMAGES| Newline-separated image manifest references. In dual mode lists the gzip and zstd child manifest references for Chains provenance; otherwise the single manifest reference.| |
219222
|IMAGE_DIGEST| Digest of the image just built| |
220223
|IMAGE_REF| Image reference of the built image| build-image-index:0.3:IMAGES|
221224
|IMAGE_URL| Image repository and tag where the built image was pushed| |

task/buildah-oci-ta-min/0.10/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ When prefetch-dependencies task is activated it is using its artifacts to run bu
2020
|BUILD_TIMESTAMP|Defines the single build time for all buildah builds in seconds since UNIX epoch. Conflicts with SOURCE_DATE_EPOCH.|""|false|
2121
|CACHI2_ARTIFACT|The Trusted Artifact URI pointing to the artifact with the prefetched dependencies.|""|false|
2222
|COMMIT_SHA|The image is built from this commit.|""|false|
23+
|COMPRESSION_FORMAT|Compression format: gzip (default), zstd-chunked, or dual. In dual mode both gzip and zstd:chunked variants are bundled in a per-arch OCI index (gzip first). dual requires BUILDAH_FORMAT=oci.|gzip|false|
2324
|CONTEXT|Path to the directory to use as context.|.|false|
2425
|CONTEXTUALIZE_SBOM|Determines if SBOM will be contextualized.|true|false|
2526
|DOCKERFILE|Path to the Dockerfile to build.|./Dockerfile|false|
2627
|ENTITLEMENT_SECRET|Name of secret which contains the entitlement certificates|etc-pki-entitlement|false|
2728
|ENV_VARS|Array of --env values ("env=value" strings)|[]|false|
29+
|FORCE_COMPRESSION|Recompress all layers including base image layers, not just layers created by this build. Only applies to zstd-chunked and dual modes.|false|false|
2830
|HERMETIC|Determines if build will be executed without network access.|false|false|
2931
|HTTP_PROXY|HTTP/HTTPS proxy to use for the buildah pull and build operations. Will not be passed through to the container during the build process.|""|false|
3032
|ICM_KEEP_COMPAT_LOCATION|Whether to keep compatibility location at /root/buildinfo/ for ICM injection|true|false|
@@ -64,6 +66,7 @@ When prefetch-dependencies task is activated it is using its artifacts to run bu
6466
## Results
6567
|name|description|
6668
|---|---|
69+
|IMAGES|Newline-separated image manifest references. In dual mode lists the gzip and zstd child manifest references for Chains provenance; otherwise the single manifest reference.|
6770
|IMAGE_DIGEST|Digest of the image just built|
6871
|IMAGE_REF|Image reference of the built image|
6972
|IMAGE_URL|Image repository and tag where the built image was pushed|

0 commit comments

Comments
 (0)