Commit c80a0c9a authored by Vincent Pelletier's avatar Vincent Pelletier Committed by Kazuhiko Shiozaki

Initial Cloudooo Cluster setup

This use haproxy and configureable amount of cloudooo instances (via parameters).
parent 09d9bb3b
...@@ -10,34 +10,54 @@ offline = true ...@@ -10,34 +10,54 @@ offline = true
[publish-cloudooo-connection-information] [publish-cloudooo-connection-information]
recipe = slapos.cookbook:publishurl recipe = slapos.cookbook:publishurl
url = cloudooo://${cloudooo-instance:ip}:${cloudooo-instance:port}/ url = cloudooo://${haproxy:ip}:${haproxy:port}/
[cloudooo-instance] [cloudooo-base]
recipe = slapos.cookbook:generic.cloudooo recipe = slapos.cookbook:generic.cloudooo
# Network options
ip = ${slap-network-information:local-ipv4} ip = ${slap-network-information:local-ipv4}
port = 23000
openoffice-port = 23060
# Paths
configuration-file = ${rootdirectory:etc}/cloudooo.cfg
wrapper = ${basedirectory:services}/cloudooo wrapper = ${basedirectory:services}/cloudooo
# Paths: Data
data-directory = ${directory:cloudooo-data}
environment = 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 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} FONTCONFIG_FILE = ${fontconfig-instance:conf-path}
PATH = ${binary-link:target-directory} PATH = ${binary-link:target-directory}
# Binary information # Binary information
# cloudooo specific configuration # cloudooo specific configuration
ooo-binary-path = {{ parameter_dict['libreoffice-bin'] }}/program ooo-binary-path = {{ parameter_dict['libreoffice-bin'] }}/program
ooo-paster = {{ bin_directory }}/cloudooo_paster ooo-paster = {{ bin_directory }}/cloudooo_paster
ooo-uno-path = {{ parameter_dict['libreoffice-bin'] }}/basis-link/program ooo-uno-path = {{ parameter_dict['libreoffice-bin'] }}/basis-link/program
{% set cloudooo_port = 23000 -%}
{% for index in range(slapparameter_dict.get('backend_count', 1)) -%}
{% set name = 'cloudooo-' ~ index -%}
[{{ section(name) }}]
< = cloudooo-base
port = {{ cloudooo_port }}
openoffice-port = {{ cloudooo_port + 1 }}
configuration-file = ${rootdirectory:etc}/{{ name }}.cfg
{% set cloudooo_port = cloudooo_port + 2 -%}
{% endfor -%}
[haproxy]
recipe = slapos.cookbook:haproxy
name = haproxy
conf-path = ${directory:etc}/haproxy.cfg
ip = {{ ipv4 }}
port = 8001
maxconn = {{ slapparameter_dict['haproxy-maxconn'] }}
# XXX: should be optional (check recipe code)
server-check-path = {{ slapparameter_dict['haproxy-server-check-path'] }}
wrapper-path = ${directory:services}/haproxy
binary-path = {{ parameter_dict['haproxy'] }}/sbin/haproxy
backend-list =
{%- for section_name in section_list %}
{{ "${" ~ section_name ~ ":ip}:${" ~ section_name ~ ":port}" }}
{%- endfor %}
[cloudooo-instance]
# Paths: Data
data-directory = ${directory:cloudooo-data}
[cloudooo-test-runner] [cloudooo-test-runner]
recipe = slapos.cookbook:cloudooo.test recipe = slapos.cookbook:cloudooo.test
......
...@@ -6,6 +6,14 @@ eggs-directory = {{ eggs_directory }} ...@@ -6,6 +6,14 @@ eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }} develop-eggs-directory = {{ develop_eggs_directory }}
offline = true offline = true
[slap-parameters]
recipe = slapos.cookbook:slapconfiguration
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
[jinja2-template-base] [jinja2-template-base]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename} rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/${:filename}
...@@ -13,12 +21,14 @@ extra-context = ...@@ -13,12 +21,14 @@ extra-context =
context = context =
key eggs_directory buildout:eggs-directory key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory key develop_eggs_directory buildout:develop-eggs-directory
key slapparameter_dict slap-parameters:configuration
${:extra-context} ${:extra-context}
[dynamic-template-cloudooo-parameters] [dynamic-template-cloudooo-parameters]
file = {{ file_location }} file = {{ file_location }}
fontconfig = {{ fontconfig_location }} fontconfig = {{ fontconfig_location }}
freetype = {{ freetype_location }} freetype = {{ freetype_location }}
haproxy = {{ haproxy_location }}
libICE = {{ libICE_location }} libICE = {{ libICE_location }}
libpng12 = {{ libpng12_location }} libpng12 = {{ libpng12_location }}
libSM = {{ libSM_location }} libSM = {{ libSM_location }}
......
...@@ -54,7 +54,7 @@ context = ...@@ -54,7 +54,7 @@ context =
# XXX: "template.cfg" is hardcoded in instanciation recipe # XXX: "template.cfg" is hardcoded in instanciation recipe
filename = template.cfg filename = template.cfg
template = ${:_profile_base_location_}/instance.cfg.in template = ${:_profile_base_location_}/instance.cfg.in
md5sum = 694205787e78c5d615d72d7b4b26d174 md5sum = dd0073d8e8d8aaf94df0405c86c7a055
extra-context = extra-context =
key buildout_bin_directory buildout:bin-directory key buildout_bin_directory buildout:bin-directory
key dcron_location dcron:location key dcron_location dcron:location
...@@ -63,6 +63,7 @@ extra-context = ...@@ -63,6 +63,7 @@ extra-context =
key fonts_location fonts:location key fonts_location fonts:location
key freetype_location freetype:location key freetype_location freetype:location
key git_location git:location key git_location git:location
key haproxy_location haproxy:location
key imagemagick_location imagemagick:location key imagemagick_location imagemagick:location
key libICE_location libICE:location key libICE_location libICE:location
key libSM_location libSM:location key libSM_location libSM:location
...@@ -83,7 +84,7 @@ extra-context = ...@@ -83,7 +84,7 @@ extra-context =
[template-cloudooo] [template-cloudooo]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-cloudoo.cfg.in url = ${:_profile_base_location_}/instance-cloudoo.cfg.in
md5sum = 4c8608f9525be0f01a09d60b240315a9 md5sum = 91eb4b262d3d61d193fa13fb97ef28c8
mode = 640 mode = 640
......
...@@ -49,6 +49,7 @@ extends = ...@@ -49,6 +49,7 @@ extends =
../component/dcron/buildout.cfg ../component/dcron/buildout.cfg
../component/coreutils/buildout.cfg ../component/coreutils/buildout.cfg
../component/cloudooo/buildout.cfg ../component/cloudooo/buildout.cfg
../component/haproxy/buildout.cfg
versions = versions versions = versions
...@@ -77,6 +78,7 @@ parts = ...@@ -77,6 +78,7 @@ parts =
ffmpeg ffmpeg
rdiff-backup rdiff-backup
haproxy
cloudooo cloudooo
# Local development # Local development
......
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