Commit 033eb157 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

Introduce basic resiliency for slaprunner

parent 93c590d6
...@@ -5,8 +5,10 @@ extends = ...@@ -5,8 +5,10 @@ extends =
../../component/dropbear/buildout.cfg ../../component/dropbear/buildout.cfg
../../component/git/buildout.cfg ../../component/git/buildout.cfg
../../component/lxml-python/buildout.cfg ../../component/lxml-python/buildout.cfg
../../component/rsync/buildout.cfg
../../stack/flask.cfg ../../stack/flask.cfg
../../stack/shacache-client.cfg ../../stack/shacache-client.cfg
../../stack/resilient/buildout.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
parts = parts =
...@@ -14,18 +16,47 @@ parts = ...@@ -14,18 +16,47 @@ parts =
slapos-cookbook slapos-cookbook
eggs eggs
instance-runner-import
instance-runner-export
[template] [template]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg output = ${buildout:directory}/template.cfg
mode = 0644 mode = 0644
md5sum = 5307e4200f044ae57b504ad68444491c #md5sum = 5307e4200f044ae57b504ad68444491c
[template-runner] [template-runner]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner.cfg url = ${:_profile_base_location_}/instance-runner.cfg
output = ${buildout:directory}/template-runner.cfg output = ${buildout:directory}/template-runner.cfg
md5sum = 91d6550c43b7a43a999724af4650ae40 #md5sum = 91d6550c43b7a43a999724af4650ae40
mode = 0644
[instance-resilient]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance-resilient.cfg.jinja2
rendered = ${buildout:directory}/instance-resilient.cfg
context = key buildout buildout:bin-directory
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
import-list = file parts template-parts:destination
file replicated template-replicated:destination
mode = 0644
[instance-runner-import]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner-import.cfg.in
output = ${buildout:directory}/instance-runner-import.cfg
mode = 0644
[instance-runner-export]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner-export.cfg.in
output = ${buildout:directory}/instance-runner-export.cfg
mode = 0644 mode = 0644
[eggs] [eggs]
......
# vim: set ft=cfg:
{% import 'parts' as parts %}
{% import 'replicated' as replicated %}
[buildout]
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
# += because we need to take up parts (like instance-custom, slapmonitor etc) from the profile we extended
parts +=
{{ parts.replicate("runner", "3") }}
publish-connection-informations
{{ replicated.replicate("runner", "3", "runner-export", "runner-import") }}
# Bubble up the parameters
[request-runner]
return = url ssh-public-key ssh-url notification-id ip backend_url url cloud9_url ssh_command password_recovery_code
[publish-connection-informations]
recipe = slapos.cookbook:publish
backend_url = ${request-runner:connection-backend_url}
url = ${request-runner:connection-url}
cloud9_url = ${request-runner:connection-cloud9_url}
ssh_command = ${request-runner:connection-ssh_command}
password_recovery_code = ${request-runner:connection-password_recovery_code}
[buildout]
extends = ${template-runner:output}
${pbsready-export:output}
parts +=
urls
slaprunner
cron-entry-backup
[exporter]
recipe = slapos.cookbook:slaprunner.export
wrapper = $${directory:bin}/$${slap-parameter:namebase}-exporter
srv-directory = $${directory:srv}
backup-directory = $${directory:backup}
shell-binary = ${dash:location}/bin/dash
# Extends publish section with resilient parameters
[urls]
<= resilient-publish-connection-parameter
backend_url = $${slaprunner:access-url}
url = $${request-frontend:connection-site_url}
cloud9_url = $${cloud9:access-url}
ssh_command = ssh $${dropbear-server:host} -p $${dropbear-server:port}
password_recovery_code = $${recovery-code:passwd}
[buildout]
extends = ${template-runner:output}
${pbsready-import:output}
parts +=
slaprunner
# have to repeat the next one, as it's not inherited from pbsready-import
import-on-notification
[importer]
recipe = slapos.cookbook:slaprunner.import
wrapper = $${directory:bin}/$${slap-parameter:namebase}-exporter
srv-directory = $${directory:srv}
backup-directory = $${directory:backup}
shell-binary = ${dash:location}/bin/dash
\ No newline at end of file
...@@ -9,3 +9,10 @@ offline = true ...@@ -9,3 +9,10 @@ offline = true
[switch_softwaretype] [switch_softwaretype]
recipe = slapos.cookbook:softwaretype recipe = slapos.cookbook:softwaretype
default = ${template-runner:output} default = ${template-runner:output}
resilient = ${instance-resilient:rendered}
runner = ${template-runner:output}
runner-import = ${instance-runner-import:output}
runner-export = ${instance-runner-export:output}
frozen = ${instance-frozen:output}
pull-backup = ${template-pull-backup:output}
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# 2/ Define list of trusted certificates for the cache. # 2/ Define list of trusted certificates for the cache.
[buildout] [buildout]
extends = common.cfg extends = development.cfg
[networkcache] [networkcache]
# signature certificates of the following uploaders. # signature certificates of the following uploaders.
...@@ -57,7 +57,7 @@ plone.recipe.command = 1.1 ...@@ -57,7 +57,7 @@ plone.recipe.command = 1.1
pycrypto = 2.6 pycrypto = 2.6
pytz = 2012j pytz = 2012j
slapos.cookbook = 0.71.1 slapos.cookbook = 0.71.1
slapos.core = 0.34 slapos.core = 0.35.1
slapos.libnetworkcache = 0.13.4 slapos.libnetworkcache = 0.13.4
slapos.recipe.build = 0.11.5 slapos.recipe.build = 0.11.5
slapos.recipe.template = 2.4.2 slapos.recipe.template = 2.4.2
......
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