]> git.openstreetmap.org Git - chef.git/commitdiff
Drop promscale support
authorTom Hughes <tom@compton.nu>
Tue, 13 Jun 2023 19:53:26 +0000 (20:53 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 13 Jun 2023 19:53:26 +0000 (20:53 +0100)
.kitchen.yml
cookbooks/apt/recipes/timescaledb.rb [deleted file]
cookbooks/prometheus/attributes/default.rb
cookbooks/prometheus/metadata.rb
cookbooks/prometheus/recipes/server.rb
cookbooks/prometheus/templates/default/prometheus.yml.erb
cookbooks/timescaledb/README.md [deleted file]
cookbooks/timescaledb/attributes/default.rb [deleted file]
cookbooks/timescaledb/metadata.rb [deleted file]
cookbooks/timescaledb/recipes/default.rb [deleted file]
test/integration/prometheus-server/serverspec/promscale_spec.rb [deleted file]

index 2b5b581f8eaad5f9cca6d8aeb940dc73f4134f2e..a79c1582937f172896f1c2b366e6b133478ea381 100644 (file)
@@ -324,9 +324,6 @@ suites:
   - name: prometheus-server
     run_list:
       - recipe[prometheus::server]
-    attributes:
-      prometheus:
-        promscale: true
   - name: python
     run_list:
       - recipe[python::default]
@@ -379,9 +376,6 @@ suites:
   - name: tilelog
     run_list:
       - recipe[tilelog::default]
-  - name: timescaledb
-    run_list:
-      - recipe[timescaledb::default]
   - name: tools
     run_list:
       - recipe[tools::default]
diff --git a/cookbooks/apt/recipes/timescaledb.rb b/cookbooks/apt/recipes/timescaledb.rb
deleted file mode 100644 (file)
index 5fc56c2..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Cookbook:: apt
-# Recipe:: timescaledb
-#
-# Copyright:: 2022, Tom Hughes
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-include_recipe "apt"
-include_recipe "apt::postgresql"
-
-platform_name = if platform?("debian")
-                  "debian"
-                else
-                  "ubuntu"
-                end
-
-apt_repository "timescaledb" do
-  uri "https://packagecloud.io/timescale/timescaledb/#{platform_name}"
-  components ["main"]
-  key "https://packagecloud.io/timescale/timescaledb/gpgkey"
-end
index a104883e7b12079ca2a7900741fa58439c26300e..7ea8bfd1d169e38c675c6a4c5d759bd27cf68bab 100644 (file)
@@ -3,4 +3,3 @@ default[:prometheus][:exporters] = {}
 default[:prometheus][:snmp] = {}
 default[:prometheus][:metrics] = {}
 default[:prometheus][:files] = []
-default[:prometheus][:promscale] = true
index 0d635560a766f67fc53380a41d523cf5a891f6cb..f79ad0bcb43e3eda65ca415ad4e3dc5c600b0409 100644 (file)
@@ -11,4 +11,3 @@ depends           "apt"
 depends           "git"
 depends           "hardware"
 depends           "networking"
-depends           "timescaledb"
index 1c4f8e2d20f8a9500e91a8bc0ae04609f88d5355..28f75767276f1ead3ab7d32d02231bbb3a979a33 100644 (file)
@@ -19,9 +19,7 @@
 
 include_recipe "apache"
 include_recipe "apt::grafana"
-include_recipe "apt::timescaledb"
 include_recipe "networking"
-include_recipe "timescaledb"
 
 passwords = data_bag_item("prometheus", "passwords")
 tokens = data_bag_item("prometheus", "tokens")
@@ -111,78 +109,6 @@ archive_file "#{cache_dir}/karma-linux-amd64.tar.gz" do
   subscribes :extract, "remote_file[#{cache_dir}/karma-linux-amd64.tar.gz]", :immediately
 end
 
-promscale_version = "0.17.0"
-promscale_extension_version = "0.8.0-1"
-
-database_version = node[:timescaledb][:database_version]
-database_cluster = "#{database_version}/main"
-
-package %W[
-  prometheus
-  promscale-extension-postgresql-#{database_version}
-]
-
-package "promscale-extension-postgresql-#{database_version}" do
-  version promscale_extension_version
-end
-
-apt_preference "promscale-extension-postgresql" do
-  pin "version #{promscale_extension_version}"
-  pin_priority "1100"
-end
-
-postgresql_user "prometheus" do
-  cluster database_cluster
-  superuser true
-end
-
-postgresql_database "promscale" do
-  cluster database_cluster
-  owner "prometheus"
-end
-
-directory "/opt/promscale" do
-  owner "root"
-  group "root"
-  mode "755"
-end
-
-directory "/opt/promscale/bin" do
-  owner "root"
-  group "root"
-  mode "755"
-end
-
-remote_file "/opt/promscale/bin/promscale" do
-  action :create
-  source "https://github.com/timescale/promscale/releases/download/#{promscale_version}/promscale_#{promscale_version}_Linux_x86_64"
-  owner "root"
-  group "root"
-  mode "755"
-end
-
-systemd_service "promscale" do
-  description "Promscale Connector"
-  type "simple"
-  user "prometheus"
-  exec_start "/opt/promscale/bin/promscale --db.uri postgresql:///promscale?host=/run/postgresql&port=5432 --db.connections-max 400"
-  limit_nofile 16384
-  sandbox :enable_network => true
-  restrict_address_families "AF_UNIX"
-end
-
-if node[:prometheus][:promscale]
-  service "promscale" do
-    action [:enable, :start]
-    subscribes :restart, "remote_file[/opt/promscale/bin/promscale]"
-    subscribes :restart, "systemd_service[promscale]"
-  end
-else
-  service "promscale" do
-    action [:disable, :stop]
-  end
-end
-
 search(:node, "roles:gateway") do |gateway|
   allowed_ips = gateway.ipaddresses(:role => :internal).map(&:subnet)
 
index a4de984911cf1e4429998ba8fdd4127b87ae518c..9c163f265fefae0ad7d58029dd1f9301664a7064 100644 (file)
@@ -27,10 +27,6 @@ scrape_configs:
     static_configs:
       - targets:
           - localhost:9093
-  - job_name: promscale
-    static_configs:
-      - targets:
-          - localhost:9201
   - job_name: ssl
     scrape_interval: 15m
     metrics_path: /probe
@@ -115,6 +111,3 @@ scrape_configs:
       - source_labels: [__address__]
         regex: "[^/]+/[^/]+/(.*)"
         target_label: __address__
-
-remote_read:
-  - url: "http://localhost:9201/read"
diff --git a/cookbooks/timescaledb/README.md b/cookbooks/timescaledb/README.md
deleted file mode 100644 (file)
index f37c32e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-# TimescaleDB Cookbook
-
-This cookbook configures TimescaleDB.
diff --git a/cookbooks/timescaledb/attributes/default.rb b/cookbooks/timescaledb/attributes/default.rb
deleted file mode 100644 (file)
index e39bd05..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-default[:timescaledb][:database_version] = "15"
-default[:timescaledb][:max_background_workers] = 8
diff --git a/cookbooks/timescaledb/metadata.rb b/cookbooks/timescaledb/metadata.rb
deleted file mode 100644 (file)
index 9b8821a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-name              "timescaledb"
-maintainer        "OpenStreetMap Administrators"
-maintainer_email  "admins@openstreetmap.org"
-license           "Apache-2.0"
-description       "Installs and configures timescaledb"
-
-version           "1.0.0"
-supports          "ubuntu"
-depends           "apache"
-depends           "apt"
-depends           "postgresql"
diff --git a/cookbooks/timescaledb/recipes/default.rb b/cookbooks/timescaledb/recipes/default.rb
deleted file mode 100644 (file)
index 05085d9..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# Cookbook:: timescaledb
-# Recipe:: default
-#
-# Copyright:: 2021, OpenStreetMap Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-include_recipe "apt::timescaledb"
-
-database_version = node[:timescaledb][:database_version]
-
-package %W[
-  timescaledb-tools
-  timescaledb-2-postgresql-#{database_version}
-]
-
-node.default_unless[:postgresql][:versions] = []
-node.default[:postgresql][:versions] |= [database_version]
-node.default[:postgresql][:monitor_tables] = false
-node.default_unless[:postgresql][:settings][database_version][:shared_preload_libraries] = []
-node.default[:postgresql][:settings][database_version][:shared_preload_libraries] |= ["timescaledb"]
-node.default_unless[:postgresql][:settings][database_version][:customized_options] = {}
-node.default[:postgresql][:settings][database_version][:customized_options]["timescaledb.max_background_workers"] = node[:timescaledb][:max_background_workers]
-
-include_recipe "postgresql"
diff --git a/test/integration/prometheus-server/serverspec/promscale_spec.rb b/test/integration/prometheus-server/serverspec/promscale_spec.rb
deleted file mode 100644 (file)
index aaedf15..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-require "serverspec"
-
-# Required by serverspec
-set :backend, :exec
-
-describe service("promscale") do
-  it { should be_enabled }
-  it { should be_running }
-end
-
-describe port(9201) do
-  it { should be_listening.with("tcp6") }
-end