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 = ...@@ -16,8 +16,8 @@ parts =
[openssl] [openssl]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = https://www.openssl.org/source/openssl-1.0.2h.tar.gz url = https://www.openssl.org/source/openssl-1.0.2j.tar.gz
md5sum = 9392e65072ce4b614c1392eefc1f23d0 md5sum = 96322138f0b69e61b7212bc53d5e912b
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
# 'prefix' option to override --openssldir/--prefix (which is useful # 'prefix' option to override --openssldir/--prefix (which is useful
# when combined with INSTALL_PREFIX). Used by slapos.package.git/obs # when combined with INSTALL_PREFIX). Used by slapos.package.git/obs
......
...@@ -10,11 +10,11 @@ parts = ...@@ -10,11 +10,11 @@ parts =
[openvpn] [openvpn]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = http://swupdate.openvpn.org/community/releases/openvpn-2.3.8.tar.xz url = https://swupdate.openvpn.org/community/releases/openvpn-2.3.12.tar.xz
md5sum = acc5ea4b08ad53173784520acbd4e9c3 md5sum = 63326bab2ebb9efe3c7becaa4f15e1c1
configure-options = configure-options =
--disable-dependency-tracking
--disable-plugin-auth-pam --disable-plugin-auth-pam
--enable-static
environment = environment =
PATH=${xz-utils:location}/bin:%(PATH)s PATH=${xz-utils:location}/bin:%(PATH)s
LZO_LIBS=-L${lzo:location}/lib -llzo2 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 @@ ...@@ -2,14 +2,24 @@
[buildout] [buildout]
extends = extends =
../../stack/slapos.cfg ../../stack/slapos.cfg
../bison/buildout.cfg
../bzip2/buildout.cfg
../firewalld/buildout.cfg
../gdbm/buildout.cfg ../gdbm/buildout.cfg
../gettext/buildout.cfg ../gettext/buildout.cfg
../glib/buildout.cfg
../libxml2/buildout.cfg
../libxslt/buildout.cfg
../m4/buildout.cfg ../m4/buildout.cfg
../ncurses/buildout.cfg
../openssl/buildout.cfg
../patch/buildout.cfg
../pkgconfig/buildout.cfg
../python-2.7/buildout.cfg ../python-2.7/buildout.cfg
../readline/buildout.cfg
../sqlite3/buildout.cfg ../sqlite3/buildout.cfg
../swig/buildout.cfg ../swig/buildout.cfg
../patch/buildout.cfg ../zlib/buildout.cfg
../firewalld/buildout.cfg
parts = parts =
slapos slapos
...@@ -35,11 +45,11 @@ allowed-eggs-from-site-packages = ...@@ -35,11 +45,11 @@ allowed-eggs-from-site-packages =
# Note: For now original PATH is appended to the end, as not all tools are # Note: For now original PATH is appended to the end, as not all tools are
# provided by SlapOS # 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 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} 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 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:${popt:location}/lib/pkgconfig:${python2.7:location}/lib/pkgconfig:${sqlite3:location}/lib/pkgconfig 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:${popt:location}/lib:${readline:location}/lib:${sqlite3:location}/lib:${zlib:location}/lib 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] [cfg-environment]
# Section exposes SlapOS default environment as configuration file. # Section exposes SlapOS default environment as configuration file.
...@@ -128,5 +138,5 @@ scripts = py ...@@ -128,5 +138,5 @@ scripts = py
[versions] [versions]
setuptools = 19.6.2 setuptools = 19.6.2
slapos.rebootstrap = 3.7 slapos.rebootstrap = 3.7
zc.buildout = 2.5.2+slapos002 zc.buildout = 2.5.2+slapos003
zc.recipe.egg = 2.0.3+slapos001 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, ...@@ -214,5 +214,8 @@ setup(name=name,
], ],
}, },
test_suite='slapos.test', test_suite='slapos.test',
tests_require=[ 'jsonschema' ], tests_require=[
'jsonschema',
'mock',
],
) )
...@@ -168,15 +168,20 @@ def keysplit(s): ...@@ -168,15 +168,20 @@ def keysplit(s):
""" """
Split a string like "ssh-rsa AKLFKJSL..... ssh-rsa AAAASAF...." Split a string like "ssh-rsa AKLFKJSL..... ssh-rsa AAAASAF...."
and return the individual key_type + key strings. 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(' ')) si = iter(s.split(' '))
while True: while True:
key_type = next(si) key_type = next(si)
if key_type == '':
continue
try: try:
key_value = next(si) key_value = next(si)
except StopIteration: except StopIteration:
# odd number of elements, should not happen, yield the last one by itself # odd number of elements, should not happen
yield key_type
break break
yield '%s %s' % (key_type, key_value) yield '%s %s' % (key_type, key_value)
......
...@@ -303,7 +303,7 @@ class Recipe(GenericSlapRecipe, Notify, Callback): ...@@ -303,7 +303,7 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
executable=rdiff_wrapper, executable=rdiff_wrapper,
log=os.path.join(self.options['feeds'], entry['notification-id']), log=os.path.join(self.options['feeds'], entry['notification-id']),
title=entry.get('title', slave_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']), feed_url='%s/get/%s' % (self.options['notifier-url'], entry['notification-id']),
pidfile=os.path.join(self.options['run-directory'], '%s.pid' % slave_id), pidfile=os.path.join(self.options['run-directory'], '%s.pid' % slave_id),
instance_root_name=self.options.get('instance-root-name', None), instance_root_name=self.options.get('instance-root-name', None),
......
...@@ -31,27 +31,28 @@ from slapos.recipe.librecipe import GenericSlapRecipe ...@@ -31,27 +31,28 @@ from slapos.recipe.librecipe import GenericSlapRecipe
CONNECTION_PARAMETER_STRING = 'connection-' CONNECTION_PARAMETER_STRING = 'connection-'
class Recipe(GenericSlapRecipe): class Recipe(GenericSlapRecipe):
def _install(self): def __init__(self, buildout, name, options):
publish_dict = {} super(Recipe, self).__init__(buildout, name, options)
done = set() # Tell buildout about the sections we will access during install.
self._extend_set = done = set()
extends = [self.name] extends = [self.name]
while extends: while extends:
name = extends.pop() name = extends.pop()
done.add(name) done.add(name)
for k, v in self.buildout[name].iteritems(): extends += set(self.buildout[name].get('-extends', '').split()) - done
if k[:1] == '-':
if k == '-extends': def _install(self):
extends += set(v.split()) - done publish_dict = {}
elif k != 'recipe': for name in self._extend_set:
publish_dict[k] = v 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')) self._setConnectionDict(publish_dict, self.options.get('-slave-reference'))
return [] return []
def _setConnectionDict(self, publish_dict, slave_reference=None): def _setConnectionDict(self, publish_dict, slave_reference=None):
return self.setConnectionDict(publish_dict, slave_reference) return self.setConnectionDict(publish_dict, slave_reference)
SERIALISED_MAGIC_KEY = '_'
class Serialised(Recipe): class Serialised(Recipe):
def _setConnectionDict(self, publish_dict, slave_reference=None): def _setConnectionDict(self, publish_dict, slave_reference=None):
return super(Serialised, self)._setConnectionDict(wrap(publish_dict), slave_reference) return super(Serialised, self)._setConnectionDict(wrap(publish_dict), slave_reference)
......
...@@ -38,6 +38,51 @@ import errno ...@@ -38,6 +38,51 @@ import errno
import zc.buildout 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: class Recipe:
def __init__(self, buildout, name, options): def __init__(self, buildout, name, options):
...@@ -144,7 +189,7 @@ class Recipe: ...@@ -144,7 +189,7 @@ class Recipe:
raise zc.buildout.UserError("The specified buildout config file %r does " raise zc.buildout.UserError("The specified buildout config file %r does "
"not exist." % instance_file_path) "not exist." % instance_file_path)
buildout = ConfigParser() buildout = SlapConfigParser()
with open(instance_file_path) as instance_path: with open(instance_file_path) as instance_path:
buildout.readfp(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/SUkEWCyTT5fbLDb5r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v/PChOsrpdUljRoB0r1ciWAlHWq2vMEWGQD3uJu6KQ3Dxl7eQp4IFlO65uqtyxkz/t72JeoEAn7lHFd19gGn2QikaD0MPNVL1y/py49WDCPG5tvPubJE6IDky0IrFCFuKegSUtQ0N9BAUAAmesTddSzIPVbr5Q==", "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDm2q2ROZIatffz8f1d/9poPlFwflQwDv3EM8Ey674I9GFO9tHQTl2Y8Cp8KlJEGIwiSHJH4J+0F/MrqmwbShHA/R+ocoTAv3nubWGqdKll4o7/wMfHh/7l9H1nqvY3McXO+yjbjbpA2fGFEzQX+Z+j6g+mzrlcYnPB0Bjpc/sPGeOSCfTGmw+BjsxkkwQEvYarZriM1eCz9i7aYJ87OSFgDyo96Dj9ke7EHOESYV0LzxN2WLN/3pYGTdr3Dg18krupCP+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 socket
import sys
import unittest import unittest
from mock import patch
from slapos.recipe import free_port from slapos.recipe import free_port
class SocketMock(): class SocketMock():
...@@ -14,11 +17,14 @@ class SocketMock(): ...@@ -14,11 +17,14 @@ class SocketMock():
bind = close = nothing_happen bind = close = nothing_happen
import sys def useMock(function):
sys.modules['socket'].socket = SocketMock def withMock(function):
with patch('slapos.recipe.free_port.socket.socket', new=SocketMock):
return function
return withMock
class FreePortTest(unittest.TestCase): class FreePortTest(unittest.TestCase):
def afterSetup(self): def setUp(self):
SocketMock.bind = SocketMock.close = SocketMock.nothing_happen SocketMock.bind = SocketMock.close = SocketMock.nothing_happen
def new_recipe(self, **kw): def new_recipe(self, **kw):
...@@ -48,10 +54,12 @@ class FreePortTest(unittest.TestCase): ...@@ -48,10 +54,12 @@ class FreePortTest(unittest.TestCase):
options.update(kw) options.update(kw)
return free_port.Recipe(buildout=buildout, name='free_port', options=options) return free_port.Recipe(buildout=buildout, name='free_port', options=options)
@useMock
def test_ifNoBusyPortThenMinPortIsAlwaysReturned(self): def test_ifNoBusyPortThenMinPortIsAlwaysReturned(self):
recipe = self.new_recipe(minimum=2000) recipe = self.new_recipe(minimum=2000)
self.assertEqual(recipe.options['port'], '2000') self.assertEqual(recipe.options['port'], '2000')
@useMock
def test_iterateUntilFreePortIsFound(self): def test_iterateUntilFreePortIsFound(self):
def bindFailExceptOnPort2020(socket_instance, binding): def bindFailExceptOnPort2020(socket_instance, binding):
ip, port = binding ip, port = binding
...@@ -61,6 +69,7 @@ class FreePortTest(unittest.TestCase): ...@@ -61,6 +69,7 @@ class FreePortTest(unittest.TestCase):
recipe = self.new_recipe(minimum=2000) recipe = self.new_recipe(minimum=2000)
self.assertEqual(recipe.options['port'], '2020') self.assertEqual(recipe.options['port'], '2020')
@useMock
def test_returnsPort0IfNoPortIsFreeInRange(self): def test_returnsPort0IfNoPortIsFreeInRange(self):
def bindAlwaysFail(socket_instance, binding): def bindAlwaysFail(socket_instance, binding):
raise socket.error() raise socket.error()
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
extends = extends =
../../component/lxml-python/buildout.cfg ../../component/lxml-python/buildout.cfg
../../component/git/buildout.cfg ../../component/git/buildout.cfg
../../component/pycurl/buildout.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
parts = parts =
...@@ -34,6 +35,7 @@ mode = 0644 ...@@ -34,6 +35,7 @@ mode = 0644
[script] [script]
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs =
${pycurl:egg}
zc.buildout zc.buildout
slapos.core slapos.core
slapos.toolbox slapos.toolbox
...@@ -43,7 +45,7 @@ eggs = ...@@ -43,7 +45,7 @@ eggs =
[versions] [versions]
apache-libcloud = 0.18.0 apache-libcloud = 0.18.0
ecdsa = 0.13 ecdsa = 0.13
erp5.util = 0.4.45 erp5.util = 0.4.46
gitdb = 0.6.4 gitdb = 0.6.4
pycrypto = 2.6.1 pycrypto = 2.6.1
slapos.recipe.download = 1.0 slapos.recipe.download = 1.0
......
...@@ -11,6 +11,7 @@ extends = ...@@ -11,6 +11,7 @@ extends =
../../component/stunnel/buildout.cfg ../../component/stunnel/buildout.cfg
../../component/dcron/buildout.cfg ../../component/dcron/buildout.cfg
../../component/logrotate/buildout.cfg ../../component/logrotate/buildout.cfg
../../component/pycurl/buildout.cfg
../../component/python-cryptography/buildout.cfg ../../component/python-cryptography/buildout.cfg
../../component/rdiff-backup/buildout.cfg ../../component/rdiff-backup/buildout.cfg
../../component/trafficserver/buildout.cfg ../../component/trafficserver/buildout.cfg
...@@ -39,6 +40,7 @@ recipe = zc.recipe.egg ...@@ -39,6 +40,7 @@ recipe = zc.recipe.egg
eggs = eggs =
${lxml-python:egg} ${lxml-python:egg}
${python-cryptography:egg} ${python-cryptography:egg}
${pycurl:egg}
slapos.toolbox slapos.toolbox
scripts = scripts =
......
...@@ -38,6 +38,6 @@ eggs = ...@@ -38,6 +38,6 @@ eggs =
[versions] [versions]
cns.recipe.symlink = 0.2.3 cns.recipe.symlink = 0.2.3
collective.recipe.environment = 0.2.0 collective.recipe.environment = 0.2.0
erp5.util = 0.4.45 erp5.util = 0.4.46
plone.recipe.command = 1.1 plone.recipe.command = 1.1
slapos.recipe.template = 2.8 slapos.recipe.template = 2.8
...@@ -4,7 +4,7 @@ Available ``software-type`` values ...@@ -4,7 +4,7 @@ Available ``software-type`` values
- ``default`` - ``default``
Recommended for production use. Recommended for production use.
- ``create-erp5-site`` - ``create-erp5-site``
Automated creation of ERP5Site instance, for easy deployment. Automated creation of ERP5Site instance, for easy deployment.
...@@ -22,6 +22,62 @@ Included cloudooo partition is **deprecated**. It is not recommended for ...@@ -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 intensive usage. See the ``cloudooo`` Software Release to setup a cloudooo
cluster, more suitable for intensive usage. 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 Port ranges
=========== ===========
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
}, },
"cloudooo-url": { "cloudooo-url": {
"description": "Conversion service access information - DEPRECATED", "description": "Conversion service access information - DEPRECATED",
"pattern": "^cloudooo://", "pattern": "^(http|https)://",
"type": "string" "type": "string"
}, },
"mariadb-database-list": { "mariadb-database-list": {
......
...@@ -13,7 +13,7 @@ parts = ...@@ -13,7 +13,7 @@ parts =
shellinabox shellinabox
certificate-authority certificate-authority
ca-shellinabox ca-shellinabox
ca-httpd ca-httpd-testnode
monitor-base monitor-base
monitor-publish monitor-publish
...@@ -126,7 +126,7 @@ wrapper = $${basedirectory:services}/shellinaboxd ...@@ -126,7 +126,7 @@ wrapper = $${basedirectory:services}/shellinaboxd
key-file = $${shellinabox:key-file} key-file = $${shellinabox:key-file}
cert-file = $${shellinabox:cert-file} cert-file = $${shellinabox:cert-file}
[ca-httpd] [ca-httpd-testnode]
<= certificate-authority <= certificate-authority
recipe = slapos.cookbook:certificate_authority.request recipe = slapos.cookbook:certificate_authority.request
executable = $${testnode:httpd-wrapper} executable = $${testnode:httpd-wrapper}
......
...@@ -61,12 +61,12 @@ recipe = slapos.recipe.template ...@@ -61,12 +61,12 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-default.cfg url = ${:_profile_base_location_}/instance-default.cfg
output = ${buildout:directory}/template-default.cfg output = ${buildout:directory}/template-default.cfg
mode = 0644 mode = 0644
md5sum = 621c84f7adcba394686acbaf44cc1d7d md5sum = 7fb3f4177dccac601d8fafd342af3c38
[versions] [versions]
PyXML = 0.8.5 PyXML = 0.8.5
erp5.util = 0.4.45 erp5.util = 0.4.46
slapos.recipe.template = 2.7 slapos.recipe.template = 2.7
setuptools = 19.6.2 setuptools = 19.6.2
zc.buildout = 2.5.2+slapos002 zc.buildout = 2.5.2+slapos003
zc.recipe.egg = 2.0.3+slapos001 zc.recipe.egg = 2.0.3+slapos002
...@@ -111,6 +111,6 @@ output = ${buildout:directory}/runTestSuite.in ...@@ -111,6 +111,6 @@ output = ${buildout:directory}/runTestSuite.in
mode = 0644 mode = 0644
[versions] [versions]
erp5.util = 0.4.45 erp5.util = 0.4.46
slapos.recipe.template = 2.9 slapos.recipe.template = 2.9
selenium = 2.53.1 selenium = 2.53.1
...@@ -6,7 +6,7 @@ extends = common.cfg ...@@ -6,7 +6,7 @@ extends = common.cfg
websockify = 0.5.1 websockify = 0.5.1
slapos.toolbox = 0.59 slapos.toolbox = 0.59
erp5.util = 0.4.45 erp5.util = 0.4.46
apache-libcloud = 1.1.0 apache-libcloud = 1.1.0
collective.recipe.environment = 0.2.0 collective.recipe.environment = 0.2.0
gitdb = 0.6.4 gitdb = 0.6.4
......
...@@ -14,6 +14,7 @@ extends = ...@@ -14,6 +14,7 @@ extends =
../../component/patch/buildout.cfg ../../component/patch/buildout.cfg
../../component/python-mysqlclient/buildout.cfg ../../component/python-mysqlclient/buildout.cfg
../../component/python-cryptography/buildout.cfg ../../component/python-cryptography/buildout.cfg
../../component/pycurl/buildout.cfg
parts = parts =
# keep neoppod first so that ZODB3 is built correctly, # keep neoppod first so that ZODB3 is built correctly,
...@@ -47,6 +48,7 @@ eggs = neoppod[admin, ctl, master, storage-importer, storage-mysqldb, tests] ...@@ -47,6 +48,7 @@ eggs = neoppod[admin, ctl, master, storage-importer, storage-mysqldb, tests]
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs =
${lxml-python:egg} ${lxml-python:egg}
${pycurl:egg}
${python-PyYAML:egg} ${python-PyYAML:egg}
${python-cryptography:egg} ${python-cryptography:egg}
${python-cliff:egg} ${python-cliff:egg}
......
...@@ -41,7 +41,7 @@ ZODB3-patches += ...@@ -41,7 +41,7 @@ ZODB3-patches +=
[versions] [versions]
ZODB3 = 3.10.7+SlapOSPatched001 ZODB3 = 3.10.7+SlapOSPatched001
erp5.util = 0.4.45 erp5.util = 0.4.46
# To match ERP5 # To match ERP5
transaction = 1.1.1 transaction = 1.1.1
ZConfig = 2.9.3 ZConfig = 2.9.3
......
...@@ -8,6 +8,7 @@ extends = ...@@ -8,6 +8,7 @@ extends =
../../component/openssl/buildout.cfg ../../component/openssl/buildout.cfg
../../component/logrotate/buildout.cfg ../../component/logrotate/buildout.cfg
../../component/apache/buildout.cfg ../../component/apache/buildout.cfg
../../component/pycurl/buildout.cfg
../../component/python-cryptography/buildout.cfg ../../component/python-cryptography/buildout.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
...@@ -24,6 +25,7 @@ parts = ...@@ -24,6 +25,7 @@ parts =
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs =
${lxml-python:egg} ${lxml-python:egg}
${pycurl:egg}
${python-cryptography:egg} ${python-cryptography:egg}
slapos.toolbox slapos.toolbox
scripts = scripts =
......
...@@ -84,7 +84,7 @@ test-list = ...@@ -84,7 +84,7 @@ test-list =
$${slapos.recipe.cmmi:location} $${slapos.recipe.cmmi:location}
$${slapos.toolbox:location} $${slapos.toolbox:location}
$${erp5-util: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 = environment
[environment] [environment]
......
...@@ -9,6 +9,7 @@ extends = ...@@ -9,6 +9,7 @@ extends =
../../component/python-setuptools/buildout.cfg ../../component/python-setuptools/buildout.cfg
../../component/zlib/buildout.cfg ../../component/zlib/buildout.cfg
../../component/phantomjs/buildout.cfg ../../component/phantomjs/buildout.cfg
../../component/pycurl/buildout.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
parts = parts =
...@@ -28,6 +29,7 @@ recipe = zc.recipe.egg ...@@ -28,6 +29,7 @@ recipe = zc.recipe.egg
eggs = eggs =
${lxml-python:egg} ${lxml-python:egg}
${python-cryptography:egg} ${python-cryptography:egg}
${pycurl:egg}
Jinja2 Jinja2
erp5.util erp5.util
slapos.cookbook slapos.cookbook
...@@ -78,7 +80,7 @@ repository = https://lab.nexedi.com/nexedi/erp5.git ...@@ -78,7 +80,7 @@ repository = https://lab.nexedi.com/nexedi/erp5.git
[template] [template]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg url = ${:_profile_base_location_}/instance.cfg
md5sum = 1674921ba26e80d5e5266b71271c7ed1 md5sum = 51c82ee9139e26c7ab35be65263130c4
output = ${buildout:directory}/template.cfg output = ${buildout:directory}/template.cfg
mode = 640 mode = 640
......
...@@ -13,6 +13,7 @@ extends = ...@@ -13,6 +13,7 @@ extends =
../../component/nginx/buildout.cfg ../../component/nginx/buildout.cfg
../../component/openssh/buildout.cfg ../../component/openssh/buildout.cfg
../../component/rsync/buildout.cfg ../../component/rsync/buildout.cfg
../../component/pycurl/buildout.cfg
../../component/python-2.7/buildout.cfg ../../component/python-2.7/buildout.cfg
../../component/screen/buildout.cfg ../../component/screen/buildout.cfg
../../component/shellinabox/buildout.cfg ../../component/shellinabox/buildout.cfg
...@@ -59,7 +60,7 @@ mode = 0644 ...@@ -59,7 +60,7 @@ mode = 0644
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner.cfg url = ${:_profile_base_location_}/instance-runner.cfg
output = ${buildout:directory}/template-runner.cfg.in output = ${buildout:directory}/template-runner.cfg.in
md5sum = 71ce5a39bf61ae5f80a10c27b9c12761 md5sum = 0b3561ee4ef8d687fa95f2915fe9923b
mode = 0644 mode = 0644
[template-runner-import-script] [template-runner-import-script]
...@@ -208,6 +209,7 @@ mode = 0644 ...@@ -208,6 +209,7 @@ mode = 0644
[eggs] [eggs]
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs =
${pycurl:egg}
collective.recipe.environment collective.recipe.environment
collective.recipe.template collective.recipe.template
cns.recipe.symlink cns.recipe.symlink
...@@ -227,5 +229,5 @@ eggs += ...@@ -227,5 +229,5 @@ eggs +=
supervisor supervisor
[versions] [versions]
zc.buildout = 2.5.2+slapos002 zc.buildout = 2.5.2+slapos003
zc.recipe.egg = 2.0.3+slapos001 zc.recipe.egg = 2.0.3+slapos002
...@@ -222,7 +222,8 @@ template = inline: ...@@ -222,7 +222,8 @@ template = inline:
PasswordAuthentication no PasswordAuthentication no
PubkeyAuthentication yes PubkeyAuthentication yes
AuthorizedKeysFile $${buildout:directory}/.ssh/authorized_keys 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] [runner-sshd-raw-server]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
...@@ -239,11 +240,11 @@ key = $${slap-parameter:user-authorized-key} ...@@ -239,11 +240,11 @@ key = $${slap-parameter:user-authorized-key}
[runner-sshd-server] [runner-sshd-server]
recipe = collective.recipe.template recipe = collective.recipe.template
log = $${basedirectory:log}/runner-sshd.log log = $${directory:log}/runner-sshd.log
input = inline:#!/bin/sh input = inline:#!/bin/sh
exec $${runner-sshd-raw-server:wrapper-path} >> $${:log} 2>&1 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 mode = 700
[runner-sshd-graceful] [runner-sshd-graceful]
......
...@@ -13,7 +13,7 @@ apache-libcloud = 0.20.1 ...@@ -13,7 +13,7 @@ apache-libcloud = 0.20.1
cns.recipe.symlink = 0.2.3 cns.recipe.symlink = 0.2.3
collective.recipe.environment = 0.2.0 collective.recipe.environment = 0.2.0
ecdsa = 0.13 ecdsa = 0.13
erp5.util = 0.4.45 erp5.util = 0.4.46
futures = 3.0.5 futures = 3.0.5
gitdb = 0.6.4 gitdb = 0.6.4
gunicorn = 19.5.0 gunicorn = 19.5.0
......
...@@ -11,6 +11,7 @@ extends = ...@@ -11,6 +11,7 @@ extends =
../../component/git/buildout.cfg ../../component/git/buildout.cfg
../../component/gzip/buildout.cfg ../../component/gzip/buildout.cfg
../../component/logrotate/buildout.cfg ../../component/logrotate/buildout.cfg
../../component/pycurl/buildout.cfg
../../component/python-2.7/buildout.cfg ../../component/python-2.7/buildout.cfg
../../component/stunnel/buildout.cfg ../../component/stunnel/buildout.cfg
../../component/varnish/buildout.cfg ../../component/varnish/buildout.cfg
...@@ -96,6 +97,7 @@ scripts = ...@@ -96,6 +97,7 @@ scripts =
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs =
${lxml-python:egg} ${lxml-python:egg}
${pycurl:egg}
slapos.toolbox slapos.toolbox
scripts = scripts =
killpidfromfile killpidfromfile
......
...@@ -12,6 +12,8 @@ parts += ...@@ -12,6 +12,8 @@ parts +=
ipython ipython
wendelin.core wendelin.core
ipython-notebook ipython-notebook
wendelin_test_suite_runner
wendelin_testrunner
[eggs] [eggs]
initialization = initialization =
...@@ -24,7 +26,35 @@ eggs += ...@@ -24,7 +26,35 @@ eggs +=
${msgpack-python:egg} ${msgpack-python:egg}
${wendelin.core:egg} ${wendelin.core:egg}
${ipython: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] [erp5_repository_list]
repository_id_list += wendelin repository_id_list += wendelin
...@@ -47,4 +77,4 @@ revision = e8154cf06f01155f3f97d06954993f98bc1c9132 ...@@ -47,4 +77,4 @@ revision = e8154cf06f01155f3f97d06954993f98bc1c9132
[versions] [versions]
msgpack-python = 0.4.8 msgpack-python = 0.4.8
wendelin.core = 0.7 wendelin.core = 0.8
...@@ -20,11 +20,13 @@ extends = ...@@ -20,11 +20,13 @@ extends =
../../component/lxml-python/buildout.cfg ../../component/lxml-python/buildout.cfg
../../component/stunnel/buildout.cfg ../../component/stunnel/buildout.cfg
../../component/dcron/buildout.cfg ../../component/dcron/buildout.cfg
../../component/pycurl/buildout.cfg
../slapos.cfg ../slapos.cfg
[instance-egg] [instance-egg]
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs =
${pycurl:egg}
${python-mysqlclient:egg} ${python-mysqlclient:egg}
slapos.toolbox slapos.toolbox
......
...@@ -102,4 +102,4 @@ PasteDeploy = 1.5.2 ...@@ -102,4 +102,4 @@ PasteDeploy = 1.5.2
# Required by: # Required by:
# cloudooo==1.2.5.dev0 # cloudooo==1.2.5.dev0
erp5.util = 0.4.45 erp5.util = 0.4.46
...@@ -177,7 +177,7 @@ md5sum = 763db0c4a94649296e74fe1f53c03940 ...@@ -177,7 +177,7 @@ md5sum = 763db0c4a94649296e74fe1f53c03940
[template-cloudooo] [template-cloudooo]
<= download-base <= download-base
filename = instance-cloudoo.cfg.in filename = instance-cloudoo.cfg.in
md5sum = 1eedc7ee93ac7c95e1c7d50a36ef2b01 md5sum = 5691b7f12d22bfb8a926dfcb592f12c8
[template-zope-conf] [template-zope-conf]
<= download-base <= download-base
...@@ -331,7 +331,7 @@ rendered = ${monitor-template-dummy:target} ...@@ -331,7 +331,7 @@ rendered = ${monitor-template-dummy:target}
[template-erp5] [template-erp5]
<= download-base <= download-base
filename = instance-erp5.cfg.in filename = instance-erp5.cfg.in
md5sum = 66edf64eeaecded8977459acb26f4424 md5sum = cb0a8dfc15874939ec786a8b7ac5bff1
[template-zeo] [template-zeo]
<= download-base <= download-base
......
...@@ -14,9 +14,9 @@ parts += ...@@ -14,9 +14,9 @@ parts +=
[publish] [publish]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
{% if use_ipv6 -%} {% if use_ipv6 -%}
url = cloudooo://[${ipv6toipv4:ipv6}]:${ipv6toipv4:ipv6-port}/ url = http://[${ipv6toipv4:ipv6}]:${ipv6toipv4:ipv6-port}/
{% else -%} {% else -%}
url = cloudooo://${cloudooo-instance:ip}:${cloudooo-instance:port}/ url = http://${cloudooo-instance:ip}:${cloudooo-instance:port}/
{% endif -%} {% endif -%}
[cloudooo-instance] [cloudooo-instance]
......
...@@ -117,6 +117,10 @@ name = neo-${gen-neo-cluster-base:passwd} ...@@ -117,6 +117,10 @@ name = neo-${gen-neo-cluster-base:passwd}
[gen-smtpd-sasl-password] [gen-smtpd-sasl-password]
< = gen-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-zope-base]
<= request-common <= request-common
return = return =
...@@ -158,7 +162,7 @@ software-type = zope ...@@ -158,7 +162,7 @@ software-type = zope
{% set zope_family_dict = {} -%} {% set zope_family_dict = {} -%}
{% set jupyter_zope_family_default = [] -%} {% 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 partition_name = 'zope-' ~ custom_name -%}
{% set section_name = 'request-' ~ partition_name -%} {% set section_name = 'request-' ~ partition_name -%}
{% set zope_family = zope_parameter_dict.get('family', 'default') -%} {% set zope_family = zope_parameter_dict.get('family', 'default') -%}
...@@ -189,7 +193,6 @@ config-webdav = {{ dumps(zope_parameter_dict.get('webdav', False)) }} ...@@ -189,7 +193,6 @@ config-webdav = {{ dumps(zope_parameter_dict.get('webdav', False)) }}
{% endif -%} {% endif -%}
{# We need to concatenate lists that we cannot read as lists, so this gets hairy. -#} {# 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 = {} -%} {% set zope_family_parameter_dict = {} -%}
{% for family_name, zope_section_id_list in zope_family_dict.items() -%} {% for family_name, zope_section_id_list in zope_family_dict.items() -%}
{% for zope_section_id in zope_section_id_list -%} {% for zope_section_id in zope_section_id_list -%}
...@@ -264,6 +267,8 @@ config-{{ name }} = {{ value }} ...@@ -264,6 +267,8 @@ config-{{ name }} = {{ value }}
return = site_url return = site_url
{% endif -%} {% endif -%}
{% endif -%}{# if zope_partition_dict -#}
[publish] [publish]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
-extends = publish-early -extends = publish-early
...@@ -271,11 +276,13 @@ recipe = slapos.cookbook:publish.serialised ...@@ -271,11 +276,13 @@ recipe = slapos.cookbook:publish.serialised
neo-masters = ${neo-0-final:connection-masters} neo-masters = ${neo-0-final:connection-masters}
neo-admins = ${neo-0-final:connection-admins} neo-admins = ${neo-0-final:connection-admins}
{% endif -%} {% endif -%}
{% if zope_address_list_id_dict -%}
{# {#
Pick any published hosts-dict, they are expected to be identical - and there is Pick any published hosts-dict, they are expected to be identical - and there is
no way to check here. no way to check here.
-#} -#}
hosts-dict = {{ '${' ~ zope_address_list_id_dict.keys()[0] ~ ':connection-hosts-dict}' }} hosts-dict = {{ '${' ~ zope_address_list_id_dict.keys()[0] ~ ':connection-hosts-dict}' }}
{% endif -%}
{% for name, value in publish_dict.items() -%} {% for name, value in publish_dict.items() -%}
{{ name }} = {{ value }} {{ name }} = {{ value }}
{% endfor -%} {% endfor -%}
......
...@@ -35,6 +35,7 @@ extends = ...@@ -35,6 +35,7 @@ extends =
../../component/rdiff-backup/buildout.cfg ../../component/rdiff-backup/buildout.cfg
../../component/stunnel/buildout.cfg ../../component/stunnel/buildout.cfg
../../component/dropbear/buildout.cfg ../../component/dropbear/buildout.cfg
../../component/pycurl/buildout.cfg
../slapos.cfg ../slapos.cfg
../resilient/buildout.cfg ../resilient/buildout.cfg
...@@ -176,6 +177,7 @@ recipe = zc.recipe.egg ...@@ -176,6 +177,7 @@ recipe = zc.recipe.egg
eggs = eggs =
${lxml-python:egg} ${lxml-python:egg}
${psycopg2:egg} ${psycopg2:egg}
${pycurl:egg}
slapos.toolbox slapos.toolbox
[versions] [versions]
......
...@@ -9,6 +9,7 @@ extends = ...@@ -9,6 +9,7 @@ extends =
../../component/logrotate/buildout.cfg ../../component/logrotate/buildout.cfg
../../component/gzip/buildout.cfg ../../component/gzip/buildout.cfg
../../component/lxml-python/buildout.cfg ../../component/lxml-python/buildout.cfg
../../component/pycurl/buildout.cfg
../../component/python-cryptography/buildout.cfg ../../component/python-cryptography/buildout.cfg
parts = parts =
...@@ -39,6 +40,7 @@ on-update = true ...@@ -39,6 +40,7 @@ on-update = true
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = eggs =
${lxml-python:egg} ${lxml-python:egg}
${pycurl:egg}
${python-cryptography:egg} ${python-cryptography:egg}
plone.recipe.command plone.recipe.command
collective.recipe.template collective.recipe.template
...@@ -91,7 +93,7 @@ recipe = slapos.recipe.template:jinja2 ...@@ -91,7 +93,7 @@ recipe = slapos.recipe.template:jinja2
filename = template-monitor.cfg filename = template-monitor.cfg
template = ${:_profile_base_location_}/instance-monitor.cfg.jinja2.in template = ${:_profile_base_location_}/instance-monitor.cfg.jinja2.in
rendered = ${buildout:directory}/template-monitor.cfg rendered = ${buildout:directory}/template-monitor.cfg
md5sum = 84998b1ca3c29445dca70b495515c35b md5sum = c25e1c8206fb7c08924ae3d5c16521fc
context = context =
key apache_location apache:location key apache_location apache:location
key gzip_location gzip:location key gzip_location gzip:location
......
...@@ -115,7 +115,7 @@ ca-certs = ${ca-directory:certs} ...@@ -115,7 +115,7 @@ ca-certs = ${ca-directory:certs}
ca-newcerts = ${ca-directory:newcerts} ca-newcerts = ${ca-directory:newcerts}
ca-crl = ${ca-directory:crl} ca-crl = ${ca-directory:crl}
[ca-httpd] [ca-monitor-httpd]
<= certificate-authority <= certificate-authority
recipe = slapos.cookbook:certificate_authority.request recipe = slapos.cookbook:certificate_authority.request
key-file = ${monitor-httpd-conf-parameter:key-file} key-file = ${monitor-httpd-conf-parameter:key-file}
...@@ -136,9 +136,8 @@ service-pid-folder = ${monitor-directory:pids} ...@@ -136,9 +136,8 @@ service-pid-folder = ${monitor-directory:pids}
crond-folder = ${logrotate-directory:cron-entries} crond-folder = ${logrotate-directory:cron-entries}
logrotate-folder = ${logrotate:logrotate-entries} logrotate-folder = ${logrotate:logrotate-entries}
promise-runner = {{ monitor_runpromise }} promise-runner = {{ monitor_runpromise }}
promise-folder-list = promise-folder = ${directory:promises}
${directory:promises} pid-file = ${monitor-directory:pids}/monitor-bootstrap.pid
${directory:monitor-promise}
public-path-list = public-path-list =
private-path-list = private-path-list =
...@@ -370,15 +369,23 @@ curl_path = {{ curl_executable_location }} ...@@ -370,15 +369,23 @@ curl_path = {{ curl_executable_location }}
check-secure = 1 check-secure = 1
[monitor-bootstrap-promise] [monitor-bootstrap-promise]
recipe = slapos.recipe.template:jinja2 recipe = collective.recipe.template
template = {{ template_wrapper }}
rendered = ${directory:promises}/monitor-bootstrap-status
file = ${monitor-conf-parameters:promise-output-file} 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 input = inline:#!{{ dash_executable_location }}
mode = 0700 PID=`cat ${monitor-conf-parameters:pid-file}`
context = for i in {1..20}; do
key content :command # wait for monitor bootstrap script to finish (max 10 seconds)
raw dash_binary {{ dash_executable_location }} 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] [monitor-base]
# create dependencies between required monitor parts # create dependencies between required monitor parts
...@@ -393,7 +400,7 @@ depends = ...@@ -393,7 +400,7 @@ depends =
${certificate-authority:wrapper} ${certificate-authority:wrapper}
${monitor-conf:rendered} ${monitor-conf:rendered}
${start-monitor:wrapper-path} ${start-monitor:wrapper-path}
${ca-httpd:wrapper} ${ca-monitor-httpd:wrapper}
${monitor-httpd-promise:filename} ${monitor-httpd-promise:filename}
${monitor-status2rss-cron-entry:name} ${monitor-status2rss-cron-entry:name}
${monitor-bootstrap-promise:file} ${monitor-bootstrap-promise:file}
......
...@@ -134,7 +134,7 @@ requests = 2.11.1 ...@@ -134,7 +134,7 @@ requests = 2.11.1
setuptools = 19.6.2 setuptools = 19.6.2
six = 1.10.0 six = 1.10.0
slapos.cookbook = 1.0.35 slapos.cookbook = 1.0.35
slapos.core = 1.3.15 slapos.core = 1.3.16
slapos.extension.strip = 0.1 slapos.extension.strip = 0.1
slapos.libnetworkcache = 0.14.5 slapos.libnetworkcache = 0.14.5
slapos.recipe.build = 0.23 slapos.recipe.build = 0.23
...@@ -144,7 +144,7 @@ unicodecsv = 0.14.1 ...@@ -144,7 +144,7 @@ unicodecsv = 0.14.1
xml-marshaller = 0.9.7 xml-marshaller = 0.9.7
# Required by: # Required by:
# slapos.core==1.3.15 # slapos.core==1.3.16
Flask = 0.11.1 Flask = 0.11.1
# Required by: # 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