Commit d4c591cb authored by Jérome Perrin's avatar Jérome Perrin

cloudooo

parent 04e4c9de
...@@ -13,9 +13,13 @@ ...@@ -13,9 +13,13 @@
# section inheritance (< = ...) are NOT supported (but you should really # section inheritance (< = ...) are NOT supported (but you should really
# not need these here). # not need these here).
[template-cloudooo] [template-cloudooo]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = d1e4d7306c39f2ebc64d0407860d4301 md5sum = d1e4d7306c39f2ebc64d0407860d4301
[template-cloudooo-instance] [template-cloudooo-instance]
filename = instance-cloudooo.cfg.in filename = instance-cloudooo.cfg.in
md5sum = 90299c1dbdc5f983613794a8e9a7bc9d md5sum = 3c499fd3cdfc7915d6eaf1cf4130b56d
[template-haproxy-cfg]
filename = haproxy.cfg.in
md5sum = 3d989eeb2e326bb0daf9351850f7fc39
global
maxconn 4096
stats socket {{ parameter_dict['socket-path'] }} level admin
master-worker
pidfile {{ parameter_dict['pidfile'] }}
defaults
mode http
retries 1
option redispatch
maxconn 2000
timeout server 305s
timeout queue 60s
timeout connect 5s
timeout client 305s
option httpclose
listen cloudooo
bind {{ parameter_dict['ip'] }}:{{ parameter_dict['port'] }}
balance roundrobin
stats uri /haproxy
{% for i, backend_netloc in enumerate(parameter_dict['backend-list'].splitlines()) -%}
server cloudooo_{{ i + 1 }} {{ backend_netloc }} rise 1 fall 2 maxqueue 5 maxconn 1
{% endfor %}
...@@ -68,7 +68,7 @@ parts = ...@@ -68,7 +68,7 @@ parts =
apache-promise apache-promise
apache-logrotate apache-logrotate
cloudooo-test-runner cloudooo-test-runner
haproxy haproxy-service
xvfb-instance xvfb-instance
wkhtmltopdf-on-xvfb wkhtmltopdf-on-xvfb
...@@ -181,17 +181,25 @@ wrapper = ${directory:services}/{{ name }} ...@@ -181,17 +181,25 @@ wrapper = ${directory:services}/{{ name }}
{% endfor -%} {% endfor -%}
[haproxy-cfg]
recipe = slapos.recipe.template:jinja2
url = {{ parameter_dict['template-haproxy-cfg'] }}
output = ${directory:etc}/haproxy.cfg
context =
section parameter_dict haproxy
[haproxy-service]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:services}/${:_buildout_section_name_}
command-line =
"{{ parameter_dict['haproxy'] }}/sbin/haproxy" -f "${haproxy-cfg:output}"
hash-files = ${haproxy-cfg:output}
[haproxy] [haproxy]
recipe = slapos.cookbook:haproxy
name = cloudooo
conf-path = ${directory:etc}/haproxy.cfg
socket-path = ${directory:run}/haproxy.sock socket-path = ${directory:run}/haproxy.sock
pidfile = ${directory:run}/haproxy.pid
ip = {{ ipv4 }} ip = {{ ipv4 }}
port = {{ haproxy_port }} port = {{ haproxy_port }}
maxconn = 1
wrapper-path = ${directory:services}/haproxy
binary-path = {{ parameter_dict['haproxy'] }}/sbin/haproxy
ctl-path = ${directory:bin}/haproxy-ctl
backend-list = backend-list =
{%- for section_name in cloudooo_section_list %} {%- for section_name in cloudooo_section_list %}
{{ "${" ~ section_name ~ ":ip}:${" ~ section_name ~ ":port}" }} {{ "${" ~ section_name ~ ":ip}:${" ~ section_name ~ ":port}" }}
...@@ -230,7 +238,6 @@ link-binary = ...@@ -230,7 +238,6 @@ link-binary =
{{ parameter_dict['poppler'] }}/bin/pdftohtml {{ parameter_dict['poppler'] }}/bin/pdftohtml
{{ parameter_dict['onlyoffice-core'] }}/bin/x2t {{ parameter_dict['onlyoffice-core'] }}/bin/x2t
# rest of parts are candidates for some generic stuff
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
apache-conf = ${:etc}/apache apache-conf = ${:etc}/apache
......
...@@ -92,11 +92,16 @@ zlib = ${zlib:location} ...@@ -92,11 +92,16 @@ zlib = ${zlib:location}
template-apache-conf = ${template-apache-backend-conf:target} template-apache-conf = ${template-apache-backend-conf:target}
template-logrotate-base = ${template-logrotate-base:output} template-logrotate-base = ${template-logrotate-base:output}
template-monitor = ${monitor2-template:output} template-monitor = ${monitor2-template:output}
template-haproxy-cfg = ${template-haproxy-cfg:target}
[template-cloudooo-instance] [template-cloudooo-instance]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
[template-haproxy-cfg]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename}
[versions] [versions]
argparse = 1.4.0 argparse = 1.4.0
pyPdf = 1.13 pyPdf = 1.13
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