From 6e4ae7f19e11f4c8e83741c55dce1134ef37d977 Mon Sep 17 00:00:00 2001 From: Oliver Mautschke <40239127+OliverMautschke@users.noreply.github.com> Date: Wed, 23 Aug 2023 10:45:29 +0200 Subject: [PATCH] Revert "Scheduler use health endpoint monit" --- jobs/scheduler/monit | 18 ++++-------------- jobs/scheduler/spec | 14 ++++++-------- spec/fixtures/monit | 8 -------- spec/jobs/scheduler/scheduler_spec.rb | 21 --------------------- 4 files changed, 10 insertions(+), 51 deletions(-) delete mode 100644 spec/fixtures/monit diff --git a/jobs/scheduler/monit b/jobs/scheduler/monit index 54193457f7..f52917201e 100644 --- a/jobs/scheduler/monit +++ b/jobs/scheduler/monit @@ -1,16 +1,6 @@ -<% - require 'erb' - - user = ERB::Util.url_encode(p('autoscaler.scheduler.health.username')) - password = ERB::Util.url_encode(p('autoscaler.scheduler.health.password')) - port = p('autoscaler.scheduler.health.port') - - health_url = "http://#{user}:#{password}@localhost:#{port}" -%>check host scheduler with address localhost - if failed url <%=health_url%> - timeout 30 seconds - then restart - +check process scheduler + with pidfile /var/vcap/sys/run/bpm/scheduler/scheduler.pid start program "/var/vcap/jobs/bpm/bin/bpm start scheduler" stop program "/var/vcap/jobs/bpm/bin/bpm stop scheduler" - group vcap \ No newline at end of file + group vcap + diff --git a/jobs/scheduler/spec b/jobs/scheduler/spec index d63bd474cd..01cf63ccf4 100644 --- a/jobs/scheduler/spec +++ b/jobs/scheduler/spec @@ -3,25 +3,23 @@ name: scheduler templates: bpm-pre-start.erb: bin/bpm-pre-start bpm.yml.erb: config/bpm.yml - + liquibase.properties: bin/liquibase.properties + scheduler.yml.erb: config/scheduler.yml install_crt_keystore.sh: bin/install_crt_keystore install_crt_truststore.sh: bin/install_crt_truststore - liquibase.properties: bin/liquibase.properties - - policy_db_ca.crt.erb: config/certs/policy_db/ca.crt - policy_db.crt.erb: config/certs/policy_db/crt - policy_db.key.erb: config/certs/policy_db/key - scheduler_ca.crt.erb: config/certs/ca.crt scheduler_server.crt.erb: config/certs/server.crt scheduler_server.key.erb: config/certs/server.key - scheduler.yml.erb: config/scheduler.yml scalingengine_ca.crt.erb: config/certs/scalingengine/ca.crt scalingengine_client.crt.erb: config/certs/scalingengine/client.crt scalingengine_client.key.erb: config/certs/scalingengine/client.key + policy_db_ca.crt.erb: config/certs/policy_db/ca.crt + policy_db.crt.erb: config/certs/policy_db/crt + policy_db.key.erb: config/certs/policy_db/key + scheduler_db_ca.crt.erb: config/certs/scheduler_db/ca.crt scheduler_db.crt.erb: config/certs/scheduler_db/crt scheduler_db.key.erb: config/certs/scheduler_db/key diff --git a/spec/fixtures/monit b/spec/fixtures/monit deleted file mode 100644 index 6dce2368e1..0000000000 --- a/spec/fixtures/monit +++ /dev/null @@ -1,8 +0,0 @@ -check host scheduler with address localhost - if failed url http://user:my%20password@localhost:1234 - timeout 30 seconds - then restart - - start program "/var/vcap/jobs/bpm/bin/bpm start scheduler" - stop program "/var/vcap/jobs/bpm/bin/bpm stop scheduler" - group vcap \ No newline at end of file diff --git a/spec/jobs/scheduler/scheduler_spec.rb b/spec/jobs/scheduler/scheduler_spec.rb index be04e99a02..0290dbd0bc 100644 --- a/spec/jobs/scheduler/scheduler_spec.rb +++ b/spec/jobs/scheduler/scheduler_spec.rb @@ -100,25 +100,4 @@ expect(rendered_template["spring"]["datasource"]["password"]).to eq("default") end end - - context "Scheduler monit" do - def p(v) - case v - when "autoscaler.scheduler.health.username" - "user" - when "autoscaler.scheduler.health.password" - "my password" - when "autoscaler.scheduler.health.port" - 1234 - else - "Error: param not supported (#{v})" - end - end - - it "renders the monit file" do - template = ERB.new(File.read("jobs/scheduler/monit"), trim_mode: "%") - expected = File.read("spec/fixtures/monit") - expect(template.result(binding)).to eq(expected) - end - end end