From bd7e255c7bc278c6a3d9da88cb167c327c89ba49 Mon Sep 17 00:00:00 2001 From: Damon Douglas Date: Fri, 18 Oct 2024 16:40:22 +0000 Subject: [PATCH 1/2] Enable BuildKit on gradle docker task --- .../main/groovy/org/apache/beam/gradle/BeamDockerPlugin.groovy | 1 + runners/google-cloud-dataflow-java/build.gradle | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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 cd46c1270f83..388069a03983 100644 --- a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamDockerPlugin.groovy +++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamDockerPlugin.groovy @@ -130,6 +130,7 @@ class BeamDockerPlugin implements Plugin { group = 'Docker' description = 'Builds Docker image.' dependsOn prepare + environment 'DOCKER_BUILDKIT', '1' }) Task tag = project.tasks.create('dockerTag', { diff --git a/runners/google-cloud-dataflow-java/build.gradle b/runners/google-cloud-dataflow-java/build.gradle index 4906d9cf9cb8..615155794982 100644 --- a/runners/google-cloud-dataflow-java/build.gradle +++ b/runners/google-cloud-dataflow-java/build.gradle @@ -152,7 +152,7 @@ def firestoreDb = project.findProperty('firestoreDb') ?: 'firestoredb' def dockerImageRoot = project.findProperty('dockerImageRoot') ?: "us.gcr.io/${gcpProject.replaceAll(':', '/')}/java-postcommit-it" def dockerJavaImageContainer = "${dockerImageRoot}/java" def dockerPythonImageContainer = "${dockerImageRoot}/python" -def dockerTag = new Date().format('yyyyMMddHHmmss') +def dockerTag = project.findProperty('dockerTag') ?: new Date().format('yyyyMMddHHmmss') ext.dockerJavaImageName = "${dockerJavaImageContainer}:${dockerTag}" ext.dockerPythonImageName = "${dockerPythonImageContainer}:${dockerTag}" From 86ddc830c418f6085e6ee0100e74efe78d4e5ccb Mon Sep 17 00:00:00 2001 From: Damon Douglas Date: Fri, 18 Oct 2024 21:13:00 +0000 Subject: [PATCH 2/2] Revert setting dockerTag --- runners/google-cloud-dataflow-java/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runners/google-cloud-dataflow-java/build.gradle b/runners/google-cloud-dataflow-java/build.gradle index 615155794982..4906d9cf9cb8 100644 --- a/runners/google-cloud-dataflow-java/build.gradle +++ b/runners/google-cloud-dataflow-java/build.gradle @@ -152,7 +152,7 @@ def firestoreDb = project.findProperty('firestoreDb') ?: 'firestoredb' def dockerImageRoot = project.findProperty('dockerImageRoot') ?: "us.gcr.io/${gcpProject.replaceAll(':', '/')}/java-postcommit-it" def dockerJavaImageContainer = "${dockerImageRoot}/java" def dockerPythonImageContainer = "${dockerImageRoot}/python" -def dockerTag = project.findProperty('dockerTag') ?: new Date().format('yyyyMMddHHmmss') +def dockerTag = new Date().format('yyyyMMddHHmmss') ext.dockerJavaImageName = "${dockerJavaImageContainer}:${dockerTag}" ext.dockerPythonImageName = "${dockerPythonImageContainer}:${dockerTag}"