Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Scheduler use health endpoint monit" #2079

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading