From: Tom Hughes Date: Sat, 3 Jul 2021 14:28:38 +0000 (+0000) Subject: Use a virtualenv for tilelog processing X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/d924fba4d5e22c9a16d5eebbc8f310d21f171959?ds=inline Use a virtualenv for tilelog processing --- diff --git a/cookbooks/tilelog/recipes/default.rb b/cookbooks/tilelog/recipes/default.rb index 7e356e50a..9596cd7fe 100644 --- a/cookbooks/tilelog/recipes/default.rb +++ b/cookbooks/tilelog/recipes/default.rb @@ -21,9 +21,15 @@ include_recipe "python" passwords = data_bag_item("tilelog", "passwords") +tilelog_directory = "/opt/tilelog" tilelog_output_directory = node[:tilelog][:output_directory] +python_virtualenv tilelog_directory do + interpreter "/usr/bin/python3" +end + python_package "tilelog" do + python_virtualenv tilelog_directory python_version "3" end @@ -34,7 +40,7 @@ directory tilelog_output_directory do recursive true end -template "/usr/local/bin/generate-tilelog" do +template "/usr/local/bin/tilelog" do source "tilelog.erb" owner "root" group "root" @@ -47,6 +53,6 @@ cron_d "tilelog" do minute "17" hour "22" user "www-data" - command "/usr/local/bin/generate-tilelog" + command "/usr/local/bin/tilelog" mailto "admins@openstreetmap.org" end diff --git a/cookbooks/tilelog/templates/default/tilelog.erb b/cookbooks/tilelog/templates/default/tilelog.erb index f53c69dc2..9294f82d6 100644 --- a/cookbooks/tilelog/templates/default/tilelog.erb +++ b/cookbooks/tilelog/templates/default/tilelog.erb @@ -14,4 +14,4 @@ export AWS_ACCESS_KEY_ID="AKIASQUXHPE7JFCFMOUP" export AWS_SECRET_ACCESS_KEY="<%= @aws_key %>" export AWS_REGION="eu-west-1" -nice -n 19 /usr/local/bin/tilelog --date ${DATE} && mv tiles-${DATE}.txt.xz "${OUTDIR}" +nice -n 19 /opt/tilelog/bin/tilelog --date ${DATE} && mv tiles-${DATE}.txt.xz "${OUTDIR}"