jenkins-bot has submitted this change and it was merged.

Change subject: Define service entries for InitialiseSettings
......................................................................


Define service entries for InitialiseSettings

Bug: T114273
Change-Id: I148a1517f40983478d262fa19cdedc025af555de
---
A tests/TestServices.php
M tests/cirrusTest.php
M tests/loggingTest.php
M wmf-config/InitialiseSettings-labs.php
M wmf-config/InitialiseSettings.php
M wmf-config/LabsServices.php
M wmf-config/ProductionServices.php
7 files changed, 103 insertions(+), 27 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, but someone else must approve
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/TestServices.php b/tests/TestServices.php
new file mode 100644
index 0000000..66ad076
--- /dev/null
+++ b/tests/TestServices.php
@@ -0,0 +1,53 @@
+<?php
+# WARNING: This file is publically viewable on the web. Do not put private 
data here.
+
+#######################################################################
+# ProductionServices.php should include all the service hostnames/ips
+# for any service used in production, divided by datacenter.
+#
+# It is included by CommonSettings.php
+#
+#######################################################################
+
+global $wmfDatacenter, $wmfMasterDatacenter;
+
+$wmfAllServices = array();
+
+$wmfAllServices['unittest'] = array(
+       'udp2log' => 'localhost:8420',
+       'statsd' => 'localhost',
+       'search' => 'localhost',
+       'ocg' => 'localhost',
+       'urldownloader' => 'localhost',
+       'parsoidcache' => 'localhost',
+       'mathoid' => 'localhost',
+       'eventlogging' => 'localhost',
+       'eventbus' => 'localhost',
+);
+
+### Logstash
+$wmfAllServices['unittest']['logstash'] = array( '127.0.0.1' );
+
+### Analytics Kafka cluster
+$wmfAllServices['unittest']['kafka'] = array( '127.0.0.1:9092' );
+
+### IRC
+$wmfAllServices['unittest']['irc'] = '127.0.0.1';
+
+### Restbase
+$wmfAllServices['unittest']['restbase'] = "http://127.0.0.1:7231";;
+
+### Poolcounter
+$wmfAllServices['unittest']['poolcounter'] = array( '127.0.0.1' );
+
+### LockManager Redis
+$wmfAllServices['eqiad']['redis_lock'] = array(
+       'rdb1' => '127.0.0.1',
+       'rdb2' => '127.0.0.1',
+       'rdb3' => '127.0.0.1'
+);
+
+# Shorthand when we have no master-slave situation to keep into account
+$wmfLocalServices = $wmfAllServices[$wmfDatacenter];
+
+$wmfMasterServices = $wmfAllServices[$wmfMasterDatacenter];
diff --git a/tests/cirrusTest.php b/tests/cirrusTest.php
index 53dc64d..db094c2 100644
--- a/tests/cirrusTest.php
+++ b/tests/cirrusTest.php
@@ -5,6 +5,7 @@
 
 class cirrusTests extends PHPUnit_Framework_TestCase {
        public function testClusterConfigurationForProdTestwiki() {
+               $wmfDatacenter = 'unittest';
                $config = $this->loadCirrusConfig( 'production', 'testwiki', 
'wiki' );
                $this->assertArrayNotHasKey( 'wgCirrusSearchServers', $config );
                $this->assertArrayHasKey( 'wgCirrusSearchClusters', $config );
@@ -68,10 +69,12 @@
                // InitialiseSettings.php explicitly declares these as global, 
so we must too
                $GLOBALS['wmfUdp2logDest'] = 'localhost';
                $GLOBALS['wmfDatacenter'] = 'unittest';
+               $GLOBALS['wmfMasterDatacenter'] = 'unittest';
                $GLOBALS['wmfRealm'] = $wmfRealm;
                $GLOBALS['wmfConfigDir'] = $wmfConfigDir;
                $GLOBALS['wgConf'] = $wgConf;
 
+               require __DIR__ . '/TestServices.php';
                require "{$wmfConfigDir}/InitialiseSettings.php";
 
                return $wgConf;
@@ -198,7 +201,7 @@
 
                $this->assertLessThanOrEqual( $numServers, $totalShards );
 
-               // For our busiest wikis we want to make sure we are using most 
of the 
+               // For our busiest wikis we want to make sure we are using most 
of the
                // cluster for the indices. This was guesstimated by running 
the following query
                // in hive and choosing wikis with > 100M queries/week:
                //   select wikiid, count(1) as count from 
wmf_raw.cirrussearchrequestset where year = 2016
diff --git a/tests/loggingTest.php b/tests/loggingTest.php
index a522dae..81efb09 100644
--- a/tests/loggingTest.php
+++ b/tests/loggingTest.php
@@ -111,6 +111,7 @@
                $GLOBALS['wmfConfigDir'] = $wmfConfigDir;
                $GLOBALS['wgConf'] = $wgConf;
 
+               require __DIR__ . "/TestServices.php";
                require "{$wmfConfigDir}/InitialiseSettings.php";
 
                $tests = array();
@@ -149,7 +150,7 @@
                                }
                        }
                }
-               
+
                return $tests;
        }
 
diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 46e2074..b3e29e1 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -148,12 +148,6 @@
                        'default' => 'wgDebugLogFile',
                ),
 
