Filippo Giunchedi has submitted this change and it was merged.
Change subject: deployment-prep: Point upload cache at swift, fix rewrite.py to
use beta.wmflabs.org domains
......................................................................
deployment-prep: Point upload cache at swift, fix rewrite.py to use
beta.wmflabs.org domains
Bug: T64835
Change-Id: Ie0ed6ddeeeb0f12ce4b4dc271db0528add894296
---
M hieradata/labs.yaml
M modules/swift/files/SwiftMedia/wmf/rewrite.py
M modules/swift/manifests/proxy.pp
M modules/swift/templates/proxy-server.conf.erb
4 files changed, 9 insertions(+), 6 deletions(-)
Approvals:
Filippo Giunchedi: Verified; Looks good to me, approved
diff --git a/hieradata/labs.yaml b/hieradata/labs.yaml
index 4caaf7b..ccc2864 100644
--- a/hieradata/labs.yaml
+++ b/hieradata/labs.yaml
@@ -93,13 +93,11 @@
swift:
route: eqiad
backends:
- # ms emulator set in July 2013. Beta does not have Swift yet.
- # instance is an unpuppetized hack with nginx proxy.
- eqiad: '10.68.16.189' # deployment-upload.eqiad.wmflabs
+ eqiad: '10.68.16.96' # deployment-ms-fe01.deployment-prep.eqiad.wmflabs
swift_thumbs:
route: eqiad
backends:
- eqiad: '10.68.16.189' # deployment-upload.eqiad.wmflabs
+ eqiad: '10.68.16.96' # deployment-ms-fe01.deployment-prep.eqiad.wmflabs
role::cache::base::zero_site: 'http://zero.wikimedia.beta.wmflabs.org'
role::cache::base::purge_host_only_upload_re: '^upload\.beta\.wmflabs\.org$'
role::cache::base::purge_host_not_upload_re: '^(?!upload\.beta\.wmflabs\.org)'
@@ -113,6 +111,8 @@
- vdb
varnish::dynamic_directors: false
+swift::proxy::tld: 'beta.wmflabs.org'
+
zookeeper_hosts:
"${::fqdn}": 1
nrpe::allowed_hosts: '10.68.16.195'
diff --git a/modules/swift/files/SwiftMedia/wmf/rewrite.py
b/modules/swift/files/SwiftMedia/wmf/rewrite.py
index 9673b0e..d87d03a 100644
--- a/modules/swift/files/SwiftMedia/wmf/rewrite.py
+++ b/modules/swift/files/SwiftMedia/wmf/rewrite.py
@@ -42,6 +42,7 @@
# as is (eg. upload/proj/lang/) or with the site/lang converted and
# only the path sent back (eg en.wikipedia/thumb).
self.backend_url_format = conf['backend_url_format'].strip() # asis,
sitelang
+ self.tld = conf['tld'].strip()
def handle404(self, reqorig, url, container, obj):
"""
@@ -95,10 +96,10 @@
if(lang in ['mediawiki']):
lang = 'www'
proj = 'mediawiki'
- hostname = '%s.%s.org' % (lang, proj)
+ hostname = '%s.%s.%s' % (lang, proj, self.tld)
if(proj == 'wikipedia' and lang == 'sources'):
# yay special case
- hostname = 'wikisource.org'
+ hostname = 'wikisource.%s' % self.tld
# ok, replace the URL with just the part starting with
thumb/
# take off the first two parts of the path
# (eg /wikipedia/commons/); make sure the string starts
diff --git a/modules/swift/manifests/proxy.pp b/modules/swift/manifests/proxy.pp
index ee94874..c4cd6b7 100644
--- a/modules/swift/manifests/proxy.pp
+++ b/modules/swift/manifests/proxy.pp
@@ -13,6 +13,7 @@
$backend_url_format = 'sitelang',
$rewrite_account = undef,
$dispersion_account = undef,
+ $tld = 'org',
) {
package {[
'swift-proxy',
diff --git a/modules/swift/templates/proxy-server.conf.erb
b/modules/swift/templates/proxy-server.conf.erb
index faa9a71..d520835 100644
--- a/modules/swift/templates/proxy-server.conf.erb
+++ b/modules/swift/templates/proxy-server.conf.erb
@@ -66,5 +66,6 @@
# transformed to something more palatable (specifically, turning
http://upload/proj/lang/ into http://lang.proj/
# valid options are 'asis' (leave it alone) and 'sitelang' (change upload to
lang.site.org)
backend_url_format = <%= @backend_url_format %>
+tld = <%= @tld %>
paste.filter_factory = wmf.rewrite:filter_factory
--
To view, visit https://gerrit.wikimedia.org/r/298297
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie0ed6ddeeeb0f12ce4b4dc271db0528add894296
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alex Monk <[email protected]>
Gerrit-Reviewer: Filippo Giunchedi <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Muehlenhoff <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits