python_package "tilekiln" do
python_virtualenv tilekiln_directory
python_version "3"
- version "0.6.3"
+ version "0.6.5"
end
template "/srv/vector.openstreetmap.org/html/index.html" do
end
end
+postgresql_table "tile_stats" do
+ cluster node[:vectortile][:database][:cluster]
+ database "tiles"
+ schema "tilekiln"
+ owner "tilekiln"
+end
+
(0..14).each do |zoom|
postgresql_table "shortbread_v1_z#{zoom}" do
cluster node[:vectortile][:database][:cluster]
"--database-name=spirit"
]
end
+
+systemd_service "tilekiln-prometheus" do
+ description "Tilekiln vector tile server"
+ user "tilekiln"
+ after "postgresql.service"
+ wants "postgresql.service"
+ sandbox :enable_network => true
+ restrict_address_families "AF_UNIX"
+ exec_start "#{tilekiln_directory}/bin/tilekiln prometheus --bind-host #{node[:prometheus][:address]} --storage-dbname tiles"
+end
+
+service "tilekiln-prometheus" do
+ action [:enable, :start]
+end
+
+node.default[:prometheus][:exporters][10013] = {
+ :name => "tilekiln",
+ :address => "#{node[:prometheus][:address]}:10013",
+}
--- /dev/null
+describe service("tilekiln-prometheus") do
+ it { should be_enabled }
+ it { should be_running }
+end
+
+describe port(10013) do
+ it { should be_listening }
+end
its("status") { should cmp 200 }
end
-describe json(:content => http("https://localhost/shortbread_v1/tilejson.json", :ssl_verify => false)) do
+describe json(:content => http("https://localhost/shortbread_v1/tilejson.json", :ssl_verify => false).body) do
its(["tiles"]) { should eq(["https://vector.openstreetmap.org/shortbread_v1/{z}/{x}/{y}.mvt"]) }
end
-# There are no tiles so everything should return a 404
-describe http("https://localhost/shortbread_v1/0/0/0.mvt", :ssl_verify => false) do
- its("status") { should cmp 404 }
-end
describe http("https://localhost/shortbread_v1/16/0/0.mvt", :ssl_verify => false) do
- its("status") { should cmp 404 }
+ its("status") { should cmp 410 }
end