Commit 38ac3e3d authored by Rafael Monnerat's avatar Rafael Monnerat

slaprunner: Add slapformat to supervisord

   This would allow the webrunner invoke it to bootstrap the instance
   rather them create the folders manually.
parent a13739c2
...@@ -18,7 +18,7 @@ md5sum = 8d6878ff1d2e75010c50a1a2b0c13b24 ...@@ -18,7 +18,7 @@ md5sum = 8d6878ff1d2e75010c50a1a2b0c13b24
[template-runner] [template-runner]
filename = instance-runner.cfg filename = instance-runner.cfg
md5sum = 73f8d2e4dda8f46b83cb45cacd7434f7 md5sum = 00915c7ad17e335c87be40bae4bd0cfb
[template-runner-import-script] [template-runner-import-script]
filename = template/runner-import.sh.jinja2 filename = template/runner-import.sh.jinja2
...@@ -66,7 +66,7 @@ md5sum = 7645048216fcf957f7773534cd0408dc ...@@ -66,7 +66,7 @@ md5sum = 7645048216fcf957f7773534cd0408dc
[template-supervisord] [template-supervisord]
filename = template/supervisord.conf.in filename = template/supervisord.conf.in
md5sum = 28f69b57c2835bddfcfbe312563eef51 md5sum = 37f053d75752e998fc3bb9e4bf29d776
[template-listener-slapgrid] [template-listener-slapgrid]
filename = template/listener_slapgrid.py.in filename = template/listener_slapgrid.py.in
......
...@@ -677,7 +677,6 @@ context = ...@@ -677,7 +677,6 @@ context =
import codecs codecs import codecs codecs
raw buildout_shared_part_list_dump $${slaprunner:buildout-shared-part-list-dump} raw buildout_shared_part_list_dump $${slaprunner:buildout-shared-part-list-dump}
[shellinabox] [shellinabox]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
# We cannot use slapos.cookbook:wrapper here because this recipe escapes too much # We cannot use slapos.cookbook:wrapper here because this recipe escapes too much
...@@ -791,6 +790,10 @@ slapproxy-autostart = true ...@@ -791,6 +790,10 @@ slapproxy-autostart = true
slapproxy-startsecs = 1 slapproxy-startsecs = 1
slapproxy-command = $${slaprunner:slapos} proxy start --logfile $${:slapproxy-log} --cfg $${:slapos-cfg} slapproxy-command = $${slaprunner:slapos} proxy start --logfile $${:slapproxy-log} --cfg $${:slapos-cfg}
slapproxy-log = $${directory:log}/slapproxy.log slapproxy-log = $${directory:log}/slapproxy.log
slapformat = slapformat
slapformat-command = $${slaprunner:slapos} node format --cfg $${:slapos-cfg} --verbose --logfile $${:slapformat-log} --now -i $${:slapformat-definition.cfg}
slapformat-log = $${directory:log}/slapos-node-format.log
slapformat-startretries = 0
socket_name = unix://$${:socket_path} socket_name = unix://$${:socket_path}
socket_path = $${directory:tmp}/supervisord.sock socket_path = $${directory:tmp}/supervisord.sock
startsecs = 0 startsecs = 0
...@@ -798,6 +801,7 @@ startsecs = 0 ...@@ -798,6 +801,7 @@ startsecs = 0
# Processes should handle their logs by themselves # Processes should handle their logs by themselves
stderr_logfile = $${directory:log}/supervisord-errors.log stderr_logfile = $${directory:log}/supervisord-errors.log
slapos-cfg = $${slaprunner:slapos.cfg} slapos-cfg = $${slaprunner:slapos.cfg}
slapformat-definition.cfg = $${slaprunner:slapformat-definition.cfg}
[supervisord-conf] [supervisord-conf]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
......
...@@ -44,6 +44,20 @@ stderr_logfile = {{ supervisord['no_logfile'] }} ...@@ -44,6 +44,20 @@ stderr_logfile = {{ supervisord['no_logfile'] }}
directory = {{ supervisord['directory'] }} directory = {{ supervisord['directory'] }}
environment = PATH="{{- supervisord['path'] -}}" environment = PATH="{{- supervisord['path'] -}}"
[program:{{- supervisord['slapformat'] -}}]
command = {{ supervisord['slapformat-command'] }}
process_name = {{ supervisord['slapformat'] }}
numprocs = {{ supervisord['numprocs'] }}
autostart = {{ supervisord['autostart'] }}
exitcodes = {{ supervisord['exitcodes'] }}
startretries = {{ supervisord['slapformat-startretries'] }}
startsecs = {{ supervisord['startsecs'] }}
autorestart = {{ supervisord['autorestart'] }}
stdout_logfile = {{ supervisord['no_logfile'] }}
stderr_logfile = {{ supervisord['no_logfile'] }}
directory = {{ supervisord['directory'] }}
environment = PATH="{{- supervisord['path'] -}}"
[program:{{- supervisord['slapproxy'] -}}] [program:{{- supervisord['slapproxy'] -}}]
command = {{ supervisord['slapproxy-command'] }} command = {{ supervisord['slapproxy-command'] }}
process_name = {{ supervisord['slapproxy'] }} process_name = {{ supervisord['slapproxy'] }}
......
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