-               '-wmgLogstashServers' => array(
-                       'default' => array(
-                               '10.68.16.147', // 
deployment-logstash2.deployment-prep.eqiad.wmflabs
-                       ),
-               ),
-
                // Additional log channels for beta cluster
                'wmgMonologChannels' => array(
                        '+beta' => array(
@@ -398,10 +392,6 @@
 
                'wmgImageMetricsCorsSamplingFactor' => array(
                        'default' => 1,
-               ),
-
-               'wmgRestbaseServer' => array(
-                       'default' => "http://10.68.17.189:7231"; // 
deployment-restbase02.deployment-prep.eqiad.wmflabs
                ),
 
                'wmgUseRestbaseVRS' => array(
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index b258299..d01bdf8 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -4406,25 +4406,14 @@
 
 // Logstash servers running syslog endpoint to collect log events.
 // Use false to disable all Logstash logging
-// FIXME: someday this will need to be datacenter aware
 'wmgLogstashServers' => array(
-       'default' => array(
-               '10.64.0.122', // logstash1001.eqiad.wmnet
-               '10.64.32.137', // logstash1002.eqiad.wmnet
-               '10.64.48.113', // logstash1003.eqiad.wmnet
-       ),
+       'default' => $wmfLocalServices['logstash'],
 ),
 
 # wmgKafkaServers @{
 // Kafka servers. Use false to disable all kafka logging.
 'wmgKafkaServers' => array(
-       'default' => array(
-           '10.64.5.13:9092',   // kafka1013.eqiad.wmnet
-           '10.64.36.114:9092', // kafka1014.eqiad.wmnet
-           '10.64.53.10:9092',  // kafka1018.eqiad.wmnet
-           '10.64.53.12:9092',  // kafka1020.eqiad.wmnet
-           '10.64.36.122:9092', // kafka1022.eqiad.wmnet
-       ),
+       'default' => $wmfLocalServices['kafka'],
 ),
 # @} end of wmgKafkaServers
 
@@ -6950,7 +6939,7 @@
 ),
 
 'wmgRC2UDPAddress' => array(
-       'default' => '208.80.154.160', // eqiad: argon
+       'default' => $wmfLocalServices['irc'],
 ),
 
 'wmgRC2UDPPort' => array(
@@ -13118,7 +13107,7 @@
 // -------------- RESTBase start --------------
 
 'wmgRestbaseServer' => array(
-       'default' => "http://10.2.2.17:7231"; // restbase.svc.eqiad.wmnet
+       'default' => $wmfLocalServices['restbase']
 ),
 
 // whether to activate the extension sending page edit
diff --git a/wmf-config/LabsServices.php b/wmf-config/LabsServices.php
index 404d204..d27776c 100644
--- a/wmf-config/LabsServices.php
+++ b/wmf-config/LabsServices.php
@@ -28,6 +28,20 @@
        'eventbus' => 
'http://deployment-eventlogging04.deployment-prep.eqiad.wmflabs:8085',
 );
 
+### Logstash
+$wmfAllServices['eqiad']['logstash'] = array(
+       '10.68.16.147', // deployment-logstash2.deployment-prep.eqiad.wmflabs
+);
+
+### Analytics Kafka cluster (not present in labs)
+$wmfAllServices['eqiad']['kafka'] = array(
+);
+
+### IRC (not present in labs)
+$wmfAllServices['eqiad']['irc'] = null;
+
+### Restbase
+$wmfAllServices['eqiad']['restbase'] = 'http://10.68.17.189:7231'; // 
deployment-restbase02.deployment-prep.eqiad.wmflabs
 
 # Shorthand when we have no master-slave situation to keep into account
 $wmfLocalServices = $wmfAllServices[$wmfDatacenter];
diff --git a/wmf-config/ProductionServices.php 
b/wmf-config/ProductionServices.php
index 88e7838..3aed824 100644
--- a/wmf-config/ProductionServices.php
+++ b/wmf-config/ProductionServices.php
@@ -35,6 +35,32 @@
        'eventbus' => 'http://eventbus.svc.eqiad.wmnet:8085',
 );
 
+### Logstash
+$wmfAllServices['eqiad']['logstash'] = array(
+       '10.64.0.122', // logstash1001.eqiad.wmnet
+       '10.64.32.137', // logstash1002.eqiad.wmnet
+       '10.64.48.113', // logstash1003.eqiad.wmnet
+);
+$wmfAllServices['codfw']['logstash'] = $wmfAllServices['eqiad']['logstash'];
+
+### Analytics Kafka cluster
+$wmfAllServices['eqiad']['kafka'] = array(
+       '10.64.5.13:9092',   // kafka1013.eqiad.wmnet
+       '10.64.36.114:9092', // kafka1014.eqiad.wmnet
+       '10.64.53.10:9092',  // kafka1018.eqiad.wmnet
+       '10.64.53.12:9092',  // kafka1020.eqiad.wmnet
+       '10.64.36.122:9092', // kafka1022.eqiad.wmnet
+);
+$wmfAllServices['codfw']['kafka'] = $wmfAllServices['eqiad']['kafka'];
+
+### IRC
+$wmfAllServices['eqiad']['irc'] = '208.80.154.160'; // eqiad: argon
+$wmfAllServices['codfw']['irc'] = $wmfAllServices['eqiad']['irc'];
+
+### Restbase
+$wmfAllServices['eqiad']['restbase'] = 'http://10.2.2.17:7231';
+$wmfAllServices['codfw']['restbase'] = 'http://10.2.2.17:7231';
+
 # Shorthand when we have no master-slave situation to keep into account
 $wmfLocalServices = $wmfAllServices[$wmfDatacenter];
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I148a1517f40983478d262fa19cdedc025af555de
Gerrit-PatchSet: 17
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to