Ottomata has submitted this change and it was merged. Change subject: Removing references to metrics.wikimedia.org puppetization ......................................................................
Removing references to metrics.wikimedia.org puppetization This was running the old UMAPI code on stat1001, which is no longer supported Change-Id: Id594d7227b1ef34d6613d09652bcf859b96b4439 --- M manifests/misc/statistics.pp D templates/apache/sites/metrics.wikimedia.org.erb 2 files changed, 0 insertions(+), 237 deletions(-) Approvals: Ottomata: Verified; Looks good to me, approved diff --git a/manifests/misc/statistics.pp b/manifests/misc/statistics.pp index 956d136..1852091 100644 --- a/manifests/misc/statistics.pp +++ b/manifests/misc/statistics.pp @@ -365,163 +365,6 @@ } } -# metrics-api.wikimedia.org -# See: http://stat1.wikimedia.org/rfaulk/pydocs/_build/env.html -# for more info on how and why. -# -# TODO: Make this a module. -# -class misc::statistics::sites::metrics { - require misc::statistics::user, - misc::statistics::packages::python, - passwords::mysql::research, - passwords::mysql::research_prod, - passwords::mysql::metrics, - passwords::e3::metrics - - $site_name = "metrics.wikimedia.org" - $document_root = "/srv/org.wikimedia.metrics" - - $e3_home = "/a/e3" - $e3_analysis_path = "$e3_home/E3Analysis/" - $metrics_user = $misc::statistics::user::username - - $secret_key = $passwords::e3::metrics::secret_key - - # connetions will be rendered into settings.py. - $mysql_connections = { - 'slave' => { - 'user' => $passwords::mysql::metrics::user, - 'passwd' => $passwords::mysql::metrics::pass, - 'host' => 'db1047.eqiad.wmnet', - 'port' => 3306, - 'db' => 'prod', - }, - 'cohorts' => { - 'user' => $passwords::mysql::research_prod::user, - 'passwd' => $passwords::mysql::research_prod::pass, - 'host' => 'db1047.eqiad.wmnet', - 'port' => 3306, - 'db' => 'prod', - }, - 's1' => { - 'user' => $passwords::mysql::research::user, - 'passwd' => $passwords::mysql::research::pass, - 'host' => 's1-analytics-slave.eqiad.wmnet', - 'port' => 3306, - }, - 's2' => { - 'user' => $passwords::mysql::research::user, - 'passwd' => $passwords::mysql::research::pass, - 'host' => 's2-analytics-slave.eqiad.wmnet', - 'port' => 3306, - }, - 's3' => { - 'user' => $passwords::mysql::research::user, - 'passwd' => $passwords::mysql::research::pass, - 'host' => 's3-analytics-slave.eqiad.wmnet', - 'port' => 3306, - }, - 's4' => { - 'user' => $passwords::mysql::research::user, - 'passwd' => $passwords::mysql::research::pass, - 'host' => 's4-analytics-slave.eqiad.wmnet', - 'port' => 3306, - }, - 's5' => { - 'user' => $passwords::mysql::research::user, - 'passwd' => $passwords::mysql::research::pass, - 'host' => 's5-analytics-slave.eqiad.wmnet', - 'port' => 3306, - }, - 's6' => { - 'user' => $passwords::mysql::research::user, - 'passwd' => $passwords::mysql::research::pass, - 'host' => 's6-analytics-slave.eqiad.wmnet', - 'port' => 3306, - }, - 's7' => { - 'user' => $passwords::mysql::research::user, - 'passwd' => $passwords::mysql::research::pass, - 'host' => 's7-analytics-slave.eqiad.wmnet', - 'port' => 3306, - }, - } - - package { ["python-flask", "python-flask-login"]: - ensure => "installed", - } - - file { [$e3_home, $document_root]: - ensure => "directory", - owner => $misc::statistics::user::username, - group => "wikidev", - mode => '0775', - } - - # install a .htpasswd file for E3 - file { "$e3_home/.htpasswd": - content => $passwords::e3::metrics::htpasswd_content, - owner => $metrics_user, - group => "wikidev", - mode => '0664', - } - - # clone the E3 Analysis repository - git::clone { "E3Analysis": - directory => $e3_analysis_path, - origin => "https://gerrit.wikimedia.org/r/p/analytics/user-metrics.git", - owner => $metrics_user, - group => "wikidev", - require => [Package["python-flask"], File[$e3_home], Class["misc::statistics::user"], Class["misc::statistics::packages::python"]], - ensure => "latest", - } - - # Need settings.py to configure metrics-api python application - # Make this only readable by stats user; it has db passwords in it. - file { "$e3_analysis_path/user_metrics/config/settings.py": - content => template("misc/e3-metrics.settings.py.erb"), - owner => $metrics_user, - group => "root", - mode => '0640', - require => Git::Clone["E3Analysis"], - } - - # symlink the api.wsgi app loader python script. - # api.wsgi loads 'src.api' as a module :/ - file { "$document_root/api.wsgi": - ensure => "$e3_analysis_path/user_metrics/api/api.wsgi", - require => Git::Clone["E3Analysis"], - } - - include webserver::apache - webserver::apache::module { "wsgi": } - webserver::apache::module { "alias": } - webserver::apache::module { "ssl": } - - # install metrics.wikimedia.org SSL certificate - install_certificate{ $site_name: } - - # Set up the Python WSGI VirtualHost - file { "/etc/apache2/sites-available/$site_name": - content => template("apache/sites/${site_name}.erb"), - require => [File[$document_root], File["$e3_home/.htpasswd"], Class["webserver::apache"], Webserver::Apache::Module["wsgi"], Webserver::Apache::Module['alias'], Webserver::Apache::Module['ssl']], - notify => Class['webserver::apache::service'], - } - file { "/etc/apache2/sites-enabled/$site_name": - ensure => link, - target => "/etc/apache2/sites-available/${site_name}", - require => File["/etc/apache2/sites-available/${site_name}"], - notify => Class['webserver::apache::service'], - } - - # make access and error log for metrics-api readable by wikidev group - file { ["/var/log/apache2/access.metrics.log", "/var/log/apache2/error.metrics.log"]: - group => "wikidev", - require => File["/etc/apache2/sites-enabled/$site_name"], - } -} - # installs MonogDB on stat1 class misc::statistics::db::mongo { class { "mongodb": diff --git a/templates/apache/sites/metrics.wikimedia.org.erb b/templates/apache/sites/metrics.wikimedia.org.erb deleted file mode 100644 index b71920b..0000000 --- a/templates/apache/sites/metrics.wikimedia.org.erb +++ /dev/null @@ -1,80 +0,0 @@ -# Note: This file is managed by Puppet. -<% -# ERb template variables: -# -# site_name -# document_root -# e3_analysis_path -# metrics_user -# --%> - -<VirtualHost *:80> - # The previous ServerName was metrics-api.wikimedia.org. - # Redirect this to <%= site_name %> - ServerName metrics-api.wikimedia.org - Redirect permanent / https://<%= site_name %> -</VirtualHost> - -<VirtualHost *:80> - ServerName <%= site_name %> - ServerAdmin n...@wikimedia.org - - RewriteEngine on - RewriteCond %{SERVER_PORT} !^443$ - RewriteRule ^/(.*)$ https://metrics.wikimedia.org/$1 [L,R] - - ErrorLog /var/log/apache2/error.metrics.log - # Possible values include: debug, info, notice, warn, error, crit, - # alert, emerg. - LogLevel warn - - CustomLog /var/log/apache2/access.metrics.log combined - ServerSignature On -</VirtualHost> - -<VirtualHost *:443> - ServerName <%= site_name %> - DocumentRoot <%= document_root %> - ServerAdmin n...@wikimedia.org - - ErrorLog /var/log/apache2/error.metrics.log - # Possible values include: debug, info, notice, warn, error, crit, - # alert, emerg. - LogLevel warn - - CustomLog /var/log/apache2/access.metrics.log combined - - SSLEngine on - SSLProtocol -ALL +SSLv3 +TLSv1 - SSLCipherSuite AES128-GCM-SHA256:RC4-SHA:RC4-MD5:DES-CBC3-SHA:AES128-SHA:AES256-SHA - SSLHonorCipherOrder on - SSLCertificateFile /etc/ssl/certs/<%= site_name %>.pem - SSLCertificateChainFile /etc/ssl/certs/<%= site_name %>.chained.pem - SSLCertificateKeyFile /etc/ssl/private/<%= site_name %>.key - - WSGIDaemonProcess api user=<%= metrics_user %> group=wikidev threads=1 python-path=<%= e3_analysis_path %> - WSGIScriptAlias / <%= document_root %>/api.wsgi - - <Directory <%= document_root %>> - WSGIProcessGroup api - WSGIApplicationGroup %{GLOBAL} - - Options Indexes FollowSymLinks MultiViews - AllowOverride None - Order deny,allow - Allow from all - </Directory> - - <Location /> - Order deny,allow - AuthType Basic - AuthName "WMF E3 Metrics API" - AuthUserFile /a/e3/.htpasswd - require valid-user - Deny from all - Satisfy any - </Location> - -</VirtualHost> - -- To view, visit https://gerrit.wikimedia.org/r/111466 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id594d7227b1ef34d6613d09652bcf859b96b4439 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ottomata <o...@wikimedia.org> Gerrit-Reviewer: Ottomata <o...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits