Commit 651612ba authored by Alain Takoudjou's avatar Alain Takoudjou

WIP: add vanilla software release

parent ede2bc15
# THIS IS NOT A BUILDOUT FILE, despite purposedly using a compatible syntax.
# The only allowed lines here are (regexes):
# - "^#" comments, copied verbatim
# - "^[" section beginings, copied verbatim
# - lines containing an "=" sign which must fit in the following categorie.
# - "^\s*filename\s*=\s*path\s*$" where "path" is relative to this file
# Copied verbatim.
# - "^\s*hashtype\s*=.*" where "hashtype" is one of the values supported
# by the re-generation script.
# Re-generated.
# - other lines are copied verbatim
# Substitution (${...:...}), extension ([buildout] extends = ...) and
# section inheritance (< = ...) are NOT supported (but you should really
# not need these here).
[instance-cfg]
filename = instance.cfg.in
md5sum = e1e14e7bf1595a0b39fb02748de75377
[template-vanilla-properties]
filename = vanilla.properties.in
md5sum = 14e0d2dbdb394784ef16f328b9f7a4c8
{% set part_list = [] -%}
{% set ipv6 = (ipv6 | list)[0] -%}
{% set ipv4 = (ipv4 | list)[0] -%}
{% set monitor_base_url_dict = {} -%}
[directory]
recipe = slapos.cookbook:mkdirectory
etc = ${buildout:directory}/etc
bin = ${buildout:directory}/bin
srv = ${buildout:directory}/srv
var = ${buildout:directory}/var
tmp = ${buildout:directory}/tmp
log = ${:var}/log
scripts = ${:etc}/run
services = ${:etc}/service
promise = ${:etc}/promise
ssl = ${:etc}/ssl
workdir = ${buildout:directory}
vanilla = ${:workdir}/vanilla
[request-mariadb]
<= request-common
software-type = mariadb
name = Vanilla Mariadb
sla-computer_guid = {{ dumps(slapparameter_dict.get('mariadb-computer-guid', '')) }}
config-database-list = {{ dumps([{'name': 'vanilla', 'user': 'biplatform', 'password': 'biplatform' }]) }}
config-test-database-amount = {{ dumps(0) }}
config-tcpv4-port = {{ dumps(2099) }}
config-max-slowqueries-threshold = {{ dumps(1000) }}
config-slowest-query-threshold =
config-computer-memory-percent-threshold = {{ dumps(80) }}
config-monitor-passwd = ${monitor-instance-parameter:password}
config-name = ${:name}
config-innodb-file-per-table = {{ dumps(slapparameter_dict.get('innodb-file-per-table', 1)) }}
return =
database-list
monitor-base-url
{% do monitor_base_url_dict.__setitem__('mariadb', '${request-mariadb:connection-monitor-base-url}') -%}
[mariadb-urlparse]
recipe = slapos.cookbook:urlparse
url = ${request-mariadb:connection-database-list}
[vanilla]
debug = true
config-file = ${directory:vanilla}/vanilla-conf/vanilla.properties
logback = ${directory:vanilla}/vanilla-conf/logback.xml
db-user = ${mariadb-urlparse:username}
db-password = ${mariadb-urlparse:password}
db-name = ${mariadb-urlparse:path}
db-host = ${mariadb-urlparse:host}
db-port = ${mariadb-urlparse:port}
system-login = system
system-password = system
[jetty]
http.port = 7171
host = {{ ipv4 }}
url = http://{{ ipv4 }}:${:port}
[repositoryone-properties]
recipe = slapos.recipe.template
inline =
bpm.vanilla.repository.database.driverClassName=org.h2.Driver
bpm.vanilla.repository.database.jdbcUrl=jdbc:h2:./vanilla/h2/repository5;AUTO_SERVER=TRUE
bpm.vanilla.repository.database.userName=${vanilla:db-user}
bpm.vanilla.repository.database.password=${vanilla:db-password}
bpm.vanilla.repository.database.dialect=org.hibernate.dialect.H2Dialect
output = ${directory:vanilla}/vanilla/vanilla-conf/repositoryone.properties
[vanilla.properties]
recipe = slapos.recipe.template:jinja2
url = {{ parameter_dict['template-vanilla-properties'] }}
output = ${directory:vanilla}/vanilla/vanilla-conf/vanilla.properties
context =
section parameter_dict vanilla
section jetty_dict jetty
depends =
${repositoryone-properties:recipe}
[install-vanilla]
# For now simply copy downloaded vanilla files to instance repo as we need to set
# cwd to vanilla folder. Maybe all files doesn't need to be copied
recipe = plone.recipe.command
command =
if [ "$(ls -A ${directory:vanilla})" ]; then
echo "skipping..."
else
cp -ax {{ parameter_dict['vanilla-location'] }}/* ${directory:vanilla}
fi
stop-on-error = true
update-command = ${:command}
[vanilla-runtime]
recipe = slapos.cookbook:wrapper
command-line =
${java-bin:output} -jar ${directory:vanilla}/VanillaRuntime/org.eclipse.osgi_3.13.200.v20181130-2106.jar -consoleLog -console
wrapper-path = ${directory:services}/vanilla
environment =
JAVA_OPTIONS="-Xms256m -Xmx1024m -Dosgi.compatibility.bootdelegation=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dlog4j.debug=${vanilla:debug} -Dorg.eclipse.equinox.http.jetty.http.port=${jetty-service:port} -Dorg.eclipse.equinox.http.jetty.context.path=/VanillaRuntime -Dbpm.vanilla.configurationFile=${vanilla:config-file} -Dlogback.configurationFile=${vanilla:logback}"
depends =
${repositoryone-properties:recipe}
${install-vanilla:recipe}
[jetty-service]
recipe = slapos.cookbook:wrapper
command-line =
${java-bin:output} -jar ${directory:vanilla}/start.jar -Djetty.port=${:port}
wrapper-path = ${directory:services}/jetty
port = ${jetty:http.port}
environment =
JETTY_HOME=${directory:vanilla}
JAVA_OPTIONS="-Xms256m -Xmx4096m -Dlog4j.debug=${vanilla:debug} -Dbpm.vanilla.configurationFile=${vanilla:config-file} -Dlogback.configurationFile=${vanilla:logback}"
depends =
${install-vanilla:recipe}
# Java wrapper with environment variable
[java-bin]
recipe = slapos.recipe.template
inline =
#!/bin/sh -e
export JAVA_HOME={{ parameter_dict['java-location'] }}
export JRE_HOME={{ parameter_dict['java-location'] }}
export PATH={{ parameter_dict['java-location'] }}/bin:$PATH
cd ${directory:vanilla}
exec java "$@"
output = ${directory:bin}/vanilla-java
[publish-connection-information]
<= monitor-publish
recipe = slapos.cookbook:publish
database-list = ${request-mariadb:connection-database-list}
[publish-early]
recipe = slapos.cookbook:publish-early
-init =
monitor-password monitor-htpasswd:passwd
[monitor-instance-parameter]
username = admin
password = ${publish-early:monitor-password}
[monitor-base-url-dict]
{% for key, value in monitor_base_url_dict.items() -%}
{{ key }} = {{ value }}
{% endfor %}
[buildout]
extends =
{{ template_logrotate }}
{{ ' ' ~ template_monitor }}
parts =
monitor-base
request-mariadb
vanilla-runtime
jetty-service
publish-connection-information
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[buildout]
parts =
switch_softwaretype
eggs-directory = {{ buildout_egg_directory }}
develop-eggs-directory = {{ buildout_develop_directory }}
offline = true
[switch_softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = dynamic-template-vanilla:output
RootSoftwareInstance = ${:default}
mariadb = dynamic-template-mariadb:output
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
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]
recipe = slapos.recipe.template:jinja2
output = ${buildout:directory}/${:filename}
extensions = jinja2.ext.do
extra-context =
context =
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
key ipv4_set slap-configuration:ipv4
key ipv6_set slap-configuration:ipv6
raw bin_directory {{ bin_directory }}
key slapparameter_dict slap-configuration:configuration
key computer_id slap-configuration:computer
raw template_monitor {{ template_monitor }}
raw openssl_location {{ openssl_location }}
raw logrotate_cfg {{ logrotate_cfg }}
${:extra-context}
[dynamic-template-vanilla-parameters]
java-location = {{ java_location }}
vanilla-location = {{ vanilla_location }}
template-vanilla-properties = {{ template_vanilla_properties }}
[dynamic-template-vanilla]
<= jinja2-template-base
url = {{ template_vanilla }}
filename = template-vanilla.cfg
extra-context =
section parameter_dict dynamic-template-vanilla-parameters
[dynamic-template-mariadb-parameters]
bash = {{ bash_location }}
coreutils-location = {{ coreutils_location }}
dash-location = {{ dash_location }}
findutils-location = {{ findutils_location }}
gzip-location = {{ gzip_location }}
xz-utils-location = {{ xz_utils_location }}
mariadb-location = {{ mariadb_location }}
template-my-cnf = {{ template_my_cnf }}
template-mariadb-initial-setup = {{ template_mariadb_initial_setup }}
template-mysqld-wrapper = {{ template_mysqld_wrapper }}
link-binary = {{ dumps(mariadb_link_binary) }}
mariadb-resiliency-after-import-script = {{ mariadb_resiliency_after_import_script }}
mariadb-slow-query-report-script = {{ mariadb_slow_query_report_script }}
mariadb-start-clone-from-backup = {{ mariadb_start_clone_from_backup }}
promise-check-slow-queries-digest-result = {{ bin_directory }}/check-slow-queries-digest-result
percona-tools-location = {{ percona_toolkit_location }}
unixodbc-location = {{ unixodbc_location }}
mroonga-mariadb-install-sql = {{ mroonga_mariadb_install_sql }}
mroonga-mariadb-plugin-dir = {{ mroonga_mariadb_plugin_dir }}
groonga-plugins-path = {{ groonga_plugin_dir }}:{{ groonga_mysql_normalizer_plugin_dir }}
check-computer-memory-binary = {{ bin_directory }}/check-computer-memory
bin-directory = {{ bin_directory }}
[dynamic-template-mariadb]
<= jinja2-template-base
url = {{ template_mariadb }}
filename = instance-mariadb.cfg
extra-context =
section parameter_dict dynamic-template-mariadb-parameters
[buildout]
extends =
../../component/java/buildout.cfg
../../component/xz-utils/buildout.cfg
../../component/gzip/buildout.cfg
../../component/mariadb/buildout.cfg
../../stack/erp5/buildout.cfg
../../stack/slapos.cfg
parts =
slapos-cookbook
instance
[vanilla]
recipe = slapos.recipe.build:download-unpacked
url = http://dl.bpm-conseil.com/v8/Server/vanilla-jetty-8.0_GA.zip
md5sum = 4edbe7c93250c9bce683d17a5f20c4fa
[instance]
recipe = slapos.recipe.template:jinja2
output = ${buildout:directory}/instance.cfg
url = ${:_profile_base_location_}/${:filename}
context =
key bash_location bash:location
key bin_directory buildout:bin-directory
key buildout_egg_directory buildout:eggs-directory
key buildout_develop_directory buildout:develop-eggs-directory
key buildout_directory buildout:directory
key gzip_location gzip:location
key xz_utils_location xz-utils:location
key findutils_location findutils:location
key template_logrotate template-logrotate-base:output
key logrotate_cfg template-logrotate-base:output
key vanilla_location vanilla:location
key java_location java:location
key template_mariadb template-mariadb:target
key template_mariadb_initial_setup template-mariadb-initial-setup:target
key template_mysqld_wrapper template-mysqld-wrapper:output
key template_my_cnf template-my-cnf:target
key template_vanilla_properties template-vanilla-properties:target
key unixodbc_location unixodbc:location
key mariadb_link_binary template-mariadb:link-binary
key mariadb_location mariadb:location
key mariadb_resiliency_after_import_script mariadb-resiliency-after-import-script:target
key mariadb_slow_query_report_script mariadb-slow-query-report-script:target
key mariadb_start_clone_from_backup mariadb-start-clone-from-backup:target
key mroonga_mariadb_install_sql mroonga-mariadb:install-sql
key mroonga_mariadb_plugin_dir mroonga-mariadb:plugin-dir
key groonga_plugin_dir groonga:groonga-plugin-dir
key groonga_mysql_normalizer_plugin_dir groonga-normalizer-mysql:groonga-plugin-dir
key percona_toolkit_location percona-toolkit:location
[template-vanilla-properties]
<= download-template
output = ${buildout:directory}/vanilla.properties.in
[erp5]
# disable this section
recipe =
This diff is collapsed.
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