Ottomata has submitted this change and it was merged. Change subject: mod. update config info for E3 user metrics deployment. ......................................................................
mod. update config info for E3 user metrics deployment. Change-Id: I43d5f418fa34c73eba0c97c8f808b429fb9930db --- M manifests/misc/statistics.pp M templates/misc/e3-metrics-api.settings.py.erb 2 files changed, 84 insertions(+), 20 deletions(-) Approvals: Ottomata: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/manifests/misc/statistics.pp b/manifests/misc/statistics.pp index c4e0494..5712668 100644 --- a/manifests/misc/statistics.pp +++ b/manifests/misc/statistics.pp @@ -243,8 +243,9 @@ # See: http://stat1.wikimedia.org/rfaulk/pydocs/_build/env.html # for more info on how and why. class misc::statistics::sites::metrics_api { - require passwords::mysql::research - + require passwords::mysql::research, + passwords::mysql::research_prod, + passwords::mysql::metrics $site_name = "metrics-api.wikimedia.org" $document_root = "/srv/org.wikimedia.metrics-api" @@ -252,7 +253,55 @@ $e3_analysis_path = "$e3_home/E3Analysis" $e3_user = $misc::statistics::user::username - # these get rendered in $e3_analysis_path/config/settings.py + # 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', + }, + } + + # these get rendered in $e3_analysis_path/user_metrics/config/settings.py $mysql_user = $passwords::mysql::research::user $mysql_pass = $passwords::mysql::research::pass $mysql_db = "staging" @@ -289,11 +338,11 @@ # 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/config/settings.py": + file { "$e3_analysis_path/user_metrics/config/settings.py": content => template("misc/e3-metrics-api.settings.py.erb"), owner => $e3_user, group => "root", - mode => 0600, + mode => 0640, require => Git::Clone["E3Analysis"], } @@ -304,6 +353,7 @@ require => Git::Clone["E3Analysis"], } + include webserver::apache # Set up the Python WSGI VirtualHost webserver::apache::module { "wsgi": } webserver::apache::site { $site_name: diff --git a/templates/misc/e3-metrics-api.settings.py.erb b/templates/misc/e3-metrics-api.settings.py.erb index 2d7d823..f9956ab 100644 --- a/templates/misc/e3-metrics-api.settings.py.erb +++ b/templates/misc/e3-metrics-api.settings.py.erb @@ -1,23 +1,37 @@ # Project settings # ================ -__home__ = '<%= e3_home %>' -__project_home__ = '<%= e3_analysis_path %>' -__web_home__ = ''.join([__project_home__, 'web_interface/']) -__sql_home__ = ''.join([__project_home__, 'SQL/']) -__server_log_local_home__ = ''.join([__project_home__, 'logs/']) -__data_file_dir__ = ''.join([__project_home__, 'data/']) -__web_app_module__ = 'web_interface' -__system_user__ = 'stats' +__project_home__ = '<%= e3_analysis_path %>' +__web_home__ = ''.join([__project_home__, 'user_metrics/api/']) +__data_file_dir__ = ''.join([__project_home__, 'data/']) + +__query_module__ = 'query_calls_sql' +__user_thread_max__ = 100 +__rev_thread_max__ = 50 + +__cohort_data_instance__ = 'cohorts' +__cohort_db__ = 'usertags' +__cohort_meta_db__ = 'usertags_meta' +__cohort_meta_instance__ = 'prod' + # Database connection settings # ============================ connections = { - 'slave': { - 'user' : '<%= mysql_user %>', - 'passwd' : '<%= mysql_pass %>', - 'host' : '<%= mysql_host %>', - 'db' : '<%= mysql_db %>', - 'port' : <%= mysql_port %>} -} \ No newline at end of file +<% mysql_connections.each_pair do |name, connection| -%> + <%= "'#{name}'" %>: { +<% connection.each_pair do |key, value| -%> + <%= "'#{key}': '#{value}'," %> +<% end # connection.each_pair -%> + } +<% end # mysql_connections.each_pair -%> +} + +PROJECT_DB_MAP = { + 'enwiki': 's1', + 'dewiki': 's5', + 'itwiki': 's2', + 'commonswiki': 's4', +} + -- To view, visit https://gerrit.wikimedia.org/r/51615 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I43d5f418fa34c73eba0c97c8f808b429fb9930db Gerrit-PatchSet: 3 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Rfaulk <[email protected]> Gerrit-Reviewer: Ottomata <[email protected]> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
