Giuseppe Lavagetto has uploaded a new change for review.
https://gerrit.wikimedia.org/r/197499
Change subject: filebackend: add configuration for codfw
......................................................................
filebackend: add configuration for codfw
Bug: T91754
Change-Id: Ibfca6285f4f2906a5a802fc3ec43bf530cee4cf4
---
A wmf-config/filebackend-codfw.php
A wmf-config/filebackend-common.php
R wmf-config/filebackend-eqiad.php
3 files changed, 174 insertions(+), 57 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config
refs/changes/99/197499/1
diff --git a/wmf-config/filebackend-codfw.php b/wmf-config/filebackend-codfw.php
new file mode 100644
index 0000000..fb74edd
--- /dev/null
+++ b/wmf-config/filebackend-codfw.php
@@ -0,0 +1,114 @@
+<?php
+
+# WARNING: This file is publically viewable on the web. Do not put private
data here.
+
+/* Codfw Swift backend config */
+$wgFileBackends[] = array( // backend config for wiki's local repo
+ 'class' => 'SwiftFileBackend',
+ 'name' => 'local-swift-eqiad',
+ 'wikiId' => "{$site}-{$lang}",
+ 'lockManager' => 'redisLockManager',
+ 'swiftAuthUrl' => $wmfSwiftCodfwConfig['authUrl'],
+ 'swiftUser' => $wmfSwiftCodfwConfig['user'],
+ 'swiftKey' => $wmfSwiftCodfwConfig['key'],
+ 'swiftTempUrlKey' => $wmfSwiftCodfwConfig['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' => $wmfSwiftCodfwConfig['authUrl'],
+ 'swiftUser' => $wmfSwiftCodfwConfig['user'],
+ 'swiftKey' => $wmfSwiftCodfwConfig['key'],
+ 'swiftTempUrlKey' => $wmfSwiftCodfwConfig['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' => $wmfSwiftCodfwConfig['authUrl'],
+ 'swiftUser' => $wmfSwiftCodfwConfig['user'],
+ 'swiftKey' => $wmfSwiftCodfwConfig['key'],
+ 'swiftTempUrlKey' => $wmfSwiftCodfwConfig['tempUrlKey'],
+ 'shardViaHashLevels' => array(
+ 'math-render' => array( 'levels' => 2, 'base' => 16, 'repeat'
=> 0 ),
+ ),
+ 'parallelize' => 'implicit',
+ 'cacheAuthInfo' => true
+);
+/* end Codfw Swift backend config */
+
+/* Multiwrite backend config */
+$wgFileBackends[] = array(
+ 'class' => 'FileBackendMultiWrite',
+ 'name' => 'local-multiwrite',
+ 'wikiId' => "{$site}-{$lang}",
+ 'lockManager' => 'redisLockManager',
+ 'backends' => array(
+ # DO NOT change the master backend unless it is fully trusted
or autoRsync is off
+ array( 'template' => 'local-swift-eqiad', 'isMultiMaster' =>
true ),
+ ),
+ 'syncChecks' => ( 1 | 4 ), // (size & sha1)
+ 'autoResync' => 'conservative' // bug 39221
+);
+$wgFileBackends[] = array(
+ 'class' => 'FileBackendMultiWrite',
+ 'name' => 'shared-multiwrite',
+ 'wikiId' => "wikipedia-commons",
+ 'lockManager' => 'redisLockManager',
+ 'backends' => array(
+ # DO NOT change the master backend unless it is fully trusted
or autoRsync is off
+ array( 'template' => 'shared-swift-eqiad', 'isMultiMaster' =>
true ),
+ ),
+ 'syncChecks' => ( 1 | 4 ), // (size & sha1)
+ 'autoResync' => 'conservative' // bug 39221
+);
+$wgFileBackends[] = array(
+ 'class' => 'FileBackendMultiWrite',
+ 'name' => 'global-multiwrite',
+ 'wikiId' => "global-data",
+ 'lockManager' => 'redisLockManager',
+ 'backends' => array(
+ # DO NOT change the master backend unless it is fully trusted
or autoRsync is off
+ array( 'template' => 'global-swift-eqiad', 'isMultiMaster' =>
true ),
+ ),
+ 'syncChecks' => ( 1 | 4 ), // (size & sha1)
+ 'autoResync' => 'conservative'
+);
+/* end multiwrite backend config */
+
+$wgLockManagers[] = array(
+ 'name' => 'redisLockManager',
+ 'class' => 'RedisLockManager',
+ 'lockServers' => array(
+ 'rdb1' => '10.192.0.35',
+ 'rdb2' => '10.192.16.38',
+ 'rdb3' => '10.192.32.20'
+ ),
+ 'srvsByBucket' => array(
+ 0 => array( 'rdb1', 'rdb2', 'rdb3' )
+ ),
+ 'redisConfig' => array(
+ 'connectTimeout' => 2,
+ 'password' => $wmgRedisPassword
+ )
+);
diff --git a/wmf-config/filebackend-common.php
b/wmf-config/filebackend-common.php
new file mode 100644
index 0000000..f119852
--- /dev/null
+++ b/wmf-config/filebackend-common.php
@@ -0,0 +1,60 @@
+# 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.
+
+/* Common OpenStack Swift backend config */
+$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 */
+
+require( getRealmSpecificFilename( "$wmfConfigDir/filebackend.php" ) );
+
+$wgLocalFileRepo = array(
+ 'class' => 'LocalRepo',
+ 'name' => 'local',
+ 'backend' => 'local-multiwrite',
+ 'url' => $wgUploadBaseUrl ? $wgUploadBaseUrl .
$wgUploadPath : $wgUploadPath,
+ 'scriptDirUrl' => $wgScriptPath,
+ 'hashLevels' => 2,
+ 'thumbScriptUrl' => $wgThumbnailScriptPath,
+ 'transformVia404' => true,
+ 'initialCapital' => $wgCapitalLinks,
+ 'deletedHashLevels' => 3,
+ 'abbrvThreshold' => 160,
+ 'isPrivate' => $wmgPrivateWiki,
+ 'zones' => $wmgPrivateWiki
+ ? array(
+ 'thumb' => array( 'url' =>
"$wgScriptPath/thumb_handler.php" ) )
+ : array(),
+);
+if ( $wgDBname != 'commonswiki' ) {
+ $wgForeignFileRepos[] = array(
+ 'class' => 'ForeignDBViaLBRepo',
+ 'name' => 'shared',
+ 'backend' => 'shared-multiwrite',
+ 'url' =>
"//upload.wikimedia.org/wikipedia/commons",
+ 'hashLevels' => 2,
+ 'thumbScriptUrl' => false,
+ 'transformVia404' => true,
+ 'hasSharedCache' => true,
+ 'descBaseUrl' => "//commons.wikimedia.org/wiki/File:",
+ 'scriptDirUrl' => "//commons.wikimedia.org/w",
+ 'favicon' =>
"//bits.wikimedia.org/favicon/commons.ico",
+ 'fetchDescription' => true,
+ 'wiki' => 'commonswiki',
+ 'initialCapital' => true,
+ 'zones' => array( // actual swift containers have
'local-*'
+ 'public' => array( 'container' => 'local-public' ),
+ 'thumb' => array( 'container' => 'local-thumb' ),
+ 'temp' => array( 'container' => 'local-temp' ),
+ 'deleted' => array( 'container' => 'local-deleted' )
+ ),
+ 'abbrvThreshold' => 160 /* Keep in sync with with local repo
on commons or things break. */
+ );
+}
diff --git a/wmf-config/filebackend.php b/wmf-config/filebackend-eqiad.php
similarity index 66%
rename from wmf-config/filebackend.php
rename to wmf-config/filebackend-eqiad.php
index 67129ad..3847f5b 100644
--- a/wmf-config/filebackend.php
+++ b/wmf-config/filebackend-eqiad.php
@@ -2,19 +2,6 @@
# 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.
-
-/* Common OpenStack Swift backend config */
-$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',
@@ -125,47 +112,3 @@
'password' => $wmgRedisPassword
)
);
-
-$wgLocalFileRepo = array(
- 'class' => 'LocalRepo',
- 'name' => 'local',
- 'backend' => 'local-multiwrite',
- 'url' => $wgUploadBaseUrl ? $wgUploadBaseUrl .
$wgUploadPath : $wgUploadPath,
- 'scriptDirUrl' => $wgScriptPath,
- 'hashLevels' => 2,
- 'thumbScriptUrl' => $wgThumbnailScriptPath,
- 'transformVia404' => true,
- 'initialCapital' => $wgCapitalLinks,
- 'deletedHashLevels' => 3,
- 'abbrvThreshold' => 160,
- 'isPrivate' => $wmgPrivateWiki,
- 'zones' => $wmgPrivateWiki
- ? array(
- 'thumb' => array( 'url' =>
"$wgScriptPath/thumb_handler.php" ) )
- : array(),
-);
-if ( $wgDBname != 'commonswiki' ) {
- $wgForeignFileRepos[] = array(
- 'class' => 'ForeignDBViaLBRepo',
- 'name' => 'shared',
- 'backend' => 'shared-multiwrite',
- 'url' =>
"//upload.wikimedia.org/wikipedia/commons",
- 'hashLevels' => 2,
- 'thumbScriptUrl' => false,
- 'transformVia404' => true,
- 'hasSharedCache' => true,
- 'descBaseUrl' => "//commons.wikimedia.org/wiki/File:",
- 'scriptDirUrl' => "//commons.wikimedia.org/w",
- 'favicon' =>
"//bits.wikimedia.org/favicon/commons.ico",
- 'fetchDescription' => true,
- 'wiki' => 'commonswiki',
- 'initialCapital' => true,
- 'zones' => array( // actual swift containers have
'local-*'
- 'public' => array( 'container' => 'local-public' ),
- 'thumb' => array( 'container' => 'local-thumb' ),
- 'temp' => array( 'container' => 'local-temp' ),
- 'deleted' => array( 'container' => 'local-deleted' )
- ),
- 'abbrvThreshold' => 160 /* Keep in sync with with local repo
on commons or things break. */
- );
-}
--
To view, visit https://gerrit.wikimedia.org/r/197499
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibfca6285f4f2906a5a802fc3ec43bf530cee4cf4
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Lavagetto <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits