Commit 42760240 authored by Vincent Pelletier's avatar Vincent Pelletier

Add minimal support for NEO-backed storage.

Only able to use a pre-existing NEO cluster.
parent 45977c84
No related merge requests found
......@@ -141,12 +141,13 @@
"zodb-software-type": {
"description": "Zope Object DataBase implementation",
"default": "zeo",
"enum": ["zeo"],
"enum": ["zeo", "neo"],
"type": "string"
},
"zodb": {
"description": "Zope Object DataBase service",
"oneOf": [
{"$ref": "./instance-neo-input-schema.json#properties"},
{"$ref": "./instance-zeo-input-schema.json#properties"}
]
}
......
{
"$schema": "http://json-schema.org/draft-04/schema#",
"extends": "./schema-definitions.json#",
"required": ["zodb-dict"],
"properties": {
"zodb-dict": {
"description": "Maps an export identifier to its settings",
"patternProperties": {
".*": {
"properties": {
"mount-point": {
"description": "Traversal path export should be mounted at (opaque to this software type)",
"default": "/",
"type": "string"
},
"cache-size": {
"description": "Client-side cache size in object count (opaque to this software type)",
"default": -1,
"type": "integer"
},
"storage-dict": {
"default": {},
"required": ["name", "master_nodes"],
"properties": {
"name": {
"description": "NEO cluster's name",
"type": "string"
},
"master_nodes": {
"description": "Client-side settings for this mountpoint",
"minItems": 1,
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Values returned by ZEO instanciation",
"properties": {
"zodb-storage-type": {
"description": "zope.cfg-friendly storage type",
"enum": ["NEOStorage"],
"type": "string"
},
"zodb-dict": {
"description": "Maps an export identifier to values received as parameters",
"patternProperties": {
".*": {
"description": "Contains the mount-point, cache-size and client-dict received as parameters for current export identifier (client-dict's 'storage' and 'server' entries are overwritten with actual values)",
"type": "array"
}
},
"type": "object"
},
},
"type": "object"
}
......@@ -210,7 +210,7 @@ md5sum = 564006953b7d7a12d40a14b6648b32f0
# XXX: "template.cfg" is hardcoded in instanciation recipe
filename = template.cfg
template = ${:_profile_base_location_}/instance.cfg.in
md5sum = d4b6e9bdaea4c11827dcb7a30c2d20c9
md5sum = 3465c19d25e14865c6e844c9a26ee984
extra-context =
key apache_location apache:location
key aspell_location aspell:location
......@@ -266,6 +266,7 @@ extra-context =
key template_mariadb template-mariadb:target
key template_mariadb_initial_setup template-mariadb-initial-setup:target
key template_my_cnf template-my-cnf:target
key template_neo template-neo:target
key template_varnish template-varnish:target
key template_zeo template-zeo:target
key template_zope template-zope:target
......@@ -286,6 +287,11 @@ md5sum = 77ec4f095a22b5bd7dfea9dff63bade5
filename = instance-erp5-cluster.cfg.in
md5sum = c745d794b28cae64feba527f894d7340
[template-neo]
< = download-base
filename = instance-neo.cfg.in
md5sum = 1499c42d196f6627efb904f7e4d48b1b
[template-zeo]
< = download-base
filename = instance-zeo.cfg.in
......
{% if software_type == slap_software_type -%}
{% set zodb_dict = {} -%}
{% for export_id, mountpoint_dict in slapparameter_dict['zodb-dict'].items() -%}
{% do zodb_dict.__setitem__(export_id, [
mountpoint_dict.get('mount-point', '/'),
mountpoint_dict.get('cache-size', -1),
mountpoint_dict.get('storage-dict', {}),
]) -%}
{% endfor -%}
[publish]
recipe = slapos.cookbook:publish.serialised
zodb-storage-type = NEOStorage
zodb-dict = {{ dumps(zodb_dict) }}
[buildout]
parts +=
publish
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
{% endif %}
......@@ -183,6 +183,15 @@ extra-context =
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type balancer
[dynamic-template-neo]
< = jinja2-template-base
template = {{ template_zeo }}
filename = instance-neo.cfg
extensions = jinja2.ext.do
extra-context =
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type zodb-neo
[dynamic-template-zeo-parameters]
buildout-bin-directory = {{ buildout_bin_directory }}
instance-logrotate-cfg = {{ template_logrotate_base }}
......@@ -282,6 +291,7 @@ zope = ${dynamic-template-zope:rendered}
mariadb = ${dynamic-template-mariadb:rendered}
varnish = ${dynamic-template-varnish:rendered}
balancer = ${dynamic-template-balancer:rendered}
zodb-neo = ${dynamic-template-neo:rendered}
zodb-zeo = ${dynamic-template-zeo:rendered}
cluster-zope = ${dynamic-template-cluster-zope:rendered}
......
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