Commit 0aaa7f94 authored by Rafael Monnerat's avatar Rafael Monnerat

Update Release Candidate

parents c0347b93 efd7c57d
[buildout]
parts = cython
[cython]
recipe = zc.recipe.egg:custom
egg = cython
......@@ -16,8 +16,8 @@ parts =
[openssl]
recipe = slapos.recipe.cmmi
url = https://www.openssl.org/source/openssl-1.0.2h.tar.gz
md5sum = 9392e65072ce4b614c1392eefc1f23d0
url = https://www.openssl.org/source/openssl-1.0.2j.tar.gz
md5sum = 96322138f0b69e61b7212bc53d5e912b
location = ${buildout:parts-directory}/${:_buildout_section_name_}
# 'prefix' option to override --openssldir/--prefix (which is useful
# when combined with INSTALL_PREFIX). Used by slapos.package.git/obs
......
......@@ -10,11 +10,11 @@ parts =
[openvpn]
recipe = slapos.recipe.cmmi
url = http://swupdate.openvpn.org/community/releases/openvpn-2.3.8.tar.xz
md5sum = acc5ea4b08ad53173784520acbd4e9c3
url = https://swupdate.openvpn.org/community/releases/openvpn-2.3.12.tar.xz
md5sum = 63326bab2ebb9efe3c7becaa4f15e1c1
configure-options =
--disable-dependency-tracking
--disable-plugin-auth-pam
--enable-static
environment =
PATH=${xz-utils:location}/bin:%(PATH)s
LZO_LIBS=-L${lzo:location}/lib -llzo2
......
[buildout]
extends =
../automake/buildout.cfg
../git/buildout.cfg
../libtool/buildout.cfg
../pkgconfig/buildout.cfg
parts = rina-tools
[rina-tools-repository]
recipe = slapos.recipe.build:gitclone
repository = https://github.com/jmuchemb/irati-stack.git
revision = 47e2b6a5f32d1090ec75206ccdb797b78a1a3330
git-executable = ${git:location}/bin/git
[rina-tools]
recipe = slapos.recipe.cmmi
path = ${rina-tools-repository:location}/rina-tools
pre-configure =
autoreconf -fisv -I ${libtool:location}/share/aclocal -I ${pkgconfig:location}/share/aclocal
environment =
PATH=${autoconf:location}/bin:${automake:location}/bin:${git:location}/bin:${libtool:location}/bin:${m4:location}/bin:%(PATH)s
......@@ -2,14 +2,24 @@
[buildout]
extends =
../../stack/slapos.cfg
../bison/buildout.cfg
../bzip2/buildout.cfg
../firewalld/buildout.cfg
../gdbm/buildout.cfg
../gettext/buildout.cfg
../glib/buildout.cfg
../libxml2/buildout.cfg
../libxslt/buildout.cfg
../m4/buildout.cfg
../ncurses/buildout.cfg
../openssl/buildout.cfg
../patch/buildout.cfg
../pkgconfig/buildout.cfg
../python-2.7/buildout.cfg
../readline/buildout.cfg
../sqlite3/buildout.cfg
../swig/buildout.cfg
../patch/buildout.cfg
../firewalld/buildout.cfg
../zlib/buildout.cfg
parts =
slapos
......@@ -35,11 +45,11 @@ allowed-eggs-from-site-packages =
# Note: For now original PATH is appended to the end, as not all tools are
# provided by SlapOS
PATH=${bison:location}/bin:${bzip2:location}/bin:${gettext:location}/bin:${glib:location}/bin:${libxml2:location}/bin:${libxslt:location}/bin:${m4:location}/bin:${ncurses:location}/bin:${openssl:location}/bin:${pkgconfig:location}/bin:${python2.7:location}/bin:${readline:location}/bin:${sqlite3:location}/bin:${swig:location}/bin:${buildout:bin-directory}:${patch:location}/bin:$PATH
CFLAGS=-I${bzip2:location}/include -I${gdbm:location}/include -I${gettext:location}/include -I${glib:location}/include -I${libxml2:location}/include -I${libxslt:location}/include -I${ncurses:location}/include -I${openssl:location}/include -I${popt:location}/include -I${readline:location}/include -I${sqlite3:location}/include -I${zlib:location}/include
CFLAGS=-I${bzip2:location}/include -I${gdbm:location}/include -I${gettext:location}/include -I${glib:location}/include -I${libxml2:location}/include -I${libxslt:location}/include -I${ncurses:location}/include -I${openssl:location}/include -I${readline:location}/include -I${sqlite3:location}/include -I${zlib:location}/include
CPPFLAGS=${:CFLAGS}
LDFLAGS=-L${bzip2:location}/lib -Wl,-rpath=${bzip2:location}/lib -L${gdbm:location}/lib -Wl,-rpath=${gdbm:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib -L${glib:location}/lib -Wl,-rpath=${glib:location}/lib -L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib -L${libxslt:location}/lib -Wl,-rpath=${libxslt:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${popt:location}/lib -Wl,-rpath=${popt:location}/lib -L${readline:location}/lib -Wl,-rpath=${readline:location}/lib -L${sqlite3:location}/lib -Wl,-rpath=${sqlite3:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig:${libxml2:location}/lib/pkgconfig:${libxslt:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig:${pcre:location}/lib/pkgconfig:${popt:location}/lib/pkgconfig:${python2.7:location}/lib/pkgconfig:${sqlite3:location}/lib/pkgconfig
LD_LIBRARY_PATH=${bzip2:location}/lib:${gdbm:location}/lib:${gettext:location}/lib:${glib:location}/lib:${libxml2:location}/lib:${libxslt:location}/lib:${ncurses:location}/lib:${openssl:location}/lib:${popt:location}/lib:${readline:location}/lib:${sqlite3:location}/lib:${zlib:location}/lib
LDFLAGS=-L${bzip2:location}/lib -Wl,-rpath=${bzip2:location}/lib -L${gdbm:location}/lib -Wl,-rpath=${gdbm:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib -L${glib:location}/lib -Wl,-rpath=${glib:location}/lib -L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib -L${libxslt:location}/lib -Wl,-rpath=${libxslt:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${readline:location}/lib -Wl,-rpath=${readline:location}/lib -L${sqlite3:location}/lib -Wl,-rpath=${sqlite3:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig:${libxml2:location}/lib/pkgconfig:${libxslt:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig:${pcre:location}/lib/pkgconfig:${python2.7:location}/lib/pkgconfig:${sqlite3:location}/lib/pkgconfig
LD_LIBRARY_PATH=${bzip2:location}/lib:${gdbm:location}/lib:${gettext:location}/lib:${glib:location}/lib:${libxml2:location}/lib:${libxslt:location}/lib:${ncurses:location}/lib:${openssl:location}/lib:${readline:location}/lib:${sqlite3:location}/lib:${zlib:location}/lib
[cfg-environment]
# Section exposes SlapOS default environment as configuration file.
......@@ -128,5 +138,5 @@ scripts = py
[versions]
setuptools = 19.6.2
slapos.rebootstrap = 3.7
zc.buildout = 2.5.2+slapos002
zc.recipe.egg = 2.0.3+slapos001
zc.buildout = 2.5.2+slapos003
zc.recipe.egg = 2.0.3+slapos002
# This file is used to install testing, not-stable-yet, version of SlapOS Node
[buildout]
extends =
buildout.cfg
# Add hosting location of testing version of slapos.core
find-links +=
http://www.nexedi.org/static/packages/source/slapos.core-testing/
[versions]
slapos.core = 1.0.0rc6
......@@ -214,5 +214,8 @@ setup(name=name,
],
},
test_suite='slapos.test',
tests_require=[ 'jsonschema' ],
tests_require=[
'jsonschema',
'mock',
],
)
......@@ -168,15 +168,20 @@ def keysplit(s):
"""
Split a string like "ssh-rsa AKLFKJSL..... ssh-rsa AAAASAF...."
and return the individual key_type + key strings.
TODO: handle comments in ssh keys, which are generated
by default at key creation.
"""
s = s.replace('\n', ' ')
si = iter(s.split(' '))
while True:
key_type = next(si)
if key_type == '':
continue
try:
key_value = next(si)
except StopIteration:
# odd number of elements, should not happen, yield the last one by itself
yield key_type
# odd number of elements, should not happen
break
yield '%s %s' % (key_type, key_value)
......
......@@ -303,7 +303,7 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
executable=rdiff_wrapper,
log=os.path.join(self.options['feeds'], entry['notification-id']),
title=entry.get('title', slave_id),
notification_url=entry['notify'],
notification_url=entry['notify'] or '',
feed_url='%s/get/%s' % (self.options['notifier-url'], entry['notification-id']),
pidfile=os.path.join(self.options['run-directory'], '%s.pid' % slave_id),
instance_root_name=self.options.get('instance-root-name', None),
......
......@@ -31,27 +31,28 @@ from slapos.recipe.librecipe import GenericSlapRecipe
CONNECTION_PARAMETER_STRING = 'connection-'
class Recipe(GenericSlapRecipe):
def _install(self):
publish_dict = {}
done = set()
def __init__(self, buildout, name, options):
super(Recipe, self).__init__(buildout, name, options)
# Tell buildout about the sections we will access during install.
self._extend_set = done = set()
extends = [self.name]
while extends:
name = extends.pop()
done.add(name)
for k, v in self.buildout[name].iteritems():
if k[:1] == '-':
if k == '-extends':
extends += set(v.split()) - done
elif k != 'recipe':
publish_dict[k] = v
name = extends.pop()
done.add(name)
extends += set(self.buildout[name].get('-extends', '').split()) - done
def _install(self):
publish_dict = {}
for name in self._extend_set:
for k, v in self.buildout[name].iteritems():
if k != 'recipe' and not k.startswith('-'):
publish_dict[k] = v
self._setConnectionDict(publish_dict, self.options.get('-slave-reference'))
return []
def _setConnectionDict(self, publish_dict, slave_reference=None):
return self.setConnectionDict(publish_dict, slave_reference)
SERIALISED_MAGIC_KEY = '_'
class Serialised(Recipe):
def _setConnectionDict(self, publish_dict, slave_reference=None):
return super(Serialised, self)._setConnectionDict(wrap(publish_dict), slave_reference)
......
......@@ -38,6 +38,51 @@ import errno
import zc.buildout
class SlapConfigParser(ConfigParser, object):
"""
This class overrite ConfigParser.write method to fix parse problem when
configuration like:
foo += bar is included in buildout file. softwaretype recipe will generate
buildout file with foo + = bar because ConfigParser doesn't reconize +=
delimiter and read key as "foo +", value as "bar".
Then ConfigParser.write method generate
[section]
foo + = bar
...
This is invalid with buildout version 2.
"""
def write(self, fp):
"""Write an .ini-format representation of the configuration state."""
if sys.version_info[0] > 2:
return super(SlapConfigParser, self).write(fp)
if self._defaults:
fp.write("[%s]\n" % DEFAULTSECT)
for (key, value) in self._defaults.items():
if key.endswith(" +") or key.endswith(" -"):
line = "%s += %s\n" % (key.replace(' +', '').replace(' -', ''),
str(value).replace('\n', '\n\t'))
else:
line = "%s = %s\n" % (key, str(value).replace('\n', '\n\t'))
fp.write(line)
fp.write("\n")
for section in self._sections:
fp.write("[%s]\n" % section)
for (key, value) in self._sections[section].items():
if key == "__name__":
continue
if (value is not None) or (self._optcre == self.OPTCRE):
if key.endswith(" +") or key.endswith(" -"):
key = " += ".join((key.replace(' +', '').replace(' -', ''),
str(value).replace('\n', '\n\t')))
else:
key = " = ".join((key, str(value).replace('\n', '\n\t')))
fp.write("%s\n" % key)
fp.write("\n")
class Recipe:
def __init__(self, buildout, name, options):
......@@ -144,7 +189,7 @@ class Recipe:
raise zc.buildout.UserError("The specified buildout config file %r does "
"not exist." % instance_file_path)
buildout = ConfigParser()
buildout = SlapConfigParser()
with open(instance_file_path) as instance_path:
buildout.readfp(instance_path)
......
import unittest
from slapos.recipe.dropbear import keysplit
class TestAuthorizedKey(unittest.TestCase):
def test_keysplit_on_2_keys(self):
given_key_list = [
"""ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDX0juuOAibEjr3K116XZy/kc+6TrxsduaiAKSKgq+ktlgL2hbLmDKaXXbF6xbp8qUNUH3rkMXY3ujFRVGP+MMNkasaxlRBS/rXVwj4uQvSkOQXLWCOkHlwIsrS4xZ3yBXzYDz3yOXL4wQn2wzXrbR3ByxtAoZ/puLGJNvYC3i+LH33cif/SUkEWCyTT5fbLDb5rswjWgrf3v+MzXxuRYZl0rjvi31Ku/mIpLl7Jb7K8a71iQD7xUbEd6GxUORzWNbTrn4rQbUhybOOFc8PnMQJ6wb5vYvwr3UraJq64rH9WRhHak8a25mmBN00h4izEVC+AyrrdZ7Txfa0F2vGxyj/MM56NMAQW4dTkKLju71AXWZkhg2I5kiBgjGmGWyXDgxoKjJVHMJziKf9tqg1pFeDlHI0Q38zmYgCaORNpC+1nG2ydx1/gB9kTky+risJmrc81YlWtZ7lEjpCtSmcAEFIGDHvy0MbZu8UwvykKpGWASIgi4gTapPXjgcvb47cO0JOSZlCwzqrmB3qv/PChOsrpdUljRoB0r1ciWAlHWq2vMEWGQD3uJu6KQ3Dxl7eQp4IFlO65uqtyxkz/t72JeoEAn7lHFd19gGn2QikaD0MPNVL1y/py49WDCPG5tvPubJE6IDky0IrFCFuK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upCP+X3FAdgd+WP9TXKEcMFHcVs6y7Lyzis52irgEpSysqoOImQ8hdyLs/0oamXCnePoAzzHeTlw8IpUvhpTSYYtWMtCv9velIvxHsnSu87k3HD1jsZ/SZtsrrUwEFMs/9Z8wZQ6q5/GAKo6LRsXxv+BXpXNwc6K3qqxMi5D4TD0p7GBOuz6xmpzScr9eQVn1OqoekDvkdzeXmkOZC01XrJJfD1GA8fjUk7M2OTWeINNSNFiL3ovgz6cMDSuJq39vMPeH2CBW9ozjtMmODlmwEot4FHu3mq5eoajrJnpmpi7oJ6ks8icafs3GTIJDg6sAF3M3oxMXfVVKEUaqvYihq0u9T1qBjU4/raTWjUj2/DhVDNa0gX6OE/xUIdMZMqeeVHndFqb1lkORiPoXcTrD734HNvrmW73rI5TBWMK86RQ=="]
for given_key in given_key_list:
tested_result = []
for key in keysplit(given_key):
tested_result.append(key)
self.assertEqual(tested_result, expected_result)
if __name__ == '__main__':
unittest.main()
import socket
import sys
import unittest
from mock import patch
from slapos.recipe import free_port
class SocketMock():
......@@ -14,11 +17,14 @@ class SocketMock():
bind = close = nothing_happen
import sys
sys.modules['socket'].socket = SocketMock
def useMock(function):
def withMock(function):
with patch('slapos.recipe.free_port.socket.socket', new=SocketMock):
return function
return withMock
class FreePortTest(unittest.TestCase):
def afterSetup(self):
def setUp(self):
SocketMock.bind = SocketMock.close = SocketMock.nothing_happen
def new_recipe(self, **kw):
......@@ -48,10 +54,12 @@ class FreePortTest(unittest.TestCase):
options.update(kw)
return free_port.Recipe(buildout=buildout, name='free_port', options=options)
@useMock
def test_ifNoBusyPortThenMinPortIsAlwaysReturned(self):
recipe = self.new_recipe(minimum=2000)
self.assertEqual(recipe.options['port'], '2000')
@useMock
def test_iterateUntilFreePortIsFound(self):
def bindFailExceptOnPort2020(socket_instance, binding):
ip, port = binding
......@@ -61,6 +69,7 @@ class FreePortTest(unittest.TestCase):
recipe = self.new_recipe(minimum=2000)
self.assertEqual(recipe.options['port'], '2020')
@useMock
def test_returnsPort0IfNoPortIsFreeInRange(self):
def bindAlwaysFail(socket_instance, binding):
raise socket.error()
......
......@@ -2,6 +2,7 @@
extends =
../../component/lxml-python/buildout.cfg
../../component/git/buildout.cfg
../../component/pycurl/buildout.cfg
../../stack/slapos.cfg
parts =
......@@ -34,6 +35,7 @@ mode = 0644
[script]
recipe = zc.recipe.egg
eggs =
${pycurl:egg}
zc.buildout
slapos.core
slapos.toolbox
......@@ -43,7 +45,7 @@ eggs =
[versions]
apache-libcloud = 0.18.0
ecdsa = 0.13
erp5.util = 0.4.45
erp5.util = 0.4.46
gitdb = 0.6.4
pycrypto = 2.6.1
slapos.recipe.download = 1.0
......
......@@ -11,6 +11,7 @@ extends =
../../component/stunnel/buildout.cfg
../../component/dcron/buildout.cfg
../../component/logrotate/buildout.cfg
../../component/pycurl/buildout.cfg
../../component/python-cryptography/buildout.cfg
../../component/rdiff-backup/buildout.cfg
../../component/trafficserver/buildout.cfg
......@@ -39,6 +40,7 @@ recipe = zc.recipe.egg
eggs =
${lxml-python:egg}
${python-cryptography:egg}
${pycurl:egg}
slapos.toolbox
scripts =
......
......@@ -38,6 +38,6 @@ eggs =
[versions]
cns.recipe.symlink = 0.2.3
collective.recipe.environment = 0.2.0
erp5.util = 0.4.45
erp5.util = 0.4.46
plone.recipe.command = 1.1
slapos.recipe.template = 2.8
......@@ -4,7 +4,7 @@ Available ``software-type`` values
- ``default``
Recommended for production use.
- ``create-erp5-site``
Automated creation of ERP5Site instance, for easy deployment.
......@@ -22,6 +22,62 @@ Included cloudooo partition is **deprecated**. It is not recommended for
intensive usage. See the ``cloudooo`` Software Release to setup a cloudooo
cluster, more suitable for intensive usage.
Replication
===========
Replication allows setting up an ERP5 instance whose data follows another
instance.
Relations between ERP5 instances in a replication graph depend in what is
supported by individual data managers (ex: a neo cluster can replicate from a
neo cluster which itself replicates from a 3rd).
Replication lag constraints (aka sync/async replication) depends on individual
data managers (ex: neo replication between clusters is always asynchronous).
Ignoring replication lag, replicated data can be strictly identical (ex:
replicating ZODB or SQL database will contain the same data as upstream), or
may imply some remaping (ex: replicating Zope logs from an instance with 2 zope
families with 2 partition of 2 zopes each to an instance with a single zope
total).
Data whose replication is supported
-----------------------------------
- neo database
Data whose replication will eventually be supported
---------------------------------------------------
- mariadb database
- zope ``zope-*-access.log`` and ``zope-*-Z2.log``
- ``mariadb-slow.log``
Data whose replication is not planned
-------------------------------------
- zeo: use neo instead
Setting up replication
----------------------
In addition to your usual parameter set, you needs to provide the following parameters::
{
"zope-partition-dict": {}, So no zope is instanciated
"zodb": [
{
"storage-dict": {
"upstream-masters": ..., As published by to-become upstream ERP5 instance as "neo-masters"
},
"type": "neo", The only ZODB type supporting replication
...
}
...
]
...
}
Port ranges
===========
......
......@@ -41,7 +41,7 @@
},
"cloudooo-url": {
"description": "Conversion service access information - DEPRECATED",
"pattern": "^cloudooo://",
"pattern": "^(http|https)://",
"type": "string"
},
"mariadb-database-list": {
......
......@@ -13,7 +13,7 @@ parts =
shellinabox
certificate-authority
ca-shellinabox
ca-httpd
ca-httpd-testnode
monitor-base
monitor-publish
......@@ -126,7 +126,7 @@ wrapper = $${basedirectory:services}/shellinaboxd
key-file = $${shellinabox:key-file}
cert-file = $${shellinabox:cert-file}
[ca-httpd]
[ca-httpd-testnode]
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
executable = $${testnode:httpd-wrapper}
......
......@@ -61,12 +61,12 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-default.cfg
output = ${buildout:directory}/template-default.cfg
mode = 0644
md5sum = 621c84f7adcba394686acbaf44cc1d7d
md5sum = 7fb3f4177dccac601d8fafd342af3c38
[versions]
PyXML = 0.8.5
erp5.util = 0.4.45
erp5.util = 0.4.46
slapos.recipe.template = 2.7
setuptools = 19.6.2
zc.buildout = 2.5.2+slapos002
zc.recipe.egg = 2.0.3+slapos001
zc.buildout = 2.5.2+slapos003
zc.recipe.egg = 2.0.3+slapos002
......@@ -111,6 +111,6 @@ output = ${buildout:directory}/runTestSuite.in
mode = 0644
[versions]
erp5.util = 0.4.45
erp5.util = 0.4.46
slapos.recipe.template = 2.9
selenium = 2.53.1
......@@ -6,7 +6,7 @@ extends = common.cfg
websockify = 0.5.1
slapos.toolbox = 0.59
erp5.util = 0.4.45
erp5.util = 0.4.46
apache-libcloud = 1.1.0
collective.recipe.environment = 0.2.0
gitdb = 0.6.4
......
......@@ -14,6 +14,7 @@ extends =
../../component/patch/buildout.cfg
../../component/python-mysqlclient/buildout.cfg
../../component/python-cryptography/buildout.cfg
../../component/pycurl/buildout.cfg
parts =
# keep neoppod first so that ZODB3 is built correctly,
......@@ -47,6 +48,7 @@ eggs = neoppod[admin, ctl, master, storage-importer, storage-mysqldb, tests]
recipe = zc.recipe.egg
eggs =
${lxml-python:egg}
${pycurl:egg}
${python-PyYAML:egg}
${python-cryptography:egg}
${python-cliff:egg}
......
......@@ -41,7 +41,7 @@ ZODB3-patches +=
[versions]
ZODB3 = 3.10.7+SlapOSPatched001
erp5.util = 0.4.45
erp5.util = 0.4.46
# To match ERP5
transaction = 1.1.1
ZConfig = 2.9.3
......
......@@ -8,6 +8,7 @@ extends =
../../component/openssl/buildout.cfg
../../component/logrotate/buildout.cfg
../../component/apache/buildout.cfg
../../component/pycurl/buildout.cfg
../../component/python-cryptography/buildout.cfg
../../stack/slapos.cfg
......@@ -24,6 +25,7 @@ parts =
recipe = zc.recipe.egg
eggs =
${lxml-python:egg}
${pycurl:egg}
${python-cryptography:egg}
slapos.toolbox
scripts =
......
......@@ -84,7 +84,7 @@ test-list =
$${slapos.recipe.cmmi:location}
$${slapos.toolbox:location}
$${erp5-util:location}
prepend-path = ${git:location}/bin:${libxslt:location}/bin:${python2.7:location}/bin
prepend-path = ${curl:location}/bin:${openssl:location}/bin:${git:location}/bin:${libxslt:location}/bin:${python2.7:location}/bin
environment = environment
[environment]
......
......@@ -9,6 +9,7 @@ extends =
../../component/python-setuptools/buildout.cfg
../../component/zlib/buildout.cfg
../../component/phantomjs/buildout.cfg
../../component/pycurl/buildout.cfg
../../stack/slapos.cfg
parts =
......@@ -28,6 +29,7 @@ recipe = zc.recipe.egg
eggs =
${lxml-python:egg}
${python-cryptography:egg}
${pycurl:egg}
Jinja2
erp5.util
slapos.cookbook
......@@ -78,7 +80,7 @@ repository = https://lab.nexedi.com/nexedi/erp5.git
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
md5sum = 1674921ba26e80d5e5266b71271c7ed1
md5sum = 51c82ee9139e26c7ab35be65263130c4
output = ${buildout:directory}/template.cfg
mode = 640
......
......@@ -13,6 +13,7 @@ extends =
../../component/nginx/buildout.cfg
../../component/openssh/buildout.cfg
../../component/rsync/buildout.cfg
../../component/pycurl/buildout.cfg
../../component/python-2.7/buildout.cfg
../../component/screen/buildout.cfg
../../component/shellinabox/buildout.cfg
......@@ -59,7 +60,7 @@ mode = 0644
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner.cfg
output = ${buildout:directory}/template-runner.cfg.in
md5sum = 71ce5a39bf61ae5f80a10c27b9c12761
md5sum = 0b3561ee4ef8d687fa95f2915fe9923b
mode = 0644
[template-runner-import-script]
......@@ -208,6 +209,7 @@ mode = 0644
[eggs]
recipe = zc.recipe.egg
eggs =
${pycurl:egg}
collective.recipe.environment
collective.recipe.template
cns.recipe.symlink
......@@ -227,5 +229,5 @@ eggs +=
supervisor
[versions]
zc.buildout = 2.5.2+slapos002
zc.recipe.egg = 2.0.3+slapos001
zc.buildout = 2.5.2+slapos003
zc.recipe.egg = 2.0.3+slapos002
......@@ -222,7 +222,8 @@ template = inline:
PasswordAuthentication no
PubkeyAuthentication yes
AuthorizedKeysFile $${buildout:directory}/.ssh/authorized_keys
ForceCommand if [ -z "$SSH_ORIGINAL_COMMAND" ]; then ${bash:location}/bin/bash -l; else $SSH_ORIGINAL_COMMAND; fi
ForceCommand if [ -z "$SSH_ORIGINAL_COMMAND" ]; then ${bash:location}/bin/bash -l; else eval "$SSH_ORIGINAL_COMMAND"; fi
Subsystem sftp ${openssh:location}/libexec/sftp-server
[runner-sshd-raw-server]
recipe = slapos.cookbook:wrapper
......@@ -239,11 +240,11 @@ key = $${slap-parameter:user-authorized-key}
[runner-sshd-server]
recipe = collective.recipe.template
log = $${basedirectory:log}/runner-sshd.log
log = $${directory:log}/runner-sshd.log
input = inline:#!/bin/sh
exec $${runner-sshd-raw-server:wrapper-path} >> $${:log} 2>&1
output = $${rootdirectory:bin}/runner_raw_sshd_log
output = $${directory:bin}/runner_raw_sshd_log
mode = 700
[runner-sshd-graceful]
......
......@@ -13,7 +13,7 @@ apache-libcloud = 0.20.1
cns.recipe.symlink = 0.2.3
collective.recipe.environment = 0.2.0
ecdsa = 0.13
erp5.util = 0.4.45
erp5.util = 0.4.46
futures = 3.0.5
gitdb = 0.6.4
gunicorn = 19.5.0
......
......@@ -11,6 +11,7 @@ extends =
../../component/git/buildout.cfg
../../component/gzip/buildout.cfg
../../component/logrotate/buildout.cfg
../../component/pycurl/buildout.cfg
../../component/python-2.7/buildout.cfg
../../component/stunnel/buildout.cfg
../../component/varnish/buildout.cfg
......@@ -96,6 +97,7 @@ scripts =
recipe = zc.recipe.egg
eggs =
${lxml-python:egg}
${pycurl:egg}
slapos.toolbox
scripts =
killpidfromfile
......
......@@ -12,6 +12,8 @@ parts +=
ipython
wendelin.core
ipython-notebook
wendelin_test_suite_runner
wendelin_testrunner
[eggs]
initialization =
......@@ -24,7 +26,35 @@ eggs +=
${msgpack-python:egg}
${wendelin.core:egg}
${ipython:egg}
[generic_testrunner_init]
initialization =
# The 4 lines below will replace the process with another one, with the proper
# LD_PRELOAD environment variable. This is necessary because LD_PRELOAD is only
# taken into account when the process starts. Modifying it in runtime doesn't
# work.
import struct, os
arch = 8 * struct.calcsize("P")
rerun = not os.getenv('LD_PRELOAD')
if rerun: os.environ['LD_PRELOAD'] = '''${gcc-fortran:location}/lib%s/libstdc++.so''' % arch
if rerun: os.execve(os.path.realpath(__file__), sys.argv, os.environ)
[wendelin_test_suite_runner]
<= test_suite_runner
# we need to override the test suite runner to add our custom libstdc++ dynamic
# library to the path
initialization =
${generic_testrunner_init:initialization}
${test_suite_runner:initialization}
[wendelin_testrunner]
<= testrunner
# we need to override the test suite runner to add our custom libstdc++ dynamic
# library to the path
initialization =
${generic_testrunner_init:initialization}
${testrunner:initialization}
[erp5_repository_list]
repository_id_list += wendelin
......@@ -47,4 +77,4 @@ revision = e8154cf06f01155f3f97d06954993f98bc1c9132
[versions]
msgpack-python = 0.4.8
wendelin.core = 0.7
wendelin.core = 0.8
......@@ -20,11 +20,13 @@ extends =
../../component/lxml-python/buildout.cfg
../../component/stunnel/buildout.cfg
../../component/dcron/buildout.cfg
../../component/pycurl/buildout.cfg
../slapos.cfg
[instance-egg]
recipe = zc.recipe.egg
eggs =
${pycurl:egg}
${python-mysqlclient:egg}
slapos.toolbox
......
......@@ -102,4 +102,4 @@ PasteDeploy = 1.5.2
# Required by:
# cloudooo==1.2.5.dev0
erp5.util = 0.4.45
erp5.util = 0.4.46
......@@ -177,7 +177,7 @@ md5sum = 763db0c4a94649296e74fe1f53c03940
[template-cloudooo]
<= download-base
filename = instance-cloudoo.cfg.in
md5sum = 1eedc7ee93ac7c95e1c7d50a36ef2b01
md5sum = 5691b7f12d22bfb8a926dfcb592f12c8
[template-zope-conf]
<= download-base
......@@ -331,7 +331,7 @@ rendered = ${monitor-template-dummy:target}
[template-erp5]
<= download-base
filename = instance-erp5.cfg.in
md5sum = 66edf64eeaecded8977459acb26f4424
md5sum = cb0a8dfc15874939ec786a8b7ac5bff1
[template-zeo]
<= download-base
......
......@@ -14,9 +14,9 @@ parts +=
[publish]
recipe = slapos.cookbook:publish.serialised
{% if use_ipv6 -%}
url = cloudooo://[${ipv6toipv4:ipv6}]:${ipv6toipv4:ipv6-port}/
url = http://[${ipv6toipv4:ipv6}]:${ipv6toipv4:ipv6-port}/
{% else -%}
url = cloudooo://${cloudooo-instance:ip}:${cloudooo-instance:port}/
url = http://${cloudooo-instance:ip}:${cloudooo-instance:port}/
{% endif -%}
[cloudooo-instance]
......
......@@ -117,6 +117,10 @@ name = neo-${gen-neo-cluster-base:passwd}
[gen-smtpd-sasl-password]
< = gen-password
{% set zope_partition_dict = slapparameter_dict.get('zope-partition-dict', {'1': {}}) -%}
{% set zope_address_list_id_dict = {} -%}
{% if zope_partition_dict -%}
[request-zope-base]
<= request-common
return =
......@@ -158,7 +162,7 @@ software-type = zope
{% set zope_family_dict = {} -%}
{% set jupyter_zope_family_default = [] -%}
{% for custom_name, zope_parameter_dict in slapparameter_dict.get('zope-partition-dict', {'1': {}}).items() -%}
{% for custom_name, zope_parameter_dict in zope_partition_dict.items() -%}
{% set partition_name = 'zope-' ~ custom_name -%}
{% set section_name = 'request-' ~ partition_name -%}
{% set zope_family = zope_parameter_dict.get('family', 'default') -%}
......@@ -189,7 +193,6 @@ config-webdav = {{ dumps(zope_parameter_dict.get('webdav', False)) }}
{% endif -%}
{# We need to concatenate lists that we cannot read as lists, so this gets hairy. -#}
{% set zope_address_list_id_dict = {} -%}
{% set zope_family_parameter_dict = {} -%}
{% for family_name, zope_section_id_list in zope_family_dict.items() -%}
{% for zope_section_id in zope_section_id_list -%}
......@@ -264,6 +267,8 @@ config-{{ name }} = {{ value }}
return = site_url
{% endif -%}
{% endif -%}{# if zope_partition_dict -#}
[publish]
recipe = slapos.cookbook:publish.serialised
-extends = publish-early
......@@ -271,11 +276,13 @@ recipe = slapos.cookbook:publish.serialised
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
no way to check here.
-#}
hosts-dict = {{ '${' ~ zope_address_list_id_dict.keys()[0] ~ ':connection-hosts-dict}' }}
{% endif -%}
{% for name, value in publish_dict.items() -%}
{{ name }} = {{ value }}
{% endfor -%}
......
......@@ -35,6 +35,7 @@ extends =
../../component/rdiff-backup/buildout.cfg
../../component/stunnel/buildout.cfg
../../component/dropbear/buildout.cfg
../../component/pycurl/buildout.cfg
../slapos.cfg
../resilient/buildout.cfg
......@@ -176,6 +177,7 @@ recipe = zc.recipe.egg
eggs =
${lxml-python:egg}
${psycopg2:egg}
${pycurl:egg}
slapos.toolbox
[versions]
......
......@@ -9,6 +9,7 @@ extends =
../../component/logrotate/buildout.cfg
../../component/gzip/buildout.cfg
../../component/lxml-python/buildout.cfg
../../component/pycurl/buildout.cfg
../../component/python-cryptography/buildout.cfg
parts =
......@@ -39,6 +40,7 @@ on-update = true
recipe = zc.recipe.egg
eggs =
${lxml-python:egg}
${pycurl:egg}
${python-cryptography:egg}
plone.recipe.command
collective.recipe.template
......@@ -91,7 +93,7 @@ recipe = slapos.recipe.template:jinja2
filename = template-monitor.cfg
template = ${:_profile_base_location_}/instance-monitor.cfg.jinja2.in
rendered = ${buildout:directory}/template-monitor.cfg
md5sum = 84998b1ca3c29445dca70b495515c35b
md5sum = c25e1c8206fb7c08924ae3d5c16521fc
context =
key apache_location apache:location
key gzip_location gzip:location
......
......@@ -115,7 +115,7 @@ ca-certs = ${ca-directory:certs}
ca-newcerts = ${ca-directory:newcerts}
ca-crl = ${ca-directory:crl}
[ca-httpd]
[ca-monitor-httpd]
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
key-file = ${monitor-httpd-conf-parameter:key-file}
......@@ -136,9 +136,8 @@ service-pid-folder = ${monitor-directory:pids}
crond-folder = ${logrotate-directory:cron-entries}
logrotate-folder = ${logrotate:logrotate-entries}
promise-runner = {{ monitor_runpromise }}
promise-folder-list =
${directory:promises}
${directory:monitor-promise}
promise-folder = ${directory:promises}
pid-file = ${monitor-directory:pids}/monitor-bootstrap.pid
public-path-list =
private-path-list =
......@@ -370,15 +369,23 @@ curl_path = {{ curl_executable_location }}
check-secure = 1
[monitor-bootstrap-promise]
recipe = slapos.recipe.template:jinja2
template = {{ template_wrapper }}
rendered = ${directory:promises}/monitor-bootstrap-status
recipe = collective.recipe.template
file = ${monitor-conf-parameters:promise-output-file}
command = if [ ! -f "${:file}" ]; then echo "Monitor bootstrap exited with error." && exit 2; else echo "Bootstrap OK"; fi
mode = 0700
context =
key content :command
raw dash_binary {{ dash_executable_location }}
input = inline:#!{{ dash_executable_location }}
PID=`cat ${monitor-conf-parameters:pid-file}`
for i in {1..20}; do
# wait for monitor bootstrap script to finish (max 10 seconds)
kill -0 "$PID" > /dev/null 2>&1
RETURN_CODE=$?
if [ $RETURN_CODE -eq 0 ] ; then
break
else
sleep 0.5
fi
done
if [ ! -f "${:file}" ]; then echo "Monitor bootstrap exited with error." && exit 2; else echo "Bootstrap OK"; fi
output = ${directory:promises}/monitor-bootstrap-status
mode = 700
[monitor-base]
# create dependencies between required monitor parts
......@@ -393,7 +400,7 @@ depends =
${certificate-authority:wrapper}
${monitor-conf:rendered}
${start-monitor:wrapper-path}
${ca-httpd:wrapper}
${ca-monitor-httpd:wrapper}
${monitor-httpd-promise:filename}
${monitor-status2rss-cron-entry:name}
${monitor-bootstrap-promise:file}
......
......@@ -134,7 +134,7 @@ requests = 2.11.1
setuptools = 19.6.2
six = 1.10.0
slapos.cookbook = 1.0.35
slapos.core = 1.3.15
slapos.core = 1.3.16
slapos.extension.strip = 0.1
slapos.libnetworkcache = 0.14.5
slapos.recipe.build = 0.23
......@@ -144,7 +144,7 @@ unicodecsv = 0.14.1
xml-marshaller = 0.9.7
# Required by:
# slapos.core==1.3.15
# slapos.core==1.3.16
Flask = 0.11.1
# Required by:
......
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