Allow jjb-workers to be configurable 88/15088/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 27 Mar 2019 17:27:19 +0000 (13:27 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 27 Mar 2019 17:30:56 +0000 (13:30 -0400)
Default it to the number of CPU cores available on the system.

Issue: RELENG-917
Change-Id: I5f65ec7d7142f1a778b6e31cc6700ca2bca1ef88
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
docs/jjb/lf-ci-jobs.rst
jjb/lf-ci-jobs.yaml
releasenotes/notes/jjb-workers-9459a54a5ecb91e8.yaml [new file with mode: 0644]
shell/jjb-merge-job.sh

index 6184284..5ad9b6a 100644 (file)
@@ -424,6 +424,8 @@ Runs `jenkins-jobs update` to update production job configuration
     :build-timeout: Timeout in minutes before aborting build. (default: 10)
     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
     :jjb-cache: JJB cache location. (default: $HOME/.cache/jenkins_jobs)
+    :jjb-workers: Number of threads to run **update** with. Set to 0 by default
+        which is equivalent to the number of available CPU cores. (default: 0)
     :jjb-version: JJB version to install. (default: see job-template)
     :stream: Keyword that can be used to represent a release code-name.
         Often the same as the branch. (default: master)
index 8a49d03..ebf637f 100644 (file)
     # Default parameters #
     ######################
 
+    jjb-workers: 0
+
     gerrit_merge_triggers:
       - change-merged-event
       - comment-added-contains-event:
     builders:
       - lf-infra-pre-build
       - lf-infra-jjbini
+      - inject:
+          properties-content: JJB_WORKERS={jjb-workers}
       - shell: !include-raw-escape:
           - ../shell/jjb-install.sh
           - ../shell/jjb-merge-job.sh
diff --git a/releasenotes/notes/jjb-workers-9459a54a5ecb91e8.yaml b/releasenotes/notes/jjb-workers-9459a54a5ecb91e8.yaml
new file mode 100644 (file)
index 0000000..fc11d25
--- /dev/null
@@ -0,0 +1,6 @@
+---
+features:
+  - |
+    The **jjb-merge** job now has a new parameter ``jjb-workers`` to allow
+    configuration of the number of threads to run update with. Default is *0*
+    which is equivalent to the number of CPU cores available on the system.
index 090e915..0a05c4f 100644 (file)
@@ -10,7 +10,9 @@
 ##############################################################################
 echo "---> jjb-merge-job.sh"
 
+workers="${JJB_WORKERS:-0}"
+
 # Ensure we fail the job if any steps fail.
 set -eu -o pipefail
 
-jenkins-jobs update --recursive --delete-old --workers 4 jjb/
+jenkins-jobs update --recursive --delete-old --workers "$workers" jjb/