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

Change subject: Configure thumbor video support
......................................................................


Configure thumbor video support

Bug: T120205
Change-Id: Ic6deb34e05e2ee5d19f64b0dd579afdcbaad0e1e
---
M puppet/modules/role/manifests/thumbor.pp
M puppet/modules/role/templates/thumbor/local_repo.php.erb
M puppet/modules/thumbor/manifests/init.pp
M puppet/modules/thumbor/templates/thumbor.conf.erb
M puppet/modules/thumbor/templates/varnish.vcl.erb
5 files changed, 36 insertions(+), 11 deletions(-)

Approvals:
  Dduvall: Looks good to me, approved
  Filippo Giunchedi: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/puppet/modules/role/manifests/thumbor.pp 
b/puppet/modules/role/manifests/thumbor.pp
index 7a9ccce..28b0f3a 100644
--- a/puppet/modules/role/manifests/thumbor.pp
+++ b/puppet/modules/role/manifests/thumbor.pp
@@ -8,6 +8,7 @@
     require ::role::memcached
     require ::role::sentry
     require ::role::swift
+    require ::role::timedmediahandler
     require ::role::thumb_on_404
     include ::apache::mod::proxy
     include ::apache::mod::proxy_http
@@ -30,6 +31,8 @@
                 'jpeg',
                 'xcf',
                 'svg',
+                'ogv',
+                'webm',
             ],
         },
     }
diff --git a/puppet/modules/role/templates/thumbor/local_repo.php.erb 
b/puppet/modules/role/templates/thumbor/local_repo.php.erb
index 0847991..8e486fb 100644
--- a/puppet/modules/role/templates/thumbor/local_repo.php.erb
+++ b/puppet/modules/role/templates/thumbor/local_repo.php.erb
@@ -15,6 +15,8 @@
                 'png' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
                 'gif' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
                 'svg' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
+                'ogg' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
+                'webm' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
             ),
         ),
     ),
diff --git a/puppet/modules/thumbor/manifests/init.pp 
b/puppet/modules/thumbor/manifests/init.pp
index a4715e3..37978fc 100644
--- a/puppet/modules/thumbor/manifests/init.pp
+++ b/puppet/modules/thumbor/manifests/init.pp
@@ -46,6 +46,9 @@
     # For SVG engine
     require_package('librsvg2-bin')
 
+    # For Video engine
+    require_package('ffmpeg')
+
     $statsd_host = 'localhost'
     $statsd_prefix = 'Thumbor'
 
@@ -76,6 +79,7 @@
             'git+https://gerrit.wikimedia.org/r/thumbor/proxy-engine',
             'git+https://gerrit.wikimedia.org/r/thumbor/base-engine',
             'git+https://gerrit.wikimedia.org/r/thumbor/svg-engine',
