runner: new promise checking that supervisord service is running
[slapos.git] / software / slaprunner / instance-runner.cfg
1 [buildout]
2 parts =
3   nginx_conf
4   nginx-launcher
5   certificate-authority
6   ca-nginx
7   ca-shellinabox
8   gunicorn-launcher
9   gunicorn-graceful
10   sshkeys-dropbear-runner
11   dropbear-server-add-authorized-key
12   sshkeys-authority
13   publish-connection-informations
14   slaprunner-promise
15   slaprunner-frontend-promise
16   dropbear-promise
17   runtestsuite
18   shellinabox-promise
19   symlinks
20   shellinabox
21   slapos-cfg
22   slapos-repo-config
23   cron-entry-prepare-software
24   deploy-instance-parameters
25   instance-software-type
26   minishell-cwd
27   bash-profile
28   supervisord-wrapper
29   supervisord-promise
30 {% if slapparameter_dict.get('custom-frontend-backend-url') %}
31   custom-frontend-promise
32 {% endif %}
33 ## Monitoring part
34 ###Parts to add for monitoring
35   cron
36   certificate-authority
37   cron-entry-monitor
38   cron-entry-rss
39   deploy-index
40   deploy-settings-cgi
41   deploy-status-cgi
42   deploy-status-history-cgi
43   setup-static-files
44   certificate-authority
45   zero-parameters
46   public-symlink
47   cgi-httpd-wrapper
48   cgi-httpd-graceful-wrapper
49   monitor-promise
50   monitor-instance-log-access
51 ## Monitor for runner
52   monitor-current-log-access
53
54 extends = ${monitor-template:output}
55
56 eggs-directory = ${buildout:eggs-directory}
57 develop-eggs-directory = ${buildout:develop-eggs-directory}
58 offline = true
59
60 {% if slapparameter_dict.get('custom-frontend-backend-url') -%}
61 # Requests, if defined, a frontend to allow access to a server
62 # located inside of the virtual machine listening to port X
63 # to LAN IPv4.
64 # Internaly, the frontend will be asked to listen on the IPv6
65 # with port X + 10000, to match NAT rules of Qemu.
66 [request-custom-frontend]
67 recipe = slapos.cookbook:requestoptional
68 software-url = {{ slapparameter_dict.get('custom-frontend-software-url', 'http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg') }}
69 software-type = {{ slapparameter_dict.get('custom-frontend-software-type', 'RootSoftwareInstance') }}
70 slave = true
71 name = Custom Web Frontend
72
73 server-url = $${slap-connection:server-url}
74 key-file = $${slap-connection:key-file}
75 cert-file = $${slap-connection:cert-file}
76 computer-id = $${slap-connection:computer-id}
77 partition-id = $${slap-connection:partition-id}
78
79 {%- if slapparameter_dict.get('custom-frontend-instance-guid') -%}
80 sla = instance_guid
81 sla-instance_guid = $${slap-parameter:frontend-instance-guid}
82 {% endif -%}
83
84 {% set custom_frontend_backend_type = slapparameter_dict.get('custom-frontend-backend-type')%}
85 {% if custom_frontend_backend_type %}
86 config = url type
87 config-type = {{ custom_frontend_backend_type }}
88 {% else %}
89 config = url
90 {% endif -%}
91 config-url = {{ slapparameter_dict.get('custom-frontend-backend-url') }}
92 return = site_url domain
93
94 [custom-frontend-promise]
95 recipe = slapos.cookbook:check_url_available
96 path = $${directory:promises}/custom_frontend_promise
97 url = https://$${request-custom-frontend:connection-domain}
98 {% if slapparameter_dict.get('custom-frontend-basic-auth') -%}
99 check-secure = 1
100 {% endif -%}
101 dash_path = {{ dash_executable_location }}
102 curl_path = {{ curl_executable_location }}
103
104 [publish-connection-informations]
105 custom-frontend-url = https://$${request-custom-frontend:connection-domain}
106 {% endif %}
107
108 # Create all needed directories
109 [directory]
110 recipe = slapos.cookbook:mkdirectory
111 etc = $${buildout:directory}/etc/
112 var = $${buildout:directory}/var/
113 srv = $${buildout:directory}/srv/
114 bin = $${buildout:directory}/bin/
115 tmp = $${buildout:directory}/tmp/
116
117 sshkeys = $${:srv}/sshkeys
118 services = $${:etc}/service/
119 scripts = $${:etc}/run/
120 ssh = $${:etc}/ssh/
121 log = $${:var}/log/
122 run = $${:var}/run/
123 backup = $${:srv}/backup/
124 promises = $${:etc}/promise/
125 test = $${:etc}/test/
126 nginx-data = $${directory:srv}/nginx
127 ca-dir = $${:srv}/ssl
128 project = $${:srv}/runner/project
129
130 [runnerdirectory]
131 recipe = slapos.cookbook:mkdirectory
132 home = $${directory:srv}/runner/
133 test = $${directory:srv}/test/
134 project = $${:home}/project
135 public = $${:home}/public
136 software-root = $${:home}/software
137 instance-root = $${:home}/instance
138 project-test = $${:test}/project
139 software-test = $${:test}/software
140 instance-test = $${:test}/instance
141 sessions = $${buildout:directory}/.sessions
142 private-project = $${:home}/.git-private
143 public-project = $${:home}/.git-public
144
145 #Create password recovery code for slaprunner
146 [recovery-code]
147 recipe = slapos.cookbook:generate.password
148 storage-path = $${directory:etc}/.rcode
149 bytes = 8
150
151 [slaprunner]
152 slaprunner = ${buildout:directory}/bin/slaprunner
153 slapos = ${buildout:directory}/bin/slapos
154 slapproxy = ${buildout:directory}/bin/slapproxy
155 supervisor = ${buildout:directory}/bin/slapgrid-supervisorctl
156 git-binary = ${git:location}/bin/git
157 root_check = false
158 slapos.cfg = $${directory:etc}/slapos.cfg
159 working-directory = $${runnerdirectory:home}
160 project-directory = $${runnerdirectory:project}
161 instance_root = $${runnerdirectory:instance-root}
162 software_root = $${runnerdirectory:software-root}
163 instance-monitor-url = https://[$${:ipv6}]:$${monitor-parameters:port}
164 etc_dir = $${directory:etc}
165 log_dir =  $${directory:log}
166 run_dir = $${directory:run}
167 ssh_client = $${sshkeys-dropbear-runner:wrapper}
168 public_key = $${sshkeys-dropbear-runner:public-key}
169 private_key = $${sshkeys-dropbear-runner:private-key}
170 ipv4 = $${slap-network-information:local-ipv4}
171 ipv6 = $${slap-network-information:global-ipv6}
172 instance_root = $${runnerdirectory:instance-root}
173 proxy_port = 50000
174 runner_port = 50005
175 partition-amount = $${slap-parameter:instance-amount}
176 wrapper = $${directory:services}/slaprunner
177 debug = $${slap-parameter:debug}
178 access-url = https://[$${:ipv6}]:$${:runner_port}
179 supervisord_config = $${directory:etc}/supervisord.conf
180 supervisord_server = http://$${supervisord:server}
181 proxy_database = $${slaprunner:working-directory}/proxy.db
182 console = False
183 verbose = False
184 debug = False
185 auto_deploy = $${slap-parameter:auto-deploy}
186 auto_deploy_instance = $${slap-parameter:auto-deploy-instance}
187 autorun = $${slap-parameter:autorun}
188 knowledge0_file = $${buildout:directory}/$${public:filename}
189 minishell_cwd_file = $${directory:etc}/.minishell-cwd
190 minishell_history_file = $${directory:etc}/.minishell_history
191 software_info_json = $${runnerdirectory:home}/software_info.json
192 instance_info_json = $${runnerdirectory:home}/instance_info.json
193
194 [test-runner]
195 <= slaprunner
196 slapos.cfg = $${directory:etc}/slapos-test.cfg
197 working-directory = $${runnerdirectory:test}
198 project-directory = $${runnerdirectory:project-test}
199 software_root = $${runnerdirectory:software-test}
200 instance_root = $${runnerdirectory:instance-test}
201 proxy_port = 8602
202 etc_dir = $${directory:test}
203 autorun = False
204 auto_deploy = True
205
206 [runtestsuite]
207 recipe = slapos.cookbook:wrapper
208 command-line = ${buildout:directory}/bin/slaprunnertest
209 wrapper-path = $${directory:bin}/runTestSuite
210 environment = RUNNER_CONFIG=$${slapos-test-cfg:rendered}
211
212 # Deploy dropbear (minimalist SSH server)
213 [sshkeys-directory]
214 recipe = slapos.cookbook:mkdirectory
215 requests = $${directory:sshkeys}/requests/
216 keys = $${directory:sshkeys}/keys/
217
218 [sshkeys-authority]
219 recipe = slapos.cookbook:sshkeys_authority
220 request-directory = $${sshkeys-directory:requests}
221 keys-directory = $${sshkeys-directory:keys}
222 wrapper = $${directory:services}/sshkeys_authority
223 keygen-binary = ${dropbear:location}/bin/dropbearkey
224
225 [dropbear-runner-server]
226 recipe = slapos.cookbook:dropbear
227 host = $${slap-network-information:global-ipv6}
228 port = 22222
229 home = $${buildout:directory}
230 wrapper = $${directory:bin}/runner_sshd
231 shell = ${bash:location}/bin/bash
232 rsa-keyfile = $${directory:ssh}/server_key.rsa
233 dropbear-binary = ${dropbear:location}/sbin/dropbear
234
235 [sshkeys-dropbear-runner]
236 <= sshkeys-authority
237 recipe = slapos.cookbook:sshkeys_authority.request
238 name = dropbear
239 type = rsa
240 executable = $${dropbear-runner-server:wrapper}
241 public-key = $${dropbear-runner-server:rsa-keyfile}.pub
242 private-key = $${dropbear-runner-server:rsa-keyfile}
243 wrapper = $${directory:services}/runner_sshd
244
245 [dropbear-server-add-authorized-key]
246 <= dropbear-runner-server
247 recipe = slapos.cookbook:dropbear.add_authorized_key
248 key = $${slap-parameter:user-authorized-key}
249
250 #---------------------------
251 #--
252 #-- Set nginx frontend
253
254 [tempdirectory]
255 recipe = slapos.cookbook:mkdirectory
256 client_body_temp_path = $${directory:tmp}/client_body_temp_path
257 proxy_temp_path = $${directory:tmp}/proxy_temp_path
258 fastcgi_temp_path = $${directory:tmp}/fastcgi_temp_path
259 uwsgi_temp_path = $${directory:tmp}/uwsgi_temp_path
260 scgi_temp_path = $${directory:tmp}/scgi_temp_path
261
262 [nginx-frontend]
263 # Options
264 nb_workers = 2
265 # Network
266 local-ip = $${slap-network-information:local-ipv4}
267 port = 30001
268 global-ip = $${slap-network-information:global-ipv6}
269 global-port = $${slaprunner:runner_port}
270 # Backend
271 runner-ip = $${slaprunner:ipv4}
272 runner-port = $${slaprunner:runner_port}
273 # SSL
274 ssl-certificate = $${ca-nginx:cert-file}
275 ssl-key = $${ca-nginx:key-file}
276 # Log
277 path_pid = $${directory:run}/nginx.pid
278 path_log = $${directory:log}/nginx.log
279 path_access_log = $${directory:log}/nginx.access.log
280 path_error_log = $${directory:log}/nginx.error.log
281 path_tmp = $${directory:tmp}/
282 # Config files
283 path_nginx_conf = $${directory:etc}/nginx.conf
284 # Executables
285 bin_nginx = ${nginx-webdav:location}/sbin/nginx
286 bin_launcher = $${directory:bin}/launcher
287 # Utils
288 path_shell = ${dash:location}/bin/dash
289 # Misc.
290 etc_dir = $${directory:etc}
291 work_dir = $${slaprunner:working-directory}
292
293 [nginx_conf]
294 recipe = slapos.recipe.template:jinja2
295 template = ${template_nginx_conf:location}/${template_nginx_conf:filename}
296 rendered = $${nginx-frontend:path_nginx_conf}
297 context =
298     key shellinabox_port shellinabox:port
299     key socket gunicorn:socket
300     section param_nginx_frontend nginx-frontend
301     section param_tempdir tempdirectory
302
303 [nginx-launcher]
304 recipe = slapos.recipe.template:jinja2
305 template = ${template_launcher:location}/${template_launcher:filename}
306 rendered = $${nginx-frontend:bin_launcher}
307 mode = 700
308 context =
309     section param_nginx_frontend nginx-frontend
310
311 [httpd-parameters]
312 path_pid = $${directory:run}/httpd.pid
313 path_error_log = $${directory:log}/httpd-error.log
314 path_access_log = $${directory:log}/httpd-access.log
315 key_file = $${ca-httpd:key-file}
316 cert_file = $${ca-httpd:cert-file}
317 global_ip = $${slap-network-information:global-ipv6}
318 global_port = $${slaprunner:runner_port}
319 monitor_port = $${monitor-parameters:port}
320 monitor_index = $${deploy-index:rendered}
321 working_directory = $${slaprunner:working-directory}
322 dav_lock = $${directory:var}/DavLock
323 etc_dir = $${directory:etc}
324 var_dir = $${directory:var}
325 project_folder = $${directory:project}
326 project_private_folder = $${runnerdirectory:private-project}
327 project_public_folder = $${runnerdirectory:private-project}
328 runner_home = $${runnerdirectory:home}
329 git_http_backend = ${git:location}/libexec/git-core/git-http-backend
330 cgi_httpd_conf = $${monitor-httpd-configuration-file:rendered}
331
332 [httpd-conf]
333 recipe = slapos.recipe.template:jinja2
334 template = ${template_httpd_conf:location}/${template_httpd_conf:filename}
335 rendered = $${directory:etc}/httpd.conf
336 context =
337     section parameters httpd-parameters
338
339 [cgi-httpd-wrapper]
340 recipe = slapos.cookbook:wrapper
341 apache-executable = ${apache:location}/bin/httpd
342 wrapper-path = $${ca-httpd:executable}
343 command-line = $${:apache-executable} -f $${httpd-conf:rendered} -DFOREGROUND
344
345 #--------------------
346 #--
347 #-- WSGI
348
349 [gunicorn]
350 bin_gunicorn = $${directory:bin}/gunicorn
351 bin_launcher = $${directory:services}/gunicorn
352 path_shell = ${dash:location}/bin/dash
353 socket = $${directory:tmp}/flaskserver.sock
354 path_pid = $${directory:run}/gunicorn.pid
355
356 [gunicorn-launcher]
357 recipe = slapos.cookbook:wrapper
358 command-line = $${gunicorn:bin_gunicorn} slapos.runner:app -p $${gunicorn:path_pid} -b unix:$${gunicorn:socket} -e RUNNER_CONFIG=$${slaprunner:slapos.cfg} --error-logfile $${directory:log}/$${:error-log-file} --log-level error --preload 
359 error-log-file = gunicorn-error.log
360 wrapper-path = $${gunicorn:bin_launcher}
361 environment = PATH=$${environ:PATH}:${git:location}/bin/
362   RUNNER_CONFIG=$${slaprunner:slapos.cfg}
363
364 [gunicorn-graceful]
365 recipe = slapos.cookbook:wrapper
366 command-line = $${directory:bin}/killpidfromfile $${gunicorn:path_pid} SIGHUP
367 wrapper-path = $${directory:scripts}/gunicorn-graceful
368
369 #--------------------
370 #--
371 #-- ssl certificates
372
373 [certificate-authority]
374 recipe = slapos.cookbook:certificate_authority
375 openssl-binary = ${openssl:location}/bin/openssl
376 ca-dir = $${directory:ca-dir}
377 requests-directory = $${cadirectory:requests}
378 wrapper = $${directory:services}/certificate_authority
379 ca-private = $${cadirectory:private}
380 ca-certs = $${cadirectory:certs}
381 ca-newcerts = $${cadirectory:newcerts}
382 ca-crl = $${cadirectory:crl}
383
384 [cadirectory]
385 recipe = slapos.cookbook:mkdirectory
386 requests = $${directory:ca-dir}/requests/
387 private = $${directory:ca-dir}/private/
388 certs = $${directory:ca-dir}/certs/
389 newcerts = $${directory:ca-dir}/newcerts/
390 crl = $${directory:ca-dir}/crl/
391
392 [ca-nginx]
393 <= certificate-authority
394 recipe = slapos.cookbook:certificate_authority.request
395 key-file = $${cadirectory:certs}/nginx_frontend.key
396 cert-file = $${cadirectory:certs}/nginx_frontend.crt
397 executable = $${nginx-launcher:rendered}
398 wrapper = $${directory:services}/nginx-frontend
399 # Put domain name
400 name = example.com
401
402 [ca-shellinabox]
403 <= certificate-authority
404 recipe = slapos.cookbook:certificate_authority.request
405 executable = $${shellinabox:wrapper}
406 wrapper = $${directory:services}/shellinaboxd
407 key-file = $${cadirectory:certs}/shellinabox.key
408 cert-file = $${cadirectory:certs}/shellinabox.crt
409 #--------------------
410 #--
411 #-- Request frontend
412
413 [request-frontend]
414 <= slap-connection
415 recipe = slapos.cookbook:requestoptional
416 name = SlapRunner Frontend
417 # XXX We have hardcoded SR URL here.
418 software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
419 slave = true
420 config = url domain
421 config-url = $${slaprunner:access-url}
422 config-domain = $${slap-parameter:frontend-domain}
423 return = site_url domain
424
425 [monitor-frontend]
426 <= slap-connection
427 recipe = slapos.cookbook:requestoptional
428 name = Monitor Frontend
429 # XXX We have hardcoded SR URL here.
430 software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
431 slave = true
432 config = url domain
433 config-url = https://[$${monitor-httpd-configuration:listening-ip}]:$${monitor-parameters:port}
434 config-domain = $${slap-parameter:frontend-domain}
435 return = site_url domain
436
437 #--------------------------------------
438 #--
439 #-- Send informations to SlapOS Master
440
441 [publish-connection-informations]
442 recipe = slapos.cookbook:publish
443 1_info = On your first run, Use "access_url" to setup you account. Then you can use both "url" or "access_url". Or "backend_url" if you want to use ipv6. Set up your account in the webrunner in order to use webdav, and being able to clone your git repositories from the runner.
444 2_info = In order to set up your account, get the recovery-code from the monitoring interface. Before read the notification on monitor_info.
445 backend_url = $${slaprunner:access-url}
446 access_url = $${:url}/login
447 url =  https://$${request-frontend:connection-domain}
448 ssh_command = ssh $${dropbear-runner-server:host} -p $${dropbear-runner-server:port}
449 monitor_url = https://$${monitor-frontend:connection-domain}
450 webdav_url = $${:monitor_url}/share/
451 public_url =  $${:monitor_url}/public/
452 git_public_url = https://[$${httpd-parameters:global_ip}]:$${httpd-parameters:monitor_port}/git-public/
453 git_private_url = https://[$${httpd-parameters:global_ip}]:$${httpd-parameters:monitor_port}/git/
454
455 #---------------------------
456 #--
457 #-- Deploy promises scripts
458
459 [slaprunner-promise]
460 recipe = slapos.cookbook:check_port_listening
461 path = $${directory:promises}/slaprunner
462 hostname = $${slaprunner:ipv6}
463 port = $${slaprunner:runner_port}
464
465 [slaprunner-frontend-promise]
466 recipe = slapos.cookbook:check_url_available
467 path = $${directory:promises}/slaprunner_frontend
468 url = https://$${request-frontend:connection-domain}/login
469 dash_path = ${dash:location}/bin/dash
470 curl_path = ${curl:location}/bin/curl
471 check-secure = 1
472
473 [dropbear-promise]
474 recipe = slapos.cookbook:check_port_listening
475 path = $${directory:promises}/dropbear
476 hostname = $${dropbear-runner-server:host}
477 port = $${dropbear-runner-server:port}
478
479 [shellinabox-promise]
480 recipe = slapos.cookbook:check_port_listening
481 path = $${directory:promises}/shellinabox
482 hostname = $${shellinabox:ipv6}
483 port = $${shellinabox:port}
484
485 [symlinks]
486 recipe = cns.recipe.symlink
487 symlink_target = $${directory:bin}
488 symlink_base = ${buildout:directory}/bin
489
490 [slap-parameter]
491 # Default value if no ssh key is specified
492 user-authorized-key =
493 # Default value of instances number in slaprunner
494 instance-amount = 10
495 debug = false
496 frontend-domain =
497 slapos-repository = http://git.erp5.org/repos/slapos.git
498 slapos-software =
499 slapos-software-type =
500 slapos-reference = master
501 auto-deploy = false
502 auto-deploy-instance = true
503 autorun = false
504 monitor-port = 9684
505
506 [monitor-parameters]
507 port = $${slap-parameter:monitor-port}
508
509 [slapos-cfg]
510 recipe = slapos.recipe.template:jinja2
511 template = ${template-slapos-cfg:location}/${template-slapos-cfg:filename}
512 rendered = $${slaprunner:slapos.cfg}
513 mode = 700
514 context =
515   section slaprunner slaprunner
516
517 [slapos-test-cfg]
518 recipe = slapos.recipe.template:jinja2
519 template = ${template-slapos-cfg:location}/${template-slapos-cfg:filename}
520 rendered = $${test-runner:slapos.cfg}
521 mode = 700
522 context =
523   section slaprunner test-runner
524
525 [shellinabox]
526 recipe = slapos.cookbook:shellinabox
527 ipv6 = $${slap-network-information:global-ipv6}
528 port = 8949
529 shell = $${shell:wrapper}
530 wrapper = $${directory:bin}/shellinaboxd
531 shellinabox-binary = ${shellinabox:location}/bin/shellinaboxd
532 password = $${zero-parameters:shell-password}
533 directory = $${runnerdirectory:home}
534 login-shell = $${directory:bin}/login
535 certificate-directory = $${cadirectory:certs}
536 cert-file = $${ca-shellinabox:cert-file}
537 key-file = $${ca-shellinabox:key-file}
538
539 [shellinabox-code]
540 recipe = slapos.cookbook:generate.password
541 storage-path = $${directory:etc}/.scode
542 bytes = 8
543
544 [shell]
545 recipe = slapos.cookbook:shell
546 wrapper = $${directory:bin}/sh
547 shell = ${bash:location}/bin/bash
548 home = $${runnerdirectory:home}
549 path = $${environ:PATH}:${nano:location}/bin:${vim:location}/bin:${screen:location}/bin:${git:location}/bin
550 ps1 = "\\w> "
551
552 [environ]
553 recipe = collective.recipe.environment
554
555 [slapos-repo]
556 recipe = slapos.recipe.build:gitclone
557 repository = $${slap-parameter:slapos-repository}
558 git-executable = ${git:location}/bin/git
559 develop = true
560 location = $${directory:project}/slapos
561
562 [slapos-repo-config]
563 recipe = plone.recipe.command
564 stop-on-error = true
565 command = cd $${slapos-repo:location} && ${git:location}/bin/git checkout $${slap-parameter:slapos-reference} && SR=$${slap-parameter:slapos-software} && if [ -n "$SR" ] && [ ! -f "$${directory:etc}/.project" ]; then echo workspace/slapos/$${slap-parameter:slapos-software}/ > $${directory:etc}/.project; fi
566 update-command = true
567
568 [prepare-software]
569 recipe = slapos.cookbook:wrapper
570 command-line = ${curl:location}/bin/curl -g https://[$${slaprunner:ipv6}]:$${slaprunner:runner_port}/isSRReady --max-time 1 --insecure
571 wrapper-path = $${directory:scripts}/prepareSoftware
572
573 [cron-entry-prepare-software]
574 <= cron
575 recipe = slapos.cookbook:cron.d
576 name = prepare-software
577 frequency = */2 * * * *
578 command = $${prepare-software:wrapper-path}
579
580 [instance-parameters]
581 recipe = slapos.recipe.template:jinja2
582 extensions = jinja2.ext.do
583 template = ${template-parameters:location}/${template-parameters:filename}
584 rendered = $${directory:etc}/.parameter.xml.default
585 mode = 0644
586 context =
587   key slapparameter_dict slap-configuration:configuration
588
589 [deploy-instance-parameters]
590 recipe = plone.recipe.command
591 stop-on-error = true
592 parameter-xml = $${directory:etc}/.parameter.xml
593 command = if [ ! -f $${:parameter-xml} ]; then cp $${instance-parameters:rendered} $${:parameter-xml}; fi
594
595 [instance-software-type]
596 recipe = plone.recipe.command
597 stop-on-error = true
598 # XXX It should not be named with .xml as it is not xml
599 software-type-path = $${directory:etc}/.software_type.xml
600 command = if [ ! -f $${:software-type-path} -a "$${slap-parameter:slapos-software-type}" != "" ]; then echo "$${slap-parameter:slapos-software-type}" > $${:software-type-path}; fi
601
602 [slap-configuration]
603 recipe = slapos.cookbook:slapconfiguration.serialised
604 computer = $${slap-connection:computer-id}
605 partition = $${slap-connection:partition-id}
606 url = $${slap-connection:server-url}
607 key = $${slap-connection:key-file}
608 cert = $${slap-connection:cert-file}
609
610 [public]
611 shell-password = $${shellinabox-code:passwd}
612 recovery-code = $${recovery-code:passwd}
613
614 [zero-parameters]
615
616
617 [minishell-cwd]
618 recipe = plone.recipe.command
619 command = if [ ! -f $${slaprunner:minishell_cwd_file} ]; then echo $${runnerdirectory:home} > $${slaprunner:minishell_cwd_file}; fi
620 location = $${slaprunner:minishell_cwd_file}
621 stop-on-error = true
622
623 [bash-profile]
624 recipe = slapos.recipe.template:jinja2
625 template = ${template-bash-profile:location}/${template-bash-profile:filename}
626 rendered = $${buildout:directory}/.bash_profile
627 context =
628     raw path $PATH:${nano:location}/bin:${vim:location}/bin:${screen:location}/bin:${git:location}/bin:${curl:location}/bin:${python2.7:location}/bin
629     key workdir runnerdirectory:home
630
631 [supervisord]
632 autorestart = false
633 autostart = false
634 directory = $${buildout:directory}
635 exitcodes = 0
636 logfile = $${directory:log}/supervisord.log
637 no_logfile = NONE
638 numprocs = 1
639 path = $${environ:PATH}
640 pidfile = $${directory:run}/supervisord.pid
641 server = $${slaprunner:ipv4}:$${:port}
642 port = 39986
643 slapgrid-cp = slapgrid-cp
644 slapgrid-cp-command = $${slaprunner:slapos} node instance --all --cfg $${slaprunner:slapos.cfg} --pidfile $${:slapgrid-cp-pid} --verbose --logfile $${:slapgrid-cp-log}
645 slapgrid-cp-log = $${runnerdirectory:home}/instance.log
646 slapgrid-cp-pid = $${directory:run}/slapgrid-cp.pid
647 slapgrid-cp-startretries = 0
648 slapgrid-sr = slapgrid-sr
649 slapgrid-sr-command = $${slaprunner:slapos} node software --all --cfg $${slaprunner:slapos.cfg} --pidfile $${:slapgrid-sr-pid} --verbose --logfile $${:slapgrid-sr-log}
650 slapgrid-sr-log = $${runnerdirectory:home}/software.log
651 slapgrid-sr-pid = $${directory:run}/slapgrid-sr.pid
652 slapgrid-sr-startretries = 0
653 slapproxy = slapproxy
654 slapproxy-autorestart = true
655 slapproxy-autostart = true
656 slapproxy-startsecs = 1
657 slapproxy-command = $${slaprunner:slapos} proxy start --logfile $${:slapproxy-log} --cfg $${slaprunner:slapos.cfg}
658 slapproxy-log = $${directory:log}/slapproxy.log
659 socket_name = unix://$${:socket_path}
660 socket_path = $${directory:tmp}/supervisord.sock
661 startsecs = 0
662 # This file logs errors from listeners. Supervisord has its own logfile.
663 # Processes should handle their logs by themselves
664 stderr_logfile = $${directory:log}/supervisord-errors.log
665
666 [supervisord-conf]
667 recipe = slapos.recipe.template:jinja2
668 template = ${template-supervisord:location}/${template-supervisord:filename}
669 rendered = $${directory:etc}/supervisord.conf
670 context =
671     section supervisord supervisord
672     key listener_slapgrid listener-slapgrid-bin:rendered
673
674 [listener-slapgrid-bin]
675 recipe = slapos.recipe.template:jinja2
676 template = ${template-listener-slapgrid:location}/${template-listener-slapgrid:filename}
677 rendered = $${directory:bin}/listener_slapgrid.py
678 mode = 0744
679 context =
680     section supervisord supervisord
681     section slaprunner slaprunner
682     raw python_executable ${buildout:directory}/bin/${extra-eggs:interpreter}
683
684 [supervisord-wrapper]
685 recipe = slapos.cookbook:wrapper
686 command-line = $${buildout:directory}/bin/supervisord -c $${supervisord-conf:rendered} --nodaemon
687 wrapper-path = $${directory:services}/supervisord
688
689 [supervisord-promise]
690 recipe = slapos.cookbook:check_port_listening
691 path = $${directory:promises}/supervisord
692 hostname = $${slaprunner:ipv4}
693 port = $${supervisord:port}
694
695 [monitor-current-log-access]
696 < = monitor-directory-access
697 source = $${directory:log}