]> git.openstreetmap.org Git - chef.git/commitdiff
Use a virtualenv for tilelog processing
authorTom Hughes <tom@compton.nu>
Sat, 3 Jul 2021 14:28:38 +0000 (14:28 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 3 Jul 2021 14:31:12 +0000 (14:31 +0000)
cookbooks/tilelog/recipes/default.rb
cookbooks/tilelog/templates/default/tilelog.erb

index 7e356e50a357a82a200c4d44a3829435e36a2b2f..9596cd7fec117702882a13eb738c78e80b13fa71 100644 (file)
@@ -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
index f53c69dc2f7951fa598a6e8701f64442e5c1689b..9294f82d6f833d13c8d0e52c7d5298e27a60bde8 100644 (file)
@@ -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}"