Commit 34362dba authored by Xavier Thompson's avatar Xavier Thompson

WIP theia resilient: WIP write export script

parent e2793160
......@@ -15,7 +15,7 @@
[instance.cfg]
filename = instance.cfg.in
md5sum = df9548360119b698568694a037ec9c76
md5sum = 65b944814af14846eeb71c125a2ac1cf
[instance-theia.cfg.jinja2.in]
filename = instance-theia.cfg.jinja2.in
......@@ -23,11 +23,11 @@ md5sum = be9b217852da24d31ccc6d7c7a26a828
[instance-theia-import.cfg.in]
filename = instance-theia-import.cfg.in
md5sum = 56c5abad2384e82f83ae8f357d6bc4c0
md5sum = 67b3b35208bbd7d5c66cd9e692189e90
[instance-theia-export.cfg.in]
filename = instance-theia-export.cfg.in
md5sum = 84639ad3d48b864e5ed1a5456b6a4754
md5sum = e11eb44361e5aa2ffeaece27010aa1a7
[instance-theia-resilient.cfg.jinja2]
filename = instance-theia-resilient.cfg.jinja2
......
......@@ -12,19 +12,45 @@ parts +=
$${:theia-environment-parts}
publish-connection-parameter
# The resilient stack makes the 'resilient' instance
# request the 'export' instance with a 'namebase' parameter.
# The export template then expects to receive it in
# slap-parameter:namebase
[slap-parameter]
namebase = ${slap-configuration:configuration.namebase}
# Change frontend name to help disambiguation
[apache-frontend]
name = Theia Export Frontend
# The resilient stack periodically calls exporter:wrapper
# and then notifies the pull-backup instance that data is ready
# to be pulled from the export instance.
[exporter]
recipe = slapos.cookbook:wrapper
command-line = echo "hello"
command-line = $${theia-exporter-args-script:rendered}
wrapper-path = $${directory:bin}/$${slap-parameter:namebase}-exporter
# wrapper parameter is needed by resilient stack
wrapper = $${:wrapper-path}
[transfer-args]
src = $${directory:srv}
dest = $${directory:backup}
include = $${directory:project}/src
exclude = *.1
[theia-exporter-args-script]
recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/$${:_buildout_section_name_}
mode = 0700
template =
inline:#!${software-info:bash}
exec ${software-info:python} ${software-info:transfer} \
--src $${directory:srv} \
--dest $${directory:backup} \
--include $${directory:project}/src \
--exclude *.1
# Extends publish section with resilient parameters
[publish-connection-parameter]
<= resilient-publish-connection-parameter
......@@ -20,6 +20,10 @@ namebase = ${slap-configuration:configuration.namebase}
[instance-parameter]
configuration.autorun = disabled
# Change frontend name to help disambiguation
[apache-frontend]
name = Theia Import Frontend
# The resilient stack calls importer:wrapper when the import instance
# is notified that the backup files have just been pushed to it.
[importer]
......
......@@ -29,6 +29,11 @@ pull-backup = template-pull-backup:rendered
theia-resilient = theia-resilient:rendered
RootSoftwareInstance = $${:default}
[software-info]
python = ${python:location}/bin/python
bash = ${bash:location}/bin/bash
transfer = ${transfer.py:output}
[template-base]
recipe = slapos.recipe.template
output = $${buildout:directory}/$${:filename}
......
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