You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by up...@apache.org on 2018/09/06 22:14:37 UTC

[geode] branch concourse-staging updated (debcd83 -> a7fe30b)

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

upthewaterspout pushed a change to branch concourse-staging
in repository https://gitbox.apache.org/repos/asf/geode.git.


    from debcd83  Limit max number of simultaneous runs to 5.
     new 1c7516c  Adding an option to limit the number of CPUs for docker
     new a7fe30b  Setting the dunit cpu quota to 4

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 gradle.properties    |  1 +
 gradle/docker.gradle | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)


[geode] 01/02: Adding an option to limit the number of CPUs for docker

Posted by up...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

upthewaterspout pushed a commit to branch concourse-staging
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 1c7516c446a1bfb2049e2ae1ebfdaf9475be2457
Author: Dan Smith <up...@apache.org>
AuthorDate: Thu Sep 6 15:06:06 2018 -0700

    Adding an option to limit the number of CPUs for docker
    
    When running tests in docker containers, you can limit the number of
    CPUs each container gets to use with -PdunitCpuQuota=X , where X
    can be a floating point number of CPUs.
---
 gradle/docker.gradle | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/gradle/docker.gradle b/gradle/docker.gradle
index ec08ab7..e49ab04 100644
--- a/gradle/docker.gradle
+++ b/gradle/docker.gradle
@@ -63,6 +63,7 @@ def dockerConfig = {
     // specify the user for starting Gradle test worker within the container.
     user = dunitDockerUser
 
+
     beforeContainerCreate = { cmd, client ->
       def javaHomeIdx = -1
       def pathIdx = -1
@@ -98,6 +99,18 @@ def dockerConfig = {
 
       cmd.withEnv(tmpEnv)
 
+      //Limit the CPU usage of the command
+      //Newer docker has a --cpu command, but for the docker-java plugin
+      //we have to set the CPU period (100 microseconds) and CPU quota
+      if(project.hasProperty("dunitCpuQuota")) {
+        int period = 100_000;
+        int quota = period * Float.parseFloat(project.dunitCpuQuota);
+        def hostConfig = cmd.getHostConfig();
+        hostConfig.withCpuPeriod(period)
+        hostConfig.withCpuQuota(quota)
+        cmd.withHostConfig(hostConfig)
+      }
+
       // Infer the index of this invocation
       def cmdList = cmd.getCmd()
       def matcher = (cmdList[cmdList.length - 1] =~ /.*Executor (\d*).*/)
@@ -105,7 +118,6 @@ def dockerConfig = {
       def workdir = new File(cmd.getWorkingDir() + matcher[0][1])
       workdir.mkdirs()
       cmd.withWorkingDir(workdir.toString())
-
       //println cmd
     }
   }


[geode] 02/02: Setting the dunit cpu quota to 4

Posted by up...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

upthewaterspout pushed a commit to branch concourse-staging
in repository https://gitbox.apache.org/repos/asf/geode.git

commit a7fe30b7f62122715471151e9cf6faf8ccde7919
Author: Dan Smith <up...@apache.org>
AuthorDate: Thu Sep 6 15:13:03 2018 -0700

    Setting the dunit cpu quota to 4
    
    Manually setting this to 4 here because it's easier than messing with
    the pipeline configuration. Don't keep this change, this should be set
    in the pipeline.
---
 gradle.properties | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gradle.properties b/gradle.properties
index 2e3e07d..c277372 100755
--- a/gradle.properties
+++ b/gradle.properties
@@ -68,3 +68,4 @@ org.gradle.caching = true
 org.gradle.parallel = false
 org.gradle.configureondemand = false
 
+dunitCpuQuota=4