PROJECT_MOVED -> https://lab.nexedi.com/nexedi/slapos
[slapos.git] / software / cloudooo / instance-cloudoo.cfg.in
1 {% set ipv4 = (ipv4_set | list)[0] -%}
2 {% set bin_directory = parameter_dict['buildout-bin-directory'] -%}
3 {% set section_list = [] -%}
4 {% macro section(name) %}{% do section_list.append(name) %}{{ name }}{% endmacro -%}
5 [buildout]
6 parts =
7   publish-cloudooo-connection-information
8   cloudooo-test-runner
9
10 eggs-directory = {{ eggs_directory }}
11 develop-eggs-directory = {{ develop_eggs_directory }}
12 offline = true
13
14 [publish-cloudooo-connection-information]
15 recipe = slapos.cookbook:publish.serialised
16 url = cloudooo://${haproxy:ip}:${haproxy:port}/
17
18 [cloudooo-base]
19 recipe = slapos.cookbook:generic.cloudooo
20 ip = {{ ipv4 }}
21 environment =
22   LD_LIBRARY_PATH = {{ parameter_dict['cairo'] }}/lib:{{ parameter_dict['cups'] }}/lib:{{ parameter_dict['cups'] }}/lib64:{{ parameter_dict['dbus'] }}/lib:{{ parameter_dict['dbus-glib'] }}/lib:{{ parameter_dict['file'] }}/lib:{{ parameter_dict['fontconfig'] }}/lib:{{ parameter_dict['freetype'] }}/lib:{{ parameter_dict['glib'] }}/lib:{{ parameter_dict['glu'] }}/lib:{{ parameter_dict['libICE'] }}/lib:{{ parameter_dict['libSM'] }}/lib:{{ parameter_dict['libX11'] }}/lib:{{ parameter_dict['libXau'] }}/lib:{{ parameter_dict['libXdmcp'] }}/lib:{{ parameter_dict['libXext'] }}/lib:{{ parameter_dict['libXrender'] }}/lib:{{ parameter_dict['libexpat'] }}/lib:{{ parameter_dict['libffi'] }}/lib:{{ parameter_dict['libffi'] }}/lib64:{{ parameter_dict['libpng12'] }}/lib:{{ parameter_dict['libxcb'] }}/lib:{{ parameter_dict['mesa'] }}/lib:{{ parameter_dict['pixman'] }}/lib:{{ parameter_dict['xdamage'] }}/lib:{{ parameter_dict['xfixes'] }}/lib:{{ parameter_dict['zlib'] }}/lib
23   FONTCONFIG_FILE = ${fontconfig-instance:conf-path}
24   PATH = ${binary-link:target-directory}
25 # Binary information
26 # cloudooo specific configuration
27 ooo-binary-path = {{ parameter_dict['libreoffice-bin'] }}/program
28 ooo-paster = {{ bin_directory }}/cloudooo_paster
29 ooo-uno-path = {{ parameter_dict['libreoffice-bin'] }}/basis-link/program
30
31 {% set cloudooo_port = slapparameter_dict.get('tcpv4_port', 23000) | int -%}
32 {% set backend_count = slapparameter_dict.get('backend-count', 1) | int -%}
33 {% for index in range(backend_count) -%}
34 {%   set name = 'cloudooo-' ~ index -%}
35 [{{ section(name) }}]
36 < = cloudooo-base
37 port = {{ cloudooo_port }}
38 openoffice-port = {{ cloudooo_port + 1 }}
39 configuration-file = ${directory:etc}/{{ name }}.cfg
40 data-directory = ${directory:srv}/{{ name }}
41 wrapper = ${directory:services}/{{ name }}
42
43 {%   set cloudooo_port = cloudooo_port + 2 -%}
44 {% endfor -%}
45
46 [haproxy]
47 recipe = slapos.cookbook:haproxy
48 name = cloudooo
49 conf-path = ${directory:etc}/haproxy.cfg
50 socket-path = ${directory:run}/haproxy.sock
51 ip = {{ ipv4 }}
52 port = 8001
53 maxconn = 1
54 wrapper-path = ${directory:services}/haproxy
55 binary-path = {{ parameter_dict['haproxy'] }}/sbin/haproxy
56 ctl-path = ${directory:bin}/haproxy-ctl
57 backend-list =
58 {%- for section_name in section_list %}
59   {{ "${" ~ section_name ~ ":ip}:${" ~ section_name ~ ":port}" }}
60 {%- endfor %}
61
62 [cloudooo-test-runner]
63 recipe = slapos.cookbook:cloudooo.test
64
65 prepend-path = ${buildout:bin-directory}
66 run-unit-test = ${buildout:bin-directory}/runUnitTest
67 run-test-suite = ${buildout:bin-directory}/runTestSuite
68
69 ooo-paster = ${cloudooo-0:ooo-paster}
70 configuration-file = ${cloudooo-0:configuration-file}
71
72 run-unit-test-binary = {{ bin_directory }}/runCloudoooUnitTest
73 run-test-suite-binary = {{ bin_directory }}/runCloudoooTestSuite
74
75 [fontconfig-instance]
76 recipe = slapos.cookbook:fontconfig
77 conf-path = ${directory:etc}/font.conf
78 font-system-folder = {{ parameter_dict['fonts'] }}
79 font-folder = ${directory:font}
80 {# XXX: violates "instanciation happens offline" rule -#}
81 url-list = {{ slapparameter_dict.get('font-url-list', []) | join(' ') }}
82 service-folder = ${directory:services}
83 onetimedownload_path = {{ bin_directory }}/onetimedownload
84
85 [binary-link]
86 recipe = slapos.cookbook:symbolic.link
87 target-directory = ${directory:bin}
88 link-binary =
89   {{ parameter_dict['coreutils'] }}/bin/basename
90   {{ parameter_dict['coreutils'] }}/bin/cat
91   {{ parameter_dict['coreutils'] }}/bin/cp
92   {{ parameter_dict['coreutils'] }}/bin/ls
93   {{ parameter_dict['coreutils'] }}/bin/tr
94   {{ parameter_dict['coreutils'] }}/bin/uname
95   {{ parameter_dict['coreutils'] }}/bin/dirname
96   {{ parameter_dict['imagemagick'] }}/bin/convert
97   {{ parameter_dict['imagemagick'] }}/bin/identify
98   {{ parameter_dict['poppler'] }}/bin/pdfinfo
99   {{ parameter_dict['poppler'] }}/bin/pdftotext
100   {{ parameter_dict['poppler'] }}/bin/pdftohtml
101
102 # rest of parts are candidates for some generic stuff
103 [directory]
104 recipe = slapos.cookbook:mkdirectory
105 bin = ${buildout:directory}/bin
106 etc = ${buildout:directory}/etc
107 font = ${:srv}/font
108 run = ${:var}/run
109 services = ${:etc}/run
110 srv = ${buildout:directory}/srv
111 var = ${buildout:directory}/var