Commit 95ef7b87 authored by Benjamin Blanc's avatar Benjamin Blanc

Scalability: remove recipe and specific buildout scalability-launcher instance

Update code
parent 346d93cc
##############################################################################
#
# Copyright (c) 2011 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import os
from slapos.recipe.librecipe import GenericBaseRecipe
# options needed :
#
# url
# scalability-launcher-log
# scalability-launcher-binary
# test-suite-title
# shell-path
# scalability-launcher-wrapper
class Recipe(GenericBaseRecipe):
def install(self):
# Variables used in the template
config = dict(
url=self.options['url'],
scalability_launcher_log=self.options['scalability-launcher-log'],
scalability_launcher_binary=self.options['scalability-launcher-binary'],
test_suite_title=self.options['test-suite-title'],
shell_path=self.options['shell-path'],
)
# Just create a wrapper
path_list = []
path_list.append(self.createExecutable(self.options['scalability-launcher-wrapper'],
self.substituteTemplate(self.getTemplateFilename('launcher.in'),
config)))
return path_list
#!%(shell_path)s
exec %(scalability_launcher_binary)s %(url)s 5 %(test_suite_title)s %(scalability_launcher_log)s
\ No newline at end of file
......@@ -252,7 +252,6 @@ extra-context =
key template_erp5_single template-erp5-single:target
key template_erp5_cluster template-erp5-cluster:target
key template_scalability template-scalability:target
key template_scalability_launcher template-scalability-launcher:target
key template_kumofs template-kumofs:target
key template_logrotate_base template-logrotate-base:rendered
key template_mariadb template-mariadb:target
......@@ -284,11 +283,6 @@ md5sum = d4d95f1749e1d9d3701565f934fcd4dc
filename = instance-scalability.cfg.in
md5sum = 6d33726c7cbe727fe7175080864e3ea1
[template-scalability-launcher]
< = download-base
filename = instance-scalability-launcher.cfg.in
md5sum = 7a15da7342d72a996e5325c69bf17a04
[template-zeo]
< = download-base
filename = instance-zeo.cfg.in
......
[buildout]
parts =
scalability-launcher
[scalability-launcher]
recipe = slapos.cookbook:generic.scalability.launcher
url = "http://foo.bar"
scalability-launcher-log = ${basedirectory:log}/scalability_launcher.log
scalability-launcher-binary = {{ parameter_dict['scalability-location'] }}/bin/scalability_launcher
test-suite-title = "ERP5-Sca"
shell-path = {{ parameter_dict['dash-location'] }}/bin/dash
scalability-launcher-wrapper = ${basedirectory:services}/scalability_launcher
[basedirectory]
recipe = slapos.cookbook:mkdirectory
log = ${rootdirectory:var}/log
run = ${rootdirectory:var}/run
services = ${rootdirectory:etc}/run
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = ${buildout:directory}/etc
var = ${buildout:directory}/var
srv = ${buildout:directory}/srv
bin = ${buildout:directory}/bin
\ No newline at end of file
{% if slap_software_type == software_type -%}
[buildout]
parts =
erp5-cluster
request-scalability-launcher
binary-wrap-launcher
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[request-common]
[erp5-cluster]
recipe = slapos.cookbook:request.serialised
software-url = ${slap-connection:software-release-url}
sla = computer_guid
return = url
server-url = ${slap-connection:server-url}
key-file = ${slap-connection:key-file}
cert-file = ${slap-connection:cert-file}
computer-id = ${slap-connection:computer-id}
partition-id = ${slap-connection:partition-id}
name = ERP5 Cluster
software-url = ${slap-connection:software-release-url}
software-type = cluster
sla-computer_guid = {{ slapparameter_dict.get('launcher-computer-guid', computer_id) }}
config =
use-ipv6
${:extra-config}
extra-config =
config-use-ipv6 = {{ dumps(slapparameter_dict.get('use-ipv6', False)) }}
return = url
[erp5-cluster]
recipe = slapos.cookbook:softwaretype
name = ERP5 Cluster
software-type = cluster
[request-scalability-launcher]
<=request-common
name = Scalability Launcher 1
slave = false
software-type = launcher
sla-computer_guid = {{ slapparameter_dict.get('scalability-launcher-computer-guid', computer_id) }}
[launcher-param]
binary-path = ${rootdirectory:bin}/launcher
wrapper-path = ${rootdirectory:bin}/launcher
log-path = ${basedirectory:log}/scalability_launcher.log
test-suite-title = {{ slapparameter_dict.get('test-suite-title', '') }}
[binary-wrap-launcher]
recipe = slapos.cookbook:wrapper
command-line = "{{ parameter_dict['launcher-location'] }}/bin/launcher \
--test_suite_title Bonjour --log ${launcher-param:log-path}"
output = ${launcher-param:binary-path}
#
# voir : instance-mariadb.cfg.in ... (ou pas)
#
[basedirectory]
recipe = slapos.cookbook:mkdirectory
log = ${rootdirectory:var}/log
run = ${rootdirectory:var}/run
services = ${rootdirectory:etc}/run
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = ${buildout:directory}/etc
var = ${buildout:directory}/var
srv = ${buildout:directory}/srv
bin = ${buildout:directory}/bin
{% endif %}
\ No newline at end of file
......@@ -162,16 +162,12 @@ extra-context =
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type cluster
[dynamic-template-scalability-parameters]
local-bt5-repository = {{ local_bt5_repository }}
[dynamic-template-scalability]
< = jinja2-template-base
template = {{ template_scalability }}
filename = instance-scalability.cfg
extensions = jinja2.ext.do
extra-context =
key local_bt5_repository dynamic-template-scalability-parameters:local-bt5-repository
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type scalability
......
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