instance-cloudoo.cfg.in 4.17 KB
Newer Older
1
{% set ipv4 = (ipv4_set | list)[0] -%}
2
{% set bin_directory = parameter_dict['buildout-bin-directory'] -%}
3 4
{% set section_list = [] -%}
{% macro section(name) %}{% do section_list.append(name) %}{{ name }}{% endmacro -%}
5 6 7 8 9 10 11 12 13 14
[buildout]
parts =
  publish-cloudooo-connection-information
  cloudooo-test-runner

eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true

[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 22 23 24 25 26 27 28 29 30
environment =
  LD_LIBRARY_PATH = {{ parameter_dict['file'] }}/lib:{{ parameter_dict['fontconfig'] }}/lib:{{ parameter_dict['freetype'] }}/lib:{{ parameter_dict['libICE'] }}/lib:{{ parameter_dict['libpng12'] }}/lib:{{ parameter_dict['libSM'] }}/lib:{{ parameter_dict['libX11'] }}/lib:{{ parameter_dict['libXau'] }}/lib:{{ parameter_dict['libXdmcp'] }}/lib:{{ parameter_dict['libXext'] }}/lib:{{ parameter_dict['libxcb'] }}/lib:{{ parameter_dict['libXrender'] }}/lib:{{ parameter_dict['zlib'] }}/lib
  FONTCONFIG_FILE = ${fontconfig-instance:conf-path}
  PATH = ${binary-link:target-directory}
# Binary information
# cloudooo specific configuration
ooo-binary-path = {{ parameter_dict['libreoffice-bin'] }}/program
ooo-paster = {{ bin_directory }}/cloudooo_paster
ooo-uno-path = {{ parameter_dict['libreoffice-bin'] }}/basis-link/program

31
{% set cloudooo_port = slapparameter_dict.get('tcpv4_port', 23000) | int -%}
32 33
{% set backend_count = slapparameter_dict.get('backend-count', 1) | int -%}
{% for index in range(backend_count) -%}
34 35 36 37 38
{%   set name = 'cloudooo-' ~ index -%}
[{{ section(name) }}]
< = cloudooo-base
port = {{ cloudooo_port }}
openoffice-port = {{ cloudooo_port + 1 }}
39 40 41
configuration-file = ${directory:etc}/{{ name }}.cfg
data-directory = ${directory:srv}/{{ name }}
wrapper = ${directory:services}/{{ name }}
42 43 44 45 46 47

{%   set cloudooo_port = cloudooo_port + 2 -%}
{% endfor -%}

[haproxy]
recipe = slapos.cookbook:haproxy
48
name = cloudooo
49
conf-path = ${directory:etc}/haproxy.cfg
50
socket-path = ${directory:run}/haproxy.sock
51 52
ip = {{ ipv4 }}
port = 8001
53
maxconn = 1
54 55
wrapper-path = ${directory:services}/haproxy
binary-path = {{ parameter_dict['haproxy'] }}/sbin/haproxy
56
ctl-path = ${directory:bin}/haproxy-ctl
57 58 59 60 61
backend-list =
{%- for section_name in section_list %}
  {{ "${" ~ section_name ~ ":ip}:${" ~ section_name ~ ":port}" }}
{%- endfor %}

62 63 64 65 66 67 68
[cloudooo-test-runner]
recipe = slapos.cookbook:cloudooo.test

prepend-path = ${buildout:bin-directory}
run-unit-test = ${buildout:bin-directory}/runUnitTest
run-test-suite = ${buildout:bin-directory}/runTestSuite

69 70
ooo-paster = ${cloudooo-0:ooo-paster}
configuration-file = ${cloudooo-0:configuration-file}
71 72 73 74 75 76

run-unit-test-binary = {{ bin_directory }}/runCloudoooUnitTest
run-test-suite-binary = {{ bin_directory }}/runCloudoooTestSuite

[fontconfig-instance]
recipe = slapos.cookbook:fontconfig
77
conf-path = ${directory:etc}/font.conf
78 79
font-system-folder = {{ parameter_dict['fonts'] }}
font-folder = ${directory:font}
80 81
{# XXX: violates "instanciation happens offline" rule -#}
url-list = {{ slapparameter_dict.get('font-url-list', []) | join(' ') }}
82
service-folder = ${directory:services}
83 84 85 86
onetimedownload_path = {{ bin_directory }}/onetimedownload

[binary-link]
recipe = slapos.cookbook:symbolic.link
87
target-directory = ${directory:bin}
88 89 90 91 92 93 94
link-binary =
  {{ parameter_dict['coreutils'] }}/bin/basename
  {{ parameter_dict['coreutils'] }}/bin/cat
  {{ parameter_dict['coreutils'] }}/bin/cp
  {{ parameter_dict['coreutils'] }}/bin/ls
  {{ parameter_dict['coreutils'] }}/bin/tr
  {{ parameter_dict['coreutils'] }}/bin/uname
95
  {{ parameter_dict['coreutils'] }}/bin/dirname
96 97 98 99 100 101 102 103 104
  {{ parameter_dict['imagemagick'] }}/bin/convert
  {{ parameter_dict['imagemagick'] }}/bin/identify
  {{ parameter_dict['poppler'] }}/bin/pdfinfo
  {{ parameter_dict['poppler'] }}/bin/pdftotext
  {{ parameter_dict['poppler'] }}/bin/pdftohtml

# rest of parts are candidates for some generic stuff
[directory]
recipe = slapos.cookbook:mkdirectory
105
bin = ${buildout:directory}/bin
106
etc = ${buildout:directory}/etc
107 108 109
font = ${:srv}/font
run = ${:var}/run
services = ${:etc}/run
110
srv = ${buildout:directory}/srv
111
var = ${buildout:directory}/var