Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/403464 )

Change subject: parsoid::testing:: Switch to YAML configuration 
......................................................................


parsoid::testing:: Switch to YAML configuration 

This also enables cpu_workers with useWorker.

The removed empty warnings are from cfff63a in the Parsoid repo.

Change-Id: I0aab1a81f34e717ee1fade5f7b2765d49eb2773b
---
M hieradata/role/common/parsoid/testing.yaml
M modules/parsoid/manifests/init.pp
M modules/profile/manifests/parsoid/testing.pp
M modules/role/manifests/parsoid/rt_client.pp
D modules/testreduce/templates/parsoid-rt-client.rttest.localsettings.js.erb
A modules/testreduce/templates/parsoid-rt.config.yaml.erb
6 files changed, 45 insertions(+), 76 deletions(-)

Approvals:
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/hieradata/role/common/parsoid/testing.yaml 
b/hieradata/role/common/parsoid/testing.yaml
index ada7b11..e406622 100644
--- a/hieradata/role/common/parsoid/testing.yaml
+++ b/hieradata/role/common/parsoid/testing.yaml
@@ -1 +1,2 @@
 parsoid::testing::parsoid_port: 8142
+parsoid::testing::default_api_proxy_uri: 'http://api-rw.discovery.wmnet'
diff --git a/modules/parsoid/manifests/init.pp 
b/modules/parsoid/manifests/init.pp
index 4a0b7ea..d163cb0 100644
--- a/modules/parsoid/manifests/init.pp
+++ b/modules/parsoid/manifests/init.pp
@@ -8,10 +8,14 @@
 # [*port*]
 #   Port to run the Parsoid service on. Default: 8000
 #
-# [*settings_file*]
-#   Location of the old-format Parsoid configuration and settings file. Note
-#   that Parsoid still draws part of its configuration from there when it is
-#   specified. Default: 'conf/wmf/localsettings.js'
+# [*conf*]
+#   Hash or YAML-formatted string that gets merged into the service's
+#   configuration.  Only applicable for non-scap3 deployments.
+#
+# [*no_workers*]
+#   Number of http workers to start.  Default: 'ncpu' (i.e. start as many
+#   workers as there are CPUs)  The same meaning as in service::node
+#   Only applicable for non-scap3 deployments.
 #
 # [*logging_name*]
 #   The logging name to send to logstash. Default: 'parsoid'
@@ -33,12 +37,14 @@
 #   'http://api.svc.eqiad.wmnet'
 #
 # [*discovery*]
-# If defined, will use that discovery key to discover if the current 
datacenter is active
-# for the MediaWiki API, and use HTTP or HTTPS to connect the host 
${discovery}.discovery.wmnet
+#   If defined, will use that discovery key to discover if the current
+#   datacenter is active for the MediaWiki API, and use HTTP or HTTPS to
+#   connect the host ${discovery}.discovery.wmnet
 #
 class parsoid(
     $port          = 8000,
-    $settings_file = 'conf/wmf/localsettings.js',
+    $conf          = undef,
+    $no_workers    = 'ncpu',
     $logging_name  = 'parsoid',
     $statsd_prefix = 'parsoid',
     $deployment    = 'scap3',
@@ -92,6 +98,8 @@
     } else {
         service::node::config { 'parsoid':
             port           => $port,
+            config         => $conf,
+            no_workers     => $no_workers,
             starter_module => 'src/lib/index.js',
             entrypoint     => 'apiServiceWorker',
             logging_name   => $logging_name,
@@ -99,9 +107,6 @@
             heartbeat_to   => 180000,
             statsd_prefix  => $statsd_prefix,
             auto_refresh   => false,
-            config         => {
-                localsettings => $settings_file,
-            },
         }
     }
 }
