From 5e004e027b0bf7b3a505fcda0a57e975640821c9 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 25 Jun 2013 19:08:23 +0100 Subject: [PATCH] Rerender all low zoom tiles once a month --- cookbooks/tile/recipes/default.rb | 15 +++++++++++++- .../templates/default/render-lowzoom.cron.erb | 3 +++ .../tile/templates/default/render-lowzoom.erb | 20 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 cookbooks/tile/templates/default/render-lowzoom.cron.erb create mode 100644 cookbooks/tile/templates/default/render-lowzoom.erb diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index 238e8e79d..261c0e9ed 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -398,6 +398,20 @@ template "/etc/logrotate.d/replicate" do mode 0644 end +template "/usr/local/bin/render-lowzoom" do + source "render-lowzoom.erb" + owner "root" + group "root" + mode 0755 +end + +template "/etc/cron.d/render-lowzoom" do + source "render-lowzoom.cron.erb" + owner "root" + group "root" + mode 0755 +end + munin_plugin "mod_tile_fresh" munin_plugin "mod_tile_response" munin_plugin "mod_tile_zoom" @@ -410,4 +424,3 @@ munin_plugin "renderd_zoom_time" munin_plugin "replication_delay" do conf "munin.erb" end - diff --git a/cookbooks/tile/templates/default/render-lowzoom.cron.erb b/cookbooks/tile/templates/default/render-lowzoom.cron.erb new file mode 100644 index 000000000..b516a3d6b --- /dev/null +++ b/cookbooks/tile/templates/default/render-lowzoom.cron.erb @@ -0,0 +1,3 @@ +# DO NOT EDIT - This file is being maintained by Chef + +0 1 1-7 * * tile test $(date +%u) -eq 7 && /usr/local/bin/render-lowzoom diff --git a/cookbooks/tile/templates/default/render-lowzoom.erb b/cookbooks/tile/templates/default/render-lowzoom.erb new file mode 100644 index 000000000..de2a3ddc4 --- /dev/null +++ b/cookbooks/tile/templates/default/render-lowzoom.erb @@ -0,0 +1,20 @@ +#!/bin/bash + +# DO NOT EDIT - This file is being maintained by Chef + +# Send output to the log +exec > /var/log/tile/render-lowzoom.log 2>&1 +<% node[:tile][:styles].each_key do |style| -%> + +# Update tiles from z0 to z12 for style "<%= @style %>" +render_list \ + --all --force \ + --tile-dir=/srv/tile.openstreetmap.org/tiles \ + --socket=/var/run/renderd/renderd.sock \ + --num-threads=<%= ( node[:cpu][:total] - 2 ) / 4 %> \ + --map="<%= style %>" \ + --max-load=70 \ + --min-zoom=0 --max-zoom=12 +<% end -%> + +exit 0 -- 2.39.5