Puppet Class: parsoid

Defined in:
modules/parsoid/manifests/init.pp

Overview

Class: parsoid

Parsoid is a wt2HTML and HTML2wt parser able to deliver no-diff round-trip conversions between the two formats.

Parameters

port

Port to run the Parsoid service on. Default: 8000

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'

statsd_prefix

The statsd metric prefix to use. Default: 'parsoid'

deployment

Deployment system to use: available are trebuchet, scap3 or git. Default: scap3

mwapi_server

The full URI of the MW API endpoint to contact when issuing direct requests to it. Default: ''

mwapi_proxy

The proxy to use to contact the MW API. Note that you usually want to set either mwapi_server or this variable. Do not set both! Default: 'api.svc.eqiad.wmnet'

Parameters:

  • port (Any) (defaults to: 8000)
  • conf (Any) (defaults to: undef)
  • no_workers (Any) (defaults to: 'ncpu')
  • logging_name (Any) (defaults to: 'parsoid')
  • statsd_prefix (Any) (defaults to: 'parsoid')
  • deployment (Any) (defaults to: 'scap3')
  • mwapi_server (Any) (defaults to: '')
  • mwapi_proxy (Any) (defaults to: 'http://api.svc.eqiad.wmnet')
  • discovery (Any) (defaults to: undef)


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'modules/parsoid/manifests/init.pp', line 38

class parsoid(
    $port          = 8000,
    $conf          = undef,
    $no_workers    = 'ncpu',
    $logging_name  = 'parsoid',
    $statsd_prefix = 'parsoid',
    $deployment    = 'scap3',
    $mwapi_server  = '',
    $mwapi_proxy   = 'http://api.svc.eqiad.wmnet',
    $discovery     = undef,
) {

    service::node { 'parsoid':
        port              => $port,
        starter_script    => 'src/bin/server.js',
        healthcheck_url   => '/',
        has_spec          => false,
        logging_name      => $logging_name,
        auto_refresh      => false,
        deployment        => $deployment,
        deployment_config => false,
        full_config       => 'external',
    }


    if ($deployment == 'scap3') {
        $deployment_vars = {
            mwapi_server => $mwapi_server,
            mwapi_proxy  => $mwapi_proxy,
        }

        service::node::config::scap3 { 'parsoid':
            port            => $port,
            starter_module  => 'src/lib/index.js',
            entrypoint      => 'apiServiceWorker',
            logging_name    => $logging_name,
            heap_limit      => 800,
            heartbeat_to    => 180000,
            statsd_prefix   => $statsd_prefix,
            auto_refresh    => false,
            deployment_vars => $deployment_vars,
        }
    } 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,
            heap_limit     => 800,
            heartbeat_to   => 180000,
            statsd_prefix  => $statsd_prefix,
            auto_refresh   => false,
        }
    }
}