[Asterisk-code-review] CI: Make node labels job-specific (...testsuite[13])

Friendly Automation asteriskteam at digium.com
Wed Aug 7 11:13:34 CDT 2019


Friendly Automation has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/testsuite/+/11682 )

Change subject: CI:  Make node labels job-specific
......................................................................

CI:  Make node labels job-specific

Originally, the eligible nodes for a job were labelled only by
"swdev-docker".  So basically any node could run any job.  We had
found that allowing a node to run more than 1 gate at a time was
problematic so we limited the nodes to processing 1 job at a time.
With the creation of the Asterisk 17 branches however, we now have
so many active branches that getting checks and gates through in
a timely manner is problematic when a node can run only 1 job
at a time.

Now the nodes are also labelled by the job type they can run.
For instance: "testsuite-check", "testsuite-gate", etc.  With the
"Throttle Concurrent Builds" plugin, we can now allow a node to
run more than 1 job BUT throttle by job type.  For instance:
  Allow 2 jobs but only 1 testsuite-gate at a time.
Now a node can run 2 checks or 1 check and 1 gate or 1 gate but
not 2 gates at a time.

Change-Id: I9470efdfa716645110d22672178a1ebb5a2b3b5b
---
M CI/gates.jenkinsfile
M CI/unittests.jenkinsfile
2 files changed, 10 insertions(+), 10 deletions(-)

Approvals:
  Friendly Automation: Looks good to me, approved; Approved for Submit



diff --git a/CI/gates.jenkinsfile b/CI/gates.jenkinsfile
index 187eb74..26e30de 100644
--- a/CI/gates.jenkinsfile
+++ b/CI/gates.jenkinsfile
@@ -44,7 +44,7 @@
 	}
 	agent {
 		/* All of the stages need to be performed on a docker host */
-		label "swdev-docker"
+		label "testsuite-gate"
 	}
 
 	stages {
@@ -111,7 +111,7 @@
 					def r = currentBuild.startTimeInMillis % images.length
 					def ri = images[(int)r]
 					def randomImage = env.DOCKER_REGISTRY + "/" + ri;
-					
+
 					def bt = env.BUILD_TAG.replaceAll(/[^a-zA-Z0-9_.-]/, '-')
 					def dockerOptions = "--ulimit core=0 --ulimit nofile=10240 " +
 						" -v /srv/jenkins:/srv/jenkins:rw -v /srv/cache:/srv/cache:rw " +
@@ -123,7 +123,7 @@
 					def img = docker.image(randomImage)
 					img.pull()
 					img.inside(dockerOptions) {
-						def asteriskUrl = env.GERRIT_PROJECT_URL.replaceAll(/\/(Security-)?[^\/]+$/, "/\$1asterisk")	
+						def asteriskUrl = env.GERRIT_PROJECT_URL.replaceAll(/\/(Security-)?[^\/]+$/, "/\$1asterisk")
 						checkout scm: [$class: 'GitSCM',
 							branches: [[name: "${BRANCH_NAME}"]],
 							extensions: [
@@ -137,7 +137,7 @@
 							],
 							userRemoteConfigs: [[name: env.GERRIT_NAME, url: asteriskUrl]]
 						]
-						
+
 						stage ('Build') {
 							echo 'Building..'
 
@@ -145,7 +145,7 @@
 								cd ${astDir}
 								./tests/CI/buildAsterisk.sh --output-dir=${env.WORKSPACE}/${outputDir} --cache-dir=/srv/cache
 								sudo ./tests/CI/installAsterisk.sh --user-group=jenkins:users
-							"""									
+							"""
 						}
 						stage ('Test') {
 							sh "./self_test"
diff --git a/CI/unittests.jenkinsfile b/CI/unittests.jenkinsfile
index 33be6b0..943c1d0 100644
--- a/CI/unittests.jenkinsfile
+++ b/CI/unittests.jenkinsfile
@@ -47,7 +47,7 @@
 	}
 	agent {
 		/* All of the stages need to be performed on a docker host */
-		label "swdev-docker"
+		label "testsuite-check"
 	}
 
 	stages {
@@ -114,7 +114,7 @@
 					def r = currentBuild.startTimeInMillis % images.length
 					def ri = images[(int)r]
 					def randomImage = env.DOCKER_REGISTRY + "/" + ri;
-					
+
 					def bt = env.BUILD_TAG.replaceAll(/[^a-zA-Z0-9_.-]/, '-')
 					def dockerOptions = "--ulimit core=0 --ulimit nofile=10240 " +
 						" -v /srv/jenkins:/srv/jenkins:rw -v /srv/cache:/srv/cache:rw " +
@@ -126,7 +126,7 @@
 					def img = docker.image(randomImage)
 					img.pull()
 					img.inside(dockerOptions) {
-						def asteriskUrl = env.GERRIT_PROJECT_URL.replaceAll(/\/(Security-)?[^\/]+$/, "/\$1asterisk")	
+						def asteriskUrl = env.GERRIT_PROJECT_URL.replaceAll(/\/(Security-)?[^\/]+$/, "/\$1asterisk")
 						checkout scm: [$class: 'GitSCM',
 							branches: [[name: "${BRANCH_NAME}"]],
 							extensions: [
@@ -140,7 +140,7 @@
 							],
 							userRemoteConfigs: [[name: env.GERRIT_NAME, url: asteriskUrl]]
 						]
-						
+
 						stage ('Build') {
 							echo 'Building..'
 
@@ -148,7 +148,7 @@
 								cd ${astDir}
 								./tests/CI/buildAsterisk.sh --output-dir=${env.WORKSPACE}/${outputDir} --cache-dir=/srv/cache
 								sudo ./tests/CI/installAsterisk.sh --user-group=jenkins:users
-							"""									
+							"""
 						}
 						stage ('Test') {
 							sh "./self_test"

-- 
To view, visit https://gerrit.asterisk.org/c/testsuite/+/11682
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 13
Gerrit-Change-Id: I9470efdfa716645110d22672178a1ebb5a2b3b5b
Gerrit-Change-Number: 11682
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190807/f2889684/attachment-0001.html>


More information about the asterisk-code-review mailing list