This is an automated email from the ASF dual-hosted git repository.

chamikaramj pushed a commit to branch revert-40105-revert-39409-newZstd
in repository https://gitbox.apache.org/repos/asf/beam.git

commit 5eda8df64cc7768a2a7364bc97a389c4ca007283
Author: Chamikara Jayalath <[email protected]>
AuthorDate: Mon Sep 14 09:32:23 2026 -0700

    Revert "Revert "[Experimental] Use zstd compression in Docker builds" 
(#40105)"
    
    This reverts commit 4621a0b229f31e94a819eb5c28bc9b95435f4524.
---
 ...tCommit_Python_ValidatesContainer_Dataflow.json |  2 +-
 .../beam_PreCommit_Flink_Container.json            |  2 +-
 .../org/apache/beam/gradle/BeamDockerPlugin.groovy | 24 +++++++++++++++++-----
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git 
a/.github/trigger_files/beam_PostCommit_Python_ValidatesContainer_Dataflow.json 
b/.github/trigger_files/beam_PostCommit_Python_ValidatesContainer_Dataflow.json
index 60eb7272a93..327fe1987c5 100644
--- 
a/.github/trigger_files/beam_PostCommit_Python_ValidatesContainer_Dataflow.json
+++ 
b/.github/trigger_files/beam_PostCommit_Python_ValidatesContainer_Dataflow.json
@@ -1,4 +1,4 @@
 {
     "comment": "Modify this file in a trivial way to cause this test suite to 
run",
-    "modification": 4
+    "modification": 5
 }
\ No newline at end of file
diff --git a/.github/trigger_files/beam_PreCommit_Flink_Container.json 
b/.github/trigger_files/beam_PreCommit_Flink_Container.json
index bbdc3a3910e..62ae7886c57 100644
--- a/.github/trigger_files/beam_PreCommit_Flink_Container.json
+++ b/.github/trigger_files/beam_PreCommit_Flink_Container.json
@@ -1,4 +1,4 @@
 {
     "comment": "Modify this file in a trivial way to cause this test suite to 
run",
-    "modification": 3
+    "modification": 4
 }
diff --git 
a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamDockerPlugin.groovy 
b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamDockerPlugin.groovy
index 9aaeaea9695..bfde0155be9 100644
--- a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamDockerPlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamDockerPlugin.groovy
@@ -61,6 +61,7 @@ class BeamDockerPlugin implements Plugin<Project> {
     boolean push = false
     String builder = null
     String target = null
+    String compression = 'zstd'
 
     File resolvedDockerfile = null
     File resolvedDockerComposeTemplate = null
@@ -72,6 +73,9 @@ class BeamDockerPlugin implements Plugin<Project> {
     DockerExtension(Project project) {
       this.project = project
       this.copySpec = project.copySpec()
+      if (project.hasProperty('docker-compression')) {
+        this.compression = project.property('docker-compression')
+      }
     }
 
     void resolvePathsAndValidate() {
@@ -237,13 +241,23 @@ class BeamDockerPlugin implements Plugin<Project> {
       if (!ext.platform.isEmpty()) {
         buildCommandLine.addAll('--platform', String.join(',', ext.platform))
       }
-      if (ext.load) {
-        buildCommandLine.add '--load'
+      if (ext.load && ext.push) {
+        throw new Exception("cannot combine 'push' and 'load' options")
       }
-      if (ext.push) {
-        buildCommandLine.add '--push'
+      if (ext.compression != null && !ext.compression.isEmpty()) {
+        if (ext.push) {
+          buildCommandLine.add 
"--output=type=registry,compression=${ext.compression},force-compression=true,oci-mediatypes=true"
+        } else if (ext.load) {
+          buildCommandLine.add '--load'
+        } else {
+          buildCommandLine.add 
"--output=type=image,compression=${ext.compression},force-compression=true,oci-mediatypes=true"
+        }
+      } else {
         if (ext.load) {
-          throw new Exception("cannot combine 'push' and 'load' options")
+          buildCommandLine.add '--load'
+        }
+        if (ext.push) {
+          buildCommandLine.add '--push'
         }
       }
       if (ext.builder != null) {

Reply via email to