Commit 36d9a2d1 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

Update Release Candidate

parents 3665cdbc 8fc7da4c
......@@ -67,8 +67,6 @@ md5sum = b25e165c3fb984bbf6d847adfbd9d694
<= fonts-base
url = https://download.jetbrains.com/fonts/JetBrainsMono-2.001.zip
md5sum = 62f02985bfef43a27dbdd17641fec210
# Workaround download strip autodetection bug
strip-top-level-dir = false
# Microsoft's TrueType core fonts
# non-free so not enabled by default
......
......@@ -11,8 +11,8 @@ extends =
parts =
nodejs
[nodejs]
<= nodejs-8.9.4
#[nodejs]
#<= nodejs-X.Y.Z
[nodejs-14.16.0]
<= nodejs-base
......@@ -25,33 +25,19 @@ md5sum = 7dc3666f407bf4e12a01ce1be2883d31
openssl_location = ${openssl:location}
version = v12.18.3
md5sum = 28bf6a4d98b238403fa58a0805f4a979
[nodejs-10.19.0]
<= nodejs-base
openssl_location = ${openssl:location}
version = v10.19.0
md5sum = 9e433c753d839d2d2a6341861501674f
[nodejs-10.6.0]
<= nodejs-base
openssl_location = ${openssl:location}
version = v10.6.0
md5sum = 9df233b86244ebda1ded1f91694fbe86
[nodejs-8.9.4]
<= nodejs-base
version = v8.9.4
md5sum = 4ddc1daff327d7e6f63da57fdfc24f55
PATH = ${pkgconfig:location}/bin:${python2.7:location}/bin:%(PATH)s
[nodejs-8.6.0]
<= nodejs-base
version = v8.6.0
md5sum = 0c95e08220667d8a18b97ecec8218ac6
PATH = ${pkgconfig:location}/bin:${python2.7:location}/bin:%(PATH)s
[nodejs-8.12.0]
<= nodejs-base
version = v8.12.0
md5sum = 5690333b77964edf81945fc724f6ea85
PATH = ${pkgconfig:location}/bin:${python2.7:location}/bin:%(PATH)s
[nodejs-base]
# Server-side Javascript.
......@@ -66,85 +52,15 @@ configure-options =
--shared-openssl
--shared-openssl-includes=${:openssl_location}/include
--shared-openssl-libpath=${:openssl_location}/lib
PATH = ${pkgconfig:location}/bin:%(PATH)s
environment =
HOME=@@LOCATION@@
PATH=${pkgconfig:location}/bin:%(PATH)s
PATH=${:PATH}
PKG_CONFIG_PATH=${:openssl_location}/lib/pkgconfig/
CPPFLAGS=-I${zlib:location}/include
LDFLAGS=-Wl,-rpath=${:openssl_location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
LD_LIBRARY_PATH=${:openssl_location}/lib
[nodejs-8.6.0-output]
# Shared binary location to ease migration
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
command = ${coreutils-output:test} -x ${:node} -a -x ${:npm}
node = ${nodejs-8.6.0:location}/bin/node
npm = ${nodejs-8.6.0:location}/bin/npm
[nodejs-5]
# Server-side Javascript.
recipe = slapos.recipe.cmmi
version = v5.9.1
url = http://nodejs.org/dist/${:version}/node-${:version}.tar.gz
md5sum = 346c9325912271dc7614fe955c75c3a6
configure-options =
--shared-openssl
--shared-openssl-includes=${openssl:location}/include
--shared-openssl-libpath=${openssl:location}/lib
environment =
HOME=${buildout:parts-directory}/${:_buildout_section_name_}
PATH=${pkgconfig:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig/
CPPFLAGS=-I${zlib:location}/include
LDFLAGS=-Wl,-rpath=${openssl:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
[nodejs-4]
# Server-side Javascript.
recipe = slapos.recipe.cmmi
version = v4.4.1
url = http://nodejs.org/dist/${:version}/node-${:version}.tar.gz
md5sum = ef756c3e773f08bccada08eb37ee699c
configure-options =
--shared-openssl
--shared-openssl-includes=${openssl:location}/include
--shared-openssl-libpath=${openssl:location}/lib
environment =
HOME=${buildout:parts-directory}/${:_buildout_section_name_}
PATH=${pkgconfig:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig/
CPPFLAGS=-I${zlib:location}/include
LDFLAGS=-Wl,-rpath=${openssl:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
[nodejs-0.6]
# Server-side Javascript.
recipe = slapos.recipe.cmmi
url = http://nodejs.org/dist/v0.6.21/node-v0.6.21.tar.gz
md5sum = 0da985a0bf820400af92363b9f453fe4
configure-options =
--openssl-includes=${openssl:location}/include
--openssl-libpath=${openssl:location}/lib
environment =
HOME=${buildout:parts-directory}/${:_buildout_section_name_}
PATH=${pkgconfig:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig/
CPPFLAGS=-I${zlib:location}/include
LDFLAGS=-Wl,-rpath=${openssl:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
[nodejs-0.4]
recipe = slapos.recipe.cmmi
url = http://nodejs.org/dist/node-v0.4.12.tar.gz
md5sum = a6375eaa43db5356bf443e25b828ae16
configure-options =
--openssl-includes=${openssl:location}/include
--openssl-libpath=${openssl:location}/lib
environment =
PATH=${pkgconfig:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig/
CPPFLAGS=-I${zlib:location}/include
LDFLAGS=-Wl,-rpath=${openssl:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
[npm]
# Node.js Package Manager
# Deprecated. Included in node >= 0.6.3.
......
......@@ -16,13 +16,13 @@ parts =
[openssh]
recipe = slapos.recipe.cmmi
shared = true
md5sum = 68ba883aff6958297432e5877e9a0fe2
md5sum = 8ce5f390958baeeab635aafd0ef41453
location = @@LOCATION@@
url = https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.7p1.tar.gz
url = https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.8p1.tar.gz
patch-binary = ${patch:location}/bin/patch
patch-options = -p1
patches =
${:_profile_base_location_}/no_create_privsep_path.patch#f341dc11d73df6f43c7ae1fa47b8c003
${:_profile_base_location_}/no_create_privsep_path.patch#6ab983d16c9b4caf111c737dcad6ec9b
environment =
CPPFLAGS=-I${zlib:location}/include -I${openssl-1.0:location}/include
LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${openssl-1.0:location}/lib -Wl,-rpath=${openssl-1.0:location}/lib
......
......@@ -14,7 +14,7 @@ diff --git a/Makefile.in b/Makefile.in
index 04e1c8e5..9bd5d01b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -329,7 +329,6 @@ install-files:
@@ -391,7 +391,6 @@ install-files:
$(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)5
$(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)8
$(MKDIR_P) $(DESTDIR)$(libexecdir)
......
......@@ -11,10 +11,9 @@ parts =
recipe = zc.recipe.egg:custom
egg =
pysvn
find-links = http://pysvn.barrys-emacs.org/source_kits/pysvn-1.7.10.tar.gz
find-links = https://sourceforge.net/projects/pysvn/files/pysvn/V1.9.15/pysvn-1.9.15.tar.gz/download
patches =
${:_profile_base_location_}/pysvn-1.7.10-inc_lib_dir.patch#08371129e0d0a215fb7f7811a860a89c
${:_profile_base_location_}/pysvn-issue-179.patch#bd3f9629f95f0f749c5a5e93c797ee2b
${:_profile_base_location_}/pysvn-1.9.15-inc_lib_dir.patch#c16eb88a862d4676c0ea2827f51b991a
patch-options = -p1
patch-binary = ${patch:location}/bin/patch
include-dirs =
......
diff -ur pysvn-1.7.10.orig/setup.py pysvn-1.7.10/setup.py
--- pysvn-1.7.10.orig/setup.py 2010-12-30 13:26:51.000000000 +0100
+++ pysvn-1.7.10/setup.py 2015-08-14 10:29:25.562686564 +0200
@@ -19,6 +19,10 @@
diff --git a/setup.py b/setup.py
index e5ce838..e2b95f8 100644
--- a/setup.py
+++ b/setup.py
@@ -40,9 +40,16 @@ import distutils.sysconfig
import platform
import shutil
import sys
+import subprocess
import os
import os.path
import setuptools.command.bdist_egg
+import setuptools.command.bdist_egg
from setuptools.command.build_ext import build_ext
+try:
+ from ConfigParser import ConfigParser
+except ImportError:
+ from configparser import ConfigParser
+
pysvn_version_info = {}
f = open( 'Builder/version.info', 'r' )
@@ -27,13 +28,26 @@
pysvn_version_info[ key ] = value
@@ -77,6 +84,13 @@ class BuildExtensions(build_ext):
super( BuildExtensions, self ).build_extension( ext )
def run(self):
+ cfg = ConfigParser()
+ cfg.read('setup.cfg')
+ kw = {}
+ for key in ('include-dirs', 'library-dirs'):
+ if cfg.has_option('build_ext', key):
+ kw[key] = cfg.get('build_ext', key)
def _build_pysvn( self, ext ):
+ cfg = ConfigParser()
+ cfg.read('setup.cfg')
+ kw = {}
+ for key in ('include-dirs', 'library-dirs'):
+ if cfg.has_option('build_ext', key):
+ kw[key] = cfg.get('build_ext', key)
+
# Generate metadata first
self.run_command("egg_info")
os.chdir('Source')
- os.system(sys.executable + ' setup.py configure')
+ os.system(sys.executable + ' setup.py configure --include-dirs=%(include-dirs)s --library-dirs=%(library-dirs)s' % kw)
os.system('make clean')
os.system('make')
- os.system('make egg DISTDIR="%s"' % os.path.abspath(os.path.join('..', self.dist_dir)))
+ os.system('rm -rf dist; mkdir -p dist/EGG-INFO')
+ os.system('cp -rvf pysvn dist')
+ os.system('cp -rvf ../pysvn.egg-info/* dist/EGG-INFO')
+ os.system('find dist/pysvn -type f | sed s:dist/:: > dist/EGG-INFO/SOURCES.txt')
+ setuptools.command.bdist_egg.make_zipfile(
+ self.egg_output, 'dist', verbose=self.verbose,
+ dry_run=self.dry_run, mode=self.gen_header())
os.chdir('..') # Go back in parent directory
# Add to 'Distribution.dist_files' so that the "upload" command works
getattr( self.distribution, 'dist_files', [] ).append(
diff -ur pysvn-1.7.10.orig/Source/setup_configure.py pysvn-1.7.10/Source/setup_configure.py
--- pysvn-1.7.10.orig/Source/setup_configure.py 2014-11-09 11:55:47.000000000 +0100
+++ pysvn-1.7.10/Source/setup_configure.py 2015-08-17 10:41:05.781767086 +0200
@@ -54,6 +54,8 @@
class Options:
dest_dir = os.path.join( os.path.abspath( self.build_lib ), 'pysvn' )
# Generate metadata first
@@ -91,9 +105,13 @@ class BuildExtensions(build_ext):
# Invoke the build system. This will generate the __init__.py and
# .so that we'll package.
os.chdir( 'Source' )
- os.system( sys.executable + ' setup.py configure' )
- os.system( 'make clean' )
- os.system( 'make' )
+ subprocess.check_call(sys.executable + ' setup.py configure --include-dirs=%(include-dirs)s --library-dirs=%(library-dirs)s' % kw, shell=True)
+ subprocess.check_call('make clean', shell=True)
+ subprocess.check_call('make', shell=True)
+ subprocess.check_call('rm -rf dist; mkdir -p dist/EGG-INFO', shell=True)
+ subprocess.check_call('cp -rvf pysvn dist', shell=True)
+ subprocess.check_call('cp -rvf ../pysvn.egg-info/* dist/EGG-INFO', shell=True)
+ subprocess.check_call('find dist/pysvn -type f | sed s:dist/:: > dist/EGG-INFO/SOURCES.txt', shell=True)
# Copy the built files to the destination pysvn/ directory.
self.mkpath( dest_dir )
diff --git a/Source/setup_configure.py b/Source/setup_configure.py
index 2bf8ca1..7037f8f 100644
--- a/Source/setup_configure.py
+++ b/Source/setup_configure.py
@@ -55,6 +55,8 @@ class Options:
all_options_info = {
'--arch': (2, '<arch>'),
'--distro-dir': (2, '<dir>'),
+ '--library-dirs': (1, '<dir>:<dir>:...'),
+ '--include-dirs': (1, '<dir>:<dir>:...'),
'--apr-inc-dir': (1, '<dir>'),
'--apu-inc-dir': (1, '<dir>'),
'--apr-lib-dir': (1, '<dir>'),
@@ -511,12 +513,16 @@
@@ -542,12 +544,16 @@ class Compiler:
raise last_exception
def find_svn_bin( self ):
......@@ -70,28 +80,28 @@ diff -ur pysvn-1.7.10.orig/Source/setup_configure.py pysvn-1.7.10/Source/setup_c
+ return ''
def find_svn_lib( self ):
folder = self.find_dir(
@@ -589,8 +595,8 @@
last_exception = None
@@ -633,8 +639,8 @@ class Compiler:
# override the base_dir_list from the command line kw
svn_root_dir = None
- if self.options.hasOption( kw ):
- base_dir_list = [self.options.getOption( kw )]
+ if kw and self.options.hasOption( kw ):
+ base_dir_list = self.options.getOption( kw ) + base_dir_list
+ base_dir_list = [self.options.getOption( kw )] + base_dir_list
debug( '__find_dir base_dir_list=%r' % (base_dir_list,) )
elif( self.options.hasOption( '--svn-root-dir' )
and svn_root_suffix is not None ):
@@ -604,7 +610,7 @@
@@ -644,7 +650,7 @@ class Compiler:
if self.verbose:
print( 'Info: Checking for %s in %s' % (name, full_check_file) )
if os.path.exists( full_check_file ):
- return os.path.abspath( dirname )
+ return dirname
raise SetupError( 'cannot find %s %s - use %s' % (name, check_file, kw) )
raise SetupError( 'Cannot find %s %s - use %s' % (name, check_file, kw) )
@@ -629,6 +635,17 @@
@@ -669,6 +675,17 @@ class Compiler:
def getSvnVersion( self ):
return self.__svn_version_tuple
......@@ -109,33 +119,42 @@ diff -ur pysvn-1.7.10.orig/Source/setup_configure.py pysvn-1.7.10/Source/setup_c
class Win32CompilerMSVC90(Compiler):
def __init__( self, setup ):
@@ -1093,7 +1110,7 @@
'%(PYCXX)s/Src',
'/usr/share/python%s/CXX' % distutils.sysconfig.get_python_version() # typical Linux
@@ -1185,6 +1202,7 @@ class UnixCompilerGCC(CompilerGCC):
CompilerGCC.__init__( self, setup )
self._find_paths_pycxx_dir = [
+ '../Import/pycxx-7.1.5',
distutils.sysconfig.get_python_inc(), # typical Linux
'/usr/include'
]
@@ -1194,7 +1212,7 @@ class UnixCompilerGCC(CompilerGCC):
'/usr/src/CXX'
]
- self._find_paths_svn_inc = [
+ self._find_paths_svn_inc = self._include_dirs() + [
'/usr/include/subversion-1', # typical Linux
'/usr/local/include/subversion-1', # typical *BSD
'/usr/pkg/include/subversion-1', # netbsd
@@ -1103,14 +1120,14 @@
'/usr/local/bin', # typical *BSD
'/usr/pkg/bin', # netbsd
@@ -1204,7 +1222,7 @@ class UnixCompilerGCC(CompilerGCC):
'/usr/local/bin', # typical *BSD
'/usr/pkg/bin', # netbsd
]
- self._find_paths_svn_lib = [
+ self._find_paths_svn_lib = self._library_dirs() + [
'/usr/lib64', # typical 64bit Linux
'/usr/lib', # typical Linux
'/usr/local/lib64', # typical 64bit Linux
'/usr/local/lib', # typical *BSD
@@ -1212,7 +1230,7 @@ class UnixCompilerGCC(CompilerGCC):
'/usr/pkg/lib', # netbsd
'/usr/lib/x86_64-linux-gnu', # debian/unbuntu
]
- self._find_paths_apr_inc = [
+ self._find_paths_apr_inc = self._include_dirs() + [
'/usr/include/apr-1', # typical Linux
'/usr/include/apr-1.0', # typical Linux
'/usr/local/apr/include/apr-1', # Mac OS X www.metissian.com
'/usr/pkg/include/apr-1', # netbsd
@@ -1120,7 +1137,7 @@
@@ -1223,7 +1241,7 @@ class UnixCompilerGCC(CompilerGCC):
'/usr/local/include/apache2', # alternate *BSD
]
self._find_paths_apr_util_inc = self._find_paths_apr_inc
......@@ -144,7 +163,7 @@ diff -ur pysvn-1.7.10.orig/Source/setup_configure.py pysvn-1.7.10/Source/setup_c
'/usr/lib64', # typical 64bit Linux
'/usr/lib', # typical Linux
'/usr/local/lib64', # typical 64bit Linux
@@ -1186,6 +1203,8 @@
@@ -1310,6 +1328,8 @@ class LinuxCompilerGCC(UnixCompilerGCC):
if not self.setup.options.hasOption( '--norpath' ):
py_ld_libs.extend( [
'-Wl,--rpath',
......
http://pysvn.tigris.org/ds/viewMessage.do?dsForumId=1334&dsMessageId=3094617
diff -ur pysvn-1.7.10.orig/Source/pysvn_svnenv.cpp pysvn-1.7.10/Source/pysvn_svnenv.cpp
--- pysvn-1.7.10.orig/Source/pysvn_svnenv.cpp 2010-11-20 13:02:37.000000000 +0100
+++ pysvn-1.7.10/Source/pysvn_svnenv.cpp 2015-08-17 17:39:50.491209720 +0200
@@ -292,8 +292,8 @@
if( accept_permanently )
{
new_cred->may_save = 1;
- new_cred->accepted_failures = accepted_failures;
}
+ new_cred->accepted_failures = accepted_failures;
*cred = new_cred;
......@@ -33,11 +33,8 @@ package_version = 2.7.18
package_version_suffix =
md5sum = fd6cc8ec0a78c44036f825e739f36e5a
# This is actually the default setting for prefix, but we can't use it in
# other settings in this part if we don't set it explicitly here.
prefix = @@LOCATION@@
version = 2.7
executable = ${:prefix}/bin/python${:version}
executable = @@LOCATION@@/bin/python${:version}
patch-options = -p1
patches =
......@@ -61,11 +58,11 @@ make-targets = make profile-opt && make install
# recent RedHat would otherwise mangle them, either failing ('python' is
# ambiguous and 'python2' is not supported anymore) or replacing with
# something that's really wrong (/usr/bin/python...).
post-install = cd '${:prefix}' &&
post-install = cd '%(prefix)s' &&
find -executable -type f -print0 |
xargs -0 grep -I -m 1 '' |
sed -n 's,:#! */usr/bin/env \+python2\?$,,p' |
xargs -d '\n' sed -i '1s,.*,#!${:executable},'
xargs -d '\n' sed -i '1s,.*,#!%(executable)s,'
# the entry "-Wl,-rpath=${file:location}/lib" below is needed by python-magic,
# which would otherwise load the system libmagic.so with ctypes
......
......@@ -42,6 +42,7 @@ configure-options =
--with-openssl=${openssl:location}
# Profiled build:
--enable-optimizations
pre-build = printf '*disabled*\nnis\n' >> Modules/Setup.local
pre-install = mkdir profile-opt
# the entry "-Wl,-rpath=${file:location}/lib" below is needed by python-magic,
......
......@@ -10,12 +10,22 @@ extends =
[serf]
recipe = slapos.recipe.cmmi
shared = true
url = https://archive.apache.org/dist/serf/serf-1.2.1.tar.bz2
md5sum = 4f8e76c9c6567aee1d66aba49f76a58b
configure-options =
--with-apr=${apr:location}
--with-apr-util=${apr-util:location}
--with-openssl=${openssl-1.0:location}
environment =
CFLAGS=-I${zlib:location}/include -I${libuuid:location}/include
LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib
url = https://archive.apache.org/dist/serf/serf-1.3.9.tar.bz2
md5sum = 370a6340ff20366ab088012cd13f2b57
scons-command =
python ${scons:location}/scons.py \
APR="${apr:location}" \
APU="${apr-util:location}" \
OPENSSL="${openssl:location}" \
PREFIX=@@LOCATION@@ \
CFLAGS="-I${zlib:location}/include -I${libuuid:location}/include" \
LINKFLAGS="-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib"
configure-command = :
make-binary = ${:scons-command}
[scons]
recipe = slapos.recipe.build:download-unpacked
shared = true
url = https://prdownloads.sourceforge.net/scons/scons-local-2.3.0.tar.gz
md5sum = d262e6c6da620488d2226fabc8aabf09
strip-top-level-dir = false
......@@ -15,26 +15,25 @@ extends =
../sqlite3/buildout.cfg
../zlib/buildout.cfg
../swig/buildout.cfg
../lz4/buildout.cfg
parts =
subversion
[subversion]
recipe = slapos.recipe.cmmi
shared = true
url = http://apache.mirrors.tds.net/subversion/subversion-1.8.14.tar.bz2
md5sum = fe476ba26d6835eba4393780ea907361
# Patch available thanks to gentoo developpers
# https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-vcs/subversion/files/subversion-fix-parallel-build-support-for-perl-bindings.patch
patches =
${:_profile_base_location_}/subversion-fix-parallel-build-support-for-perl-bindings.patch#fd69f4c932b4882ed98c59eb102be64a
url = https://downloads.apache.org/subversion/subversion-1.14.1.tar.bz2
md5sum = 2eccc2c7451397e01a13682600af9563
configure-options =
--disable-static
--with-apr=${apr:location}
--with-apr-util=${apr-util:location}
--with-serf=yes
--without-apxs
--with-utf8proc=internal
--with-zlib=${zlib:location}
--with-sqlite=${sqlite3:location}
--with-lz4=${lz4:location}
--without-berkeley-db
--without-sasl
--without-apr_memcache
......@@ -53,9 +52,9 @@ configure-options =
make-targets = install -j1
environment =
PATH=${patch:location}/bin:${perl:location}/bin:${pkgconfig:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${apache:location}/lib/pkgconfig:${sqlite3:location}/lib/pkgconfig:${openssl-1.0:location}/lib/pkgconfig:${serf:location}/lib/pkgconfig
PKG_CONFIG_PATH=${apache:location}/lib/pkgconfig:${sqlite3:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig:${serf:location}/lib/pkgconfig
CPPFLAGS=-I${libexpat:location}/include -I${libuuid:location}/include
LDFLAGS=-L${libexpat:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${sqlite3:location}/lib -Wl,-rpath=${apache:location}/lib -L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib -Wl,-rpath=${openssl-1.0:location}/lib
LDFLAGS=-L${libexpat:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${sqlite3:location}/lib -Wl,-rpath=${apache:location}/lib -L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib -Wl,-rpath=${openssl:location}/lib -Wl,-rpath=${serf:location}/lib -Wl,-rpath=${lz4:location}/lib
[subversion-1.9]
recipe = hexagonit.recipe.cmmi
......
--- Makefile.in 2011-07-16 13:50:53.000000000 +0200
+++ Makefile.in.new 2012-03-11 12:13:57.000000000 +0100
@@ -732,7 +732,7 @@
extraclean-swig-headers: clean-swig-headers
$(EXTRACLEAN_SWIG_HEADERS)
-$(SWIG_PL_DIR)/native/Makefile.PL: $(SWIG_SRC_DIR)/perl/native/Makefile.PL.in
+$(SWIG_PL_DIR)/native/Makefile.PL: $(SWIG_SRC_DIR)/perl/native/Makefile.PL.in libsvn_swig_perl
./config.status subversion/bindings/swig/perl/native/Makefile.PL
$(SWIG_PL_DIR)/native/Makefile: $(SWIG_PL_DIR)/native/Makefile.PL
......@@ -162,7 +162,6 @@ setup(name=name,
'slapconfiguration.serialised = slapos.recipe.slapconfiguration:Serialised',
'slapconfiguration.jsondump = slapos.recipe.slapconfiguration:JsonDump',
'slapcontainer = slapos.recipe.container:Recipe',
'softwaretype = slapos.recipe.softwaretype:Recipe', # BBB
'sphinx= slapos.recipe.sphinx:Recipe',
'squid = slapos.recipe.squid:Recipe',
'sshkeys_authority = slapos.recipe.sshkeys_authority:Recipe',
......
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import os
import sys
import copy
from six.moves.configparser import ConfigParser
import json
import subprocess
import slapos.slap
import netaddr
import logging
import errno
import re
import zc.buildout
import six
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."""
regex = re.compile(r'^(.*)\s+([+-]{1})$')
if self._defaults:
fp.write("[%s]\n" % DEFAULTSECT)
for (key, value) in self._defaults.items():
op = ""
result = regex.match(key)
if result is not None:
key, op = result.groups()
line = "%s %s= %s\n" % (key, op, 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):
op = ""
result = regex.match(key)
if result is not None:
key, op = result.groups()
key = "%s %s= %s" % (key, op, str(value).replace('\n', '\n\t'))
fp.write("%s\n" % key)
fp.write("\n")
class Recipe:
def __init__(self, buildout, name, options):
self.buildout = buildout
self.options = options
self.name = name
self.logger = logging.getLogger(self.name)
def _getIpAddress(self, test_method):
"""Internal helper method to fetch ip address"""
if not 'ip_list' in self.parameter_dict:
raise AttributeError
for name, ip in self.parameter_dict['ip_list']:
if test_method(ip):
return ip
raise AttributeError
def _getTapIpAddressList(self, test_method):
"""Internal helper method to fetch full ip address assigned for tap"""
if not 'full_ip_list' in self.parameter_dict:
return ()
for item in self.parameter_dict['full_ip_list']:
if len(item) == 5:
tap, ip, gw, mask, net = item
if tap.startswith('route_') and test_method(ip) and \
test_method(gw) and test_method(mask):
return (ip, gw, mask, net)
return ()
def getLocalIPv4Address(self):
"""Returns local IPv4 address available on partition"""
# XXX: Lack checking for locality of address
return self._getIpAddress(netaddr.valid_ipv4)
def getGlobalIPv6Address(self):
"""Returns global IPv6 address available on partition"""
# XXX: Lack checking for globality of address
return self._getIpAddress(netaddr.valid_ipv6)
def getLocalTapIPv4AddressList(self):
"""Returns global IPv6 address available for tap interface"""
# XXX: Lack checking for locality of address
return self._getTapIpAddressList(netaddr.valid_ipv4)
def getNetworkInterface(self):
"""Returns the network interface available on partition"""
if not 'ip_list' in self.parameter_dict:
raise AttributeError
for name, ip in self.parameter_dict['ip_list']:
if name:
return name
raise AttributeError("Not network interface found")
def mkdir_p(self, path, mode=0o700):
"""
Creates a directory and its parents, if needed.
NB: If the directory already exists, it does not change its permission.
"""
try:
os.makedirs(path, mode)
except OSError as exc:
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
raise
def install(self):
slap = slapos.slap.slap()
slap_connection = self.buildout['slap_connection']
computer_id = slap_connection['computer_id']
computer_partition_id = slap_connection['partition_id']
server_url = slap_connection['server_url']
key_file = slap_connection.get('key_file')
cert_file = slap_connection.get('cert_file')
instance_root = self.buildout['buildout']['directory']
storage_configuration_dict = self.buildout.get('storage-configuration')
network_dict = self.buildout.get('network-information')
storage_home = ''
global_ipv4_network = ''
if storage_configuration_dict:
storage_home = storage_configuration_dict.get('storage-home')
if network_dict:
global_ipv4_network = network_dict.get('global-ipv4-network')
slap.initializeConnection(server_url, key_file, cert_file)
self.computer_partition = slap.registerComputerPartition(
computer_id,
computer_partition_id)
self.parameter_dict = self.computer_partition.getInstanceParameterDict()
software_type = self.parameter_dict['slap_software_type']
# Raise if request software_type does not exist ...
if software_type not in self.options:
# ... Except for backward compatibility. Then use "default".
if software_type in ['RootSoftwareInstance']:
software_type = 'default'
else:
raise zc.buildout.UserError("This software type (%s) isn't mapped." % \
software_type)
instance_file_path = self.options[software_type]
if not os.path.exists(instance_file_path):
raise zc.buildout.UserError("The specified buildout config file %r does "
"not exist." % instance_file_path)
if six.PY3:
buildout = SlapConfigParser(strict=False)
else:
buildout = SlapConfigParser()
with open(instance_file_path) as instance_path:
buildout.readfp(instance_path)
buildout.set('buildout', 'installed', '.installed-%s.cfg' % self.name)
if not buildout.has_section('slap-parameter'):
buildout.add_section('slap-parameter')
for parameter, value in self.parameter_dict.items():
# All parameters evaluating to False are... False, and shouldn't
# convey any information.
# Here, all those parameters are simply ignored.
if value:
if isinstance(value, str):
buildout.set('slap-parameter', parameter, value)
else:
buildout.set('slap-parameter', parameter, json.dumps(value))
buildout.add_section('slap-network-information')
buildout.set('slap-network-information', 'local-ipv4',
self.getLocalIPv4Address())
buildout.set('slap-network-information', 'global-ipv6',
self.getGlobalIPv6Address())
buildout.set('slap-network-information', 'network-interface',
self.getNetworkInterface())
tap_ip_list = self.getLocalTapIPv4AddressList()
tap_ipv4 = tap_gateway = tap_netmask = tap_network = ''
if tap_ip_list:
tap_ipv4, tap_gateway, tap_netmask, tap_network= tap_ip_list
buildout.set('slap-network-information', 'tap-ipv4', tap_ipv4)
buildout.set('slap-network-information', 'tap-gateway', tap_gateway)
buildout.set('slap-network-information', 'tap-netmask', tap_netmask)
buildout.set('slap-network-information', 'tap-network', tap_network)
buildout.set('slap-network-information', 'global-ipv4-network',
global_ipv4_network)
# Copy/paste slap_connection
buildout.add_section('slap-connection')
for key, value in six.iteritems(self.buildout['slap_connection']):
# XXX: Waiting for SlapBaseRecipe to use dash instead of underscores
buildout.set('slap-connection', key.replace('_', '-'), value)
# XXX: Needed for lxc. Use non standard API
buildout.set('slap-connection', 'requested', self.computer_partition._requested_state)
# setup storage directory
buildout.add_section('storage-configuration')
buildout.set('storage-configuration', 'storage-home', storage_home)
if storage_home and os.path.exists(storage_home) and \
os.path.isdir(storage_home):
# Create folder instance_root/DATA/ if not exist
data_home = os.path.join(instance_root, 'DATA')
self.mkdir_p(data_home)
for filename in os.listdir(storage_home):
storage_path = os.path.join(storage_home, filename, computer_partition_id)
if os.path.exists(storage_path) and os.path.isdir(storage_path):
storage_link = os.path.join(data_home, filename)
if os.path.lexists(storage_link):
if not os.path.islink(storage_link):
raise zc.buildout.UserError(
'Target %r already exists but is not a link' % storage_link)
#os.unlink(storage_link)
else:
os.symlink(storage_path, storage_link)
buildout.set('storage-configuration', filename, storage_link)
work_directory = os.path.abspath(self.buildout['buildout'][
'directory'])
buildout_filename = os.path.join(work_directory,
'buildout-%s.cfg' % self.name)
with open(buildout_filename, 'w') as buildout_file:
buildout.write(buildout_file)
# XXX-Antoine: We gotta find a better way to do this. I tried to check
# out how slapgrid-cp was running buildout. But it is worse than that.
command_line_args = copy.copy(sys.argv) + ['-c', buildout_filename]
self.logger.info("Invoking commandline : '%s'",
' '.join(command_line_args))
subprocess.check_call(command_line_args, cwd=work_directory,
env=os.environ.copy())
return []
update = install
......@@ -27,4 +27,4 @@ md5sum = 98faa5ad8cfb23a11d97a459078a1d05
[template-runTestSuite]
filename = runTestSuite.in
md5sum = 3e2fbde4b6a1cc202b5fd2a0f14413fd
md5sum = 9d82f8afa0de8ec2b9c4f32e058fb2bc
......@@ -69,7 +69,7 @@ def main():
target = test_runner.get('target', 'firefox')
if target == 'node':
# Execute NodeJS tests
result_string = check_output(['${nodejs-output:node}', '${jio-repository.git:location}/test/node.js'],
result_string = check_output(['${nodejs:location}/bin/node', '${jio-repository.git:location}/test/node.js'],
cwd='${jio-repository.git:location}',
env={'CI': 'true'})
result_dict = json.loads(result_string)
......
......@@ -32,9 +32,6 @@ parts =
[nodejs]
<= nodejs-8.6.0
[nodejs-output]
<= nodejs-8.6.0-output
[eggs]
recipe = zc.recipe.egg
eggs =
......@@ -54,7 +51,11 @@ develop = true
[renderjs-install]
recipe = plone.recipe.command
stop-on-error = true
command = cd ${renderjs-repository.git:location} && PATH=${git:location}/bin/:${nodejs:location}/bin/:${bzip2:location}/bin/:$PATH ${nodejs-output:npm} install . && PATH=${git:location}/bin/:${nodejs:location}/bin/:${bzip2:location}/bin/:$PATH ./node_modules/grunt-cli/bin/grunt
command = set -e
cd ${renderjs-repository.git:location}
PATH=${git:location}/bin:${nodejs:location}/bin:${bzip2:location}/bin:$PATH
npm install .
./node_modules/grunt-cli/bin/grunt
update-command = ${:command}
[jio-repository.git]
......@@ -67,7 +68,11 @@ develop = true
[jio-install]
recipe = plone.recipe.command
stop-on-error = true
command = cd ${jio-repository.git:location} && PATH=${git:location}/bin/:${nodejs:location}/bin/:$PATH ${nodejs:location}/bin/npm install jslint@0.9.2 jison@0.4.16 git://github.com/qunitjs/node-qunit.git#v0.9.3 sinon@1.7.3 && PATH=${curl:location}/bin/:${nodejs:location}/bin/:$PATH make
command = set -e
cd ${jio-repository.git:location}
PATH=${git:location}/bin:${nodejs:location}/bin:$PATH
${nodejs:location}/bin/npm install jslint@0.9.2 jison@0.4.16 git://github.com/qunitjs/node-qunit.git#v0.9.3 sinon@1.7.3
make
update-command = ${:command}
[rsvp-repository.git]
......@@ -80,7 +85,10 @@ develop = true
[rsvp-install]
recipe = plone.recipe.command
stop-on-error = true
command = cd ${rsvp-repository.git:location} && PATH=${git:location}/bin/:${nodejs:location}/bin/:$PATH ${nodejs:location}/bin/npm install .
command = set -e
cd ${rsvp-repository.git:location}
PATH=${git:location}/bin:${nodejs:location}/bin:$PATH
npm install .
update-command = ${:command}
[uritemplate-repository.git]
......@@ -93,7 +101,10 @@ develop = true
[uritemplate-install]
recipe = plone.recipe.command
stop-on-error = true
command = cd ${uritemplate-repository.git:location} && PATH=${git:location}/bin/:${nodejs:location}/bin/:$PATH ${nodejs:location}/bin/npm install .
command = set -e
cd ${uritemplate-repository.git:location}
PATH=${git:location}/bin:${nodejs:location}/bin:$PATH
npm install .
update-command = ${:command}
[macro-template]
......
......@@ -13,7 +13,6 @@ extends =
../../component/numpy/buildout.cfg
../../component/gzip/buildout.cfg
../../stack/slapos.cfg
../../component/nodejs/buildout.cfg
../../stack/resilient/buildout.cfg
buildout.hash.cfg
......@@ -57,38 +56,6 @@ eggs =
scripts =
websockify
[http-proxy]
# https://github.com/nodejitsu/node-http-proxy
recipe = slapos.recipe.build:download-unpacked
shared = true
#XXX-Cedric : use upstream when merged
url = https://nodeload.github.com/desaintmartin/node-http-proxy/zipball/20120621
md5sum = 20204d0b29c2cef26e1c91e99eedca6b
[proxy-by-url]
# https://github.com/dominictarr/proxy-by-url
recipe = slapos.recipe.build:download-unpacked
shared = true
#XXX-Cedric : use upstream when merged
url = https://nodeload.github.com/desaintmartin/proxy-by-url/zipball/20120621
md5sum = c2609948aa708581f93b981b23880314
[npm-modules]
recipe = plone.recipe.command
destination = ${buildout:parts-directory}/${:_buildout_section_name_}
location = ${buildout:parts-directory}/${:_buildout_section_name_}
command =
export HOME=${:location};
rm -fr ${:destination} &&
mkdir -p ${:destination} &&
cd ${:destination} &&
${nodejs:location}/bin/node ${nodejs:location}/bin/npm install colors@0.6.0-1 &&
${nodejs:location}/bin/node ${nodejs:location}/bin/npm install socket.io@0.8.7 &&
${nodejs:location}/bin/node ${nodejs:location}/bin/npm install socket.io-client@0.8.7 &&
${nodejs:location}/bin/node ${nodejs:location}/bin/npm install optimist@0.3.1 &&
${nodejs:location}/bin/node ${nodejs:location}/bin/npm install pkginfo@0.2.3
# Create all templates that will be used to deploy instances
[download-base]
recipe = hexagonit.recipe.download
......
......@@ -31,6 +31,7 @@ from urllib.parse import urlparse, parse_qs
import tempfile
import io
import subprocess
import time
from http.server import BaseHTTPRequestHandler
import logging
......@@ -152,7 +153,12 @@ class TestSFTPOperations(ProFTPdTestCase):
with self.assertRaises(IOError):
sftp.sftp_client.putfo(ErrorFile(), "destination")
# no half uploaded file is kept
for _ in range(10):
if not os.listdir(self.upload_dir):
break
time.sleep(0.1)
self.assertEqual([], os.listdir(self.upload_dir))
def test_user_cannot_escape_home(self):
......
[buildout]
extends =
../../component/apache/buildout.cfg
../../component/bash/buildout.cfg
../../component/dcron/buildout.cfg
../../component/dropbear/buildout.cfg
../../component/gzip/buildout.cfg
../../component/logrotate/buildout.cfg
../../stack/slapos.cfg
parts =
instance-profile
slapos-cookbook
eggs
# Add hosting location of testing version of slapos.core
find-links +=
http://www.nexedi.org/static/packages/source/slapos.core-testing/
[environment]
recipe = collective.recipe.environment
[instance-profile]
# 3 advantages of using jinja2 for ALL templates:
# 1/ Explicit scope (pythonic style, we explicitely list what we want to be in the scope)
# 2/ No troubles between $ and $$ (more simple)
# 3/ We can explicitely define the path of executables (i.e
# in software, define httpd-executable = ${apache:location}/bin/httpd
# and in instance, just use httpd-executable without bother where it is actually
# (location can change inside of the component, from bin to sbin for example).
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg.jinja2
rendered = ${buildout:directory}/instance.cfg
#md5sum = 4861be4a581686feef9f9edea865d7ee
mode = 0644
context =
key bin_directory buildout:bin-directory
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
key path environment:PATH
raw httpd_executable ${apache:location}/bin/httpd
raw bash_executable ${bash:location}/bin/bash
raw dcron_executable ${dcron:location}/sbin/crond
raw dropbear_executable ${dropbear:location}/sbin/dropbear
raw dropbearkey_executable ${dropbear:location}/bin/dropbearkey
raw gzip_executable ${gzip:location}/bin/gzip
raw gunzip_executable ${gzip:location}/bin/gunzip
raw logrotate_executable ${logrotate:location}/usr/sbin/logrotate
raw slapos_configuration_file_template_path ${slapos-configuration-file-template:target}
raw httpd_configuration_file_template_path ${httpd-configuration-file-template:target}
[slapos-configuration-file-template]
# Download the template of slapos.cfg
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/slapos.cfg.in
#md5sum =
target = ${buildout:directory}/slapos.cfg.in
mode = 0644
[httpd-configuration-file-template]
# Download the template of httpd.conf
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/httpd.conf.in
mode = 0644
#md5sum =
#target = ${
[eggs]
recipe = zc.recipe.egg
eggs =
collective.recipe.template
[buildout]
parts =
slapos-configuration-file
cron-entry-slapos
slapos-node-status-wrapper
slapos-node-format-wrapper-script
httpd-wrapper
cron
logrotate
logrotate-entry-httpd
logrotate-entry-slapos
sshkeys-dropbear
dropbear-server-add-authorized-key
sshkeys-authority
publish-connection-informations
dropbear-promise
httpd-promise
slapos-promise
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[instance-parameter]
recipe = slapos.cookbook:slapconfiguration
computer = ${slap_connection:computer_id}
partition = ${slap_connection:partition_id}
url = ${slap_connection:server_url}
key = ${slap_connection:key_file}
cert = ${slap_connection:cert_file}
configuration.master-url = https://slap.vifib.com
configuration.authorized-key =
# Create all needed directories
[directory]
recipe = slapos.cookbook:mkdirectory
mode = 0750
etc = ${buildout:directory}/etc/
var = ${buildout:directory}/var/
srv = ${buildout:directory}/srv/
bin = ${buildout:directory}/bin/
sshkeys = ${:srv}/sshkeys
service = ${:etc}/service/
script = ${:etc}/run/
ssh = ${:etc}/ssh/
log = ${:var}/log/
run = ${:var}/run/
backup = ${:srv}/backup/
promises = ${:etc}/promise/
slapos-partitions-certificate-repository = ${:var}/pki
software-root = ${:srv}/slapos-software
instance-root = ${:srv}/slapos-instance
slapos-log = ${:log}/slapos
{% for i in range(0,10) %}
slappart{{i}} = ${:instance-root}/slappart{{i}}
{% endfor %}
cron-entries = ${:etc}/cron.d
crontabs = ${:etc}/crontabs
cronstamps = ${:etc}/cronstamps
logrotate-entries = ${:etc}/logrotate.d
logrotate-backup = ${:backup}/logrotate
httpd-log = ${:log}/httpd
########
# Deploy slapos.cfg, computer certificates and slapos node wrapper
########
[slapos-computer-certificate-file]
recipe = collective.recipe.template
input = inline:${instance-parameter:configuration.computer-certificate}
output = ${directory:var}/slapos-computer.crt
[slapos-computer-key-file]
recipe = collective.recipe.template
input = inline:${instance-parameter:configuration.computer-key}
output = ${directory:var}/slapos-computer.key
[computer-definition-file]
recipe = collective.recipe.template
input = inline:
[computer]
{% for i in range(0,10|int) %}
[partition_{{i}}]
address = ${instance-parameter:ipv4-random}/255.255.255.0 ${instance-parameter:ipv6-random}/64
pathname = slappart{{i}}
user = dummy
network_interface = dummy
{% endfor %}
output = ${directory:etc}/slapos-computer-definition.cfg
[slapos-configuration-file]
recipe = slapos.recipe.template
url = {{ slapos_configuration_file_template_path }}
output = ${directory:etc}/slapos.cfg
#md5sum = 4861be4a581686feef9f9edea865d7ee
software-root = ${directory:software-root}
instance-root = ${directory:instance-root}
master-url = ${instance-parameter:configuration.master-url}
computer-id = ${instance-parameter:configuration.computer-id}
# XXX should be a parameter
partition-amount = 10
computer-definition-file = ${computer-definition-file:output}
computer-xml = ${directory:var}/slapos.xml
computer-key-file = ${slapos-computer-key-file:output}
computer-certificate-file = ${slapos-computer-certificate-file:output}
certificate-repository-path = ${directory:slapos-partitions-certificate-repository}
[slapos-node-instance-wrapper]
recipe = slapos.cookbook:wrapper
command-line = {{ bin_directory }}/slapos node instance --cfg ${slapos-configuration-file:output} --pidfile ${directory:run}/slapos-instance.pid --logfile ${directory:slapos-log}/slapos-instance.log
wrapper-path = ${directory:bin}/slapos-node-instance
[slapos-node-software-wrapper]
recipe = slapos.cookbook:wrapper
command-line = {{ bin_directory }}/slapos node software --cfg ${slapos-configuration-file:output} --pidfile ${directory:run}/slapos-software.pid --logfile ${directory:slapos-log}/slapos-software.log
wrapper-path = ${directory:bin}/slapos-node-software
[slapos-node-report-wrapper]
recipe = slapos.cookbook:wrapper
command-line = {{ bin_directory }}/slapos node report --cfg ${slapos-configuration-file:output} --pidfile ${directory:run}/slapos-report.pid --logfile ${directory:slapos-log}/slapos-report.log
wrapper-path = ${directory:bin}/slapos-node-report
[slapos-node-status-wrapper]
recipe = slapos.cookbook:wrapper
command-line = {{ bin_directory }}/slapos node status --cfg ${slapos-configuration-file:output}
wrapper-path = ${directory:bin}/slapos-node-status
[slapos-node-format-wrapper]
recipe = slapos.cookbook:wrapper
command-line = {{ bin_directory }}/slapos node format --cfg ${slapos-configuration-file:output} --logfile=${directory:slapos-log}/slapos-node-format.log --now
wrapper-path = ${directory:bin}/slapos-node-format
[slapos-node-format-wrapper-script]
# Create a wrapper of the wrapper in etc/run
recipe = collective.recipe.template
input = inline:#!{{ bash_executable }}
false
while [ ! $? -eq 0 ]; do
${slapos-node-format-wrapper:wrapper-path}
done
output = ${directory:script}/slapos-node-format
mode = 700
#########
# Deploy some http server to see logs online
#########
# XXX could it be something lighter?
[httpd-configuration-file]
recipe = slapos.recipe.template
url = {{ httpd_configuration_file_template_path }}
output = ${directory:etc}/httpd.conf
# md5sum =
listening-ip = ${instance-parameter:ipv6-random}
listening-port = 8080
htdocs = ${directory:log}
pid-file = ${directory:run}/httpd.pid
access-log = ${directory:httpd-log}/access-log
error-log = ${directory:httpd-log}/error-log
document-root = ${directory:log}
# XXX logrotate for httpd
[httpd-wrapper]
recipe = slapos.cookbook:wrapper
apache-executable = {{ httpd_executable }}
command-line = ${:apache-executable} -f ${httpd-configuration-file:output} -DFOREGROUND
wrapper-path = ${directory:service}/httpd
# generated parameter containing url to use for other sections
url = http://[${httpd-configuration-file:listening-ip}]/
#########
# Deploy logrotate
#########
[logrotate]
recipe = slapos.cookbook:logrotate
# Binaries
logrotate-binary = {{ logrotate_executable }}
gzip-binary = {{ gzip_executable }}
gunzip-binary = {{ gunzip_executable }}
# Directories
wrapper = ${directory:bin}/logrotate
conf = ${directory:etc}/logrotate.conf
logrotate-entries = ${directory:logrotate-entries}
backup = ${directory:logrotate-backup}
state-file = ${directory:srv}/logrotate.status
[logrotate-entry-httpd]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = httpd
log = ${httpd-configuration-file:access-log} ${httpd-configuration-file:error-log}
frequency = daily
rotate-num = 30
post = {{ bin_directory }}/killpidfromfile $${apache-configuration:pid-file} SIGUSR1
sharedscripts = true
notifempty = true
create = true
[logrotate-entry-slapos]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = slapos
log = ${directory:slapos-log}/*.log
frequency = daily
rotate-num = 30
#post = {{ bin_directory }}/killpidfromfile ${nginx-configuration:pid-file} SIGUSR1
sharedscripts = true
notifempty = true
create = true
###########
# Deploy cron and configure it
###########
[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
wrapper = ${directory:bin}/cron_simplelogger
log = ${directory:log}/crond.log
[cron]
recipe = slapos.cookbook:cron
dcrond-binary = {{ dcron_executable }}
cron-entries = ${directory:cron-entries}
crontabs = ${directory:crontabs}
cronstamps = ${directory:cronstamps}
catcher = ${cron-simplelogger:wrapper}
binary = ${directory:service}/crond
[cron-entry-slapos]
recipe = collective.recipe.template
# Add current PATH to environment, otherwise, gcc is not able to find its own cc1.
# We don't add it in the top of the script, because dcron disallow it.
# XXX: maybe it works if we take PATH from instance, not software.
input = inline:
* * * * * PATH={{ path }} ${slapos-node-instance-wrapper:wrapper-path} > /dev/null 2>&1
* * * * * PATH={{ path }} ${slapos-node-software-wrapper:wrapper-path} > /dev/null 2>&1
* * * * * PATH={{ path }} ${slapos-node-report-wrapper:wrapper-path} > /dev/null 2>&1
output = ${directory:cron-entries}/slapos
[cron-entry-logrotate]
<= cron
recipe = slapos.cookbook:cron.d
name = logrotate
frequency = 0 0 * * *
command = $${logrotate:wrapper}
# XXX what to do for slapformat?
#########
# Deploy dropbear (minimalist SSH server)
#########
[sshkeys-directory]
recipe = slapos.cookbook:mkdirectory
requests = ${directory:sshkeys}/requests/
keys = ${directory:sshkeys}/keys/
[sshkeys-authority]
recipe = slapos.cookbook:sshkeys_authority
request-directory = ${sshkeys-directory:requests}
keys-directory = ${sshkeys-directory:keys}
wrapper = ${directory:service}/sshkeys_authority
keygen-binary = {{ dropbearkey_executable }}
[dropbear-server]
recipe = slapos.cookbook:dropbear
host = ${instance-parameter:ipv6-random}
port = 2222
home = ${directory:ssh}
wrapper = ${directory:bin}/raw_sshd
shell = {{ bash_executable }}
rsa-keyfile = ${directory:ssh}/server_key.rsa
dropbear-binary = {{ dropbear_executable }}
[sshkeys-dropbear]
<= sshkeys-authority
recipe = slapos.cookbook:sshkeys_authority.request
name = dropbear
type = rsa
executable = ${dropbear-server:wrapper}
public-key = ${dropbear-server:rsa-keyfile}.pub
private-key = ${dropbear-server:rsa-keyfile}
wrapper = ${directory:service}/sshd
[dropbear-server-add-authorized-key]
<= dropbear-server
recipe = slapos.cookbook:dropbear.add_authorized_key
key = ${instance-parameter:configuration.authorized-key}
#########
# Send informations to SlapOS Master
#########
[publish-connection-informations]
recipe = slapos.cookbook:publish
log-viewer-url = http://[${httpd-configuration-file:listening-ip}]:${httpd-configuration-file:listening-port}
ssh_command = ssh ${dropbear-server:host} -p ${dropbear-server:port}
#########
# Deploy promises scripts
#########
[dropbear-promise]
recipe = slapos.cookbook:check_port_listening
path = ${directory:promises}/dropbear
hostname = ${dropbear-server:host}
port = ${dropbear-server:port}
[httpd-promise]
recipe = slapos.cookbook:check_port_listening
path = ${directory:promises}/httpd
hostname = ${httpd-configuration-file:listening-ip}
port = ${httpd-configuration-file:listening-port}
[slapos-promise]
recipe = collective.recipe.template
input = inline:#!/{{ bash_executable }}
{{ bin_directory }}/slapgrid-supervisorctl ${slapos-configuration-file:output} status watchdog | grep RUNNING
output = ${directory:promises}/slapos
mode = 0700
# Production profile of slapos-in-partition
# Exactly the same as common.cfg, but:
# 1/ Use a defined set of Python eggs instead of using the latest available
# ones from Pypi, to ensure stability;
# 2/ Define list of trusted certificates for the cache.
[buildout]
extends = common.cfg
[versions]
Pygments = 1.6
collective.recipe.environment = 0.2.0
collective.recipe.template = 1.10
# Apache static configuration
# Automatically generated
# Basic server configuration
PidFile "${:pid-file}"
Listen [${:listening-ip}]:${:listening-port}
ServerAdmin someone@email
DefaultType text/plain
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
DocumentRoot "${:document-root}"
# Log configuration
ErrorLog "${:error-log}"
LogLevel warn
LogFormat "%h %{REMOTE_USER}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %{REMOTE_USER}i %l %u %t \"%r\" %>s %b" common
CustomLog "${:access-log}" common
# Allow cross site scripting
Header set Access-Control-Allow-Origin "*"
# List of modules
LoadModule unixd_module modules/mod_unixd.so
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule version_module modules/mod_version.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule headers_module modules/mod_headers.so
LoadModule dir_module modules/mod_dir.so
LoadModule alias_module modules/mod_alias.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule autoindex_module modules/mod_autoindex.so
<Directory />
Options Indexes FollowSymLinks
IndexOptions FancyIndexing
order allow,deny
Allow from All
</Directory>
[slapos]
software_root = ${:software-root}
instance_root = ${:instance-root}
master_url = ${:master-url}
key_file = ${:computer-key-file}
cert_file = ${:computer-certificate-file}
certificate_repository_path = ${:certificate-repository-path}
computer_id = ${:computer-id}
maximal_delay = 0
# Don't check if we are using root
root_check = false
[slapformat]
alter_user = false
alter_network = false
input_definition_file = ${:computer-definition-file}
computer_xml = ${:computer-xml}
partition_amount = ${:partition-amount}
create_tap = false
[buildout]
parts =
publish-connection-informations
request-slave-instance
check-connection-informations-promise
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[directories]
recipe = slapos.cookbook:mkdirectory
bin = $${buildout:directory}/bin
etc = $${buildout:directory}/etc
scripts = $${:etc}/run
services = $${:etc}/service
promises = $${:etc}/promise
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
computer = $${slap-connection:computer-id}
partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
[request-test-instance]
# Deploy a dummy instance
<= slap-connection
recipe = slapos.cookbook:request
name = Test Root Instance
software-url = $${slap-connection:software-release-url}
software-type = test
return = foo slave-instance-list
[request-slave-instance]
# Deploy a dummy instance
<= slap-connection
recipe = slapos.cookbook:request
name = Test Root Instance - Slave
software-url = $${slap-connection:software-release-url}
software-type = test
slave = true
sla-instance_guid = $${request-test-instance:instance-guid}
return = foo
[publish-connection-informations]
recipe = slapos.cookbook:publish
note = test-instance-guid should be equal to XXX, test-instance-state should be equal to started, test-instance-slave-instance-list should be NOT empty, and root-instance-slave-instance-list SHOULD be empty, slave-instance-parameter should NOT be empty.
test-instance-guid = $${request-test-instance:instance-guid}
test-instance-state = $${request-test-instance:instance-state}
test-instance-slave-instance-list = $${request-test-instance:connection-slave-instance-list}
root-instance-slave-instance-list = $${slap-configuration:slave-instance-list}
slave-instance-parameter = $${request-slave-instance:connection-foo}
# Create a file containing connection parameters
# Then create a promise that will check content of this file
[dump-connection-informations]
<= publish-connection-informations
recipe = slapos.cookbook:jsondump
json-output = $${buildout:directory}/connection-parameters.json
[check-connection-informations-promise]
recipe = collective.recipe.template
input = ${promise-template:output}
output = $${directories:promises}/checkparameters
mode = 700
[buildout]
parts =
publish-connection-informations
publish-slave-information
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
computer = $${slap-connection:computer-id}
partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
[publish-connection-informations]
recipe = slapos.cookbook:publish
foo = bar
slave-instance-list = $${slap-configuration:slave-instance-list}
[publish-slave-information]
recipe = slapos.cookbook:publish
# XXX hardcoded
-slave-reference = slappart0_Test Root Instance - Slave
foo = I am slave instance, and I am deployed!
[buildout]
parts =
switch-softwaretype
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[switch-softwaretype]
recipe = slapos.cookbook:softwaretype
default = ${instance-default-profile:output}
test = ${instance-test-profile:output}
[slap-connection]
# part to migrate to new - separated words
computer-id = $${slap_connection:computer_id}
partition-id = $${slap_connection:partition_id}
server-url = $${slap_connection:server_url}
software-release-url = $${slap_connection:software_release_url}
key-file = $${slap_connection:key_file}
cert-file = $${slap_connection:cert_file}
#!${buildout:executable}
import sys
import os
import json
json_file = '$${dump-connection-informations:json-output}'
connection_parameter_list = json.loads(open(json_file, 'r').read())
# XXX list all problems before exit
# XXX: factor in a clean dict loop
test_instance_guid = connection_parameter_list['test-instance-guid']
if not test_instance_guid == 'slappart1':
print 'Bad test-instance-guid connection parameter: %s' % test_instance_guid
sys.exit(1)
test_instance_state = connection_parameter_list['test-instance-state']
if not test_instance_state == 'started':
print 'Bad test-instance-state connection parameter: %s instead of started' % test_instance_state
sys.exit(1)
test_instance_slave_instance_list = connection_parameter_list['test-instance-slave-instance-list']
if test_instance_slave_instance_list == []:
print 'test-instance-slave-instance-list connection parameter is empty.'
sys.exit(1)
root_instance_slave_instance_list = connection_parameter_list['root-instance-slave-instance-list']
if root_instance_slave_instance_list != []:
print 'root-instance-slave-instance-list connection parameter is not empty.'
sys.exit(1)
slave_instance_parameter = connection_parameter_list['slave-instance-parameter']
if slave_instance_parameter != 'I am slave instance, and I am deployed!':
print 'parameter slave-instance-parameter is not correct.'
sys.exit(1)
# This Software Release is used to test
# the behavior of Slave Instances in slapos and in slaprunner.
[buildout]
# Local development
develop =
${:parts-directory}/slapos.cookbook-repository
extends =
../../component/lxml-python/buildout.cfg
../../component/git/buildout.cfg
parts =
slapos.cookbook-repository
check-recipe
slapos-cookbook
instance-profile
collective-egg
# Local development
[slapos.cookbook-repository]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/slapos.git
branch = master
git-executable = ${git:location}/bin/git
[check-recipe]
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
command = grep parts ${buildout:develop-eggs-directory}/slapos.cookbook.egg-link
[instance-profile]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/instance.cfg
mode = 0644
[instance-default-profile]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-default.cfg
output = ${buildout:directory}/instance-default.cfg
mode = 0644
[instance-test-profile]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-test.cfg
output = ${buildout:directory}/instance-test.cfg
mode = 0644
[promise-template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/parameter-check-promise.py.in
output = ${buildout:directory}/parameter-check-promise.py
mode = 0644
[collective-egg]
recipe = zc.recipe.egg
eggs = collective.recipe.template
[versions]
collective.recipe.template = 1.11
plone.recipe.command = 1.1
slapos.recipe.build = 0.28
# Replicate slapos stack, but without shacache to not have to compile the entire world for a simple test.
[buildout]
# Explicitly disable download-cache
download-cache =
# Separate from site eggs
allowed-eggs-from-site-packages =
include-site-packages = false
exec-sitecustomize = false
# Add location for modified non-official slapos.buildout
find-links +=
http://www.nexedi.org/static/packages/source/slapos.buildout/
http://www.nexedi.org/static/packages/source/
http://www.nexedi.org/static/packages/source/hexagonit.recipe.download/
# Use only quite well working sites.
allow-hosts +=
*.googlecode.com
*.nexedi.org
*.python.org
*.sourceforge.net
alastairs-place.net
bitbucket.org
dist.repoze.org
effbot.org
github.com
launchpad.net
peak.telecommunity.com
sourceforge.net
www.dabeaz.com
www.owlfish.com
# XXX: Workaround of SlapOS limitation
# Unzippig of eggs is required, as SlapOS do not yet provide nicely working
# development / fast switching environment for whole software
unzip = true
# Define where is defined what version of eggs we should use
versions = versions
# Define networkcache with shacache.org
networkcache-section = networkcache
# Install slapos.cookbook containing all officials recipes
[slapos-cookbook]
recipe = zc.recipe.egg
eggs =
${lxml-python:egg}
slapos.cookbook
[versions]
# Use SlapOS patched zc.buildout
zc.buildout = 1.6.0-dev-SlapOS-013
# zc.recipe.egg 2.x is for Buildout 2
zc.recipe.egg = 1.3.2
# Use own version of h.r.download to be able to open xz-like archives
hexagonit.recipe.download = 1.7nxd002
# Use pinned version of setuptools. Other versions work, but changing
# version makes buildout recompile everything. Developers' nightmare.
setuptools = 0.9.8
# Official egg of prettytable has permission problems in EGG-INFO.
prettytable = 0.7.3-nxd001
[networkcache]
download-cache-url = http://download.shacache.org
download-dir-url = http://dir.shacache.org
......@@ -621,7 +621,7 @@ depends =
Acquisition = 2.13.12+SlapOSPatched001
Products.DCWorkflow = 2.2.4+SlapOSPatched001
ocropy = 1.0+SlapOSPatched001
pysvn = 1.7.10+SlapOSPatched002
pysvn = 1.9.15+SlapOSPatched001
python-ldap = 2.4.32+SlapOSPatched001
python-magic = 0.4.12+SlapOSPatched001
PyPDF2 = 1.26.0+SlapOSPatched001
......
......@@ -190,16 +190,16 @@ setproctitle = 1.1.10
setuptools-dso = 1.7
rubygemsrecipe = 0.4.2
six = 1.12.0
slapos.cookbook = 1.0.197
slapos.cookbook = 1.0.212
slapos.core = 1.6.19
slapos.extension.strip = 0.4
slapos.extension.shared = 1.0
slapos.libnetworkcache = 0.20
slapos.rebootstrap = 4.5
slapos.recipe.build = 0.48
slapos.recipe.build = 0.49
slapos.recipe.cmmi = 0.17
slapos.recipe.template = 4.6
slapos.toolbox = 0.124
slapos.toolbox = 0.126
stevedore = 1.21.0:whl
subprocess32 = 3.5.4
unicodecsv = 0.14.1
......
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