jenkins-bot has submitted this change and it was merged.
Change subject: filebackend: add configuration for codfw
......................................................................
filebackend: add configuration for codfw
Bug: T91754
Change-Id: Ibfca6285f4f2906a5a802fc3ec43bf530cee4cf4
---
M wmf-config/filebackend-production.php
1 file changed, 70 insertions(+), 59 deletions(-)
Approvals:
EBernhardson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/wmf-config/filebackend-production.php
b/wmf-config/filebackend-production.php
index 499beac..9e43842 100644
--- a/wmf-config/filebackend-production.php
+++ b/wmf-config/filebackend-production.php
@@ -3,74 +3,83 @@
# WARNING: This file is publically viewable on the web. Do not put private
data here.
#
-# This file hold the configuration for the file backends
-# for production.
+# This file hold the configuration for the file backends for production.
-/* Common OpenStack Swift backend config */
+// Common OpenStack Swift backend convenience variables
$wmfSwiftBigWikis = array( # DO NOT change without proper migration first
'commonswiki', 'dewiki', 'enwiki', 'fiwiki', 'frwiki', 'hewiki',
'huwiki', 'idwiki',
'itwiki', 'jawiki', 'rowiki', 'ruwiki', 'thwiki', 'trwiki', 'ukwiki',
'zhwiki'
);
$wmfSwiftShardLocal = in_array( $wgDBname, $wmfSwiftBigWikis ) ? 2 : 0; //
shard levels
$wmfSwiftShardCommon = in_array( 'commonswiki', $wmfSwiftBigWikis ) ? 2 : 0;
// shard levels
-/* end common Swift config */
-/* Eqiad Swift backend config */
-$wgFileBackends[] = array( // backend config for wiki's local repo
- 'class' => 'SwiftFileBackend',
- 'name' => 'local-swift-eqiad',
- 'wikiId' => "{$site}-{$lang}",
- 'lockManager' => 'redisLockManager',
- 'swiftAuthUrl' => $wmfSwiftEqiadConfig['authUrl'],
- 'swiftUser' => $wmfSwiftEqiadConfig['user'],
- 'swiftKey' => $wmfSwiftEqiadConfig['key'],
- 'swiftTempUrlKey' => $wmfSwiftEqiadConfig['tempUrlKey'],
- 'shardViaHashLevels' => array(
- 'local-public' => array( 'levels' => $wmfSwiftShardLocal,
'base' => 16, 'repeat' => 1 ),
- 'local-thumb' => array( 'levels' => $wmfSwiftShardLocal,
'base' => 16, 'repeat' => 1 ),
- 'local-temp' => array( 'levels' => $wmfSwiftShardLocal,
'base' => 16, 'repeat' => 1 ),
- 'local-transcoded' => array( 'levels' => $wmfSwiftShardLocal,
'base' => 16, 'repeat' => 1 ),
- 'local-deleted' => array( 'levels' => $wmfSwiftShardLocal,
'base' => 36, 'repeat' => 0 )
- ),
- 'parallelize' => 'implicit',
- 'cacheAuthInfo' => true
-);
-$wgFileBackends[] = array( // backend config for wiki's access to shared repo
- 'class' => 'SwiftFileBackend',
- 'name' => 'shared-swift-eqiad',
- 'wikiId' => "wikipedia-commons",
- 'lockManager' => 'redisLockManager',
- 'swiftAuthUrl' => $wmfSwiftEqiadConfig['authUrl'],
- 'swiftUser' => $wmfSwiftEqiadConfig['user'],
- 'swiftKey' => $wmfSwiftEqiadConfig['key'],
- 'swiftTempUrlKey' => $wmfSwiftEqiadConfig['tempUrlKey'],
- 'shardViaHashLevels' => array(
- 'local-public' => array( 'levels' => $wmfSwiftShardCommon,
'base' => 16, 'repeat' => 1 ),
- 'local-thumb' => array( 'levels' => $wmfSwiftShardCommon,
'base' => 16, 'repeat' => 1 ),
- 'local-temp' => array( 'levels' => $wmfSwiftShardCommon,
'base' => 16, 'repeat' => 1 ),
- 'local-transcoded' => array( 'levels' => $wmfSwiftShardCommon,
'base' => 16, 'repeat' => 1 ),
- ),
- 'parallelize' => 'implicit',
- 'cacheAuthInfo' => true
-);
-$wgFileBackends[] = array( // backend config for wiki's access to shared files
- 'class' => 'SwiftFileBackend',
- 'name' => 'global-swift-eqiad',
- 'wikiId' => "global-data",
- 'lockManager' => 'redisLockManager',
- 'swiftAuthUrl' => $wmfSwiftEqiadConfig['authUrl'],
- 'swiftUser' => $wmfSwiftEqiadConfig['user'],
- 'swiftKey' => $wmfSwiftEqiadConfig['key'],
- 'swiftTempUrlKey' => $wmfSwiftEqiadConfig['tempUrlKey'],
- 'shardViaHashLevels' => array(
- 'math-render' => array( 'levels' => 2, 'base' => 16, 'repeat'
=> 0 ),
- ),
- 'parallelize' => 'implicit',
- 'cacheAuthInfo' => true
-);
-/* end Eqiad Swift backend config */
+/* DC-specific Swift backend config */
+foreach ( array( 'eqiad', 'codfw' ) as $specificDC ) {
+ $wgFileBackends[] = array( // backend config for wiki's local repo
+ 'class' => 'SwiftFileBackend',
+ 'name' => "local-swift-{$specificDC}",
+ 'wikiId' => "{$site}-{$lang}",
+ 'lockManager' => 'redisLockManager',
+ 'swiftAuthUrl' => $wmfSwiftConfig[$specificDC]['authUrl'],
+ 'swiftUser' => $wmfSwiftConfig[$specificDC]['user'],
+ 'swiftKey' => $wmfSwiftConfig[$specificDC]['key'],
+ 'swiftTempUrlKey' =>
$wmfSwiftConfig[$specificDC]['tempUrlKey'],
+ 'shardViaHashLevels' => array(
+ 'local-public'
+ => array( 'levels' => $wmfSwiftShardLocal,
'base' => 16, 'repeat' => 1 ),
+ 'local-thumb'
+ => array( 'levels' => $wmfSwiftShardLocal,
'base' => 16, 'repeat' => 1 ),
+ 'local-temp'
+ => array( 'levels' => $wmfSwiftShardLocal,
'base' => 16, 'repeat' => 1 ),
+ 'local-transcoded'
+ => array( 'levels' => $wmfSwiftShardLocal,
'base' => 16, 'repeat' => 1 ),
+ 'local-deleted'
+ => array( 'levels' => $wmfSwiftShardLocal,
'base' => 36, 'repeat' => 0 )
+ ),
+ 'parallelize' => 'implicit',
+ 'cacheAuthInfo' => true
+ );
+ $wgFileBackends[] = array( // backend config for wiki's access to
shared repo
+ 'class' => 'SwiftFileBackend',
+ 'name' => "shared-swift-{$specificDC}",
+ 'wikiId' => "wikipedia-commons",
+ 'lockManager' => 'redisLockManager',
+ 'swiftAuthUrl' => $wmfSwiftConfig[$specificDC]['authUrl'],
+ 'swiftUser' => $wmfSwiftConfig[$specificDC]['user'],
+ 'swiftKey' => $wmfSwiftConfig[$specificDC]['key'],
+ 'swiftTempUrlKey' =>
$wmfSwiftConfig[$specificDC]['tempUrlKey'],
+ 'shardViaHashLevels' => array(
+ 'local-public'
+ => array( 'levels' => $wmfSwiftShardCommon,
'base' => 16, 'repeat' => 1 ),
+ 'local-thumb'
+ => array( 'levels' => $wmfSwiftShardCommon,
'base' => 16, 'repeat' => 1 ),
+ 'local-temp'
+ => array( 'levels' => $wmfSwiftShardCommon,
'base' => 16, 'repeat' => 1 ),
+ 'local-transcoded'
+ => array( 'levels' => $wmfSwiftShardCommon,
'base' => 16, 'repeat' => 1 ),
+ ),
+ 'parallelize' => 'implicit',
+ 'cacheAuthInfo' => true
+ );
+ $wgFileBackends[] = array( // backend config for wiki's access to
shared files
+ 'class' => 'SwiftFileBackend',
+ 'name' => "global-swift-{$specificDC}",
+ 'wikiId' => "global-data",
+ 'lockManager' => 'redisLockManager',
+ 'swiftAuthUrl' => $wmfSwiftConfig[$specificDC]['authUrl'],
+ 'swiftUser' => $wmfSwiftConfig[$specificDC]['user'],
+ 'swiftKey' => $wmfSwiftConfig[$specificDC]['key'],
+ 'swiftTempUrlKey' =>
$wmfSwiftConfig[$specificDC]['tempUrlKey'],
+ 'shardViaHashLevels' => array(
+ 'math-render' => array( 'levels' => 2, 'base' => 16,
'repeat' => 0 ),
+ ),
+ 'parallelize' => 'implicit',
+ 'cacheAuthInfo' => true
+ );
+}
+/* end DC-specific Swift backend config */
-/* Multiwrite backend config */
+/* Common multiwrite backend config */
$wgFileBackends[] = array(
'class' => 'FileBackendMultiWrite',
'name' => 'local-multiwrite',
@@ -109,6 +118,8 @@
);
/* end multiwrite backend config */
+// Lock manager config must use the master datacenter
+// @TODO: configure as a switch
$wgLockManagers[] = array(
'name' => 'redisLockManager',
'class' => 'RedisLockManager',
--
To view, visit https://gerrit.wikimedia.org/r/197499
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibfca6285f4f2906a5a802fc3ec43bf530cee4cf4
Gerrit-PatchSet: 5
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Dereckson <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Filippo Giunchedi <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits