Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos-caddy
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Guillaume Hervier
slapos-caddy
Commits
9aa8e069
Commit
9aa8e069
authored
Sep 02, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resilient: pbs push/pull scripts now publish in a RSS feed every action started and their result
parent
c84fb2f8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
3 deletions
+31
-3
slapos/recipe/notifier.py
slapos/recipe/notifier.py
+9
-1
slapos/recipe/pbs.py
slapos/recipe/pbs.py
+4
-1
stack/resilient/buildout.cfg
stack/resilient/buildout.cfg
+1
-1
stack/resilient/instance-pull-backup.cfg.in
stack/resilient/instance-pull-backup.cfg.in
+17
-0
No files found.
slapos/recipe/notifier.py
View file @
9aa8e069
...
...
@@ -73,7 +73,8 @@ class Notify(GenericBaseRecipe):
self
.
options
=
options
def
createNotifier
(
self
,
notifier_binary
,
wrapper
,
executable
,
log
,
title
,
notification_url
,
feed_url
,
pidfile
=
None
):
log
,
title
,
notification_url
,
feed_url
,
pidfile
=
None
,
instance_root_name
=
None
,
log_url
=
None
,
status_item_directory
=
None
):
if
not
os
.
path
.
exists
(
log
):
# Just a touch
...
...
@@ -87,6 +88,13 @@ class Notify(GenericBaseRecipe):
]
parameters
.
extend
(
notification_url
.
split
(
' '
))
parameters
.
extend
([
'--executable'
,
executable
])
# For a more verbose mode, writing feed items for any action
if
instance_root_name
and
log_url
and
status_item_directory
:
parameters
.
extend
([
'--instance-root-name'
,
instance_root_name
,
'--log-url'
,
log_url
,
'--status-item-directory'
,
status_item_directory
,
])
return
self
.
createWrapper
(
name
=
wrapper
,
command
=
notifier_binary
,
...
...
slapos/recipe/pbs.py
View file @
9aa8e069
...
...
@@ -295,7 +295,10 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
title
=
entry
.
get
(
'title'
,
slave_id
),
notification_url
=
entry
[
'notify'
],
feed_url
=
'%s/get/%s'
%
(
self
.
options
[
'notifier-url'
],
entry
[
'notification-id'
]),
pidfile
=
os
.
path
.
join
(
self
.
options
[
'run-directory'
],
'%s.pid'
%
slave_id
)
pidfile
=
os
.
path
.
join
(
self
.
options
[
'run-directory'
],
'%s.pid'
%
slave_id
),
instance_root_name
=
self
.
options
.
get
(
'instance-root-name'
,
None
),
log_url
=
self
.
options
.
get
(
'log-url'
,
None
),
status_item_directory
=
self
.
options
.
get
(
'status-item-directory'
,
None
)
)
path_list
.
append
(
notifier_wrapper
)
...
...
stack/resilient/buildout.cfg
View file @
9aa8e069
...
...
@@ -66,7 +66,7 @@ mode = 0644
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-pull-backup.cfg.in
output = ${buildout:directory}/instance-pull-backup.cfg
md5sum =
5446135c3c2caa1405cf2f29d8f12b46
md5sum =
f3fd62d6b1247affa1b1ed5cf1547240
mode = 0644
[template-replicated]
...
...
stack/resilient/instance-pull-backup.cfg.in
View file @
9aa8e069
...
...
@@ -11,6 +11,7 @@ parts =
backup-transfer-integrity-promise
resilient-genstatrss-wrapper
pbs-push-history-log
cron-pbs-status-feed
## Monitor for pbs
monitor-base
...
...
@@ -59,6 +60,7 @@ pbs-wrappers = $${rootdirectory:bin}/pbs
dot-ssh = $${basedirectory:ssh-home}/.ssh
notifier-feeds = $${basedirectory:notifier}/feeds
notifier-callbacks = $${basedirectory:notifier}/callbacks
notifier-status-items = $${basedirectory:notifier}/status-items
#----------------
...
...
@@ -128,7 +130,22 @@ run-directory = $${basedirectory:run}
notifier-url = http://[$${notifier:host}]:$${notifier:port}
slave-instance-list = $${slap-parameter:slave_instance_list}
ignore-known-hosts-file = $${slap-parameter:ignore-known-hosts-file}
# To get a verbose feed about PBS state
instance-root-name = $${instance-info-parameters:root-name}
log-url = $${publish:monitor-base-url}/private/notifier/
status-item-directory = $${directory:notifier-status-items}
[pbs-resilient-status-feed]
recipe = slapos.cookbook:wrapper
command-line = ${buildout:directory}/bin/generateFeed --output $${monitor-directory:private}/pbs-status.rss --status-item-path $${pbs:status-item-directory} --title "Status feed for $${instance-info-parameters:root-name}-PBS" --link $${pbs:log-url}
wrapper-path = $${rootdirectory:bin}/resilient-genstatusrss.py
[cron-pbs-status-feed]
<= cron
recipe = slapos.cookbook:cron.d
name = resilient-pbs-status-feed
frequency = 5 * * * *
command = $${pbs-resilient-status-feed:wrapper-path}
#----------------
#--
...
...
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