BryanDavis has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/298023

Change subject: Allow hiera config of jobrunner groups
......................................................................

Allow hiera config of jobrunner groups

Interoduce a mediawiki::jobrunner::groups hiera variable that is
expected to contain a mapping (YAML for dict/hash/object) describing the
jobrunner groups to configure in /etc/jobrunner.json. Commmon.yaml
recreates the current default config, but a user can override this in
their local.yaml to change the number of runners or introduce separate
processing queues for certain jobs types as is done in WMF production.

Inspired by https://www.mediawiki.org/wiki/MediaWiki-Vagrant#Job_queue
instructions about hacking the config file in the VM which is gross.

Change-Id: Ic5d1e0e9aae49c7df5ef220f7b600fd93267fc23
---
M puppet/hieradata/common.yaml
M puppet/modules/mediawiki/manifests/jobrunner.pp
M puppet/modules/mediawiki/templates/jobrunner.json.erb
3 files changed, 9 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/23/298023/1

diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index dd63759..38dd04f 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -253,6 +253,10 @@
 mediawiki::jobrunner::enable: true
 mediawiki::jobrunner::dir: "%{hiera('mwv::services_dir')}/jobrunner"
 mediawiki::jobrunner::verbose: false
+mediawiki::jobrunner::groups:
+  basic:
+    include: [ "*" ]
+    runners: 1
 
 mediawiki::multiwiki::default_wiki: "%{hiera('role::mediawiki::hostname')}"
 mediawiki::multiwiki::base_domain: ".wiki%{hiera('mwv::tld')}"
diff --git a/puppet/modules/mediawiki/manifests/jobrunner.pp 
b/puppet/modules/mediawiki/manifests/jobrunner.pp
index a1dd59b..5488d32 100644
--- a/puppet/modules/mediawiki/manifests/jobrunner.pp
+++ b/puppet/modules/mediawiki/manifests/jobrunner.pp
@@ -14,10 +14,14 @@
 # [*verbose*]
 #   Enable verbose logging.
 #
+# [*groups*]
+#   Runner group configuration
+#
 class mediawiki::jobrunner(
     $enable,
     $dir,
     $verbose,
+    $groups,
 ) {
     require ::mediawiki
 
diff --git a/puppet/modules/mediawiki/templates/jobrunner.json.erb 
b/puppet/modules/mediawiki/templates/jobrunner.json.erb
index 922f71c..b879298 100644
--- a/puppet/modules/mediawiki/templates/jobrunner.json.erb
+++ b/puppet/modules/mediawiki/templates/jobrunner.json.erb
@@ -1,12 +1,7 @@
 // Configuration file for MediaWiki Jobrunner
 // This file is managed by Puppet
 {
-    "groups": {
-        "basic": {
-            "include": [ "*" ],
-            "runners": 1
-        }
-    },
+    "groups": <%= scope.function_ordered_json([@groups]) %>,
 
     "redis": {
         // Ready queue trackers

-- 
To view, visit https://gerrit.wikimedia.org/r/298023
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic5d1e0e9aae49c7df5ef220f7b600fd93267fc23
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <bda...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to