Physikerwelt has uploaded a new change for review.

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


Change subject: Mathoid service
......................................................................

Mathoid service

* Installs mathoid as a service
* mathoid is a service that runs on localhost on port 8010
* mathoid converts tex input to mathml and svg

Change-Id: I06ad1f570d652ef06e0efa2382b5dde9047b5855
---
A modules/mathoid/files/upstart/wmf-mathoid.conf
A modules/mathoid/manifests/init.pp
2 files changed, 81 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/33/90733/1

diff --git a/modules/mathoid/files/upstart/wmf-mathoid.conf 
b/modules/mathoid/files/upstart/wmf-mathoid.conf
new file mode 100644
index 0000000..717ae9d
--- /dev/null
+++ b/modules/mathoid/files/upstart/wmf-mathoid.conf
@@ -0,0 +1,35 @@
+#######################################################################
+## WARNING: this file is managed by Puppet
+## puppet:///files/wmf-mathoid.conf
+########################################################################
+
+description "TeX to MathML conversion mathematical formulae (with SVG 
fallback)"
+
+author "Antoine Musso <has...@free.fr>"
+
+setuid mathoid
+
+# start/stop based on ssh
+start on filesystem or runlevel [2345]
+stop on runlevel [!2345]
+
+# Log to /var/log/upstart
+console log
+
+# Low priority is fine
+nice 19
+env DEFAULTFILE=/etc/default/wmf-mathoid
+
+pre-start script
+    # Better have the wrapping shell script
+    test -x /vagrant/mediawiki/extensions/Math/mathoid/start.sh  || { stop; 
exit 0; }   
+end script
+
+script
+    # Load default environnement
+    if [ -f "$DEFAULTFILE" ]; then
+    . "$DEFAULTFILE"
+    fi
+
+    exec /usr/bin/env /usr/local/bin/Math/mathoid/start.sh  2>&1 1>> 
/var/log/wmf-mathoid.log
+end script
diff --git a/modules/mathoid/manifests/init.pp 
b/modules/mathoid/manifests/init.pp
new file mode 100644
index 0000000..0e9fc46
--- /dev/null
+++ b/modules/mathoid/manifests/init.pp
@@ -0,0 +1,46 @@
+class mathoid {
+    package { 'npm':
+        ensure => present,
+        before => Exec['install mathoid'],
+    }
+
+    package { 'phantomjs':
+        ensure => present,
+        before => Exec['install mathoid'],
+    }
+
+    git::clone { 'Math':
+        directory => '/usr/local/bin/Math',
+        origin    => 
'https://gerrit.wikimedia.org/r/mediawiki/extensions/Math',
+       # creates   => '/usr/local/bin/Math/mathoid/start.sh',
+    }
+
+    file { '/etc/init/wmf-mathoid.conf':
+            owner => root,
+            group => root,
+            mode => 0444,
+            source => 'puppet:///files/upstart/wmf-mathoid.conf',
+    }
+
+    exec { 'install mathoid':
+       command => '/usr/bin/npm install',
+        cwd     => '/usr/local/bin/Math/mathoid',
+        creates => '/usr/local/bin/Math/mathoid/node_modules',
+        require => [ Package['npm', 'phantomjs'], Git::Clone['Math'] ],
+        user    => root,
+        before => Service['wmf-mathoid'],
+    }
+
+   upstart_job { 'wmf-mathoid': install => true }
+
+    service { 'wmf-mathoid':
+        require => [
+            #File['/usr/local/bin/Math/mathoid/start.sh'], #depends on 
https://gerrit.wikimedia.org/r/#/c/90731/
+            Upstart_job['wmf-mathoid'],
+            #Systemuser['mathoid'], #do we need that?
+            Exec['install mathoid'],
+        ],
+        provider => upstart,
+        ensure => running,
+    }
+}
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I06ad1f570d652ef06e0efa2382b5dde9047b5855
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Physikerwelt <w...@physikerwelt.de>

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

Reply via email to