You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by am...@apache.org on 2020/09/11 18:34:52 UTC

[beam] branch master updated: [BEAM-10868] Fix build (docker run) concurrency issue when building golang license dependencies

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

amyrvold 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 803efdd  [BEAM-10868] Fix build (docker run) concurrency issue when building golang license dependencies
     new 856cc22  Merge pull request #12829 from alanmyrvold/flaky-test
803efdd is described below

commit 803efdd931699c24e60350e5ccf6e54482f5916f
Author: Alan Myrvold <am...@google.com>
AuthorDate: Fri Sep 11 17:29:37 2020 +0000

    [BEAM-10868] Fix build (docker run) concurrency issue when building golang license dependencies
---
 release/go-licenses/common.gradle | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/release/go-licenses/common.gradle b/release/go-licenses/common.gradle
index 751b8d9..172bdfb 100644
--- a/release/go-licenses/common.gradle
+++ b/release/go-licenses/common.gradle
@@ -30,7 +30,8 @@ docker {
 mkdir "${licenseOutput}"
 
 dockerRun {
-  name "license-container-${sdkName}"
+  // Add a random number to the running container name to avoid collisions.
+  name "license-container-${sdkName}-" + (new Random().nextInt())
   image "golicenses-${sdkName}:latest"
   volumes "${licenseOutput}": '/output'
   daemonize false
@@ -41,5 +42,8 @@ tasks.dockerRun.dependsOn 'docker'
 task createLicenses {
   outputs.cacheIf { true }
   outputs.file("$buildDir/output/licenses/list.csv")
-  dependsOn 'dockerRun'
+  // Aggressively cache, to avoid slowness and docker run collisions.
+  if (!file("$buildDir/output/licenses/list.csv").exists()) {
+    dependsOn 'dockerRun'
+  }
 }