Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos-mynij-dev
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mynij
slapos-mynij-dev
Commits
15c2a0d0
Commit
15c2a0d0
authored
Aug 08, 2019
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5/NEO: fix/optimize propagation of the 'masters' parameter
parent
fa7df772
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
30 additions
and
59 deletions
+30
-59
software/neoppod/cluster.cfg.in
software/neoppod/cluster.cfg.in
+9
-5
software/neoppod/instance-neo-admin.cfg.in
software/neoppod/instance-neo-admin.cfg.in
+1
-1
software/neoppod/instance-neo-master.cfg.in
software/neoppod/instance-neo-master.cfg.in
+1
-1
software/neoppod/instance-neo.cfg.in
software/neoppod/instance-neo.cfg.in
+1
-16
software/neoppod/root-common.cfg.in
software/neoppod/root-common.cfg.in
+9
-24
software/neoppod/software-common.cfg
software/neoppod/software-common.cfg
+4
-4
software/neoppod/software.cfg
software/neoppod/software.cfg
+1
-1
stack/erp5/buildout.hash.cfg
stack/erp5/buildout.hash.cfg
+1
-1
stack/erp5/instance-erp5.cfg.in
stack/erp5/instance-erp5.cfg.in
+3
-6
No files found.
software/neoppod/cluster.cfg.in
View file @
15c2a0d0
{% import "root_common" as common_macro with context %}
[request-common]
<= request-common-base
{{ common_macro.request_neo(slapparameter_dict, 'neo', 'node-') }}
[publish-early]
recipe = slapos.cookbook:publish-early
-init =
neo-admins node-cluster:admins
neo-masters node-cluster:masters
[publish]
recipe = slapos.cookbook:publish.serialised
neo-masters = ${node-0-final:connection-masters}
neo-admins = ${node-0-final:connection-admins}
-extends = publish-early
{{ common_macro.common_section() }}
software/neoppod/instance-neo-admin.cfg.in
View file @
15c2a0d0
...
...
@@ -13,7 +13,7 @@ ip = ${publish:ip}
port = ${publish:port-admin}
ssl = {{ dumps(bool(slapparameter_dict['ssl'])) }}
cluster = {{ dumps(slapparameter_dict['cluster']) }}
masters =
${publish:masters
}
masters =
{{ dumps(slapparameter_dict['masters']) }
}
[neo-admin-promise]
recipe = slapos.cookbook:check_port_listening
...
...
software/neoppod/instance-neo-master.cfg.in
View file @
15c2a0d0
...
...
@@ -21,7 +21,7 @@ autostart = {{ slapparameter_dict['autostart'] }}
# No actual installation takes place at that time
# (slapos.cookbook:neoppod.master raises), but cfg expansion must succeed. So
# this default value is required.
masters =
${publish:masters
}
masters =
{{ dumps(slapparameter_dict['masters']) }
}
[neo-master-promise]
recipe = slapos.cookbook:check_port_listening
...
...
software/neoppod/instance-neo.cfg.in
View file @
15c2a0d0
...
...
@@ -47,17 +47,6 @@ recipe = slapos.cookbook:symbolic.link
target-directory = ${directory:bin}
link-binary = {{ bin_directory }}/neolog
{% set master_list = [] -%}
{% set admin_list = [] -%}
{% for k, v in slapparameter_dict.iteritems() -%}
{% if k.startswith('master-') and v -%}
{% do master_list.append(v) -%}
{% endif -%}
{% if k.startswith('admin-') and v -%}
{% do admin_list.append(v) -%}
{% endif -%}
{% endfor -%}
[publish]
recipe = slapos.cookbook:publish.serialised
# TODO: make port a partition parameter
...
...
@@ -76,10 +65,6 @@ admin = ${:ip}:${:port-admin}
{% else -%}
admin =
{% endif -%}
masters = {{ ' '.join(sorted(master_list)) }}
{%- if admin_list %}
admins = {{ ' '.join(sorted(admin_list)) }}
{%- endif %}
{#- Hack to deploy SSL certs via instance parameters #}
{%- for name, pem in zip(('ca.crt', 'neo.crt', 'neo.key'),
...
...
@@ -102,7 +87,7 @@ binary = {{ bin_directory }}/neostorage
ip = ${publish:ip}
ssl = {{ dumps(bool(slapparameter_dict['ssl'])) }}
cluster = {{ dumps(slapparameter_dict['cluster']) }}
masters =
${publish:masters
}
masters =
{{ dumps(slapparameter_dict['masters']) }
}
database-adapter = {{ storage_type }}
wait-database = -1
engine = ${my-cnf-parameters:engine}
...
...
software/neoppod/root-common.cfg.in
View file @
15c2a0d0
...
...
@@ -39,6 +39,10 @@ parts =
{% set section_id_list = [] -%}
[{{ prefix }}request-common]
<= request-common-base
return =
master
admin
config-masters = {{ '${' ~ prefix ~ 'cluster:masters}' }}
config-cluster = {{ parameter_dict['cluster'] }}
{% set replicas = parameter_dict.get('replicas', 0) -%}
config-partitions = {{ dumps(parameter_dict.get('partitions', 12)) }}
...
...
@@ -62,35 +66,16 @@ config-autostart = {{ dumps(sum(storage_count)) }}
{% set section_id = prefix ~ i -%}
{% do section_id_list.append(section_id) -%}
[{{ section_id }}-base]
[{{section_id}}]
<= {{ prefix }}request-common
name = {{ section_id }}
{% for k, v in node.iteritems() -%}
config-{{ k }} = {{ dumps(v) }}
{% endfor -%}
{{ sla(section_id) }}
[{{ section_id }}]
<= {{ prefix }}request-common
{{ section_id }}-base
return =
master
admin
{% endfor -%}
[final-base]
{% for i, section_id in enumerate(section_id_list) -%}
config-master-{{i}} = {{ '${' + section_id + ':connection-master}' }}
config-admin-{{i}} = {{ '${' + section_id + ':connection-admin}' }}
{% endfor -%}
{% for section_id in section_id_list -%}
[{{ section(section_id + '-final') }}]
<= {{ prefix }}request-common
final-base
{{ section_id }}-base
{% if loop.first -%}
return =
masters
admins
{% endif -%}
{% endfor -%}
[{{section(prefix ~ 'cluster')}}]
recipe = slapos.cookbook:neoppod.cluster
nodes = {{ ' '.join(section_id_list) }}
{% endmacro -%}
software/neoppod/software-common.cfg
View file @
15c2a0d0
...
...
@@ -111,19 +111,19 @@ adapter-context =
[root-common]
<= download-base-neo
md5sum =
66055aa82f9097c5301864c07e6e5d80
md5sum =
15fa47a59cc3019f59612aaf33bd9ec5
[instance-neo-admin]
<= download-base-neo
md5sum =
4d1ae570b4458e7725454857aabb37f6
md5sum =
ce0d9ff9e899bb706351a99df29238a9
[instance-neo-master]
<= download-base-neo
md5sum =
1fee10f02c2fa2a581e21878ca0fd704
md5sum =
4faee020eaf7cd495cd6210dfa4eb0c1
[instance-neo]
<= download-base-neo
md5sum =
d4e30d74316e6931da4a1e305f9bbc68
md5sum =
3e394ae616e554e1eacb2b86ee74fc76
[template-neo-my-cnf]
<= download-base-neo
...
...
software/neoppod/software.cfg
View file @
15c2a0d0
...
...
@@ -22,7 +22,7 @@ context =
[cluster]
<= download-base-neo
md5sum =
ee8401a4e7d82bf488a57e3399f9ce48
md5sum =
5afd326de385563b5aeac81039f23341
[runTestSuite.in]
recipe = slapos.recipe.build:download
...
...
stack/erp5/buildout.hash.cfg
View file @
15c2a0d0
...
...
@@ -78,7 +78,7 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e
[template-erp5]
filename = instance-erp5.cfg.in
md5sum =
ca5375204bacdc1df30285d3c5d179b1
md5sum =
af5d9aeac2bae695220465a4348ae592
[template-zeo]
filename = instance-zeo.cfg.in
...
...
stack/erp5/instance-erp5.cfg.in
View file @
15c2a0d0
...
...
@@ -212,7 +212,7 @@ config-test-runner-node-count = {{ dumps(test_runner_node_count) }}
{% if server_type == 'neo' -%}
config-neo-cluster = ${publish-early:neo-cluster}
config-neo-name = {{ server_dict.keys()[0] }}
config-neo-masters = ${
neo-0-final:connection
-masters}
config-neo-masters = ${
publish-early:neo
-masters}
{% else -%}
config-zodb-zeo = ${request-zodb:connection-storage-dict}
config-tidstorage-ip = ${request-zodb:connection-tidstorage-ip}
...
...
@@ -368,10 +368,6 @@ return = site_url
<= monitor-publish
recipe = slapos.cookbook:publish.serialised
-extends = publish-early
{% if 'neo' in storage_dict -%}
neo-masters = ${neo-0-final:connection-masters}
neo-admins = ${neo-0-final:connection-admins}
{% endif -%}
{% if zope_address_list_id_dict -%}
{#
Pick any published hosts-dict, they are expected to be identical - and there is
...
...
@@ -388,7 +384,6 @@ hosts-dict = {{ '${' ~ zope_address_list_id_dict.keys()[0] ~ ':connection-hosts-
{% endfor -%}
{% endif -%}
[publish-early]
recipe = slapos.cookbook:publish-early
-init =
...
...
@@ -404,6 +399,8 @@ recipe = slapos.cookbook:publish-early
{%- endif %}
{%- if neo %}
neo-cluster gen-neo-cluster:name
neo-admins neo-cluster:admins
neo-masters neo-cluster:masters
{%- if neo[0] %}
neo-cluster = {{ dumps(neo[0]) }}
{%- endif %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment