]> git.openstreetmap.org Git - chef.git/commitdiff
tile: Fix Mac ARM compatibility (kitchen)
authorGrant Slater <github@firefishy.com>
Sat, 3 Dec 2022 11:04:53 +0000 (11:04 +0000)
committerGrant Slater <github@firefishy.com>
Sat, 3 Dec 2022 11:04:53 +0000 (11:04 +0000)
cookbooks/tile/templates/default/render-lowzoom.erb
cookbooks/tile/templates/default/renderd.conf.erb
cookbooks/tile/templates/default/update-lowzoom.erb

index 95e4ed6e8f943610752b21d2e67cb02f96ef0efe..c031813996da110addd58ab0b865889635f3f613 100644 (file)
@@ -16,7 +16,7 @@ function update_<%= style %>
     --timestamp=${timestamp} \
     --tile-dir=/srv/tile.openstreetmap.org/tiles \
     --socket=/var/run/renderd/renderd.sock \
-    --num-threads=<%= node[:cpu][:total] - 1 %> \
+    --num-threads=<%= [4, node.dig('cpu', 'total').to_i - 1, node.dig('cpu', 'cores').to_i - 1].max %> \
     --map="<%= style %>" \
     --max-load=<%= node[:cpu][:total] %> \
     --min-zoom=0 --max-zoom=12
index 8f441db2ca216269b8a627b85a1455861e02ad39..60206d1ceb09f1a578fde9ed003e9acf41466f28 100644 (file)
@@ -2,7 +2,7 @@
 
 [renderd]
 socketname=/var/run/renderd/renderd.sock
-num_threads=<%= node[:cpu][:total] - 1 %>
+num_threads=<%= [4, node.dig('cpu', 'total').to_i - 1, node.dig('cpu', 'cores').to_i - 1].max %>
 tile_dir=/srv/tile.openstreetmap.org/tiles
 stats_file=/var/run/renderd/renderd.stats
 
index 85f32c13d3688527f20383b3180b7eceb376568c..c70374de91c4d08de9c988d8372fc56ffbe7bb1c 100644 (file)
@@ -12,7 +12,7 @@ function update_tiles
     --timestamp=$(stat -c %Y "/srv/tile.openstreetmap.org/styles/<%= @style %>/project.xml") \
     --tile-dir=/srv/tile.openstreetmap.org/tiles \
     --socket=/var/run/renderd/renderd.sock \
-    --num-threads=<%= node[:cpu][:total] - 1 %> \
+    --num-threads=<%= [4, node.dig('cpu', 'total').to_i - 1, node.dig('cpu', 'cores').to_i - 1].max %> \
     --map="<%= @style %>" \
     --max-load=<%= node[:cpu][:total] %> \
     --min-zoom=0 --max-zoom=12