Commit ba6a7aa5 authored by Łukasz Nowak's avatar Łukasz Nowak

Revert "stack/resilient: Switch to monitor-promise-base"

This reverts commit 04ea0535.

It has to be redone with proper test coverage.
parent 934bc087
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# not need these here). # not need these here).
[pbsready] [pbsready]
filename = pbsready.cfg.in filename = pbsready.cfg.in
md5sum = b241faeb182193eb105dfe19e45835db md5sum = f3bf5e1d8bbfbb428c5bbe3a57d8cbe5
[pbsready-import] [pbsready-import]
filename = pbsready-import.cfg.in filename = pbsready-import.cfg.in
...@@ -26,11 +26,11 @@ md5sum = c6c11db5372150019debb1ce519b907d ...@@ -26,11 +26,11 @@ md5sum = c6c11db5372150019debb1ce519b907d
[template-pull-backup] [template-pull-backup]
filename = instance-pull-backup.cfg.in filename = instance-pull-backup.cfg.in
md5sum = 881edc84ead2a6de3c919c2f0499d54c md5sum = 57b9b421d233402e6d5177c69cf9567e
[template-replicated] [template-replicated]
filename = template-replicated.cfg.in filename = template-replicated.cfg.in
md5sum = 9372ba0e36cce57892faad4b68fe4b68 md5sum = 7392935be29d89f8224bccac78e3ecd0
[template-parts] [template-parts]
filename = template-parts.cfg.in filename = template-parts.cfg.in
......
...@@ -42,6 +42,7 @@ log = $${rootdirectory:var}/log ...@@ -42,6 +42,7 @@ log = $${rootdirectory:var}/log
services = $${rootdirectory:etc}/service services = $${rootdirectory:etc}/service
run = $${rootdirectory:var}/run run = $${rootdirectory:var}/run
backup = $${rootdirectory:srv}/backup backup = $${rootdirectory:srv}/backup
promises = $${rootdirectory:etc}/promise
ssh-home = $${rootdirectory:etc}/ssh ssh-home = $${rootdirectory:etc}/ssh
notifier = $${rootdirectory:etc}/notifier notifier = $${rootdirectory:etc}/notifier
...@@ -119,6 +120,7 @@ notifier-binary = ${buildout:bin-directory}/pubsubnotifier ...@@ -119,6 +120,7 @@ notifier-binary = ${buildout:bin-directory}/pubsubnotifier
rdiffbackup-binary = ${buildout:bin-directory}/rdiff-backup rdiffbackup-binary = ${buildout:bin-directory}/rdiff-backup
sshclient-binary = $${openssh-client:wrapper-path} sshclient-binary = $${openssh-client:wrapper-path}
known-hosts = $${directory:dot-ssh}/known_hosts known-hosts = $${directory:dot-ssh}/known_hosts
promises-directory = $${basedirectory:promises}
directory = $${directory:pbs-backup} directory = $${directory:pbs-backup}
cron-entries = $${cron:cron-entries} cron-entries = $${cron:cron-entries}
wrappers-directory = $${directory:pbs-wrappers} wrappers-directory = $${directory:pbs-wrappers}
...@@ -220,34 +222,22 @@ wrapper-path = $${directory:bin}/resilient-genstatrss.py ...@@ -220,34 +222,22 @@ wrapper-path = $${directory:bin}/resilient-genstatrss.py
recipe = cns.recipe.symlink recipe = cns.recipe.symlink
symlink = $${pbs:rdiff-backup-data-folder}/restore.log = $${basedirectory:log}/pbs-push-history-log symlink = $${pbs:rdiff-backup-data-folder}/restore.log = $${basedirectory:log}/pbs-push-history-log
[pull-push-stalled-promise-bin] [pull-push-stalled-promise]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
# # time-buffer is 24h (+1h of latitude) # # time-buffer is 24h (+1h of latitude)
command-line = ${buildout:bin-directory}/check-feed-as-promise --feed-path $${pbs-resilient-status-feed:feed-path} --title --ok-pattern 'OK' --time-buffer 90000 command-line = ${buildout:bin-directory}/check-feed-as-promise --feed-path $${pbs-resilient-status-feed:feed-path} --title --ok-pattern 'OK' --time-buffer 90000
wrapper-path = $${basedirectory:bin}/stalled-pull-push wrapper-path = $${basedirectory:promises}/stalled-pull-push
[pull-push-stalled-promise]
<= monitor-promise-base
module = check_command_execute
name = stalled-pull-push.py
config-command = $${pull-push-stalled-promise-bin:wrapper-path}
[notifier-feed-status-promise-bin] [notifier-feed-status-promise]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${notifier-feed-promise-template:target} template = ${notifier-feed-promise-template:target}
rendered = $${basedirectory:bin}/notifier-feed-check-malformed-or-failure.py rendered = $${basedirectory:promises}/notifier-feed-check-malformed-or-failure.py
mode = 700 mode = 700
context = context =
key notifier_feed_directory directory:notifier-feeds key notifier_feed_directory directory:notifier-feeds
raw base_url http://[$${notifier:host}]:$${notifier:port}/get/ raw base_url http://[$${notifier:host}]:$${notifier:port}/get/
raw python_executable ${buildout:executable} raw python_executable ${buildout:executable}
[notifier-feed-status-promise]
<= monitor-promise-base
module = check_command_execute
name = notifier-feed-check-malformed-or-failure.py
config-command = $${notifier-feed-status-promise-bin:rendered}
#---------------- #----------------
#-- #--
#-- Publish instance parameters. #-- Publish instance parameters.
......
...@@ -40,6 +40,7 @@ services = $${rootdirectory:etc}/service ...@@ -40,6 +40,7 @@ services = $${rootdirectory:etc}/service
run = $${rootdirectory:var}/run run = $${rootdirectory:var}/run
scripts = $${rootdirectory:etc}/run scripts = $${rootdirectory:etc}/run
backup = $${rootdirectory:srv}/backup backup = $${rootdirectory:srv}/backup
promises = $${rootdirectory:etc}/promise
services = $${rootdirectory:etc}/service services = $${rootdirectory:etc}/service
cache = $${rootdirectory:var}/cache cache = $${rootdirectory:var}/cache
notifier = $${rootdirectory:etc}/notifier notifier = $${rootdirectory:etc}/notifier
...@@ -151,17 +152,11 @@ name = resilient-notifier-status-feed ...@@ -151,17 +152,11 @@ name = resilient-notifier-status-feed
frequency = */5 * * * * frequency = */5 * * * *
command = $${notifier-resilient-status-feed:wrapper-path} command = $${notifier-resilient-status-feed:wrapper-path}
[notifier-stalled-promise-bin] [notifier-stalled-promise]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
# time-buffer is 24h (+1h of latitude) # time-buffer is 24h (+1h of latitude)
command-line = ${buildout:bin-directory}/check-feed-as-promise --feed-path $${notifier-resilient-status-feed:feed-path} --title --ok-pattern 'OK' --time-buffer 90000 command-line = ${buildout:bin-directory}/check-feed-as-promise --feed-path $${notifier-resilient-status-feed:feed-path} --title --ok-pattern 'OK' --time-buffer 90000
wrapper-path = $${basedirectory:bin}/stalled-notifier-callbacks wrapper-path = $${basedirectory:promises}/stalled-notifier-callbacks
[notifier-stalled-promise-bin]
<= monitor-promise-base
module = check_command_execute
name = stalled-notifier-callbacks.py
config-command = $${notifier-stalled-promise-bin:wrapper-path}
#---------------- #----------------
#-- #--
...@@ -211,11 +206,10 @@ command-line = $${directory:bin}/killpidfromfile $${resilient-sshd-config:path_p ...@@ -211,11 +206,10 @@ command-line = $${directory:bin}/killpidfromfile $${resilient-sshd-config:path_p
wrapper-path = $${basedirectory:scripts}/sshd-graceful wrapper-path = $${basedirectory:scripts}/sshd-graceful
[sshd-promise] [sshd-promise]
<= monitor-promise-base recipe = slapos.cookbook:check_port_listening
module = check_port_listening path = $${basedirectory:promises}/sshd
name = sshd.py hostname = $${slap-network-information:global-ipv6}
config-hostname = $${slap-network-information:global-ipv6} port = $${sshd-port:port}
config-port = $${sshd-port:port}
#---------------- #----------------
#-- #--
...@@ -243,7 +237,7 @@ public-key = $${sshd-raw-server:rsa-keyfile}.pub ...@@ -243,7 +237,7 @@ public-key = $${sshd-raw-server:rsa-keyfile}.pub
private-key = $${sshd-raw-server:rsa-keyfile} private-key = $${sshd-raw-server:rsa-keyfile}
wrapper = $${basedirectory:services}/sshd wrapper = $${basedirectory:services}/sshd
[resilient-sshkeys-sshd-promise-bin] [resilient-sshkeys-sshd-promise]
# Check that public key file exists and is not empty # Check that public key file exists and is not empty
recipe = collective.recipe.template recipe = collective.recipe.template
input = inline:#!${bash:location}/bin/bash input = inline:#!${bash:location}/bin/bash
...@@ -251,34 +245,23 @@ input = inline:#!${bash:location}/bin/bash ...@@ -251,34 +245,23 @@ input = inline:#!${bash:location}/bin/bash
if [[ ! -n "$PUBLIC_KEY_CONTENT" || "$PUBLIC_KEY_CONTENT" == *None* ]]; then if [[ ! -n "$PUBLIC_KEY_CONTENT" || "$PUBLIC_KEY_CONTENT" == *None* ]]; then
exit 1 exit 1
fi fi
output = $${basedirectory:bin}/public-key-existence output = $${basedirectory:promises}/public-key-existence
mode = 700 mode = 700
[resilient-sshkeys-sshd-promise]
<= monitor-promise-base
module = check_command_execute
name = public-key-existence.py
config-command = $${resilient-sshkeys-sshd-promise-bin:output}
#---------------- #----------------
#-- #--
#-- Promises #-- Promises
[notifier-feed-status-promise-bin] [notifier-feed-status-promise]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${notifier-feed-promise-template:target} template = ${notifier-feed-promise-template:target}
rendered = $${basedirectory:bin}/notifier-feed-check-malformed-or-failure.py rendered = $${basedirectory:promises}/notifier-feed-check-malformed-or-failure.py
mode = 700 mode = 700
context = context =
key notifier_feed_directory directory:notifier-feeds key notifier_feed_directory directory:notifier-feeds
raw base_url http://[$${notifier:host}]:$${notifier:port}/get/ raw base_url http://[$${notifier:host}]:$${notifier:port}/get/
raw python_executable ${buildout:executable} raw python_executable ${buildout:executable}
[notifier-feed-status-promise]
<= monitor-promise-base
module = check_command_execute
name = notifier-feed-check-malformed-or-failure.py
config-command = $${notifier-feed-status-promise-bin:rendered}
#---------------- #----------------
#-- #--
#-- Connection informations to re-use. #-- Connection informations to re-use.
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory} home = ${buildout:directory}
etc = ${:home}/etc etc = ${:home}/etc
promise = ${:etc}/promise
## Tells the Backupable recipe that we want a backup ## Tells the Backupable recipe that we want a backup
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment