Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Gabriel Monnerat
slapos
Commits
168ac91f
Commit
168ac91f
authored
Nov 14, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resilient: transform pbsready-export template into a Jinja template
parent
e630b82a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
22 deletions
+40
-22
stack/resilient/buildout.cfg
stack/resilient/buildout.cfg
+11
-3
stack/resilient/pbsready-export.cfg.in
stack/resilient/pbsready-export.cfg.in
+19
-19
stack/resilient/template-resilient-templates.cfg.in
stack/resilient/template-resilient-templates.cfg.in
+10
-0
No files found.
stack/resilient/buildout.cfg
View file @
168ac91f
...
@@ -56,10 +56,10 @@ mode = 0644
...
@@ -56,10 +56,10 @@ mode = 0644
[pbsready-export]
[pbsready-export]
# An export instance has an exporter script, and communicates
# An export instance has an exporter script, and communicates
# to parent PBS instances to deliver the exported dump.
# to parent PBS instances to deliver the exported dump.
recipe = slapos.recipe.
template
recipe = slapos.recipe.
build:download
url = ${:_profile_base_location_}/pbsready-export.cfg.in
url = ${:_profile_base_location_}/pbsready-export.cfg.in
output = ${buildout:directory}/pbsready-export.cfg
filename = pbsready-export.cfg.in
md5sum =
7539454fff5b9d271acf06615f333653
md5sum =
6f912998b88de02ef52660e4a9c336f2
mode = 0644
mode = 0644
[template-pull-backup]
[template-pull-backup]
...
@@ -83,6 +83,14 @@ md5sum = 071b1034ee8f5cc14f79b16fdeba2813
...
@@ -83,6 +83,14 @@ md5sum = 071b1034ee8f5cc14f79b16fdeba2813
mode = 0644
mode = 0644
destination = ${buildout:directory}/template-parts.cfg.in
destination = ${buildout:directory}/template-parts.cfg.in
[template-resilient-templates]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}.in
output = ${buildout:directory}/${:filename}
md5sum = be2ebf91faa6b5b131995a05a907707f
mode = 0644
filename = template-resilient-templates.cfg
[instance-frozen]
[instance-frozen]
# When an instance is detected as broken, its software type is changed to "frozen".
# When an instance is detected as broken, its software type is changed to "frozen".
# On the next run of slapgrid-cp, the buildout profile is replaced by instance-frozen.cfg,
# On the next run of slapgrid-cp, the buildout profile is replaced by instance-frozen.cfg,
...
...
stack/resilient/pbsready-export.cfg.in
View file @
168ac91f
[buildout]
[buildout]
extends =
${pbsready:output
}
extends =
{{ pbsready_template_path }
}
# Explicitely define extended parts from pbsready
# Explicitely define extended parts from pbsready
# then add local parts
# then add local parts
...
@@ -27,9 +27,9 @@ parts =
...
@@ -27,9 +27,9 @@ parts =
[resilient-directory]
[resilient-directory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
home = $
$
{buildout:directory}
home = ${buildout:directory}
var = $
$
{:home}/var
var = ${:home}/var
pid = $
$
{:var}/pid
pid = ${:var}/pid
# Define port of ssh server. It has to be different from import so that it
# Define port of ssh server. It has to be different from import so that it
# supports export/import using same IP (slaprunner, slapos-in-partition,
# supports export/import using same IP (slaprunner, slapos-in-partition,
...
@@ -38,16 +38,16 @@ pid = $${:var}/pid
...
@@ -38,16 +38,16 @@ pid = $${:var}/pid
recipe = slapos.cookbook:free_port
recipe = slapos.cookbook:free_port
minimum = 22200
minimum = 22200
maximum = 22209
maximum = 22209
ip = $
$
{slap-network-information:global-ipv6}
ip = ${slap-network-information:global-ipv6}
[notifier-port]
[notifier-port]
recipe = slapos.cookbook:free_port
recipe = slapos.cookbook:free_port
minimum = 65526
minimum = 65526
maximum = 65535
maximum = 65535
ip = $
$
{notifier:host}
ip = ${notifier:host}
[resilient-publish-connection-parameter]
[resilient-publish-connection-parameter]
notification-id = http://[$
${notifier:host}]:$${notifier:port}/get/$
${notifier-exporter:name}
notification-id = http://[$
{notifier:host}]:${notifier:port}/get/
${notifier-exporter:name}
-extends = publish-early
-extends = publish-early
[notifier-exporter]
[notifier-exporter]
...
@@ -56,27 +56,27 @@ notification-id = http://[$${notifier:host}]:$${notifier:port}/get/$${notifier-e
...
@@ -56,27 +56,27 @@ notification-id = http://[$${notifier:host}]:$${notifier:port}/get/$${notifier-e
<= notifier
<= notifier
recipe = slapos.cookbook:notifier.notify
recipe = slapos.cookbook:notifier.notify
name = exporter
name = exporter
title = Dumping $
$
{slap-parameter:namebase}
title = Dumping ${slap-parameter:namebase}
executable = $
$
{exporter:wrapper}
executable = ${exporter:wrapper}
wrapper = $
$
{rootdirectory:bin}/exporter
wrapper = ${rootdirectory:bin}/exporter
notify = $
$
{slap-parameter:notify}
notify = ${slap-parameter:notify}
pidfile = $
${resilient-directory:pid}/$
${:name}.pid
pidfile = $
{resilient-directory:pid}/
${:name}.pid
max-run = 3
max-run = 3
[logrotate-entry-notifier]
[logrotate-entry-notifier]
output = $
$
{rootdirectory:etc}/logrotate_notifier.conf
output = ${rootdirectory:etc}/logrotate_notifier.conf
[notifier-exporter-promise]
[notifier-exporter-promise]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
mode = 700
mode = 700
template = inline:
template = inline:
#!
${bash:location}/bin/bash
#!
{{ bash_executable_location }}
EXPORTER_FEED="$
$
{notifier-exporter:log-file}"
EXPORTER_FEED="${notifier-exporter:log-file}"
FAILURE_PATTERN="FAILURE"
FAILURE_PATTERN="FAILURE"
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 = ${basedirectory:promises}/exporter-status
[cron-entry-backup]
[cron-entry-backup]
# Schedule the periodic database dump.
# Schedule the periodic database dump.
...
@@ -88,12 +88,12 @@ name = backup
...
@@ -88,12 +88,12 @@ name = backup
{% if resiliency_backup_periodicity %}
{% if resiliency_backup_periodicity %}
frequency = {{ resiliency_backup_periodicity }}
frequency = {{ resiliency_backup_periodicity }}
{% else %}
{% else %}
time = $
$
{publish-early:resiliency-backup-periodicity}
time = ${publish-early:resiliency-backup-periodicity}
{% endif %}
{% endif %}
command =
${logrotate:location}/sbin/logrotate -s $${basedirectory:run}/logrotate.status $${logrotate-entry-notifier:output}; $
${notifier-exporter:wrapper} --transaction-id `date +%s`
command =
{{ logrotate_executable_location }} -s ${basedirectory:run}/logrotate.status ${logrotate-entry-notifier:output};
${notifier-exporter:wrapper} --transaction-id `date +%s`
[gen-resiliency-backup-periodicity]
[gen-resiliency-backup-periodicity]
recipe = slapos.cookbook:
cron.
random.time
recipe = slapos.cookbook:random.time
[publish-early]
[publish-early]
recipe = slapos.cookbook:publish-early
recipe = slapos.cookbook:publish-early
...
...
stack/resilient/template-resilient-templates.cfg.in
0 → 100644
View file @
168ac91f
[template-pbsready-export]
recipe = slapos.recipe.template:jinja2
template = ${pbsready-export:target}
rendered = $${buildout:directory}/pbsready-exporter.cfg
mode = 640
context =
key slapparameter_dict slap-configuration:configuration
raw pbsready_template_path ${pbsready:output}
raw bash_executable_location ${bash:location}/bin/bash
raw logrotate_executable_location ${logrotate:location}/sbin/logrotate
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