Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos-mynij-dev
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mynij
slapos-mynij-dev
Commits
bd7a1199
Commit
bd7a1199
authored
Nov 22, 2019
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stack/resilient: Fix switch to monitor-promise-base
parent
05c7cc60
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
95 additions
and
38 deletions
+95
-38
stack/resilient/buildout.hash.cfg
stack/resilient/buildout.hash.cfg
+5
-5
stack/resilient/instance-pull-backup.cfg.in
stack/resilient/instance-pull-backup.cfg.in
+16
-6
stack/resilient/pbsready-export.cfg.in
stack/resilient/pbsready-export.cfg.in
+8
-2
stack/resilient/pbsready-import.cfg.in
stack/resilient/pbsready-import.cfg.in
+13
-7
stack/resilient/pbsready.cfg.in
stack/resilient/pbsready.cfg.in
+28
-11
stack/resilient/template-replicated.cfg.in
stack/resilient/template-replicated.cfg.in
+25
-7
No files found.
stack/resilient/buildout.hash.cfg
View file @
bd7a1199
...
@@ -14,23 +14,23 @@
...
@@ -14,23 +14,23 @@
# not need these here).
# not need these here).
[pbsready]
[pbsready]
filename = pbsready.cfg.in
filename = pbsready.cfg.in
md5sum =
f3bf5e1d8bbfbb428c5bbe3a57d8cbe5
md5sum =
5e0dcd4c290f0b46cb2d316dc1c9c011
[pbsready-import]
[pbsready-import]
filename = pbsready-import.cfg.in
filename = pbsready-import.cfg.in
md5sum =
9d36d08ac6ae351b598a67db41657cc
6
md5sum =
d813c43ed00eff868fb13bc75b04533
6
[pbsready-export]
[pbsready-export]
filename = pbsready-export.cfg.in
filename = pbsready-export.cfg.in
md5sum =
c6c11db5372150019debb1ce519b907
d
md5sum =
2e804e06b5203c3f127c31a1704c48b
d
[template-pull-backup]
[template-pull-backup]
filename = instance-pull-backup.cfg.in
filename = instance-pull-backup.cfg.in
md5sum =
57b9b421d233402e6d5177c69cf9567e
md5sum =
f5695e6bcdb2a63a4990fe82b2083def
[template-replicated]
[template-replicated]
filename = template-replicated.cfg.in
filename = template-replicated.cfg.in
md5sum =
7392935be29d89f8224bccac78e3ecd0
md5sum =
290b380fe3da8736642bc10a8b1163d1
[template-parts]
[template-parts]
filename = template-parts.cfg.in
filename = template-parts.cfg.in
...
...
stack/resilient/instance-pull-backup.cfg.in
View file @
bd7a1199
...
@@ -42,7 +42,6 @@ log = $${rootdirectory:var}/log
...
@@ -42,7 +42,6 @@ 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
...
@@ -120,7 +119,6 @@ notifier-binary = ${buildout:bin-directory}/pubsubnotifier
...
@@ -120,7 +119,6 @@ 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}
...
@@ -222,22 +220,34 @@ wrapper-path = $${directory:bin}/resilient-genstatrss.py
...
@@ -222,22 +220,34 @@ 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]
[pull-push-stalled-promise
-bin
]
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:promises
}/stalled-pull-push
wrapper-path = $${
rootdirectory:bin
}/stalled-pull-push
[notifier-feed-status-promise]
[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]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
template = ${notifier-feed-promise-template:target}
template = ${notifier-feed-promise-template:target}
rendered = $${
basedirectory:promises
}/notifier-feed-check-malformed-or-failure.py
rendered = $${
rootdirectory:bin
}/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.
...
...
stack/resilient/pbsready-export.cfg.in
View file @
bd7a1199
...
@@ -46,7 +46,7 @@ max-run = 3
...
@@ -46,7 +46,7 @@ max-run = 3
[logrotate-entry-notifier]
[logrotate-entry-notifier]
rendered = ${rootdirectory:etc}/logrotate_notifier.conf
rendered = ${rootdirectory:etc}/logrotate_notifier.conf
[notifier-exporter-promise]
[notifier-exporter-promise
-bin
]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
mode = 700
mode = 700
template = inline:
template = inline:
...
@@ -56,7 +56,13 @@ template = inline:
...
@@ -56,7 +56,13 @@ template = inline:
if [ -s "$EXPORTER_FEED" ]; then
if [ -s "$EXPORTER_FEED" ]; then
tail -n 1 $EXPORTER_FEED | grep -vq FAILURE_PATTERN
tail -n 1 $EXPORTER_FEED | grep -vq FAILURE_PATTERN
fi
fi
rendered = ${basedirectory:promises}/exporter-status
rendered = ${rootdirectory:bin}/exporter-status
[notifier-exporter-promise]
<= monitor-promise-base
module = check_command_execute
name = exporter-status.py
config-command = ${notifier-exporter-promise-bin:rendered}
[cron-entry-backup]
[cron-entry-backup]
# Schedule the periodic database dump.
# Schedule the periodic database dump.
...
...
stack/resilient/pbsready-import.cfg.in
View file @
bd7a1199
...
@@ -65,7 +65,7 @@ recipe = slapos.cookbook:notifier.callback
...
@@ -65,7 +65,7 @@ recipe = slapos.cookbook:notifier.callback
on-notification-id = $${slap-parameter:on-notification}
on-notification-id = $${slap-parameter:on-notification}
callback = $${post-notification-run:output}
callback = $${post-notification-run:output}
[backup-checksum-integrity-promise]
[backup-checksum-integrity-promise
-bin
]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
template = inline:
template = inline:
#!/${bash:location}/bin/bash
#!/${bash:location}/bin/bash
...
@@ -80,9 +80,16 @@ template = inline:
...
@@ -80,9 +80,16 @@ template = inline:
# If file doesn't exist, promise shouldnt raise false positive
# If file doesn't exist, promise shouldnt raise false positive
exit 0;
exit 0;
fi
fi
rendered = $${
basedirectory:promises
}/backup-checksum-integrity
rendered = $${
rootdirectory:bin
}/backup-checksum-integrity
mode = 700
mode = 700
[backup-checksum-integrity-promise]
<= monitor-promise-base
module = check_command_execute
name = backup-checksum-integrity.py
config-command = $${backup-checksum-integrity-promise-bin:rendered}
###########
###########
# Generate the takeover script
# Generate the takeover script
###########
###########
...
@@ -155,11 +162,10 @@ command-line = $${:apache-executable} -f $${resilient-web-takeover-httpd-configu
...
@@ -155,11 +162,10 @@ command-line = $${:apache-executable} -f $${resilient-web-takeover-httpd-configu
wrapper-path = $${basedirectory:services}/resilient-web-takeover-httpd
wrapper-path = $${basedirectory:services}/resilient-web-takeover-httpd
[resilient-web-takeover-httpd-promise]
[resilient-web-takeover-httpd-promise]
recipe = slapos.cookbook:check_url_available
<= monitor-promise-base
path = $${basedirectory:promises}/resilient-web-takeover-httpd
module = check_url_available
url = http://[$${resilient-web-takeover-httpd-configuration-file:listening-ip}]:$${resilient-web-takeover-httpd-configuration-file:listening-port}/
name = resilient-web-takeover-httpd.py
dash_path = ${dash:location}/bin/dash
config-url = http://[$${resilient-web-takeover-httpd-configuration-file:listening-ip}]:$${resilient-web-takeover-httpd-configuration-file:listening-port}/
curl_path = ${curl:location}/bin/curl
###########
###########
# Symlinks
# Symlinks
...
...
stack/resilient/pbsready.cfg.in
View file @
bd7a1199
...
@@ -40,7 +40,6 @@ services = $${rootdirectory:etc}/service
...
@@ -40,7 +40,6 @@ 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
...
@@ -152,11 +151,17 @@ name = resilient-notifier-status-feed
...
@@ -152,11 +151,17 @@ 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]
[notifier-stalled-promise
-bin
]
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:promises}/stalled-notifier-callbacks
wrapper-path = $${rootdirectory:bin}/stalled-notifier-callbacks
[notifier-stalled-promise]
<= monitor-promise-base
module = check_command_execute
name = stalled-notifier-callbacks.py
config-command = $${notifier-stalled-promise-bin:wrapper-path}
#----------------
#----------------
#--
#--
...
@@ -206,10 +211,11 @@ command-line = $${directory:bin}/killpidfromfile $${resilient-sshd-config:path_p
...
@@ -206,10 +211,11 @@ 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]
recipe = slapos.cookbook:check_port_listening
<= monitor-promise-base
path = $${basedirectory:promises}/sshd
module = check_port_listening
hostname = $${slap-network-information:global-ipv6}
name = sshd.py
port = $${sshd-port:port}
config-hostname = $${slap-network-information:global-ipv6}
config-port = $${sshd-port:port}
#----------------
#----------------
#--
#--
...
@@ -237,7 +243,7 @@ public-key = $${sshd-raw-server:rsa-keyfile}.pub
...
@@ -237,7 +243,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]
[resilient-sshkeys-sshd-promise
-bin
]
# 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
...
@@ -245,23 +251,34 @@ input = inline:#!${bash:location}/bin/bash
...
@@ -245,23 +251,34 @@ 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:promises
}/public-key-existence
output = $${
rootdirectory:bin
}/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]
[notifier-feed-status-promise
-bin
]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
template = ${notifier-feed-promise-template:target}
template = ${notifier-feed-promise-template:target}
rendered = $${
basedirectory:promises
}/notifier-feed-check-malformed-or-failure.py
rendered = $${
rootdirectory:bin
}/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.
...
...
stack/resilient/template-replicated.cfg.in
View file @
bd7a1199
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +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
bin = ${:home}/bin
## Tells the Backupable recipe that we want a backup
## Tells the Backupable recipe that we want a backup
...
@@ -137,7 +137,7 @@ takeover-{{namebase}}-{{id}}-password = ${request-{{namebase}}-pseudo-replicatin
...
@@ -137,7 +137,7 @@ takeover-{{namebase}}-{{id}}-password = ${request-{{namebase}}-pseudo-replicatin
[resilient-request-{{namebase}}-public-key-promise]
[resilient-request-{{namebase}}-public-key-promise
-bin
]
# Check that public-key-value parameter exists and is not empty
# Check that public-key-value parameter exists and is not empty
# XXX: maybe we should consider empty values to be non-nexistent.
# XXX: maybe we should consider empty values to be non-nexistent.
recipe = collective.recipe.template
recipe = collective.recipe.template
...
@@ -147,12 +147,19 @@ input = inline:#!/bin/bash
...
@@ -147,12 +147,19 @@ input = inline:#!/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 = ${resilient-directory:
promise
}/resilient-request-{{namebase}}-public-key
output = ${resilient-directory:
bin
}/resilient-request-{{namebase}}-public-key
mode = 700
mode = 700
[resilient-request-{{namebase}}-public-key-promise]
<= monitor-promise-base
module = check_command_execute
name = resilient-request-{{namebase}}-public-key.py
config-command = ${resilient-request-{{namebase}}-public-key-promise-bin:output}
{% for id in range(1,nbbackup|int) %}
{% for id in range(1,nbbackup|int) %}
[resilient-request-{{namebase}}-pseudo-replicating-{{id}}-public-key-promise]
[resilient-request-{{namebase}}-pseudo-replicating-{{id}}-public-key-promise
-bin
]
# Check that public-key-value parameter exists and is not empty
# Check that public-key-value parameter exists and is not empty
# XXX: maybe we should consider empty values to be non-nexistent.
# XXX: maybe we should consider empty values to be non-nexistent.
recipe = collective.recipe.template
recipe = collective.recipe.template
...
@@ -162,9 +169,15 @@ input = inline:#!/bin/bash
...
@@ -162,9 +169,15 @@ input = inline:#!/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 = ${resilient-directory:
promise
}/resilient-request-{{namebase}}-pseudo-replicating-{{id}}-public-key
output = ${resilient-directory:
bin
}/resilient-request-{{namebase}}-pseudo-replicating-{{id}}-public-key
mode = 700
mode = 700
[resilient-request-{{namebase}}-pseudo-replicating-{{id}}-public-key-promise]
<= monitor-promise-base
module = check_command_execute
name = resilient-request-{{namebase}}-pseudo-replicating-{{id}}-public-key.py
config-command = ${resilient-request-{{namebase}}-pseudo-replicating-{{id}}-public-key-promise-bin:output}
{% endfor %}
{% endfor %}
...
@@ -214,7 +227,7 @@ sla-{{ key }} = {{ value }}
...
@@ -214,7 +227,7 @@ sla-{{ key }} = {{ value }}
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
[resilient-request-pbs-{{namebase}}-{{id}}-public-key-promise]
[resilient-request-pbs-{{namebase}}-{{id}}-public-key-promise
-bin
]
# Check that public-key-value parameter exists and is not empty
# Check that public-key-value parameter exists and is not empty
# XXX: maybe we should consider empty values to be non-nexistent.
# XXX: maybe we should consider empty values to be non-nexistent.
recipe = collective.recipe.template
recipe = collective.recipe.template
...
@@ -224,9 +237,14 @@ input = inline:#!/bin/bash
...
@@ -224,9 +237,14 @@ input = inline:#!/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 = ${resilient-directory:
promise
}/resilient-request-{{namebase}}-pseudo-replicating-{{id}}-public-key
output = ${resilient-directory:
bin
}/resilient-request-{{namebase}}-pseudo-replicating-{{id}}-public-key
mode = 700
mode = 700
[resilient-request-pbs-{{namebase}}-{{id}}-public-key-promise]
<= monitor-promise-base
module = check_command_execute
name = resilient-request-{{namebase}}-pseudo-replicating-{{id}}-public-key
config-command = ${resilient-request-pbs-{{namebase}}-{{id}}-public-key-promise-bin:output}
[request-pull-backup-server-{{namebase}}-{{id}}]
[request-pull-backup-server-{{namebase}}-{{id}}]
<= request-pbs-common
<= request-pbs-common
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment