Ori.livneh has uploaded a new change for review.

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

Change subject: Complete xhgui role
......................................................................

Complete xhgui role

- Deploy xhgui with Git.
- Serve xhgui via Apache.
- Proxy performance.wikimedia.org/xhgui to xhgui vhost.

Change-Id: Idc306585643229439a0a992d160e6c114efe11b3
---
M manifests/role/xhgui.pp
M templates/apache/sites/performance.wikimedia.org.erb
A templates/apache/sites/xhgui.erb
3 files changed, 57 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/53/271953/1

diff --git a/manifests/role/xhgui.pp b/manifests/role/xhgui.pp
index 2f4d252..96afa9f 100644
--- a/manifests/role/xhgui.pp
+++ b/manifests/role/xhgui.pp
@@ -1,11 +1,39 @@
 # == Class: role::xhgui
 #
-# Aggregates XHProf profiling data from the app servers.
+# XHGUI is a MongoDB-backed PHP webapp for viewing and analyzing
+# PHP profiling data.
 #
 class role::xhgui {
-    class { 'mongodb': }
+    include ::apache::mod::php5
+    include ::apache::mod::rewrite
 
-    ferm::rule { 'xhgui_mongodb':
-        rule => 'proto tcp dport 27017 { saddr $INTERNAL ACCEPT; }',
+    include ::mongodb
+
+    # TODO: set up indexing on mongodb
+    # TODO: set NUMA arg
+
+    system::role { 'role::xhgui': }
+
+    ferm::service { 'xhgui_mongodb':
+        port   => 27017,
+        proto  => 'tcp',
+        srange => '$INTERNAL',
+    }
+
+    ferm::service { 'xhgui_http':
+        port   => 80,
+        proto  => 'tcp',
+        srange => '$INTERNAL',
+    }
+
+    git::clone { 'operations/software/xhgui':
+        ensure    => 'latest',
+        directory => '/srv/xhgui',
+        branch    => 'wmf_deploy',
+    }
+
+    apache::site { 'xhgui_apache_site':
+        content => template('apache/sites/xhgui.erb'),
+        require => Git::Clone['vendor/xhgui'],
     }
 }
diff --git a/templates/apache/sites/performance.wikimedia.org.erb 
b/templates/apache/sites/performance.wikimedia.org.erb
index 8542e4d..4ba3d40 100644
--- a/templates/apache/sites/performance.wikimedia.org.erb
+++ b/templates/apache/sites/performance.wikimedia.org.erb
@@ -30,4 +30,7 @@
 
     ProxyPass /xenon http://fluorine.eqiad.wmnet/xenon
     ProxyPassReverse /xenon http://fluorine.eqiad.wmnet/xenon
+
+    ProxyPass /xhgui http://hafnium.eqiad.wmnet/xhgui
+    ProxyPassReverse /xhgui http://hafnium.eqiad.wmnet/xhgui
 </VirtualHost>
diff --git a/templates/apache/sites/xhgui.erb b/templates/apache/sites/xhgui.erb
new file mode 100644
index 0000000..c8a24d6
--- /dev/null
+++ b/templates/apache/sites/xhgui.erb
@@ -0,0 +1,22 @@
+# Apache configuration for XHGUI, a web app for exploration
+# and analysis of PHP profiling data.
+<VirtualHost *:80>
+    DocumentRoot /srv/xhgui/webroot
+    Alias /xhgui /srv/xhgui/webroot
+
+    <Directory />
+        AllowOverride None
+    </Directory>
+
+    <Directory /srv/xhgui/webroot>
+        Options Indexes FollowSymLinks
+        AllowOverride None
+        Require all granted
+
+        php_admin_flag engine on
+
+        RewriteEngine On
+        RewriteCond %{REQUEST_FILENAME} !-f
+        RewriteRule ^ index.php [QSA,L]
+    </Directory>
+</VirtualHost>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc306585643229439a0a992d160e6c114efe11b3
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>

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

Reply via email to