Commit 8725ab1a authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

slaprunner: use switch-softwaretype instead of softwaretype

parent 4b5a20a3
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
# not need these here). # not need these here).
[template] [template]
filename = instance.cfg filename = instance.cfg
md5sum = 8b78e32b877d591400746ec7fd68ed4c md5sum = ec70348dd71b319590a5c5837f3d2e45
[template-runner] [template-runner]
filename = instance-runner.cfg filename = instance-runner.cfg
md5sum = 99f2c1e0ff1668e57a242a77a33b4d23 md5sum = b20894f378530e79c847ddfb61782cc5
[template-runner-import-script] [template-runner-import-script]
filename = template/runner-import.sh.jinja2 filename = template/runner-import.sh.jinja2
......
...@@ -51,9 +51,9 @@ extends = ...@@ -51,9 +51,9 @@ extends =
${monitor2-template:rendered} ${monitor2-template:rendered}
${template-logrotate-base:rendered} ${template-logrotate-base:rendered}
eggs-directory = ${buildout:eggs-directory} [slap-network-information]
develop-eggs-directory = ${buildout:develop-eggs-directory} local-ipv4 = $${slap-configuration:ipv4-random}
offline = true global-ipv6 = $${slap-configuration:ipv6-random}
{% if slapparameter_dict.get('custom-frontend-backend-url') -%} {% if slapparameter_dict.get('custom-frontend-backend-url') -%}
[request-custom-frontend] [request-custom-frontend]
...@@ -659,6 +659,9 @@ monitor-cors-domains = ...@@ -659,6 +659,9 @@ monitor-cors-domains =
monitor-interface-url = monitor-interface-url =
monitor-httpd-port = 8386 monitor-httpd-port = 8386
buildout-shared-folder = $${runnerdirectory:home}/shared buildout-shared-folder = $${runnerdirectory:home}/shared
{% for k, v in slapparameter_dict.items() -%}
{{ k }} = {{ v }}
{% endfor -%}
[slapos-cfg] [slapos-cfg]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
...@@ -739,15 +742,6 @@ recipe = plone.recipe.command ...@@ -739,15 +742,6 @@ recipe = plone.recipe.command
stop-on-error = true stop-on-error = true
command = SR=$${slap-parameter:slapos-software} && if [ -n "$SR" ] && [ ! -f "$${directory:etc}/.project" ]; then echo workspace/slapos/$${slap-parameter:slapos-software}/ > $${directory:etc}/.project; fi command = SR=$${slap-parameter:slapos-software} && if [ -n "$SR" ] && [ ! -f "$${directory:etc}/.project" ]; then echo workspace/slapos/$${slap-parameter:slapos-software}/ > $${directory:etc}/.project; fi
[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}
[minishell-cwd] [minishell-cwd]
recipe = plone.recipe.command recipe = plone.recipe.command
command = if [ ! -f $${slaprunner:minishell_cwd_file} ]; then echo $${runnerdirectory:home} > $${slaprunner:minishell_cwd_file}; fi command = if [ ! -f $${slaprunner:minishell_cwd_file} ]; then echo $${runnerdirectory:home} > $${slaprunner:minishell_cwd_file}; fi
......
...@@ -9,15 +9,18 @@ extends = ...@@ -9,15 +9,18 @@ extends =
${template-resilient-templates:output} ${template-resilient-templates:output}
[switch_softwaretype] [switch_softwaretype]
recipe = slapos.cookbook:softwaretype recipe = slapos.cookbook:switch-softwaretype
default = $${instance-base-runner:rendered} default = $${:runner}
resilient = $${instance-resilient:rendered} resilient = instance-resilient:rendered
runner = $${instance-base-runner:rendered} runner = instance-base-runner:rendered
runner-import = $${template-runner-import:rendered} runner-import = template-runner-import:rendered
runner-export = $${template-runner-export:rendered} runner-export = template-runner-export:rendered
frozen = ${instance-frozen:output} frozen = instance-frozen:rendered
pull-backup = ${template-pull-backup:output} pull-backup = template-pull-backup:rendered
# BBB
RootSoftwareInstance = $${:default}
[instance-base-runner] [instance-base-runner]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
......
...@@ -26,7 +26,7 @@ md5sum = 2b0c71b085cfe8017f28098c160b1f49 ...@@ -26,7 +26,7 @@ md5sum = 2b0c71b085cfe8017f28098c160b1f49
[template-pull-backup] [template-pull-backup]
filename = instance-pull-backup.cfg.in filename = instance-pull-backup.cfg.in
md5sum = 0bbe16f3d805afd880a251a4f40ecaf1 md5sum = 555d528b198564f0ce1e94db1160ebf3
[template-replicated] [template-replicated]
filename = template-replicated.cfg.in filename = template-replicated.cfg.in
...@@ -38,7 +38,7 @@ md5sum = 071b1034ee8f5cc14f79b16fdeba2813 ...@@ -38,7 +38,7 @@ md5sum = 071b1034ee8f5cc14f79b16fdeba2813
[template-resilient-templates] [template-resilient-templates]
filename = template-resilient-templates.cfg.in filename = template-resilient-templates.cfg.in
md5sum = 41e82859dc6b65e94a300a006d51536e md5sum = 097a14371efde11465ab4bd08ef3131b
[instance-frozen] [instance-frozen]
filename = instance-frozen.cfg.in filename = instance-frozen.cfg.in
......
...@@ -19,10 +19,6 @@ parts = ...@@ -19,10 +19,6 @@ parts =
extends = extends =
${monitor2-template:rendered} ${monitor2-template:rendered}
${template-logrotate-base:rendered} ${template-logrotate-base:rendered}
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
#---------------- #----------------
#-- #--
...@@ -90,7 +86,7 @@ rendered = $${:wrapper} ...@@ -90,7 +86,7 @@ rendered = $${:wrapper}
wrapper = $${basedirectory:services}/notifier wrapper = $${basedirectory:services}/notifier
mode = 0700 mode = 0700
command = ${buildout:bin-directory}/pubsubserver --callbacks $${directory:notifier-callbacks} --feeds $${directory:notifier-feeds} --equeue-socket $${equeue:socket} --logfile $${basedirectory:log}/notifier.log $${:host} $${:port} command = ${buildout:bin-directory}/pubsubserver --callbacks $${directory:notifier-callbacks} --feeds $${directory:notifier-feeds} --equeue-socket $${equeue:socket} --logfile $${basedirectory:log}/notifier.log $${:host} $${:port}
host = $${slap-network-information:global-ipv6} host = {{ ipv6 }}
port = $${notifier-port:port} port = $${notifier-port:port}
context = context =
key content notifier:command key content notifier:command
...@@ -128,8 +124,8 @@ run-directory = $${basedirectory:run} ...@@ -128,8 +124,8 @@ run-directory = $${basedirectory:run}
pull-push-maximum-run = 5 pull-push-maximum-run = 5
# XXX: this should be named "notifier-host" # XXX: this should be named "notifier-host"
notifier-url = http://[$${notifier:host}]:$${notifier:port} notifier-url = http://[$${notifier:host}]:$${notifier:port}
slave-instance-list = $${slap-parameter:slave_instance_list} slave-instance-list = {{ slapparameter_dict.get('slave_instance_list', '[]') }}
ignore-known-hosts-file = $${slap-parameter:ignore-known-hosts-file} ignore-known-hosts-file = {{ slapparameter_dict.get('ignore-known-hosts-file', 'false') }}
# To get a verbose feed about PBS state # To get a verbose feed about PBS state
instance-root-name = $${monitor-instance-parameter:root-instance-title} instance-root-name = $${monitor-instance-parameter:root-instance-title}
log-url = $${monitor-publish-parameters:monitor-base-url}/private/notifier/ log-url = $${monitor-publish-parameters:monitor-base-url}/private/notifier/
...@@ -194,20 +190,6 @@ identity-file = $${:home}/id_rsa ...@@ -194,20 +190,6 @@ identity-file = $${:home}/id_rsa
command-line = ${openssh:location}/bin/ssh -T -o "UserKnownHostsFile $${pbs:known-hosts}" -i $${:identity-file} command-line = ${openssh:location}/bin/ssh -T -o "UserKnownHostsFile $${pbs:known-hosts}" -i $${:identity-file}
wrapper-path = $${rootdirectory:bin}/ssh wrapper-path = $${rootdirectory:bin}/ssh
#----------------
#--
#-- Slave instance list (empty default).
[slap-parameter]
slave_instance_list = []
ignore-known-hosts-file = false
monitor-cors-domains =
monitor-httpd-port = 8070
monitor-title = PBS Instance
monitor-password = $${monitor-htpasswd:passwd}
monitor-username = admin
#---------------- #----------------
#-- #--
#-- Resiliency promises. #-- Resiliency promises.
...@@ -269,11 +251,11 @@ monitor-password = $${monitor-publish-parameters:monitor-password} ...@@ -269,11 +251,11 @@ monitor-password = $${monitor-publish-parameters:monitor-password}
#-- Monitor #-- Monitor
[monitor-instance-parameter] [monitor-instance-parameter]
monitor-httpd-port = $${slap-parameter:monitor-httpd-port} monitor-httpd-port = {{ slapparameter_dict.get('monitor-httpd-port', 8070) }}
monitor-title = $${slap-parameter:monitor-title} monitor-title = {{ slapparameter_dict.get('monitor-title', 'PBS Instance') }}
cors-domains = $${slap-parameter:monitor-cors-domains} cors-domains = {{ slapparameter_dict.get('monitor-cors-domains', '') }}
username = $${slap-parameter:monitor-username} username = {{ slapparameter_dict.get('monitor-username', 'admin') }}
password = $${slap-parameter:monitor-password} password = {{ slapparameter_dict.get('monitor-password', '$${monitor-htpasswd:passwd}') }}
[monitor-conf-parameters] [monitor-conf-parameters]
private-path-list += private-path-list +=
......
...@@ -8,3 +8,20 @@ context = ...@@ -8,3 +8,20 @@ context =
raw pbsready_template_path ${pbsready:output} raw pbsready_template_path ${pbsready:output}
raw bash_executable_location ${bash:location}/bin/bash raw bash_executable_location ${bash:location}/bin/bash
raw logrotate_executable_location ${logrotate:location}/usr/sbin/logrotate raw logrotate_executable_location ${logrotate:location}/usr/sbin/logrotate
[instance-frozen]
recipe = slapos.recipe.template:jinja2
template = ${instance-frozen:output}
rendered = $${buildout:directory}/template-frozen.cfg
extensions = jinja2.ext.do
context =
key slapparameter_dict slap-configuration:configuration
[template-pull-backup]
recipe = slapos.recipe.template:jinja2
template = ${template-pull-backup:output}
rendered = $${buildout:directory}/template-pull-backup.cfg
extensions = jinja2.ext.do
context =
key slapparameter_dict slap-configuration:configuration
key ipv6 slap-configuration:ipv6-random
  • This seem to have caused issues with SlapOS.SlapRunner.ResilienceTest-Master.ERP5. Test fail like this:

    While:
      Installing.
      Getting section switch_softwaretype.
      Initializing section switch_softwaretype.
    
    An internal error occurred due to a bug in either zc.buildout or in a
    recipe being used:
    Traceback (most recent call last):
      File eggs/zc.buildout-2.7.1+slapos001-py2.7.egg/zc/buildout/buildout.py", line 2240, in main
        getattr(buildout, command)(args)
      File eggs/zc.buildout-2.7.1+slapos001-py2.7.egg/zc/buildout/buildout.py", line 643, in install
        self._install_parts(install_args)
      File eggs/zc.buildout-2.7.1+slapos001-py2.7.egg/zc/buildout/buildout.py", line 694, in _install_parts
        [self[part]['recipe'] for part in install_parts]
      File eggs/zc.buildout-2.7.1+slapos001-py2.7.egg/zc/buildout/buildout.py", line 1304, in __getitem__
        options._initialize()
      File eggs/zc.buildout-2.7.1+slapos001-py2.7.egg/zc/buildout/buildout.py", line 1418, in _initialize
        self.recipe = self.buildout.initialize(self, *_recipe(self._data))
      File eggs/zc.buildout-2.7.1+slapos001-py2.7.egg/zc/buildout/buildout.py", line 1288, in initialize
        return recipe_class(self, options.name, options)
      File parts/slapos.cookbook-repository/slapos/recipe/switch_softwaretype.py", line 38, in __init__
        section, key = self.options[self.software_type].split(":")
    ValueError: need more than 1 value to unpack

    The software release installed is https://lab.nexedi.com/nexedi/slapos/blob/master/software/erp5testnode/testsuite/slaprunner.cfg which reused parts of slaprunner.

    before bcf6f229...075b0ba2 test was failing like this but at least the test software was installing.

    I made a quick fix, b2e21fe9 and pushed to master directly when I saw that slapos node instance succeeded.

  • mentioned in commit slapos.core@a9b92d27

    Toggle commit list
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