Skip to content

Commit

Permalink
Merge pull request #2079 from cloudfoundry/revert-2074-scheduler-use-…
Browse files Browse the repository at this point in the history
…health-endpoint-monit

Revert "Scheduler use health endpoint monit"
  • Loading branch information
OliverMautschke authored Aug 23, 2023
2 parents a604bb2 + 6e4ae7f commit c264638
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 51 deletions.
18 changes: 4 additions & 14 deletions jobs/scheduler/monit
Original file line number Diff line number Diff line change
@@ -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
group vcap

14 changes: 6 additions & 8 deletions jobs/scheduler/spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions spec/fixtures/monit

This file was deleted.

21 changes: 0 additions & 21 deletions spec/jobs/scheduler/scheduler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c264638

Please sign in to comment.