Mobrovac has uploaded a new change for review.

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

Change subject: RESTBase: Enable purging and minor config style changes
......................................................................

RESTBase: Enable purging and minor config style changes

We have a purging module which allows us to send HTCP purge requests to
the vhtcpd daemon sitting on the Varnish text machine. This change
enables purging content (currently only for MobileApps) whenever there's
a new render of the same content stored in RESTBase's storage.

This patch also slightly changes the config file style of RESTBase to be
fully Swagger-compliant.

Change-Id: Ia50d2a293a98265a4e560f558339d0553d6bd203
---
M hieradata/labs/deployment-prep/common.yaml
M modules/restbase/manifests/init.pp
M modules/restbase/templates/config.labs.yaml.erb
M modules/restbase/templates/config.yaml.erb
4 files changed, 104 insertions(+), 92 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/36/271436/1

diff --git a/hieradata/labs/deployment-prep/common.yaml 
b/hieradata/labs/deployment-prep/common.yaml
index f6d9a0f..e6ef15b 100644
--- a/hieradata/labs/deployment-prep/common.yaml
+++ b/hieradata/labs/deployment-prep/common.yaml
@@ -114,6 +114,7 @@
 restbase::mobileapps_uri: http://appservice.wmflabs.org
 restbase::mathoid_uri: http://mathoid-tester.wmflabs.org
 restbase::aqs_uri: https://wikimedia.org/api/rest_v1/metrics
+restbase::purge_host: deployment-cache-text04.deployment-prep.eqiad.wmflabs
 "mediawiki::log_aggregator": deployment-fluorine.eqiad.wmflabs:8420
 "mediawiki::forward_syslog": 
deployment-logstash2.deployment-prep.eqiad.wmflabs:10514
 mediawiki_memcached_servers:
diff --git a/modules/restbase/manifests/init.pp 
b/modules/restbase/manifests/init.pp
index ddf8693..bf7fb7a 100644
--- a/modules/restbase/manifests/init.pp
+++ b/modules/restbase/manifests/init.pp
@@ -63,6 +63,12 @@
 #   Analytics Query Service URI. Default:
 #   http://aqs.svc.eqiad.wmnet:7232/analytics.wikimedia.org/v1
 #
+# [*purge_host*]
+#   The vhtcpd daemon host to send purge requests to. Default: 239.128.0.112
+#
+# [*purge_port*]
+#   The port the vhtcp daemon listens to. Default: 4827
+#
 # [*monitor_domain*]
 #   The domain to monitor during the service's operation.
 #   Default: en.wikipedia.org
@@ -89,6 +95,8 @@
     $mathoid_uri    = 'http://mathoid.svc.eqiad.wmnet:10042',
     $aqs_uri        =
     'http://aqs.svc.eqiad.wmnet:7232/analytics.wikimedia.org/v1',
