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
41119516
Commit
41119516
authored
Jan 21, 2014
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5: Implement automated ERP5Site creation.
parent
a9611645
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
159 additions
and
2 deletions
+159
-2
software/erp5/README.rst
software/erp5/README.rst
+26
-0
software/erp5/instance-erp5-input-schema.json
software/erp5/instance-erp5-input-schema.json
+26
-1
stack/erp5/buildout.cfg
stack/erp5/buildout.cfg
+13
-1
stack/erp5/instance-create-erp5-site-real.cfg.in
stack/erp5/instance-create-erp5-site-real.cfg.in
+31
-0
stack/erp5/instance-create-erp5-site.cfg.in
stack/erp5/instance-create-erp5-site.cfg.in
+41
-0
stack/erp5/instance.cfg.in
stack/erp5/instance.cfg.in
+22
-0
No files found.
software/erp5/README.rst
0 → 100644
View file @
41119516
Available ``software-type`` values
==================================
- ``default``
Recommended for production use.
- ``create-erp5-site``
Automated creation of ERP5Site instance, for easy deployment.
Usage in production discouraged due to the increased risk of data loss.
Notes
=====
This software release is not intended to be accessed directly, but through a
front-end instance which is expected to contains the RewriteRules_ (or
equivalent) needed to relocate Zope's urls via its VirtualHostMonster_. See the
``frontend`` erp5 instance parameter.
Included cloudooo partition is not recommended for intensive usage, and will
eventually be dropped. See the ``cloudooo`` software type to setup a cloudooo
cluster, more suitable for intensive usage.
.. _RewriteRules: http://httpd.apache.org/docs/current/en/mod/mod_rewrite.html#rewriterule
.. _VirtualHostMonster: http://docs.zope.org/zope2/zope2book/VirtualHosting.html
software/erp5/instance-erp5-input-schema.json
View file @
41119516
...
...
@@ -18,7 +18,32 @@
"description"
:
"Password for /manage_debug_threads"
,
"default"
:
"random"
,
"type"
:
"string"
}
},
"frontend"
:
{
"description"
:
"Front-end slave instance request parameters"
,
"properties"
:
{
"software-url"
:
{
"description"
:
"Front-end's software type. If this parameter is the empty string, no front-end instance is requested."
,
"default"
:
""
,
"type"
:
"string"
},
"domain"
:
{
"description"
:
"The domain name to request front-end to respond as."
,
"default"
:
""
,
"type"
:
"string"
},
"software-type"
:
{
"description"
:
"Request a front-end slave instance of this software type."
,
"default"
:
"RootSoftwareInstance"
,
"type"
:
""
},
"instance-guid"
:
{
"description"
:
"GUID of computer instance must be requested on. Mandatory if software-url is a non-empty string."
,
"type"
:
"string"
}
},
"type"
:
"object"
},
"zope-partition-dict"
:
{
"description"
:
"Zope layout definition"
,
"patternProperties"
:
{
...
...
stack/erp5/buildout.cfg
View file @
41119516
...
...
@@ -210,12 +210,22 @@ md5sum = 774b0e5d167b75a0ad8ead45fa2eadf6
filename = mariadb_initial_setup.sql.in
md5sum = 564006953b7d7a12d40a14b6648b32f0
[template-create-erp5-site]
< = download-base
filename = instance-create-erp5-site.cfg.in
md6sum = 4504b8e58cf6eb0f17ef30c29c04432d
[template-create-erp5-site-real]
< = download-base
filename = instance-create-erp5-site-real.cfg.in
md5sum = c7dde5117e3e99c9669b9a10c82778f3
[template]
< = template-jinja2-base
# XXX: "template.cfg" is hardcoded in instanciation recipe
filename = template.cfg
template = ${:_profile_base_location_}/instance.cfg.in
md5sum =
c717ed0f17a85da36f268cf55e545da7
md5sum =
3a3845caa33fffd762b346ed5949f196
extra-context =
key mariadb_link_binary template-mariadb:link-binary
key zope_link_binary template-zope:link-binary
...
...
@@ -255,6 +265,8 @@ extra-context =
key stunnel_location stunnel:location
key template_balancer template-balancer:target
key template_cloudooo template-cloudooo:target
key template_create_erp5_site template-create-erp5-site:target
key template_create_erp5_site_real template-create-erp5-site-real:target
key template_erp5 template-erp5:target
key template_haproxy_cfg template-haproxy-cfg:target
key template_kumofs template-kumofs:target
...
...
stack/erp5/instance-create-erp5-site-real.cfg.in
0 → 100644
View file @
41119516
[directory]
recipe = slapos.cookbook:mkdirectory
etc = ${buildout:directory}/etc
services = ${:etc}/run
promise = ${:etc}/promise
[erp5-bootstrap]
recipe = slapos.cookbook:erp5.bootstrap
runner-path = ${directory:services}/erp5-bootstrap
{# XXX: Expect the first database to be the one to use for catalog. -#}
mysql-url = {{ publish['mariadb-database-list'][0] }}
{# Pick the first family found, they should be all equivalent anyway. -#}
{% set family_list = [] -%}
{% for key, value in publish.items() -%}
{% if key.startswith('family-') -%}
{% do family_list.append(value.split('://', 1)) -%}
{% endif -%}
{% endfor -%}
zope-url = {{ family_list[0][0] + '://zope:insecure@' + family_list[0][1] + '/' + publish['site-id'] }}
[promise-erp5-site]
recipe = slapos.cookbook:check_url_available
url = ${erp5-bootstrap:zope-url}
path = ${directory:promise}/erp5-site
dash_path = {{ parameter_dict['dash-location'] }}/bin/dash
curl_path = {{ parameter_dict['curl-location'] }}/bin/curl
[buildout]
parts = promise-erp5-site
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
stack/erp5/instance-create-erp5-site.cfg.in
0 → 100644
View file @
41119516
{% if software_type == slap_software_type -%}
{# To create the script (wrapper) which creates the ERP5Site object, pieces
# of what is published by extended file are required. Because they are not
# available at the time the file you are reading is rendered, and because
# those values are composed (lists, dicts...) of which items are needed,
# they cannot be accessed. Instead, make buildout provide these values to
# a second template, rendered at a convenient time.
-#}
[instance-create-erp5-site-real-parameters]
dash-location = {{ parameter_dict['dash-location'] }}
curl-location = {{ parameter_dict['curl-location'] }}
[instance-create-erp5-site-real]
recipe = slapos.recipe.template:jinja2
template = {{ parameter_dict['template-create-erp5-site-real'] }}
rendered = ${buildout:directory}/instance-create-erp5-site-real.cfg
extensions = jinja2.ext.do
context =
section publish publish
section parameter_dict instance-create-erp5-site-real-parameters
key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory
[instance-create-erp5-site-real-run]
recipe = slapos.recipe.build
script =
import subprocess, sys
subprocess.check_call([
sys.argv[0],
"buildout:directory=${buildout:directory}",
"buildout:installed=.installed-${:_buildout_section_name_}.cfg",
"-Uoc", self.options['run'],
])
run = ${instance-create-erp5-site-real:rendered}
slapos_promise =
[buildout]
extends = {{ parameter_dict['instance-erp5'] }}
parts +=
instance-create-erp5-site-real-run
{% endif %}
stack/erp5/instance.cfg.in
View file @
41119516
...
...
@@ -78,6 +78,10 @@ software-type = cluster
< = dynamic-template-erp5
software-type = RootSoftwareInstance
[dynamic-template-erp5-create-erp5-site]
< = dynamic-template-erp5
software-type = create-erp5-site
[dynamic-template-balancer-parameters]
apache = {{ apache_location }}
openssl = {{ openssl_location }}
...
...
@@ -188,6 +192,21 @@ extra-context =
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type mariadb
[dynamic-template-create-erp5-site-parameters]
instance-erp5 = ${dynamic-template-erp5-create-erp5-site:rendered}
template-create-erp5-site-real = {{ template_create_erp5_site_real }}
dash-location = {{ dash_location }}
curl-location = {{ curl_location }}
[dynamic-template-create-erp5-site]
< = jinja2-template-base
template = {{ template_create_erp5_site }}
filename = instance-create-erp5-site.cfg
extra-context =
section parameter_dict dynamic-template-create-erp5-site-parameters
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type create-erp5-site
[switch-softwaretype]
recipe = slapos.recipe.build
script =
...
...
@@ -214,7 +233,10 @@ slapos_promise =
slapos_update_promise = ${:slapos_promise}
override = {{ dumps(override_switch_softwaretype |default) }}
# Public software types
default = ${dynamic-template-erp5:rendered}
create-erp5-site = ${dynamic-template-create-erp5-site:rendered}
# Internal software types
kumofs = ${dynamic-template-kumofs:rendered}
cloudooo = ${dynamic-template-cloudooo:rendered}
mariadb = ${dynamic-template-mariadb:rendered}
...
...
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