KartikMistry has uploaded a new change for review.

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

Change subject: WIP: Update cxserver (beta) config
......................................................................

WIP: Update cxserver (beta) config

Changes:
1. Added registry in config.erb
2. Added aperitum URL variable
3. apertium-* packages are no longer needed

Change-Id: I94597e7e78e97c4b34e3ad40c32a6ca97afeccfa
---
M manifests/role/cxserver.pp
M modules/cxserver/manifests/init.pp
M modules/cxserver/templates/config.erb
3 files changed, 104 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/87/157787/1

diff --git a/manifests/role/cxserver.pp b/manifests/role/cxserver.pp
index 88fd5be..ad798cd 100644
--- a/manifests/role/cxserver.pp
+++ b/manifests/role/cxserver.pp
@@ -13,12 +13,13 @@
     }
 
     class { '::cxserver':
-        base_path => '/srv/deployment/cxserver/cxserver',
-        node_path => '/srv/deployment/cxserver/deploy/node_modules',
-        conf_path => '/srv/deployment/cxserver/config.js',
-        log_dir   => '/data/project/cxserver/log',
-        parsoid   => 'http://parsoid-lb.eqiad.wikimedia.org',
-        require   => [
+        base_path  => '/srv/deployment/cxserver/cxserver',
+        node_path  => '/srv/deployment/cxserver/deploy/node_modules',
+        conf_path  => '/srv/deployment/cxserver/config.js',
+        log_dir    => '/data/project/cxserver/log',
+        parsoid    => 'http://parsoid-lb.eqiad.wikimedia.org',
+        apertium   => 'http://apertium.wmflabs.org',
+        require    => [
             File['/srv/deployment/cxserver'],
             File['/data/project/cxserver']
         ],
diff --git a/modules/cxserver/manifests/init.pp 
b/modules/cxserver/manifests/init.pp
index cdd7264..b1e6853 100644
--- a/modules/cxserver/manifests/init.pp
+++ b/modules/cxserver/manifests/init.pp
@@ -18,6 +18,8 @@
 #   have write access to cxserver user.
 # [*parsoid*]
 #   Url to parsoid service.
+# [*apertium*]
+#   Url to apertium service.
 # [*port*]
 #   Port where to run the cxserver service. Defaults to 8080.
 
@@ -28,13 +30,12 @@
     $conf_path,
     $log_dir,
     $parsoid,
+    $apertium,
     $port=8080
 ) {
     # apertium-* packages are for machine translation.
     # dictd-* packages for dictionary server.
     package { ['nodejs',
-               'apertium',
-               'apertium-es-ca',
                'dictd',
                'dict-freedict-eng-spa',
                'dict-freedict-spa-eng',
diff --git a/modules/cxserver/templates/config.erb 
b/modules/cxserver/templates/config.erb
index 2f91f67..89be2ef 100644
--- a/modules/cxserver/templates/config.erb
+++ b/modules/cxserver/templates/config.erb
@@ -7,5 +7,98 @@
 module.exports = {
        port: <%= @port %>,
        logDir: '<%= @log_dir %>',
-       'parsoid.api': '<%= @parsoid %>'
+       'parsoid.api': '<%= @parsoid %>',
+       'mt.apertium.api': '<%= @apertium %>',
+       registry: {
+               ca: {
+                       es: {
+                               mt: {
+                                       providers: [
+                                               'Apertium'
+                                       ]
+                               }
+                       },
+                       pt: {
+                               mt: {
+                                       providers: [
+                                               'Apertium'
+                                       ]
+                               }
+                       }
+               },
+               en: {
+                       en: {
+                               dictionary: {
+                                       providers: [
+                                               'Dictd'
+                                       ]
+                               }
+                       },
+                       es: {
+                               dictionary: {
+                                       providers: [
+                                               'JsonDict'
+                                       ]
+                               }
+                       },
+                       hi: {
+                               dictionary: {
+                                       providers: [
+                                               'Dictd'
+                                       ]
+                               }
+                       },
+                       ru: {
+                               dictionary: {
+                                       providers: [
+                                               'Dictd'
+                                       ]
+                               }
+                       },
+                       de: {
+                               dictionary: {
+                                       providers: [
+                                               'Dictd'
+                                       ]
+                               }
+                       }
+               },
+               es: {
+                       ca: {
+                               dictionary: {
+                                       providers: [
+                                               'JsonDict'
+                                       ]
+                               },
+                               mt: {
+                                       providers: [
+                                               'Apertium'
+                                       ]
+                               }
+                       },
+                       pt: {
+                               mt: {
+                                       providers: [
+                                               'Apertium'
+                                       ]
+                               }
+                       }
+               },
+               pt: {
+                       ca: {
+                               mt: {
+                                       providers: [
+                                               'Apertium'
+                                       ]
+                               }
+                       },
+                       es: {
+                               mt: {
+                                       providers: [
+                                               'Apertium'
+                                       ]
+                               }
+                       }
+               }
+       }
 };

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I94597e7e78e97c4b34e3ad40c32a6ca97afeccfa
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: KartikMistry <kartik.mis...@gmail.com>

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

Reply via email to