Ppchelko has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391801 )

Change subject: [Config] Move the enabled job config to vars.yaml
......................................................................

[Config] Move the enabled job config to vars.yaml

Using regexes to subscrive to the topics is becoming unbearable,
so let's switch to using the vars.yaml.

This will completely break the metrics - we are renaming the rules
so the metrics will start over. I think it's ok, if we continue with
this pattern from now on.

Change-Id: I854c125cfd46e5f3acbe5695be1dfcc34d05deaa
---
M scap/templates/config.yaml.j2
M scap/vars.yaml
2 files changed, 22 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/services/change-propagation/jobqueue-deploy
 refs/changes/01/391801/1

diff --git a/scap/templates/config.yaml.j2 b/scap/templates/config.yaml.j2
index 21bcf61..7b3a367 100644
--- a/scap/templates/config.yaml.j2
+++ b/scap/templates/config.yaml.j2
@@ -33,18 +33,30 @@
             concurrency: <%= concurrency %>
             startup_delay: 60000
             templates:
-              job:
 <%- if env == 'production' %>
-                topic: 
'/(?:^mediawiki\.job\.RecordLintJob$)|(?:^mediawiki\.job\.deleteLinks$)|(?:^mediawiki\.job\.MessageIndexRebuildJob$)|(?:^mediawiki\.job\.flaggedrevs_CacheUpdate$)|(?:^mediawiki\.job\.updateBetaFeaturesUserCounts$)/'
+<%- for topic, topic_config in jobs_enabled.iteritems() %>
+              <%= topic %>:
+                topic: 'mediawiki.job.<%= topic %>'
+                exec:
+<%- if topic_config.concurrency is not none %>
+                concurrency: <%= topic_config.concurrency %>
+<% endif %>
+                  method: post
+                  uri: '<%= jobrunner_uri %>'
+                  headers:
+                    content-type: 'application/json'
+                  body: '{{globals.message}}'
+<% endfor -%>
 <%- else %>
+              job:
                 topic: '/^mediawiki\.job\..*/'
-<%- endif %>
                 exec:
                   method: post
                   uri: '<%= jobrunner_uri %>'
                   headers:
                     content-type: 'application/json'
                   body: '{{globals.message}}'
+<%- endif %>
 
 
 # Number of worker processes to spawn.
diff --git a/scap/vars.yaml b/scap/vars.yaml
index ea9031f..1d04fa9 100644
--- a/scap/vars.yaml
+++ b/scap/vars.yaml
@@ -19,3 +19,10 @@
 redis_pass:
 env: production
 kafka_max_bytes: 4194304
+jobs_enabled:
+  deleteLinks: {}
+  MessageIndexRebuildJob: {}
+  flaggedrevs_CacheUpdate: {}
+  updateBetaFeaturesUserCounts: {}
+  RecordLintJob:
+    concurrency: 60
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I854c125cfd46e5f3acbe5695be1dfcc34d05deaa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/change-propagation/jobqueue-deploy
Gerrit-Branch: master
Gerrit-Owner: Ppchelko <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to