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