+    $purge_host     = '239.128.0.112',
+    $purge_port     = 4827,
     $monitor_domain = 'en.wikipedia.org',
 ) {
 
diff --git a/modules/restbase/templates/config.labs.yaml.erb 
b/modules/restbase/templates/config.labs.yaml.erb
index ed01f91..66c247a 100644
--- a/modules/restbase/templates/config.labs.yaml.erb
+++ b/modules/restbase/templates/config.labs.yaml.erb
@@ -4,44 +4,46 @@
 # between domains in the root_spec further down.
 default_project: &default_project
   x-modules:
-    /:
-      - path: projects/wmf_default.yaml
-        options: &default_options
-          table:
-            hosts: [<%= Array(@seeds).join(',') %>]
-            keyspace: system
-            localDc: <%= @cassandra_localDc %>
-            datacenters: [<%= Array(@cassandra_datacenters).join(',') %>]
-            username: <%= @cassandra_user %>
-            password: <%= @cassandra_password %>
-            defaultConsistency: <%= @cassandra_defaultConsistency %>
-            storage_groups:
-              # Catch-all group
-              - name: default.group.local
-                domains: /./
+    - path: projects/wmf_default.yaml
+      options: &default_options
+        table:
+          hosts: [<%= Array(@seeds).join(',') %>]
+          keyspace: system
+          localDc: <%= @cassandra_localDc %>
+          datacenters: [<%= Array(@cassandra_datacenters).join(',') %>]
+          username: <%= @cassandra_user %>
+          password: <%= @cassandra_password %>
+          defaultConsistency: <%= @cassandra_defaultConsistency %>
+          storage_groups:
+            # Catch-all group
+            - name: default.group.local
+              domains: /./
 
-          parsoid:
-            host: <%= @parsoid_uri %>
-          action:
-            apiUriTemplate: "{{'http://{domain}/w/api.php'}}"
-          graphoid:
-            host: <%= @graphoid_uri %>
-          mathoid:
-            host: <%= @mathoid_uri %>
-            # 10 days Varnish caching, one day client-side
-            cache-control: s-maxage=864000, max-age=86400
-          mobileapps:
-            host: <%= @mobileapps_uri %>
+        parsoid:
+          host: <%= @parsoid_uri %>
+        action:
+          apiUriTemplate: "{{'http://{domain}/w/api.php'}}"
+        graphoid:
+          host: <%= @graphoid_uri %>
+        mathoid:
+          host: <%= @mathoid_uri %>
+          # 10 days Varnish caching, one day client-side
+          cache-control: s-maxage=864000, max-age=86400
+        mobileapps:
+          host: <%= @mobileapps_uri %>
+        events:
+          purge:
+            host: <%= @purge_address %>
+            port: <%= @purge_port %>
 
 # A different project template, sharing configuration options.
 wikimedia.org: &wikimedia.org
   x-modules:
-    /:
-      - path: projects/wikimedia.org.yaml
-        options:
-            <<: *default_options
-            pageviews:
-              host: <%= @aqs_uri %>
+    - path: projects/wikimedia.org.yaml
+      options:
+          <<: *default_options
+          pageviews:
+            host: <%= @aqs_uri %>
 
 
 # Swagger spec root.
diff --git a/modules/restbase/templates/config.yaml.erb 
b/modules/restbase/templates/config.yaml.erb
index a27ceac..63586a7 100644
--- a/modules/restbase/templates/config.yaml.erb
+++ b/modules/restbase/templates/config.yaml.erb
@@ -4,74 +4,75 @@
 # between domains in the root_spec further down.
 default_project: &default_project
   x-modules:
-    /:
-      - path: projects/wmf_default.yaml
-        options: &default_options
-          table:
-            hosts: [<%= Array(@seeds).join(',') %>]
-            keyspace: system
-            localDc: <%= @cassandra_localDc %>
-            datacenters: [<%= Array(@cassandra_datacenters).join(',') %>]
-            username: <%= @cassandra_user %>
-            password: <%= @cassandra_password %>
-            defaultConsistency: <%= @cassandra_defaultConsistency %>
-            storage_groups:
-              - name: phase0.group.local
-                domains:
-                  - /^(?:test.*\.wiki.*\.org|www.mediawiki.org)$/
-              - name: wikipedia.group.local
-                domains: /\.wikipedia\.org$/
-              - name: wikimedia.group.local
-                domains: /\.wikimedia\.org$/
-              - name: wiktionary.group.local
-                domains: /\.wiktionary\.org$/
-              - name: wikibooks.group.local
-                domains: /\.wikibooks\.org$/
-              - name: wikisource.group.local
-                domains: /\.wikisource\.org$/
-              - name: wikiquote.group.local
-                domains: /\.wikiquote\.org$/
-              - name: wikinews.group.local
-                domains: /\.wikinews\.org$/
-              - name: wikiversity.group.local
-                domains: /\.wikiversity\.org$/
-              - name: wikivoyage.group.local
-                domains: /\.wikivoyage\.org$/
-              - name: globaldomain.group.local
-                domains: /^wikimedia\.org$/
-              # Catch-all group
-              - name: default.group.local
-                domains: /./
+    - path: projects/wmf_default.yaml
+      options: &default_options
+        table:
+          hosts: [<%= Array(@seeds).join(',') %>]
+          keyspace: system
+          localDc: <%= @cassandra_localDc %>
+          datacenters: [<%= Array(@cassandra_datacenters).join(',') %>]
+          username: <%= @cassandra_user %>
+          password: <%= @cassandra_password %>
+          defaultConsistency: <%= @cassandra_defaultConsistency %>
+          storage_groups:
+            - name: phase0.group.local
+              domains:
+                - /^(?:test.*\.wiki.*\.org|www.mediawiki.org)$/
+            - name: wikipedia.group.local
+              domains: /\.wikipedia\.org$/
+            - name: wikimedia.group.local
+              domains: /\.wikimedia\.org$/
+            - name: wiktionary.group.local
+              domains: /\.wiktionary\.org$/
+            - name: wikibooks.group.local
+              domains: /\.wikibooks\.org$/
+            - name: wikisource.group.local
+              domains: /\.wikisource\.org$/
+            - name: wikiquote.group.local
+              domains: /\.wikiquote\.org$/
+            - name: wikinews.group.local
+              domains: /\.wikinews\.org$/
+            - name: wikiversity.group.local
+              domains: /\.wikiversity\.org$/
+            - name: wikivoyage.group.local
+              domains: /\.wikivoyage\.org$/
+            - name: globaldomain.group.local
+              domains: /^wikimedia\.org$/
+            # Catch-all group
+            - name: default.group.local
+              domains: /./
 
-          parsoid:
-            host: <%= @parsoid_uri %>
-          action:
-            apiUriTemplate: http://api.svc.eqiad.wmnet/w/api.php
-          graphoid:
-            host: <%= @graphoid_uri %>
-          mathoid:
-            host: <%= @mathoid_uri %>
-            # 10 days Varnish caching, one day client-side
-            cache-control: s-maxage=864000, max-age=86400
-          mobileapps:
-            host: <%= @mobileapps_uri %>
+        parsoid:
+          host: <%= @parsoid_uri %>
+        action:
+          apiUriTemplate: http://api.svc.eqiad.wmnet/w/api.php
+        graphoid:
+          host: <%= @graphoid_uri %>
+        mathoid:
+          host: <%= @mathoid_uri %>
+          # 10 days Varnish caching, one day client-side
+          cache-control: s-maxage=864000, max-age=86400
+        mobileapps:
+          host: <%= @mobileapps_uri %>
+        events:
+          purge:
+            host: <%= @purge_address %>
+            port: <%= @purge_port %>
 
 # A different project template, sharing configuration options.
 wikimedia.org: &wikimedia.org
   x-modules:
-    /:
-      - path: projects/wikimedia.org.yaml
-        options:
-            <<: *default_options
-            pageviews:
-              host: <%= @aqs_uri %>
+    - path: projects/wikimedia.org.yaml
+      options:
+          <<: *default_options
+          pageviews:
+            host: <%= @aqs_uri %>
 
 # wiktionaries config
 wiktionary: &wiktionary_project
   x-modules:
-    /:
-      - path: projects/wmf_wiktionary.yaml
-        options: *default_options
+    - path: projects/wmf_wiktionary.yaml
+      options: *default_options
 
 # Swagger spec root.
 root_spec: &root_spec

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia50d2a293a98265a4e560f558339d0553d6bd203
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Mobrovac <[email protected]>

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

Reply via email to