You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by tv...@apache.org on 2020/12/16 19:21:45 UTC

[beam] branch master updated: [BEAM-11432] put latest tag when publishing SDK head containers to gcr (#13517)

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

tvalentyn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 1ccdee8  [BEAM-11432] put latest tag when publishing SDK head containers to gcr (#13517)
1ccdee8 is described below

commit 1ccdee89ffcefc094f750a2f33e243c7f40e8544
Author: Heejong Lee <he...@gmail.com>
AuthorDate: Wed Dec 16 11:20:54 2020 -0800

    [BEAM-11432] put latest tag when publishing SDK head containers to gcr (#13517)
---
 .test-infra/jenkins/job_Publish_SDK_Image_Snapshots.groovy  |  8 ++++----
 .../groovy/org/apache/beam/gradle/BeamModulePlugin.groovy   | 13 +++++++++++++
 sdks/go/container/build.gradle                              |  2 ++
 sdks/java/container/common.gradle                           |  2 ++
 sdks/python/container/common.gradle                         |  2 ++
 5 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/.test-infra/jenkins/job_Publish_SDK_Image_Snapshots.groovy b/.test-infra/jenkins/job_Publish_SDK_Image_Snapshots.groovy
index 0b72c4c..cc35e7f 100644
--- a/.test-infra/jenkins/job_Publish_SDK_Image_Snapshots.groovy
+++ b/.test-infra/jenkins/job_Publish_SDK_Image_Snapshots.groovy
@@ -41,15 +41,15 @@ job('beam_Publish_Beam_SDK_Snapshots') {
     gradle {
       rootBuildScriptDir(commonJobProperties.checkoutDir)
       commonJobProperties.setGradleSwitches(delegate)
-      tasks(':sdks:go:container:dockerPush')
+      tasks(':sdks:go:container:dockerTagPush')
       SUPPORTED_JAVA_CONTAINER_TASKS.each { taskVer ->
-        tasks(":sdks:java:container:${taskVer}:dockerPush")
+        tasks(":sdks:java:container:${taskVer}:dockerTagPush")
       }
       SUPPORTED_PYTHON_CONTAINER_TASKS.each { taskVer ->
-        tasks(":sdks:python:container:${taskVer}:dockerPush")
+        tasks(":sdks:python:container:${taskVer}:dockerTagPush")
       }
       switches("-Pdocker-repository-root=${imageRepo}")
-      switches("-Pdocker-tag=${imageTag}")
+      switches("-Pdocker-tag-list=${imageTag},latest")
     }
   }
 }
diff --git a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
index 1541663..7cd178f 100644
--- a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
@@ -1704,6 +1704,19 @@ class BeamModulePlugin implements Plugin<Project> {
       return "${configuration.root}/${configuration.name}:${configuration.tag}"
     }
 
+    project.ext.containerImageTags = {
+      String[] tags
+      if (project.rootProject.hasProperty(["docker-tag-list"])) {
+        tags = project.rootProject["docker-tag-list"].split(',')
+      } else {
+        tags = [
+          project.rootProject.hasProperty(["docker-tag"]) ?
+          project.rootProject["docker-tag"] : project.sdk_version
+        ]
+      }
+      return tags
+    }
+
     /** ***********************************************************************************************/
 
     // applyGrpcNature should only be applied to projects who wish to use
diff --git a/sdks/go/container/build.gradle b/sdks/go/container/build.gradle
index 74ca6c1..31fcee8 100644
--- a/sdks/go/container/build.gradle
+++ b/sdks/go/container/build.gradle
@@ -53,6 +53,8 @@ docker {
           root: project.rootProject.hasProperty(["docker-repository-root"]) ?
                   project.rootProject["docker-repository-root"] :
                   project.docker_image_default_repo_root)
+  // tags used by dockerTag task
+  tags containerImageTags()
   files "./build/"
   buildArgs(['pull_licenses': project.rootProject.hasProperty(["docker-pull-licenses"]) ||
                      project.rootProject.hasProperty(["isRelease"])])
diff --git a/sdks/java/container/common.gradle b/sdks/java/container/common.gradle
index a18cdde..47fa8ac 100644
--- a/sdks/java/container/common.gradle
+++ b/sdks/java/container/common.gradle
@@ -84,6 +84,8 @@ docker {
                     project.docker_image_default_repo_root,
             tag: project.rootProject.hasProperty(["docker-tag"]) ?
                     project.rootProject["docker-tag"] : project.sdk_version)
+    // tags used by dockerTag task
+    tags containerImageTags()
     dockerfile project.file("../Dockerfile")
     files "./build/"
     buildArgs([
diff --git a/sdks/python/container/common.gradle b/sdks/python/container/common.gradle
index bb4eba9..9fedf93 100644
--- a/sdks/python/container/common.gradle
+++ b/sdks/python/container/common.gradle
@@ -60,6 +60,8 @@ docker {
                   project.docker_image_default_repo_root,
           tag: project.rootProject.hasProperty(["docker-tag"]) ?
                   project.rootProject["docker-tag"] : project.sdk_version)
+  // tags used by dockerTag task
+  tags containerImageTags()
   files "../Dockerfile", "./build"
   buildArgs(['py_version': "${project.ext.pythonVersion}",
              'pull_licenses': project.rootProject.hasProperty(["docker-pull-licenses"]) ||