Commit 88fa3070 authored by Xavier Thompson's avatar Xavier Thompson

software/theia: Add resilience

parent eb5d675c
......@@ -13,9 +13,25 @@
# section inheritance (< = ...) are NOT supported (but you should really
# not need these here).
[instance]
[instance.cfg]
filename = instance.cfg.in
md5sum = 4f119df2b2d71e5ec1fd04051fd8fff8
md5sum = df9548360119b698568694a037ec9c76
[instance-theia.cfg.jinja2.in]
filename = instance-theia.cfg.jinja2.in
md5sum = 3ce9e1c54943840b0e363764bf28111e
[instance-theia-import.cfg.in]
filename = instance-theia-import.cfg.in
md5sum = 45ef2827041459f897f9e9c45eb44832
[instance-theia-export.cfg.in]
filename = instance-theia-export.cfg.in
md5sum = 9feb1a143fe70b70dda222d752315e13
[instance-theia-resilient.cfg.jinja2]
filename = instance-theia-resilient.cfg.jinja2
md5sum = 388ef606ccbc6d543685a53b18eb7369
[yarn.lock]
filename = yarn.lock
......
[buildout]
extends = ${theia:rendered}
${template-pbsready-export:rendered}
parts += $${:theia-parts}
[slap-parameter]
namebase = ${slap-configuration:configuration.namebase}
[exporter]
recipe = slapos.cookbook:wrapper
command-line = echo "hello"
wrapper-path = $${directory:bin}/$${slap-parameter:namebase}-exporter
# wrapper parameter is needed by resilience stack
wrapper = $${:wrapper-path}
# Extends publish section with resilient parameters
[publish-connection-parameter]
<= resilient-publish-connection-parameter
[buildout]
extends = ${theia:rendered}
${template-pbsready-import:rendered}
parts += $${:theia-parts}
[slap-parameter]
namebase = ${slap-configuration:configuration.namebase}
[importer]
recipe = slapos.cookbook:wrapper
command-line = echo "goodbye"
wrapper-path = $${directory:bin}/$${slap-parameter:namebase}-exporter
# wrapper parameter is needed by resilience stack
wrapper = $${:wrapper-path}
{% import 'parts' as parts %}
{% import 'replicated' as replicated with context %}
{% set number_of_instances = slapparameter_dict.get('resilient-clone-number', 1)|int %}
[buildout]
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
extends =
{{ monitor_template }}
parts +=
# Generate the parts to request theia-export, pull-backup and theia-import
# See stack/resilient/template-parts.cfg.in and stack/resilient/template-replicated.cfg.in
# See below for the generation of the sections corresponding to the parts generated here
{{ parts.replicate("theia", number_of_instances + 1) }}
# Also publish some connection parameters
publish-connection-parameter
[ArgLeader]
[ArgBackup]
# Generate sections to request theia-export, pull-backup and theia-import
# See stack/resilient/template-replicated.cfg.in
# In particular:
#
# [request-theia]
# <= ArgLeader
# ...
#
# [request-theia-pseudo-replicating-1]
# <= ArgBackup
# ...
#
# [request-pbs-theia-1]
# ...
#
{{ replicated.replicate("theia", number_of_instances + 1,
"theia-export", "theia-import",
"ArgLeader", "ArgBackup",
slapparameter_dict=slapparameter_dict) }}
# Extend the list of return parameters for the theia-export request
[request-theia]
return += url username password
# Publish some parameters from the theia-export instance
[publish-connection-parameter]
recipe = slapos.cookbook:publish
url = ${request-theia:connection-url}
username = ${request-theia:connection-username}
password = ${request-theia:connection-password}
This diff is collapsed.
This diff is collapsed.
......@@ -15,6 +15,7 @@ extends =
../../component/fonts/buildout.cfg
../../stack/slapos.cfg
../../stack/monitor/buildout.cfg
../../stack/resilient/buildout.cfg
../../component/defaults.cfg
./download-plugins.cfg
./buildout.hash.cfg
......@@ -22,7 +23,14 @@ extends =
parts =
theia-wrapper
slapos-cookbook
instance
instance-theia.cfg.jinja2.in
instance-theia-import.cfg.in
instance-theia-export.cfg.in
instance-theia-resilient.cfg.jinja2
instance.cfg
# XXX: we have to manually add this for resilience
rdiff-backup
# pbs-recipe-egg
# default for slapos-standalone
shared-part-list =
......@@ -157,6 +165,15 @@ url = ${:_profile_base_location_}/${:filename}
output = ${buildout:parts-directory}/${:_buildout_section_name_}
mode = 0644
[download-base]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
destination = ${buildout:directory}
download-only = true
ignore-existing = true
output = ${:destination}/${:filename}
mode = 0644
[python-language-server]
version = 0.19.0
recipe = plone.recipe.command
......@@ -326,6 +343,19 @@ template =
exec ${yarn:location}/bin/yarn theia start $@
[instance]
[instance.cfg]
<= template-base
output = ${buildout:directory}/instance.cfg
[instance-theia.cfg.jinja2.in]
<= template-base
output = ${buildout:directory}/instance-theia.cfg.jinja2
[instance-theia-import.cfg.in]
<= download-base
[instance-theia-export.cfg.in]
<= download-base
[instance-theia-resilient.cfg.jinja2]
<= download-base
......@@ -253,3 +253,21 @@ We can find 2 kinds of magic keys:
* id : example, in "-sla-2-foo" 2 is the magic key and the parameter will be used for each request with id 2 (in case of kvm: kvm2 and PBS 2)
* nameid : example, in "-sla-kvm2-foo", foo will be used for kvm2 request. Name for pbs is "pbs" -> "-sla-pbs2-foo".
IMPORTANT NOTE: in case the same foo parameter is asked for the group, the nameid key prevail
Documentation Edits
-------------------
- slap-parameter required by import and export
- export / import template names have changed: template-pbsready-import / template-pbsready-export
- slap-configuration required by switch_softwareype
- resilient jinja required importing parts and replicate
- resilient jinja template requires ext.do
- exporter:wrapper and importer:wrapper required by resilient stack (path of wrapper)
- rdiff-backup
- pbs-recipe-egg ??
Changes
-------
- template-replicated.cfg.in: Add optional leaderReturn option ??? => need to access the parameter after anyway so no
\ No newline at end of file
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