+            'git+https://gerrit.wikimedia.org/r/thumbor/video-engine',
         ],
         require  => [
             Package['libjpeg-progs'],
@@ -136,7 +140,7 @@
     varnish::backend { 'thumbor':
         host   => '127.0.0.1',
         port   => '8888',
-        onlyif => 'req.url ~ 
"^/images/thumb/.*\.(jpeg|jpg|jpe|png|apng|gif|svg)"',
+        onlyif => 'req.url ~ 
"^/images/thumb/.*\.(jpeg|jpg|jpe|png|apng|gif|svg|ogv|webm)"',
     }
 
     varnish::backend { 'swift':
diff --git a/puppet/modules/thumbor/templates/thumbor.conf.erb 
b/puppet/modules/thumbor/templates/thumbor.conf.erb
index 7b9cf82..5072fb9 100644
--- a/puppet/modules/thumbor/templates/thumbor.conf.erb
+++ b/puppet/modules/thumbor/templates/thumbor.conf.erb
@@ -434,7 +434,7 @@
 ## List of optimizers that thumbor will use to optimize images
 ## Defaults to: []
 OPTIMIZERS = [
-       'wikimedia_thumbor_exif_optimizer',
+    'wikimedia_thumbor_exif_optimizer',
 ]
 
 
@@ -444,7 +444,7 @@
 
 ## Path for the ffmpeg binary used to generate gifv(h.264)
 ## Defaults to: /usr/local/bin/ffmpeg
-#FFMPEG_PATH = '/usr/local/bin/ffmpeg'
+FFMPEG_PATH = '/usr/bin/ffmpeg'
 
 
################################################################################
 
@@ -594,6 +594,12 @@
 
 RSVG_CONVERT_PATH = '/usr/bin/rsvg-convert'
 
-PROXY_ENGINE_ENGINES = [ 'wikimedia_thumbor_svg_engine', 'thumbor.engines.pil' 
]
+FFPROBE_PATH = '/usr/bin/ffprobe'
+
+PROXY_ENGINE_ENGINES = [
+    'wikimedia_thumbor_svg_engine',
+    'wikimedia_thumbor_video_engine',
+    'thumbor.engines.pil'
+]
 
 
################################################################################
diff --git a/puppet/modules/thumbor/templates/varnish.vcl.erb 
b/puppet/modules/thumbor/templates/varnish.vcl.erb
index f5bef39..c90a1c0 100644
--- a/puppet/modules/thumbor/templates/varnish.vcl.erb
+++ b/puppet/modules/thumbor/templates/varnish.vcl.erb
@@ -58,16 +58,24 @@
     }
 
     # qlow jpg thumbs (thumbor)
-    if (req.url ~ "^/images/thumb/(.*)/qlow-(\d+)px-.*\.(jpg|jpeg|jpe)") {
-        set req.url = "/unsafe/" + regsub(req.url, 
"^/images/thumb/(.*)/qlow-(\d+)px-.*\.(jpg|jpeg|jpe)", "\2") + 
"x/filters:quality(40):sharpen(0.6,0.01,false)/127.0.0.1:<%= 
scope['::swift::port'] %>/v1/AUTH_testproj/wiki-local-public/" + 
regsub(req.url, "^/images/thumb/(.*)/qlow-(\d+)px-.*\.(jpg|jpeg|jpe)", "\1");
+    if (req.url ~ "^/images/thumb/(.*)\.(jpg|jpeg|jpe)/qlow-(\d+)px-.*") {
+        set req.url = "/unsafe/" + regsub(req.url, 
"^/images/thumb/(.*)\.(jpg|jpeg|jpe)/qlow-(\d+)px-.*", "\3") + 
"x/filters:quality(40):sharpen(0.6,0.01,false)/127.0.0.1:<%= 
scope['::swift::port'] %>/v1/AUTH_testproj/wiki-local-public/" + 
regsub(req.url, "^/images/thumb/(.*)\.(jpg|jpeg|jpe)/qlow-(\d+)px-.*", "\1.\2");
         return (hash);
     # regular jpg thumbs (thumbor)
-    } else if (req.url ~ "^/images/thumb/(.*)/(\d+)px-.*\.(jpg|jpeg|jpe)") {
-        set req.url = "/unsafe/" + regsub(req.url, 
"^/images/thumb/(.*)/(\d+)px-.*\.(jpg|jpeg|jpe)", "\2") + 
"x/filters:quality(87):sharpen(0.6,0.01,false)/127.0.0.1:<%= 
scope['::swift::port'] %>/v1/AUTH_testproj/wiki-local-public/" + 
regsub(req.url, "^/images/thumb/(.*)/(\d+)px-.*\.(jpg|jpeg|jpe)", "\1");
+    } else if (req.url ~ "^/images/thumb/(.*)\.(jpg|jpeg|jpe)/(\d+)px-.*") {
+        set req.url = "/unsafe/" + regsub(req.url, 
"^/images/thumb/(.*)\.(jpg|jpeg|jpe)/(\d+)px-.*", "\3") + 
"x/filters:quality(87):sharpen(0.6,0.01,false)/127.0.0.1:<%= 
scope['::swift::port'] %>/v1/AUTH_testproj/wiki-local-public/" + 
regsub(req.url, "^/images/thumb/(.*)\.(jpg|jpeg|jpe)/(\d+)px-.*", "\1.\2");
         return (hash);
-    # png & gif thumbs, no filters (thumbor)
-    } else if (req.url ~ "^/images/thumb/(.*)/(\d+)px-.*\.(png|apng|gif)") {
-        set req.url = "/unsafe/" + regsub(req.url, 
"^/images/thumb/(.*)/(\d+)px-.*\.(png|apng|gif)", "\2") + "x/127.0.0.1:<%= 
scope['::swift::port'] %>/v1/AUTH_testproj/wiki-local-public/" + 
regsub(req.url, "^/images/thumb/(.*)/(\d+)px-.*\.(png|apng|gif)", "\1");
+    # png, gif & svg thumbs, no filters (thumbor)
+    } else if (req.url ~ "^/images/thumb/(.*)\.(png|apng|gif|svg)/(\d+)px-.*") 
{
+        set req.url = "/unsafe/" + regsub(req.url, 
"^/images/thumb/(.*)\.(png|apng|gif|svg)/(\d+)px-.*", "\3") + "x/127.0.0.1:<%= 
scope['::swift::port'] %>/v1/AUTH_testproj/wiki-local-public/" + 
regsub(req.url, "^/images/thumb/(.*)\.(png|apng|gif|svg)/(\d+)px-.*", "\1.\2");
+        return (hash);
+    # ogv & webm thumbs, with seek parameter (thumbor)
+    } else if (req.url ~ "^/images/thumb/(.*)\.(ogv|webm)/(\d+)px-(\d+)-.*") {
+        set req.url = "/unsafe/" + regsub(req.url, 
"^/images/thumb/(.*)\.(ogv|webm)/(\d+)px-(\d+)-.*", "\3") + "x/filters:page(" + 
regsub(req.url, "^/images/thumb/(.*)\.(ogv|webm)/(\d+)px-(\d+)-.*", "\4")  + 
")/127.0.0.1:<%= scope['::swift::port'] %>/v1/AUTH_testproj/wiki-local-public/" 
+ regsub(req.url, "^/images/thumb/(.*)\.(ogv|webm)/(\d+)px-(\d+)-.*", "\1.\2");
+        return (hash);
+    # ogv & webm thumbs, without seek parameter (thumbor)
+    } else if (req.url ~ "^/images/thumb/(.*)\.(ogv|webm)/(\d+)px--.*") {
+        set req.url = "/unsafe/" + regsub(req.url, 
"^/images/thumb/(.*)\.(ogv|webm)/(\d+)px--.*", "\3") + "x/127.0.0.1:<%= 
scope['::swift::port'] %>/v1/AUTH_testproj/wiki-local-public/" + 
regsub(req.url, "^/images/thumb/(.*)\.(ogv|webm)/(\d+)px--.*", "\1.\2");
         return (hash);
     # thumbs unsupported by thumbor (mediawiki)
     } else if (req.url ~ "^/images/thumb/.*") {
@@ -87,6 +95,8 @@
         set beresp.http.X-Url = bereq.http.X-Url;
     }
 
+    set beresp.http.X-Backend-Url = bereq.url;
+
     if (bereq.http.X-Url ~ "^/images/thumb/") {
         set beresp.http.xkey = "File:" + regsub(bereq.http.X-Url, 
"^/images/thumb/[^/]+/[^/]+/([^/]+)/[^/]+$", "\1");
     } else if (bereq.http.X-Url ~ "^/images/") {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic6deb34e05e2ee5d19f64b0dd579afdcbaad0e1e
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Gilles <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Dduvall <[email protected]>
Gerrit-Reviewer: Filippo Giunchedi <[email protected]>
Gerrit-Reviewer: Gilles <[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