diff --git a/modules/profile/manifests/parsoid/testing.pp 
b/modules/profile/manifests/parsoid/testing.pp
index a7a3eb1..f08ad5d 100644
--- a/modules/profile/manifests/parsoid/testing.pp
+++ b/modules/profile/manifests/parsoid/testing.pp
@@ -1,11 +1,14 @@
 # Parsoid roundtrip testing, Parsoid & PHP parser visual diff testing
 class profile::parsoid::testing (
     $parsoid_port = hiera('parsoid::testing::parsoid_port'),
+    $default_api_proxy_uri = hiera('parsoid::testing::default_api_proxy_uri'),
 ) {
+
     class { '::parsoid':
-        port          => $parsoid_port,
-        settings_file => '/srv/deployment/parsoid/deploy/src/localsettings.js',
-        deployment    => 'git',
+        port       => $parsoid_port,
+        deployment => 'git',
+        no_workers => 1,
+        conf       => template('testreduce/parsoid-rt.config.yaml.erb'),
     }
 
     file { '/usr/local/bin/update_parsoid.sh':
@@ -13,15 +16,6 @@
         owner  => 'root',
         group  => 'root',
         mode   => '0555',
-    }
-
-    # Use this parsoid instance for parsoid rt-testing
-    file { '/srv/deployment/parsoid/deploy/src/localsettings.js':
-        content => 
template('testreduce/parsoid-rt-client.rttest.localsettings.js.erb'),
-        owner   => 'root',
-        group   => 'wikidev',
-        mode    => '0444',
-        before  => Service['parsoid'],
     }
 
     # mysql client and configuration to provide command line access to
diff --git a/modules/role/manifests/parsoid/rt_client.pp 
b/modules/role/manifests/parsoid/rt_client.pp
index 9b2a52a..028a0c1 100644
--- a/modules/role/manifests/parsoid/rt_client.pp
+++ b/modules/role/manifests/parsoid/rt_client.pp
@@ -2,14 +2,6 @@
 class role::parsoid::rt_client {
     include ::testreduce
 
-    file { 
'/srv/deployment/parsoid/deploy/src/tests/testreduce/parsoid-rt-client.rttest.localsettings.js':
-        content => 
template('testreduce/parsoid-rt-client.rttest.localsettings.js.erb'),
-        owner   => 'root',
-        group   => 'root',
-        mode    => '0444',
-        notify  => Service['parsoid-rt-client'],
-    }
-
     testreduce::client { 'parsoid-rt-client':
         instance_name => 'parsoid-rt-client',
         parsoid_port  => hiera('parsoid::testing::parsoid_port'),
diff --git 
a/modules/testreduce/templates/parsoid-rt-client.rttest.localsettings.js.erb 
b/modules/testreduce/templates/parsoid-rt-client.rttest.localsettings.js.erb
deleted file mode 100644
index 5f1cdb0..0000000
--- a/modules/testreduce/templates/parsoid-rt-client.rttest.localsettings.js.erb
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * This is a sample configuration file.
- *
- * Copy this file to localsettings.js and edit that file to fit your needs.
- *
- * Also see the file server.js for more information.
- */
-'use strict';
-
-exports.setup = function(parsoidConfig) {
-       // Enable dev API so that we can run the /_rt/ endpoints
-       parsoidConfig.devAPI = true;
-
-       // Point at WMF's wikis
-       parsoidConfig.loadWMF = true;
-
-       // Use the API backends directly without hitting the text varnishes.
-       // API requests are not cacheable anyway.
-       parsoidConfig.defaultAPIProxyURI = 'http://api-rw.discovery.wmnet';
-
-       // Turn on the batching API
-       parsoidConfig.useBatchAPI = true;
-
-       // Use selective serialization
-       parsoidConfig.useSelser = true;
-
-       // Enabled the linting code
-       parsoidConfig.linting = true;
-       parsoidConfig.linter = {
-               // at a low sampling rate
-               apiSampling: 1000,  // 0.1%
-               // and send it to logs
-               sendAPI: false,
-       };
-
-       // Set rtTestMode to true for round-trip testing
-       parsoidConfig.rtTestMode = true;
-
-       // Sample verbose logs
-       parsoidConfig.loggerSampling = [
-               ['warning/dsr/inconsistent', 5],
-               ['warning/empty/li', 20],
-               ['warning/empty/tr', 1],
-               [/^warning\/empty\//, 5],
-       ];
-};
diff --git a/modules/testreduce/templates/parsoid-rt.config.yaml.erb 
b/modules/testreduce/templates/parsoid-rt.config.yaml.erb
new file mode 100644
index 0000000..5651d18
--- /dev/null
+++ b/modules/testreduce/templates/parsoid-rt.config.yaml.erb
@@ -0,0 +1,23 @@
+# Note that this is only the parsoid service config, not all of service-runner
+# as is normally found in Parsoid's config.yaml
+
+devAPI: true
+loadWMF: true
+rtTestMode: true
+
+useBatchAPI: true
+useSelser: true
+useWorker: true
+
+defaultAPIProxyURI: <%= @default_api_proxy_uri %>
+
+linting: true;
+linter:
+  apiSampling: 1000
+  sendAPI: false
+
+rtTestMode: true
+
+loggerSampling:
+  - - 'warn/dsr/inconsistent'
+    - 5

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0aab1a81f34e717ee1fade5f7b2765d49eb2773b
Gerrit-PatchSet: 11
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Arlolra <abrea...@wikimedia.org>
Gerrit-Reviewer: Arlolra <abrea...@wikimedia.org>
Gerrit-Reviewer: C. Scott Ananian <canan...@wikimedia.org>
Gerrit-Reviewer: Dzahn <dz...@wikimedia.org>
Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org>
Gerrit-Reviewer: Mobrovac <mobro...@wikimedia.org>
Gerrit-Reviewer: Sbailey <sbai...@wikimedia.org>
Gerrit-Reviewer: Subramanya Sastry <ssas...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to