Commit 98383e9c authored by Nicolas Wavrant's avatar Nicolas Wavrant

slaprunner: adapt the instanciation to correctly extend the resilient stack.

Also, the instance-runner-export template becomes a Jinja template
parent 168ac91f
...@@ -53,7 +53,7 @@ parts = ...@@ -53,7 +53,7 @@ parts =
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
md5sum = 62c2ad4b0e2fe3edad27bdb885dee626 md5sum = 06107f93ebe78905c957a4c4fc4edf16
mode = 0644 mode = 0644
[template-runner] [template-runner]
...@@ -89,10 +89,10 @@ filename = runner-export.sh.jinja2 ...@@ -89,10 +89,10 @@ filename = runner-export.sh.jinja2
mode = 0644 mode = 0644
[instance-runner-export] [instance-runner-export]
recipe = slapos.recipe.template recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-runner-export.cfg.in url = ${:_profile_base_location_}/instance-runner-export.cfg.in
output = ${buildout:directory}/instance-runner-export.cfg filename = instance-runner-export.cfg.in
md5sum = fb0974c51380eef28d4839318e0ef6e2 md5sum = 852a2ed99af566d27e5e4403334a3376
mode = 0644 mode = 0644
[template-resilient] [template-resilient]
......
[buildout] [buildout]
extends = template-runner.cfg extends = {{ template_runner_path }}
pbsready-exporter.cfg {{ pbsready_export_template_path }}
parts += parts +=
nginx_conf nginx_conf
...@@ -41,51 +41,51 @@ parts += ...@@ -41,51 +41,51 @@ parts +=
recipe = slapos.cookbook:free_port recipe = slapos.cookbook:free_port
minimum = 49980 minimum = 49980
maximum = 49989 maximum = 49989
ip = $${slap-network-information:local-ipv4} ip = ${slap-network-information:local-ipv4}
[runner-free-port] [runner-free-port]
recipe = slapos.cookbook:free_port recipe = slapos.cookbook:free_port
minimum = 50005 minimum = 50005
maximum = 50014 maximum = 50014
ip = $${slap-network-information:global-ipv6} ip = ${slap-network-information:global-ipv6}
[slaprunner] [slaprunner]
proxy_port = $${proxy-free-port:port} proxy_port = ${proxy-free-port:port}
runner_port = $${runner-free-port:port} runner_port = ${runner-free-port:port}
[supervisord-free-port] [supervisord-free-port]
recipe = slapos.cookbook:free_port recipe = slapos.cookbook:free_port
minimum = 39986 minimum = 39986
maximum = 39995 maximum = 39995
ip = $${slaprunner:ipv4} ip = ${slaprunner:ipv4}
[supervisord] [supervisord]
port = $${supervisord-free-port:port} port = ${supervisord-free-port:port}
[exporter] [exporter]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${template-runner-export-script:location}/${template-runner-export-script:filename} template = {{ exporter_script_path }}
rendered = $${directory:bin}/$${slap-parameter:namebase}-exporter rendered = ${directory:bin}/${slap-parameter:namebase}-exporter
# backward compatibility for resilient stack # backward compatibility for resilient stack
wrapper = $${:rendered} wrapper = ${:rendered}
mode = 700 mode = 700
context = context =
section directory directory section directory directory
raw output_log_file $${directory:log}/resilient.log raw output_log_file ${directory:log}/resilient.log
raw shell_binary ${bash:location}/bin/bash raw shell_binary {{ bash_executable_location }}
raw rsync_binary ${rsync:location}/bin/rsync raw rsync_binary {{ rsync_executable_location }}
[monitor-httpd-free-port] [monitor-httpd-free-port]
recipe = slapos.cookbook:free_port recipe = slapos.cookbook:free_port
minimum = 8437 minimum = 8437
maximum = 8446 maximum = 8446
ip = $${slap-network-information:global-ipv6} ip = ${slap-network-information:global-ipv6}
[monitor-instance-parameter] [monitor-instance-parameter]
monitor-httpd-port = $${monitor-httpd-free-port:port} monitor-httpd-port = ${monitor-httpd-free-port:port}
# Pass some parameter to dispay in monitoring interface # Pass some parameter to dispay in monitoring interface
instance-configuration = instance-configuration =
httpdcors cors-domain $${slaprunner-httpd-cors:location} $${httpd-graceful-wrapper:output} httpdcors cors-domain ${slaprunner-httpd-cors:location} ${httpd-graceful-wrapper:output}
# Extends publish section with resilient parameters # Extends publish section with resilient parameters
[publish-connection-information] [publish-connection-information]
...@@ -93,11 +93,11 @@ instance-configuration = ...@@ -93,11 +93,11 @@ instance-configuration =
[monitor-check-resilient-feed-file] [monitor-check-resilient-feed-file]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${template-monitor-check-resilient-feed:location}/${template-monitor-check-resilient-feed:filename} template = {{ monitor_check_resilient_feed_template_path }}
rendered = $${monitor-directory:reports}/check-create-resilient-feed-files rendered = ${monitor-directory:reports}/check-create-resilient-feed-files
mode = 700 mode = 700
context = context =
key input_feed_directory directory:notifier-feeds key input_feed_directory directory:notifier-feeds
key monitor_feed_directory monitor-directory:public key monitor_feed_directory monitor-directory:public
raw base_url http://[$${notifier:host}]:$${notifier:port}/get/ raw base_url http://[${notifier:host}]:${notifier:port}/get/
raw python_executable ${buildout:executable} raw python_executable ${buildout:executable}
[buildout] [buildout]
parts = parts =
template-pbsready-export
switch_softwaretype switch_softwaretype
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
extends = ${template-resilient-templates:output}
[switch_softwaretype] [switch_softwaretype]
recipe = slapos.cookbook:softwaretype recipe = slapos.cookbook:softwaretype
default = $${instance-base-runner:rendered} default = $${instance-base-runner:rendered}
...@@ -13,7 +14,7 @@ resilient = $${instance-resilient:rendered} ...@@ -13,7 +14,7 @@ resilient = $${instance-resilient:rendered}
test = $${instance-resilient-test:rendered} test = $${instance-resilient-test:rendered}
runner = $${instance-base-runner:rendered} runner = $${instance-base-runner:rendered}
runner-import = ${instance-runner-import:output} runner-import = ${instance-runner-import:output}
runner-export = ${instance-runner-export:output} runner-export = $${template-runner-export:rendered}
frozen = ${instance-frozen:output} frozen = ${instance-frozen:output}
pull-backup = ${template-pull-backup:output} pull-backup = ${template-pull-backup:output}
...@@ -59,13 +60,19 @@ context = ...@@ -59,13 +60,19 @@ context =
key slapparameter_dict slap-configuration:configuration key slapparameter_dict slap-configuration:configuration
mode = 0644 mode = 0644
[template-pbsready-export] [template-runner-export]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${pbsready-export:output} template = ${instance-runner-export:target}
rendered = $${buildout:directory}/pbsready-exporter.cfg rendered = $${buildout:directory}/instance-runner-export.cfg
mode = 640 mode = 640
context = context =
key slapparameter_dict slap-configuration:configuration key pbsready_export_template_path template-pbsready-export:rendered
key template_runner_path instance-base-runner:rendered
raw exporter_script_path ${template-runner-export-script:location}/${template-runner-export-script:filename}
raw monitor_check_resilient_feed_template_path ${template-monitor-check-resilient-feed:location}/${template-monitor-check-resilient-feed:filename}
raw buildout_executable_location ${buildout:executable}
raw bash_executable_location ${bash:location}/bin/bash
raw rsync_executable_location ${rsync:location}/bin/rsync
[slap-configuration] [slap-configuration]
recipe = slapos.cookbook:slapconfiguration recipe = slapos.cookbook:slapconfiguration
......
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