Commit b5200bd7 authored by Justin's avatar Justin

Merge branch 'master' of https://lab.nexedi.com/nexedi/slapos into dovecot

parents 211cc3ff 66abc9c5
...@@ -65,7 +65,7 @@ egg = ZEO ...@@ -65,7 +65,7 @@ egg = ZEO
eggs = ${:egg} eggs = ${:egg}
egg-versions = egg-versions =
ZEO = 5.2.3 ZEO = 5.4.0
trollius = 2.2.1 trollius = 2.2.1
futures = 3.3.0 futures = 3.3.0
......
...@@ -58,7 +58,7 @@ egg-versions = ...@@ -58,7 +58,7 @@ egg-versions =
[ZODB5] [ZODB5]
<= _ZODB <= _ZODB
egg-versions = egg-versions =
ZODB = 5.6.0 ZODB = 5.8.0
transaction = 2.4.0 transaction = 2.4.0
......
[buildout]
extends =
../../component/golang/buildout.cfg
parts =
gowork
caddy
[caddy-get]
<= go-git-package
go.importpath = github.com/caddyserver/caddy
repository = https://lab.nexedi.com/nexedi/caddy.git
revision = nxd-v1.0.3-1-03fba31bf
[gowork]
golang = ${golang1.17:location}
install =
${caddy-get:location}:./...
[caddy]
recipe = plone.recipe.command
command = exit 0
update-command = ${:command}
output = ${gowork:bin}/caddy
location = ${:output}
...@@ -10,6 +10,8 @@ extends = ...@@ -10,6 +10,8 @@ extends =
../zstd/buildout.cfg ../zstd/buildout.cfg
../zlib/buildout.cfg ../zlib/buildout.cfg
../nghttp2/buildout.cfg ../nghttp2/buildout.cfg
../ngtcp2/buildout.cfg
../nghttp3/buildout.cfg
../ca-certificates/buildout.cfg ../ca-certificates/buildout.cfg
parts = parts =
curl curl
...@@ -17,8 +19,8 @@ parts = ...@@ -17,8 +19,8 @@ parts =
[curl] [curl]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true shared = true
url = https://curl.se/download/curl-7.86.0.tar.xz url = https://curl.se/download/curl-7.87.0.tar.xz
md5sum = 19a2165f37941a6f412afc924e750568 md5sum = 0b0f5de173afd303229e5272689578d7
configure-options = configure-options =
--disable-static --disable-static
--disable-ech --disable-ech
...@@ -36,10 +38,10 @@ configure-options = ...@@ -36,10 +38,10 @@ configure-options =
--disable-manual --disable-manual
--enable-ipv6 --enable-ipv6
--disable-sspi --disable-sspi
--disable-alt-svc ${:ALT-SVC}
--with-zlib=${zlib:location} --with-zlib=${zlib:location}
--with-ssl=${openssl:location} --with-ssl=${:OPENSSL}
--with-ca-path=${openssl:location}/etc/ssl/certs --with-ca-path=${:OPENSSL}/etc/ssl/certs
--without-gnutls --without-gnutls
--without-polarssl --without-polarssl
--without-mbedtls --without-mbedtls
...@@ -60,8 +62,34 @@ configure-options = ...@@ -60,8 +62,34 @@ configure-options =
--without-brotli --without-brotli
--with-zstd=${zstd:location} --with-zstd=${zstd:location}
--without-gssapi --without-gssapi
${:WITH}
ALT-SVC = --disable-alt-svc
LDFLAGS =
OPENSSL = ${openssl:location}
PATH =
PKG_CONFIG_PATH =
WITH =
environment = environment =
PATH=${perl:location}/bin:${pkgconfig:location}/bin:${xz-utils:location}/bin:%(PATH)s PATH=${perl:location}/bin:${pkgconfig:location}/bin:${xz-utils:location}/bin:${:PATH}:%(PATH)s
PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig:${nghttp2:location}/lib/pkgconfig PKG_CONFIG_PATH=${:OPENSSL}/lib/pkgconfig:${nghttp2:location}/lib/pkgconfig${:PKG_CONFIG_PATH}
LDFLAGS=-Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${openssl:location}/lib -Wl,-rpath=${nghttp2:location}/lib -Wl,-rpath=${zstd:location}/lib LDFLAGS=-Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${:OPENSSL}/lib -Wl,-rpath=${nghttp2:location}/lib -Wl,-rpath=${zstd:location}/lib ${:LDFLAGS}
[curl-http3]
<= curl
url = https://shacache.nxdcdn.com/73669dd9ed7aefbb30414c6ce2dd20c39bb2f106cf420dedf7d302eb2c4147876a05b0a1458661bcb66ab1d944e7254a42802caa31070a7e43e9dd24f98320b8
md5sum = d71d04dd7201480df1024d5c754a9613
pre-configure =
autoreconf -fisv -I ${libtool:location}/share/aclocal -I ${pkgconfig:location}/share/aclocal
automake
autoconf
ALT-SVC = --enable-alt-svc
LDFLAGS = -Wl,-rpath=${nghttp3:location}/lib -Wl,-rpath=${ngtcp2:location}/lib
OPENSSL = ${openssl-quictls:location}
PATH = ${autoconf:location}/bin:${automake:location}/bin:${libtool:location}/bin:${m4:location}/bin
PKG_CONFIG_PATH = :${nghttp3:location}/lib/pkgconfig:${ngtcp2:location}/lib/pkgconfig
WITH =
--with-nghttp3=${nghttp3:location}
--with-ngtcp2=${ngtcp2:location}
...@@ -14,8 +14,8 @@ extends = ...@@ -14,8 +14,8 @@ extends =
[fish-shell] [fish-shell]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true shared = true
url = https://github.com/fish-shell/fish-shell/releases/download/3.5.1/fish-3.5.1.tar.xz url = https://github.com/fish-shell/fish-shell/releases/download/3.6.0/fish-3.6.0.tar.xz
md5sum = 59950f8ec9bf9e2fa02ff205dc5a9c57 md5sum = 2a1ae1070c6486093cbea507da8b30e0
configure-command = ${cmake:location}/bin/cmake configure-command = ${cmake:location}/bin/cmake
configure-options = configure-options =
-DCMAKE_INSTALL_PREFIX=${:location} -DCMAKE_INSTALL_PREFIX=${:location}
......
...@@ -18,8 +18,8 @@ parts = ...@@ -18,8 +18,8 @@ parts =
[git] [git]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true shared = true
url = https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.38.1.tar.xz url = https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.39.1.tar.xz
md5sum = abdafbfb85d205421903a2100c734b17 md5sum = 74b450a513504fd7b3f5016f80de5e54
configure-options = configure-options =
--with-curl=${curl:location} --with-curl=${curl:location}
--with-openssl=${openssl:location} --with-openssl=${openssl:location}
......
...@@ -13,8 +13,8 @@ parts = haproxy ...@@ -13,8 +13,8 @@ parts = haproxy
[haproxy] [haproxy]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true shared = true
url = http://www.haproxy.org/download/2.6/src/haproxy-2.6.7.tar.gz url = https://www.haproxy.org/download/2.6/src/haproxy-2.6.8.tar.gz
md5sum = cfa36413f2bc5187ab34ffcdf71914d4 md5sum = 0b506378f1ade633d5b921f5806a5e82
configure-command = true configure-command = true
# for Linux kernel 2.6.28 and above, we use "linux-glibc" as the TARGET, # for Linux kernel 2.6.28 and above, we use "linux-glibc" as the TARGET,
# otherwise use "generic". # otherwise use "generic".
......
[buildout]
extends =
../automake/buildout.cfg
../libtool/buildout.cfg
../pkgconfig/buildout.cfg
[nghttp3]
recipe = slapos.recipe.cmmi
shared = true
url = https://github.com/ngtcp2/nghttp3/archive/refs/tags/v0.8.0.tar.gz
md5sum = c6068762cdf221ae1fed2351af40b4d6
pre-configure =
autoreconf -fisv -I ${libtool:location}/share/aclocal -I ${pkgconfig:location}/share/aclocal
automake
autoconf
configure-options =
--enable-lib-only
environment =
PATH=${autoconf:location}/bin:${automake:location}/bin:${libtool:location}/bin:${m4:location}/bin:%(PATH)s
[buildout]
extends =
../pkgconfig/buildout.cfg
../automake/buildout.cfg
../libtool/buildout.cfg
../pkgconfig/buildout.cfg
[ngtcp2]
recipe = slapos.recipe.cmmi
shared = true
url = https://github.com/ngtcp2/ngtcp2/archive/refs/tags/v0.12.1.tar.gz
md5sum = c826c4630689d2afb9300b97cc5e52a3
pre-configure =
autoreconf -fisv -I ${libtool:location}/share/aclocal -I ${pkgconfig:location}/share/aclocal
automake
autoconf
configure-options =
--enable-lib-only
environment =
PATH=${autoconf:location}/bin:${automake:location}/bin:${libtool:location}/bin:${m4:location}/bin:${pkgconfig:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${openssl-quictls:location}/lib/pkgconfig:${nghttp3:location}/lib/pkgconfig
LDFLAGS=-Wl,-rpath=${openssl-quictls:location}/lib -Wl,-rpath=${nghttp3:location}/lib
...@@ -48,8 +48,8 @@ environment = ...@@ -48,8 +48,8 @@ environment =
[openssl-quictls] [openssl-quictls]
<= openssl <= openssl
url = https://github.com/quictls/openssl/archive/refs/tags/OpenSSL_1_1_1s+quic1.tar.gz url = https://github.com/quictls/openssl/archive/refs/tags/openssl-3.0.7+quic1.tar.gz
md5sum = 8ee8e1828879e2b527eca5dcc7923769 md5sum = 8e27cd201b554a33ed03a59f6c679c77
[openssl-output] [openssl-output]
# Shared binary location to ease migration # Shared binary location to ease migration
......
...@@ -20,6 +20,7 @@ location = @@LOCATION@@ ...@@ -20,6 +20,7 @@ location = @@LOCATION@@
patch-options = -p1 patch-options = -p1
patches = patches =
${:_profile_base_location_}/noroot.patch#05fc6333e05576ea8e5a49f27a6ef951 ${:_profile_base_location_}/noroot.patch#05fc6333e05576ea8e5a49f27a6ef951
${:_profile_base_location_}/linux-6.patch#08967a35249243eb06e46b1868e2dae2
configure-command = make configure-command = make
configure-options = makefiles CCARGS=${:configure-options-CCARGS} AUXLIBS=${:configure-options-AUXLIBS} configure-options = makefiles CCARGS=${:configure-options-CCARGS} AUXLIBS=${:configure-options-AUXLIBS}
configure-options-CCARGS = '-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -DUSE_TLS -DHAS_PCRE -DHAS_DB -I${libdb:location}/include -I${pcre:location}/include -I${openssl:location}/include -I${cyrus-sasl:location}/include/sasl -I${libnsl:location}/include' configure-options-CCARGS = '-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -DUSE_TLS -DHAS_PCRE -DHAS_DB -I${libdb:location}/include -I${pcre:location}/include -I${openssl:location}/include -I${cyrus-sasl:location}/include/sasl -I${libnsl:location}/include'
......
--- a/makedefs 2022-01-23 21:53:41.000000000 +0100
+++ b/makedefs 2022-09-07 19:07:02.000000000 +0200
@@ -627,7 +627,8 @@
: ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"}
: ${PLUGIN_LD="${CC-gcc} -shared"}
;;
- Linux.[345].*) SYSTYPE=LINUX$RELEASE_MAJOR
+ Linux.[3456].*)
+ SYSTYPE=LINUX$RELEASE_MAJOR
case "$CCARGS" in
*-DNO_DB*) ;;
*-DHAS_DB*) ;;
--- a/src/util/sys_defs.h 2021-12-05 19:59:27.000000000 +0100
+++ b/src/util/sys_defs.h 2022-09-07 19:09:09.000000000 +0200
@@ -751,7 +751,8 @@
/*
* LINUX.
*/
-#if defined(LINUX2) || defined(LINUX3) || defined(LINUX4) || defined(LINUX5)
+#if defined(LINUX2) || defined(LINUX3) || defined(LINUX4) || defined(LINUX5) \
+ || defined(LINUX6)
#define SUPPORTED
#define UINT32_TYPE unsigned int
#define UINT16_TYPE unsigned short
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
[preloadTemplate.html] [preloadTemplate.html]
_update_hash_filename_ = preloadTemplate.html _update_hash_filename_ = preloadTemplate.html
md5sum = 8157c22134200bd862a07c6521ebf799 md5sum = 6343592161a349bb40e0de16ce67aa51
[yarn.lock] [yarn.lock]
_update_hash_filename_ = yarn.lock _update_hash_filename_ = yarn.lock
......
<script> <script>
let link = document.createElement('link'); let link = document.createElement('link');
link.rel = "stylesheet"; link.rel = "stylesheet";
link.href = "/css/slapos.css"; link.href = "/css/slapos.css";
document.head.appendChild(link); document.head.appendChild(link);
link = document.createElement('link');
link.rel = "manifest";
link.href = "/theia.webmanifest";
document.head.appendChild(link);
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/theia-serviceworker.js').then(function (reg) {
console.log('Successfully registered service worker', reg);
}).catch(function (err) {
console.warn('Error whilst registering service worker', err);
});
}
</script> </script>
\ No newline at end of file
[buildout]
extends =
../autoconf/buildout.cfg
../automake/buildout.cfg
../libtool/buildout.cfg
../git/buildout.cfg
../openssl/buildout.cfg
../util-linux/buildout.cfg
parts = accords
[accords-source]
recipe = slapos.recipe.build:gitclone
repository = http://git.gitorious.ow2.org/ow2-compatibleone/accords-platform.git
[accords]
# Part of Compatible One project
# http://gitorious.ow2.org/ow2-compatibleone/accords-platform
recipe = hexagonit.recipe.cmmi
#url = http://gitorious.ow2.org/ow2-compatibleone/accords-platform/archive-tarball/master
path = ${accords-source:location}/
#md5sum =
# Replaces autogen.sh
configure-command =
./clean
libtoolize -c -f
aclocal -I ${libtool:location}/share/aclocal
automake -c -a -f --add-missing
autoreconf --install
./configure
configure-options =
--with-ssl=${openssl:location}
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
environment =
CPPFLAGS =-I${libuuid:location}/include -I${openssl:location}/include
LDFLAGS =-Wl,-rpath=${openssl:location}/lib -L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib
LIBTOOL=libtool
PATH=${autoconf:location}/bin:${automake:location}/bin:${libtool:location}/bin:%(PATH)s
# Accords makefile does not install necessary scripts. Let's copy it
[accords-scripts]
recipe = plone.recipe.command
requires = ${accords:location}
location = ${buildout:parts-directory}/${:_buildout_section_name_}
origin = ${accords-source:location}/scripts
destination = ${:location}
command = ([ -e ${:origin}/co-broker ] && [ ! -e ${:destination}/co-broker ] && mkdir ${:destination} && cp -r ${:origin} ${:destination})
[buildout]
parts = apache-perl perl-Apache2-Request
extends =
../apache/buildout.cfg
../perl/buildout.cfg
../util-linux/buildout.cfg
[apache-perl]
# Note: Shall react on each build of apache and reinstall itself
recipe = slapos.recipe.cmmi
url = http://perl.apache.org/dist/mod_perl-2.0.5.tar.gz
md5sum = 03d01d135a122bd8cebd0cd5b185d674
configure-command =
${perl:location}/bin/perl Makefile.PL
configure-options =
MP_AP_PREFIX=${apache-2.2:location}
LIBS="-L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}"
# for mod_apreq2 and Apache2::Request
[perl-Apache2-Request]
recipe = slapos.recipe.build:cpan
modules =
I/IS/ISAAC/libapreq2-2.13.tar.gz
perl = perl
cpan-configuration =
makepl_arg = ('--with-apache2-apxs=${apache-2.2:location}/bin/apxs')
environment =
APR_LDFLAGS = -L${libuuid:location}/lib -Wl,-R${libuuid:location}/lib -L${libexpat:location}/lib -Wl,-R${libexpat:location}/lib -L${apache-2.2:location}/lib -Wl,-R${apache-2.2:location}/lib
LDFLAGS=-L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib -L${libexpat:location}/lib -Wl,-rpath=${libexpat:location}/lib -L${apache-2.2:location}/lib -Wl,-rpath=${apache-2.2:location}/lib
--- a/client/scripts/Makefile.am 2012-08-24 12:11:10.400291229 +0200
+++ b/client/scripts/Makefile.am 2012-09-10 15:21:01.973773228 +0200
@@ -2,16 +2,16 @@
install-exec-hook:
chmod +x boinc-client
- $(INSTALL) -d $(DESTDIR)/etc/init.d
- $(INSTALL) -b boinc-client $(DESTDIR)/etc/init.d/boinc-client
+ $(INSTALL) -d $(DESTDIR)$(exec_prefix)/etc/init.d
+ $(INSTALL) -b boinc-client $(DESTDIR)$(exec_prefix)/etc/init.d/boinc-client
if [ -d /etc/sysconfig ] ; then \
- $(INSTALL) -d $(DESTDIR)/etc/sysconfig ; \
- $(INSTALL) boinc-client.conf $(DESTDIR)/etc/sysconfig/boinc-client ; \
+ $(INSTALL) -d $(DESTDIR)$(exec_prefix)/etc/sysconfig ; \
+ $(INSTALL) boinc-client.conf $(DESTDIR)$(exec_prefix)/etc/sysconfig/boinc-client ; \
elif [ -d /etc/default ] ; then \
- $(INSTALL) -d $(DESTDIR)/etc/default ; \
- $(INSTALL) boinc-client.conf $(DESTDIR)/etc/default/boinc-client ; \
+ $(INSTALL) -d $(DESTDIR)$(exec_prefix)/etc/default ; \
+ $(INSTALL) boinc-client.conf $(DESTDIR)$(exec_prefix)/etc/default/boinc-client ; \
else \
- $(INSTALL) -d $(DESTDIR)/etc ; \
- $(INSTALL) boinc-client.conf $(DESTDIR)/etc/boinc-client.conf ; \
+ $(INSTALL) -d $(DESTDIR)$(exec_prefix)/etc ; \
+ $(INSTALL) boinc-client.conf $(DESTDIR)$(exec_prefix)/etc/boinc-client.conf ; \
fi
\ No newline at end of file
[buildout]
parts =
boinc
extends =
../curl/buildout.cfg
../openssl/buildout.cfg
../zlib/buildout.cfg
../subversion/buildout.cfg
../m4/buildout.cfg
../automake/buildout.cfg
../libtool/buildout.cfg
../pkgconfig/buildout.cfg
../openldap/buildout.cfg
../gnutls/buildout.cfg
[download-boinc]
recipe = slapos.recipe.build:download
url = http://boinc.berkeley.edu/dl/boinc_7.0.28_x86_64-pc-linux-gnu.sh
md5sum = efdfd115ae69227ceb6118ca09777988
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = boinc_7.0.28_x86_64-pc-linux-gnu.sh
mode = 0744
[boinc-bin]
recipe = plone.recipe.command
on_install = true
on_update = true
command = cp ${download-boinc:location}/${download-boinc:filename} ${buildout:parts-directory} && \
cd ${buildout:parts-directory} && \
./${download-boinc:filename}
#boinc client is a binary: write LD_LABRARY_PATH
ld_library = ${curl:location}/lib:${openssl:location}/lib:${zlib:location}/lib
location = ${buildout:parts-directory}/BOINC
[boinc-patch]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/boinc-abs-path.patch
md5sum = 412acedfbcdc8a9a7f196a02465da248
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = boinc-abs-path.patch
#checkout boinc package from svn repository
[boinc-package]
recipe = plone.recipe.command
location = ${buildout:parts-directory}/${:_buildout_section_name_}
tarball = ${buildout:parts-directory}/boinc.tar.gz
svnversion = ${subversion:location}/bin/svnversion
command = ${subversion:location}/bin/svn co --revision 26162 http://boinc.berkeley.edu/svn/branches/server_stable ${:location} && \
sed -i 's#/usr/bin/svnversion#${:svnversion}#' ${:location}/tools/make_project && \
cd ${:location} && rm -f ${:tarball} && tar -cvzf ${:tarball} .
update-command =
# Compile now boinc client
[boinc]
recipe = slapos.recipe.cmmi
url = ${boinc-package:tarball}
configure-command =
echo 'AC_PROG_OBJCXX' >> configure.ac
aclocal -I${pkgconfig:location}/share/aclocal -I${libtool:location}/share/aclocal
./_autosetup
./configure
configure-options =
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--disable-fcgi
--disable-shared
--enable-static
--with-pic
--disable-manager
--disable-server
--with-pkg-config
--with-ssl=${openssl:location}
--with-libldap=${openldap:location}/lib
--with-libgnutls=${gnutls:location}/lib
--with-libcurl=${curl:location}/lib
--with-x=no
patches =
${boinc-patch:location}/${boinc-patch:filename}
patch-options = -p1
environment =
PATH=${pkgconfig:location}/bin:${automake:location}/bin:${autoconf:location}/bin:${libtool:location}/bin:${subversion:location}/bin:${curl:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig
M4=${m4:location}/bin/m4
CFLAGS=-fPIC
CPPFLAGS=-I${openssl:location}/include -I${zlib:location}/include
LDFLAGS = -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
ACLOCAL_PATH=${pkgconfig:location}/share/aclocal:${libtool:location}/share/aclocal
[buildout]
parts=
mariadb
boinc
extends =
../subversion/buildout.cfg
../m4/buildout.cfg
../automake/buildout.cfg
../libtool/buildout.cfg
../pkgconfig/buildout.cfg
../openssl/buildout.cfg
../cyrus-sasl/buildout.cfg
../openldap/buildout.cfg
../gnutls/buildout.cfg
../mariadb/buildout.cfg
../curl/buildout.cfg
#checkout boinc package from svn repository
[boinc-package]
recipe = plone.recipe.command
location = ${buildout:parts-directory}/${:_buildout_section_name_}
tarball = ${buildout:parts-directory}/boinc.tar.gz
svnversion = ${subversion:location}/bin/svnversion
command = ${subversion:location}/bin/svn co --revision 26162 http://boinc.berkeley.edu/svn/branches/server_stable ${:location} && \
sed -i 's#/usr/bin/svnversion#${:svnversion}#' ${:location}/tools/make_project && \
sed -i "20i\#include <unistd.h>" ${:location}/tools/process_input_template.cpp && \
sed -i "25i\#include <unistd.h>" ${:location}/sched/single_job_assimilator.cpp && \
sed -i "27i\#include <unistd.h>" ${:location}/tools/create_work.cpp && \
sed -i 's#--prefix=$(prefix)#--prefix=/$(prefix)#' ${:location}/py/Makefile.am && \
sed -i 's#parent::base_escape_string#@parent::base_escape_string#' ${:location}/html/inc/boinc_db.inc
cd ${:location} && rm -f ${:tarball} && tar -cvzf ${:tarball} .
update-command =
# Compile now boinc
# When installing boinc python module, path /srv/slapgrid/... is strip to srv/slapgrid... It is why
# we need to set --prefix="/${buildout:parts-directory}/${:_buildout_section_name_}"
[boinc]
recipe = slapos.recipe.cmmi
url = ${boinc-package:tarball}
keep-compile-dir = true
source = ${buildout:parts-directory}/${:_buildout_section_name_}__compile__
configure-command =
echo 'AC_PROG_OBJCXX' >> configure.ac
aclocal -I${pkgconfig:location}/share/aclocal -I${libtool:location}/share/aclocal
./_autosetup
./configure
configure-options =
--prefix="${buildout:parts-directory}/${:_buildout_section_name_}"
--disable-fcgi
--disable-shared
--enable-static
--disable-manager
--disable-client
--with-pkg-config
--with-ssl=${openssl:location}
--with-libsasl2=${cyrus-sasl:location}/lib
--with-libldap=${openldap:location}/lib
--with-libgnutls=${gnutls:location}/lib
--with-libcurl=${curl:location}/lib
--with-x=no
environment =
PATH=${pkgconfig:location}/bin:${automake:location}/bin:${autoconf:location}/bin:${libtool:location}/bin:${subversion:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig
M4=${m4:location}/bin/m4
CPPFLAGS=-I${openssl:location}/include -I${mariadb:location}/include
LDFLAGS = -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${mariadb:location}/lib -Wl,-rpath=${mariadb:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
MYSQL_CONFIG=${mariadb:location}/bin/mysql_config
ACLOCAL_PATH=${pkgconfig:location}/share/aclocal:${libtool:location}/share/aclocal
\ No newline at end of file
[buildout]
extends =
../dcron/buildout.cfg
../libxml2/buildout.cfg
../logrotate/buildout.cfg
../rdiff-backup/buildout.cfg
../nodejs/buildout.cfg
parts =
nodejs
npm
cloud9
[cloud9]
<= cloud9-git
[node-sm]
recipe = slapos.recipe.build:npm
packages = sm@0.2.11
node = nodejs
environment =
PATH=${nodejs-0.6:location}/bin:%(PATH)s
[cloud9-stable]
# Online IDE written in javascript/node.js
# URL : c9.io
# You can use it using the following command :
# NODE_PATH=${:destination}/node_modules ${nodejs:node_location} ${:cloud9_js_location}
recipe = plone.recipe.command
stop-on-error = true
commit = 5d18344936baf1d86b0fa5fc2c690051b4c77cb2
repository = https://github.com/ajaxorg/cloud9.git
location = ${buildout:parts-directory}/${:_buildout_section_name_}
git-binary = ${git:location}/bin/git
npm-binary = ${nodejs-0.4:location}/bin/node ${npm:location}/bin/npm
command = export GIT_SSL_NO_VERIFY=true; export HOME=${:location}; (${:git-binary} clone --quiet ${:repository} ${:location} && cd ${:location} && ${:git-binary} reset --hard ${:commit} && ${:git-binary} submodule update --init && cd support/jsdav && PATH=${nodejs-0.4:location}/bin:$PATH LDFLAGS=-L${libxml2:location}/lib ${:npm-binary} install) || (rm -fr ${:location}; exit 1)
update-command =
executable = ${:location}/bin/cloud9.js
[cloud9-session-directory.patch]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/${:filename}
filename = cloud9-session-directory.patch
download-only = true
md5sum = 5dc8cc28447ed3747b8a53c768d872aa
[cloud9-socket.patch]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/${:filename}
filename = cloud9-socket.patch
download-only = true
md5sum = c581456cb3a76841898f79f9600e3a1e
[cloud9-file-already-exist.patch]
# This patch prevents the error "File already exists"
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/${:filename}
filename = cloud9-file_already_exist.patch
download-only = true
md5sum = 0bc104af8176388d60cbf884b72c8318
[cloud9-remove-all-listeners.patch]
# This patch prevents cloud9 to die every
# time a tab is closed
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/${:filename}
filename = cloud9-removeAllListeners.patch
download-only = true
md5sum = 357915330d677f4917140e02a55646b7
[cloud9-git-download]
recipe = slapos.recipe.build:gitclone
repository = https://github.com/ajaxorg/cloud9.git
revision = f7d102bc225c922f116d2cea52a746d64343ea59
location = ${buildout:parts-directory}/cloud9
git-executable = ${git:location}/bin/git
develop = true
use-cache = true
ignore-ssl-certificate = true
[cloud9-git]
# Online IDE written in javascript/node.js
# URL : c9.io
# You can use it using the following command :
# NODE_PATH=${:destination}/node_modules ${nodejs:node_location} ${:cloud9_js_location}
recipe = plone.recipe.command
stop-on-error = true
environment = export GIT_SSL_NO_VERIFY=true; export PATH=${git:location}/bin:${nodejs-0.6:location}/bin:${node-sm:location}/node_modules/.bin/:$PATH; export CPPFLAGS="-I${libxml2:location}/include -I${nodejs-0.6:location}/include"; export LDFLAGS="-L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib"; export HOME=${cloud9-git-download:location};
command = ${:environment} (cd ${cloud9-git-download:location} && ${node-sm:location}/node_modules/.bin/sm install && patch -p1 < ${cloud9-session-directory.patch:location}/${cloud9-session-directory.patch:filename} && patch -p1 < ${cloud9-socket.patch:location}/${cloud9-socket.patch:filename} && patch -p1 < ${cloud9-file-already-exist.patch:location}/${cloud9-file-already-exist.patch:filename} && patch -p1 < ${cloud9-remove-all-listeners.patch:location}/${cloud9-remove-all-listeners.patch:filename}) || (rm -fr ${cloud9-git-download:location}; exit 1)
update-command = true
executable = ${cloud9-git-download:location}/server.js
[cloud9-npm]
# Online IDE written in javascript/node.js
# URL : c9.io
# You can use it using the following command :
# NODE_PATH=${:destination}/node_modules ${nodejs:node_location} ${:cloud9_js_location}
recipe = slapos.recipe.npm
# Node part has to be specified, otherwise system node is used.
node = nodejs
# List of packages to install
packages =
cloud9==0.7
# Specify environment jsDAV (dependency of cloud9) needs libxml2
environment =
LDFLAGS=-L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib
diff --git a/node_modules/vfs-local/localfs.js b/node_modules/vfs-local/localfs.js
index 7ce9981..1dd07b7 100644
--- a/node_modules/vfs-local/localfs.js
+++ b/node_modules/vfs-local/localfs.js
@@ -677,7 +677,7 @@ module.exports = function setup(fsOptions) {
else {
var err = new Error("File already exists.");
err.code = "EEXIST";
- callback(err);
+ //callback(err);
}
});
});
diff --git a/plugins-server/cloud9.ide.watcher/file_watcher.js b/plugins-server/cloud9.ide.watcher/file_watcher.
index b7ed7da..36dcd05 100644
--- a/plugins-server/cloud9.ide.watcher/file_watcher.js
+++ b/plugins-server/cloud9.ide.watcher/file_watcher.js
@@ -69,11 +69,11 @@ util.inherits(FileWatcher, EventEmitter);
this.close = function() {
if (this.watcher) {
- this.watcher.removeAllListeners();
+ //this.watcher.removeAllListeners();
this.watcher.close();
this.emit("close");
}
this.watcher = null;
};
-}).call(FileWatcher.prototype);
\ No newline at end of file
+}).call(FileWatcher.prototype);
diff --git a/configs/default.js b/configs/default.js
index 6d1c85f..be35b37 100644
--- a/configs/default.js
+++ b/configs/default.js
@@ -22,6 +22,8 @@ var vfsUrl = "/vfs";
var port = argv.p || process.env.PORT || 3131;
var host = argv.l || process.env.IP || "localhost";
+var home = process.env['HOME']
+
var config = [
{
packagePath: "connect-architect/connect",
@@ -167,7 +169,7 @@ var config = [
},
{
packagePath: "connect-architect/connect.session.file",
- sessionsPath: __dirname + "/../.sessions"
+ sessionsPath: home + "/.sessions"
},
"./cloud9.permissions",
{
\ No newline at end of file
diff --git a/node_modules/smith.io/node_modules/engine.io/node_modules/engine.io-client/dist/engine.io-dev.js b/node_modules/smith.io/node_modules/engine.io/node_modules/engine.io-client/dist/engine.io-dev.js
index fa7e54a..14b8e67 100644
--- a/node_modules/smith.io/node_modules/engine.io/node_modules/engine.io-client/dist/engine.io-dev.js
+++ b/node_modules/smith.io/node_modules/engine.io/node_modules/engine.io-client/dist/engine.io-dev.js
@@ -2126,7 +2126,7 @@ Polling.prototype.uri = function () {
query = '?' + query;
}
- return schema + '://' + this.host + port + this.path + query;
+ return this.path + query;
};
});require.register("transports/websocket.js", function(module, exports, require, global){
[buildout]
parts =
condor
extends =
../libexpat/buildout.cfg
../kerberos/buildout.cfg
../perl/buildout.cfg
../java/buildout.cfg
../openldap/buildout.cfg
../dash/buildout.cfg
../zlib/buildout.cfg
[condor]
recipe = slapos.recipe.build
slapos_promise =
directory:bin
directory:etc
directory:examples
directory:include
directory:lib
directory:libexec
directory:man
directory:src
directory:sbin
depends =
${libexpat:location}
${kerberos:location}
${perl:location}
${openldap:location}
${java:location}
${dash:location}
${zlib:location}
x86 = http://parrot.cs.wisc.edu//symlink/20130530031504/7/7.9/7.9.5/28b36a94ad1a405bac689a76b6c353a7/condor-7.9.5-x86_Debian6-unstripped.tar.gz 227059bb9bebc9033665bb246d90a7bb
x86-64 = http://parrot.cs.wisc.edu//symlink/20130530031504/7/7.9/7.9.5/7000a12f9a22765b457e2958762871d5/condor-7.9.5-x86_64_Debian6-stripped.tar.gz 30fa4cebabb8ff4971c769f4ef74ba68
install =
url, md5sum = self.options[guessPlatform()].split()
extract_dir = self.extract(self.download(url, md5sum))
workdir = guessworkdir(extract_dir)
self.copyTree(workdir, location)
[buildout]
extends =
../openssl/buildout.cfg
../curl/buildout.cfg
../erlang/buildout.cfg
../icu/buildout.cfg
../spidermonkey/buildout.cfg
parts = couchdb
[couchdb]
recipe = slapos.recipe.cmmi
url = http://mir2.ovh.net/ftp.apache.org/dist//couchdb/1.1.1/apache-couchdb-1.1.1.tar.gz
md5sum = cd126219b9cb69a4c521abd6960807a6
configure-options =
--with-erlang=${erlang:location}/lib/erlang/usr/include
--with-js-include=${spidermonkey-1.7:location}/include
--with-js-lib=${erlang:location}/lib
--enable-js-trunk
environment-section = couchdb-environ
[couchdb-environ]
PATH = ${erlang:location}/bin:${icu4c:location}/bin:${curl:location}/bin:%(PATH)s
# XXX: Gotta put everything on the same line. If not, it won't compile
CFLAGS = -I${icu4c:location}/include -I${spidermonkey-1.7:location}/include -I${curl:location}/include
LDFLAGS = -L${icu4c:location}/lib -Wl,-rpath=${icu4c:location}/lib -L${spidermonkey-1.7:location}/lib -Wl,-rpath=${spidermonkey-1.7:location}/lib -L${curl:location}/lib -Wl,-rpath=${curl:location}/lib
[buildout]
extends =
../librsync/buildout.cfg
../patch/buildout.cfg
parts =
duplicity
[duplicity]
recipe = slapos.recipe.build
url = http://code.launchpad.net/duplicity/0.6-series/0.6.15/+download/duplicity-0.6.15.tar.gz
md5sum = 88f3c990f41fde86cd7d5af5a1bc7b81
patch = ${:_profile_base_location_}/duplicity-ipv6.patch 32c44816a9a59401e233ef622bf50223
script =
import os
import tempfile
import sys
workingdir = guessworkdir(self.extract(self.download(%(url)r, %(md5sum)r)))
os.chdir(workingdir)
self.applyPatchList('${:patch}', patch_binary='${patch:location}/bin/patch', patch_options='-p0', cwd=workingdir)
call([sys.executable, os.path.join(workingdir, 'setup.py'),
'build_ext',
'--include-dirs', os.path.join('${librsync:location}', 'include'),
'--library-dirs', os.path.join('${librsync:location}', 'lib'),
'--rpath', os.path.join('${librsync:location}', 'lib')])
call([sys.executable, os.path.join(workingdir, 'setup.py'),
'install',
'--prefix', %(location)r])
os.chdir(os.path.join(%(location)r, 'bin'))
paths = [os.path.join(%(location)r, 'lib', 'python%%s.%%s' %% sys.version_info[:2], 'site-packages')]
from zc.buildout.easy_install import scripts
scripts([('duplicity', '__builtin__', 'execfile')], [], sys.executable, '${buildout:bin-directory}', arguments='%%r' %% os.path.abspath('duplicity'), extra_paths=paths)
scripts([('rdiffdir', '__builtin__', 'execfile')], [], sys.executable, '${buildout:bin-directory}', arguments='%%r' %% os.path.abspath('rdiffdir'), extra_paths=paths)
=== modified file 'src/urlparse_2_5.py'
--- src/urlparse_2_5.py 2011-03-06 15:12:33 +0000
+++ src/urlparse_2_5.py 2011-08-31 14:21:06 +0000
@@ -109,18 +109,19 @@
password = property(get_password)
def get_hostname(self):
- netloc = self.netloc
- if "@" in netloc:
- netloc = _rsplit(netloc, "@", 1)[1]
- if ":" in netloc:
- netloc = netloc.split(":", 1)[0]
- return netloc.lower() or None
+ netloc = self.netloc.split('@')[-1]
+ if '[' in netloc and ']' in netloc:
+ return netloc.split(']')[0][1:].lower()
+ elif ':' in netloc:
+ return netloc.split(':')[0].lower()
+ elif netloc == '':
+ return None
+ else:
+ return netloc.lower()
hostname = property(get_hostname)
def get_port(self):
- netloc = self.netloc
- if "@" in netloc:
- netloc = _rsplit(netloc, "@", 1)[1]
+ netloc = self.netloc.split('@')[-1].split(']')[-1]
if ":" in netloc:
port = netloc.split(":", 1)[1]
return int(port, 10)
[buildout]
extends =
../openssl/buildout.cfg
../ncurses/buildout.cfg
../zlib/buildout.cfg
../java/buildout.cfg
parts = erlang
[erlang]
recipe = slapos.recipe.cmmi
url = http://www.erlang.org/download/otp_src_R14B04.tar.gz
md5sum = 4b469729f103f52702bfb1fb24529dc0
configure-options =
--with-ssl=${openssl:location}
--with-java
--enable-dynamic-ssl-lib
--enable-shared-zlib
--enable-native-libs
environment=
PATH=${java-sdk-1.6.0:location}/bin:%(PATH)s
CFLAGS=-I${ncurses:location}/include -I${zlib:location}/include/
LDFLAGS=-L${ncurses:location}/lib/ -L${zlib:location}/lib/ -Wl,-rpath=${ncurses:location}/lib/ -Wl,-rpath=${zlib:location}/lib/
make-options =
-j1
[buildout]
extends =
../lxml-python/buildout.cfg
../python-kerberos/buildout.cfg
../git/buildout.cfg
develop =
gateone-repository
parts =
gateone-develop
gateone
[gateone-repository]
recipe = slapos.recipe.build:gitclone
repository = https://github.com/liftoff/GateOne.git
branch = master
git-executable = ${git:location}/bin/git
[gateone-develop]
recipe = zc.recipe.egg:develop
setup = ${gateone-repository:location}
[gateone]
recipe = zc.recipe.egg
eggs =
${lxml-python:egg}
${python-kerberos:egg}
tornado
setuptools
pyOpenSSL
futures
PIL
gateone
[buildout]
parts =
hookbox
versions = versions
[versions]
# special version of hookbox supporting history_duration option
# https://github.com/fdiary/hookbox
hookbox = 0.3.4nxd001
[hookbox]
recipe = zc.recipe.egg
eggs =
hookbox
scripts =
hookbox
--- ATLAS/CONFIG/src/config.c.orig 2014-07-10 18:22:02.000000000 +0200
+++ ATLAS/CONFIG/src/config.c 2014-08-22 13:28:04.990976246 +0200
@@ -455,10 +455,10 @@
if (OSIsWin(OS))
OSextra = "-lgcc";
- i = strlen(path) + strlen(libnam) + strlen(OSextra) + 2 + 2 + 1 + 1 + 1;
+ i = strlen(path) * 2 + strlen(libnam) + strlen(OSextra) + 2 + 11 + 2 + 1 + 1 + 1 + 1;
sp = malloc(i*sizeof(char));
assert(sp);
- sprintf(sp, "-L%s -l%s %s", path, libnam, OSextra);
+ sprintf(sp, "-L%s -Wl,-rpath=%s -l%s %s", path, path, libnam, OSextra);
return(sp);
}
[buildout]
extends =
../patch/buildout.cfg
parts =
libatlas
[lapack-download]
recipe = hexagonit.recipe.download
ignore-existing = true
version = 3.5.0
filename = lapack-${:version}.tgz
url = http://www.netlib.org/lapack/${:filename}
md5sum = b1d3e3e425b2e44a06760ff173104bdf
download-only = true
[libatlas]
recipe = slapos.recipe.cmmi
version = 3.10.2
url = http://downloads.sourceforge.net/project/math-atlas/Stable/${:version}/atlas${:version}.tar.bz2
md5sum = a4e21f343dec8f22e7415e339f09f6da
# http://stackoverflow.com/questions/14592401/atlas-install-really-need-to-get-past-cpu-throttle-check
# http://sourceforge.net/p/math-atlas/support-requests/886/
patches =
${:_profile_base_location_}/skip-throttle-check.patch#17c8471d67c99fac80ace05273ce0817
${:_profile_base_location_}/add-rpath.patch#44672b68960a14b3fb4970cd1e76f8fe
patch-options = -p1
configure-command =
mkdir build
cd build
../configure
configure-options =
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--with-netlib-lapack-tarfile=${lapack-download:location}/${lapack-download:filename}
--shared
-b "$(uname -m | grep -q 64 && echo 64 || echo 32)"
-Fa alg '-fPIC'
make-options =
-C build
environment =
PATH=${patch:location}/bin:%(PATH)s
diff --git a/CONFIG/src/probe_arch.c b/CONFIG/src/probe_arch.c
index 75edef9..f440bf6 100644
--- a/CONFIG/src/probe_arch.c
+++ b/CONFIG/src/probe_arch.c
@@ -238,8 +238,7 @@ int main(int nargs, char **args)
printf("CPU MHZ=%d\n",
ProbeOneInt(OS, asmd, targ, "-m", "CPU MHZ=", &sure));
if (flags & Pthrottle)
- printf("CPU THROTTLE=%d\n",
- ProbeOneInt(OS, asmd, targ, "-t", "CPU THROTTLE=", &sure));
+ printf("CPU THROTTLE=0\n");
if (flags & P64)
{
if (asmd == gas_x86_64)
[buildout]
parts =
libmemcached
[libmemcached]
<= libmemcached-0.50
[libmemcached-0.50]
<= libmemcached-common
url = http://launchpad.net/libmemcached/1.0/0.50/+download/libmemcached-0.50.tar.gz
md5sum = c8627014a37cd821cf93317b8de6f9f8
[libmemcached-0.44]
<= libmemcached-common
url = http://launchpad.net/libmemcached/1.0/0.44/+download/libmemcached-0.44.tar.gz
md5sum = e6bd825c46fa080b550f90f9001cba8c
[libmemcached-common]
recipe = slapos.recipe.cmmi
configure-options =
--without-docs
--without-memcached
--without-libgtest-prefix
--without-libevent-prefix
--without-libinnodb-prefix
--without-libsasl-prefix
--without-libsasl2-prefix
[buildout]
extends =
../patch/buildout.cfg
../attr/buildout.cfg
../libcap/buildout.cfg
parts = lxc
[lxc]
<= lxc-0.8
[lxc-0.8.0-rc2-libexecdir-patch]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/${:filename}
filename = libexecdir-fix.patch
download-only = true
md5sum = d674463ccb3a7c205c2326fb4ab5436b
[lxc-0.8.0-rc2-lxc-ls-patch]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/${:filename}
filename = lxc-ls-fix.patch
download-only = true
md5sum = 28c155a554d4f4856351085494585c73
[lxc-0.8.0-rc2-cap_get_flag-patch]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/${:filename}
filename = cap_get_flag-fix.patch
download-only = true
md5sum = 8d3706a9bd60b6ebfea33998644b1a99
[lxc-0.8]
recipe = slapos.recipe.cmmi
url = http://lxc.sourceforge.net/download/lxc/lxc-0.8.0-rc2.tar.gz
md5sum = 9bd6988542fd7dd198d056ef3a2db9f6
patch-binary = ${patch:location}/bin/patch
patch-options = -p1
patches =
${lxc-0.8.0-rc2-cap_get_flag-patch:location}/${lxc-0.8.0-rc2-cap_get_flag-patch:filename}
${lxc-0.8.0-rc2-libexecdir-patch:location}/${lxc-0.8.0-rc2-libexecdir-patch:filename}
${lxc-0.8.0-rc2-lxc-ls-patch:location}/${lxc-0.8.0-rc2-lxc-ls-patch:filename}
environment =
PATH=%(PATH)s:${attr:location}/bin/:${libcap:location}/sbin/
CFLAGS=-I${libcap:location}/include
LDFLAGS=-L${libcap:location}/lib/ -Wl,-rpath=${libcap:location}/lib/
commit 94767c5249b5802a894f6d84f6245ef86f50bff3
Author: Serge Hallyn <serge.hallyn@ubuntu.com>
Date: Fri Jun 29 10:37:07 2012 -0500
Fix lxc's handling of CAP_LAST_CAP
CAP_LAST_CAP in linux/capability.h doesn't always match what the kernel
actually supports. If the kernel supports fewer capabilities, then a
cap_get_flag for an unsupported capability returns -EINVAL.
Recognize that, and don't fail when initializing capabilities when this
happens, rather accept that we've reached the last capability.
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
diff --git a/src/lxc/caps.c b/src/lxc/caps.c
index 10a0b4a..c32e7e4 100644
--- a/src/lxc/caps.c
+++ b/src/lxc/caps.c
@@ -28,6 +28,7 @@
#include <limits.h>
#include <sys/prctl.h>
#include <sys/capability.h>
+#include <errno.h>
#include "log.h"
@@ -90,6 +91,7 @@ int lxc_caps_up(void)
cap_t caps;
cap_value_t cap;
int ret;
+ int lastcap = 0;
/* when we are run as root, we don't want to play
* with the capabilities */
@@ -108,9 +110,15 @@ int lxc_caps_up(void)
ret = cap_get_flag(caps, cap, CAP_PERMITTED, &flag);
if (ret) {
- ERROR("failed to cap_get_flag: %m");
- goto out;
+ if (errno == EINVAL) {
+ INFO("Last supported cap was %d\n", cap-1);
+ break;
+ } else {
+ ERROR("failed to cap_get_flag: %m");
+ goto out;
+ }
}
+ lastcap = cap;
ret = cap_set_flag(caps, CAP_EFFECTIVE, 1, &cap, flag);
if (ret) {
commit 00ad19d4dba5c05401125d4217dc8f4e7fd9403a
Author: David Ward <david.ward@ll.mit.edu>
Date: Fri May 4 00:50:15 2012 +0200
lxc-setcap/lxc-setuid: add autoconf expansion for $libexecdir
Support new default location for LXCINITDIR.
Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
diff --git a/configure.ac b/configure.ac
index c2bf4b0..0c8aa69 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,6 +40,7 @@ AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
AS_AC_EXPAND(PREFIX, $prefix)
AS_AC_EXPAND(LIBDIR, $libdir)
AS_AC_EXPAND(BINDIR, $bindir)
+AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
AS_AC_EXPAND(INCLUDEDIR, $includedir)
AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
AS_AC_EXPAND(DATADIR, $datadir)
diff --git a/src/lxc/lxc-setcap.in b/src/lxc/lxc-setcap.in
index 52d4b48..71e3710 100644
--- a/src/lxc/lxc-setcap.in
+++ b/src/lxc/lxc-setcap.in
@@ -84,6 +84,7 @@ lxc_dropcaps()
shortoptions='hd'
longoptions='help'
libdir=@LIBDIR@
+libexecdir=@LIBEXECDIR@
localstatedir=@LOCALSTATEDIR@
getopt=$(getopt -o $shortoptions --longoptions $longoptions -- "$@")
diff --git a/src/lxc/lxc-setuid.in b/src/lxc/lxc-setuid.in
index 0919eac..020dfae 100644
--- a/src/lxc/lxc-setuid.in
+++ b/src/lxc/lxc-setuid.in
@@ -81,6 +81,7 @@ lxc_dropuid()
shortoptions='hd'
longoptions='help'
libdir=@LIBDIR@
+libexecdir=@LIBEXECDIR@
localstatedir=@LOCALSTATEDIR@
getopt=$(getopt -o $shortoptions --longoptions $longoptions -- "$@")
commit 7ef0141356454503ab81460290b5dffa32c1f441
Author: David Ward <david.ward@ll.mit.edu>
Date: Fri May 4 00:50:15 2012 +0200
refresh lxc-ls
Add an '--active' option that lists active containers by searching
cgroups. (Otherwise, the directories in /var/lib/lxc are listed.)
Modify the cgroup search to only use hierarchies that contain one
or more subsystems. When searching, if a hierarchy contains the
'ns' subsystem, do not append '/lxc' to the parent cgroup.
Add a '--help' option that prints the command syntax.
Print error messages and help information to stderr.
Update the documentation.
Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
diff --git a/doc/lxc-ls.sgml.in b/doc/lxc-ls.sgml.in
index 3ffd4f8..d33e9b3 100644
--- a/doc/lxc-ls.sgml.in
+++ b/doc/lxc-ls.sgml.in
@@ -48,7 +48,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
<refsynopsisdiv>
<cmdsynopsis>
- <command>lxc-ls <optional>ls option</optional>
+ <command>lxc-ls <optional>--active</optional> <optional>ls option</optional>
</command>
</cmdsynopsis>
</refsynopsisdiv>
@@ -67,6 +67,17 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
<varlistentry>
<term>
+ <option><optional>--active</optional></option>
+ </term>
+ <listitem>
+ <para>
+ List active containers.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>
<option><optional>ls options</optional></option>
</term>
<listitem>
@@ -94,10 +105,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
</varlistentry>
<varlistentry>
- <term>lxc-ls -1</term>
+ <term>lxc-ls --active -1</term>
<listitem>
<para>
- list all the containers and display the list in one column.
+ list active containers and display the list in one column.
</para>
</listitem>
</varlistentry>
diff --git a/src/lxc/lxc-ls.in b/src/lxc/lxc-ls.in
index a1ad642..11a3b45 100644
--- a/src/lxc/lxc-ls.in
+++ b/src/lxc/lxc-ls.in
@@ -1,43 +1,100 @@
#!/bin/bash
-localstatedir=@LOCALSTATEDIR@
-lxcpath=@LXCPATH@
+#
+# lxc: linux Container library
-if [ ! -r $lxcpath ]; then
- exit 0
-fi
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# This library 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
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+localstatedir=@LOCALSTATEDIR@
+lxc_path=@LXCPATH@
-function get_cgroup()
+usage()
{
- local mount_string
- mount_string=$(mount -t cgroup |grep -E -e '^lxc ')
- if test -n "$mount_string"; then
- mount_point=$(echo $mount_string |cut -d' ' -f3)
- return
- fi
- mount_string=`grep -m1 -E '^[^ \t]+[ \t]+[^ \t]+[ \t]+cgroup' /proc/self/mounts`;
- if test -z "$mount_string"; then
- echo "failed to find mounted cgroup"
- exit 1
- fi
- mount_point=`echo "$mount_string" |cut -d' ' -f2`;
+ echo "usage: $(basename $0) [--active] [--] [LS_OPTIONS...]" >&2
}
-ls "$@" $lxcpath
+help() {
+ usage
+ echo >&2
+ echo "List containers existing on the system." >&2
+ echo >&2
+ echo " --active list active containers" >&2
+ echo " LS_OPTIONS ls command options (see \`ls --help')" >&2
+}
+
+get_parent_cgroup()
+{
+ local hierarchies hierarchy fields subsystems init_cgroup mountpoint
+
+ parent_cgroup=""
+
+ # Obtain a list of hierarchies that contain one or more subsystems
+ hierarchies=$(tail -n +2 /proc/cgroups | cut -f 2)
-active=$(netstat -xl 2>/dev/null | grep $lxcpath | \
- sed -e 's#.*'"$lxcpath/"'\(.*\)/command#\1#');
+ # Iterate through the list until a suitable hierarchy is found
+ for hierarchy in $hierarchies; do
+ # Obtain information about the init process in the hierarchy
+ fields=$(grep -E "^$hierarchy:" /proc/1/cgroup | head -n 1)
+ if [ -z "$fields" ]; then continue; fi
+ fields=${fields#*:}
-if test -n "$active"; then
- get_cgroup
- if test -n "$mount_point"; then
- # get cgroup for init
- init_cgroup=`cat /proc/1/cgroup | awk -F: '{ print $3 }' | head -1`
- if [ ! -d $mount_point/$init_cgroup/lxc ]; then
- cd $mount_point/$init_cgroup
+ # Get a comma-separated list of the hierarchy's subsystems
+ subsystems=${fields%:*}
+
+ # Get the cgroup of the init process in the hierarchy
+ init_cgroup=${fields#*:}
+
+ # Get the filesystem mountpoint of the hierarchy
+ mountpoint=$(grep -E "^cgroup [^ ]+ [^ ]+ ([^ ]+,)?$subsystems(,[^ ]+)? " /proc/self/mounts | cut -d ' ' -f 2)
+ if [ -z "$mountpoint" ]; then continue; fi
+
+ # Return the absolute path to the containers' parent cgroup
+ # (do not append '/lxc' if the hierarchy contains the 'ns' subsystem)
+ if [[ ",$subsystems," == *,ns,* ]]; then
+ parent_cgroup="${mountpoint}${init_cgroup%/}"
else
- cd $mount_point/$init_cgroup/lxc
+ parent_cgroup="${mountpoint}${init_cgroup%/}/lxc"
fi
- ls "$@" -d $active
- fi
+ break
+ done
+}
+
+directory="$lxc_path"
+
+for i in "$@"; do
+ case $i in
+ --help)
+ help; exit 1;;
+ --active)
+ get_parent_cgroup; directory="$parent_cgroup"; shift;;
+ --)
+ shift; break;;
+ *)
+ break;;
+ esac
+done
+
+containers=""
+if [ ! -z "$directory" ]; then
+ containers=$(find $directory -mindepth 1 -maxdepth 1 -type d -printf "%f\n" 2>/dev/null)
fi
+
+if [ -z "$containers" ]; then
+ echo "$(basename $0): no containers found" >&2
+ exit 1
+fi
+
+cd "$directory"
+ls -d $@ $containers
[buildout]
extends =
../curl/buildout.cfg
../libevent/buildout.cfg
../erlang/buildout.cfg
parts =
membase-source
membase-memcached
membase-libmemcached
membase-libconflate
membase-libvbucket
membase-moxi
membase-bucket_engine
membase-ep-engine
membase-membase-cli
membase-memcachetest
membase-ns_server
membase-vbucketmigrator
[membase]
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[membase-source]
<= membase-1.7.0-source
[membase-1.7.0-source]
<= membase-source-common
url = http://files.couchbase.com/source/membase-server_src-1.7.0.tar.gz
md5sum = c933fffea299d00e43b002cb65738663
[membase-source-common]
recipe = hexagonit.recipe.download
ignore-existing = true
strip-top-level-dir = true
[membase-component-common]
recipe = slapos.recipe.cmmi
path = ${membase-source:location}/${:component}
prefix = ${membase:location}
configure-options =
--prefix=${:prefix}
${:component-configure-options}
[membase-libmemcached]
<= membase-component-common
component = libmemcached
component-configure-options =
--disable-static
--enable-shared
--disable-dtrace
--without-docs
--disable-sasl
--with-memcached=${membase:location}/bin/memcached
[membase-memcached]
<= membase-component-common
component = memcached
patches =
configure-command =
./configure
component-configure-options =
--enable-isasl
[membase-libconflate]
<= membase-component-common
component = libconflate
component-configure-options =
--disable-static
--enable-shared
--without-check
--with-libcurl-prefix=${curl:location}
[membase-libvbucket]
<= membase-component-common
component = libvbucket
component-configure-options =
--disable-static
--enable-shared
--without-docs
--with-libhashkit-prefix=${membase:location}
[membase-moxi]
<= membase-component-common
component = moxi
component-configure-options =
--enable-moxi-libvbucket
--enable-moxi-libmemcached
--without-check
--with-libevent-prefix=${libevent:location}
--with-libmemcached-prefix=${membase:location}
--with-memcached=${membase:location}/bin/memcached
--with-libhashkit-prefix=${membase:location}
--with-libconflate-prefix=${membase:location}
--with-libvbucket-prefix=${membase:location}
[membase-bucket_engine]
<= membase-component-common
component = bucket_engine
component-configure-options =
--with-memcached=${membase-source:location}/memcached
[membase-ep-engine]
<= membase-component-common
component = ep-engine
component-configure-options =
--with-memcached=${membase-source:location}/memcached
[membase-membase-cli]
<= membase-component-common
component = membase-cli
patches =
configure-command =
./configure
component-configure-options =
[membase-memcachetest]
<= membase-component-common
component = memcachetest
component-configure-options =
--with-memcached=${membase:location}/bin/memcached
[membase-ns_server]
<= membase-component-common
component = ns_server
patches =
configure-command =
./configure
component-configure-options =
environment =
PATH=${erlang:location}/bin:%(PATH)s
[membase-vbucketmigrator]
<= membase-component-common
component = vbucketmigrator
component-configure-options =
--without-sasl
--with-isasl
[buildout]
extends =
../libmemcached/buildout.cfg
../git/buildout.cfg
../autoconf/buildout.cfg
../automake/buildout.cfg
../libtool/buildout.cfg
parts =
memstrike
[memstrike]
recipe = slapos.recipe.cmmi
path = ${memstrikesource:location}
configure-command =
./bootstrap
./configure
configure-options =
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--with-libmemcached=${libmemcached:location}
environment =
PATH =${autoconf:location}/bin:${automake:location}/bin:${libtool:location}/bin:%(PATH)s
LDFLAGS =-Wl,-rpath=${libmemcached:location}/lib
[memstrikesource]
recipe=plone.recipe.command
location = ${buildout:parts-directory}/${:_buildout_section_name_}
stop-on-error = true
revision = 39d7a99e8bb7eea6df8b
command =
rm -rf ${:location} &&
${git:location}/bin/git clone --quiet git://github.com/frsyuki/memstrike.git ${:location} &&
cd ${:location} &&
${git:location}/bin/git checkout --quiet ${:revision}
[buildout]
extends =
../cmake/buildout.cfg
../glib/buildout.cfg
../pkgconfig/buildout.cfg
../openssl/buildout.cfg
../pcre/buildout.cfg
../mariadb/buildout.cfg
parts = mydumper
# XXX-Antoine:
# This is really dirty, but it's the only way to install
# mydumper that works
[mydumper]
recipe = slapos.recipe.build
url = https://launchpad.net/mydumper/0.5/0.5.1/+download/mydumper-0.5.1.tar.gz
md5sum = b4df42dfe23f308ab13eb6ecb73a0d21
buildout-bin-dir = ${buildout:bin-directory}
cmake-command = ${cmake:location}/bin/cmake
mysql-config = ${mariadb:location}/bin/mysql_config
mysqllib = ${mariadb:location}/lib
path = ${pkgconfig:location}/bin
pkg-config-path = ${glib:location}/lib/pkgconfig/:${pcre:location}/lib/pkgconfig/:${openssl:location}/lib/pkgconfig/
libraries = ${zlib:location}/lib/:${glib:location}/lib/:${pcre:location}/lib/:${mariadb:location}/lib/:${openssl:location}/lib/
includes = ${zlib:location}/include/:${glib:location}/include/:${pcre:location}/include/:${mariadb:location}/include:${openssl:location}/include/
cflags = -I${zlib:location}/include/ -I${glib:location}/include/ -I${pcre:location}/include/ -I${mariadb:location}/include -I${openssl:location}/include/
mysql-include-dir = ${mariadb:location}/include
mydumper-patches =
${:_profile_base_location_}/mydumper-remove-warnings-errors.patch 917fea16b5ddea195cfa33fbd9827f57 -p1
slapos_promise =
directory:bin
file:bin/mydumper
file:bin/myloader
script =
import os
url = self.download(self.options['url'], self.options.get('md5sum'))
extract_dir = self.extract(url)
workdir = guessworkdir(extract_dir)
self.applyPatchList(self.options['mydumper-patches'], cwd=workdir)
env['PATH'] = self.options['path'] + ':' + self.options['buildout-bin-dir'] + ':' + env.get('PATH', '')
env['PKG_CONFIG_PATH'] = self.options['pkg-config-path'] + ':' + \
env.get('PKG_CONFIG_PATH', '')
env['CMAKE_INCLUDE_PATH'] = self.options['includes']
env['CMAKE_LIBRARY_PATH'] = self.options['libraries']
env['CFLAGS'] = self.options['cflags']
command_line = [self.options['cmake-command'],
'-DCMAKE_INSTALL_PREFIX=%%s' %% self.options['location'],
'-DMYSQL_CONFIG=%%s' %% self.options['mysql-config'],
'-DCMAKE_C_FLAGS=%%s' %% self.options['cflags'],
'-DCMAKE_INSTALL_RPATH=%%s' %% self.options['libraries'],
'-DMYSQL_INCLUDE_DIR=%%s' %% self.options['mysql-include-dir'],
'-DBUILD_DOCS=OFF',
'.']
call(command_line, cwd=workdir, env=env)
call(['make'], cwd=workdir, env=env)
call(['make', 'install'], cwd=workdir, env=env)
# XXX-Antoine: here's what I did using slapos.recipe.cmmi.
# and it wasn't working !
#[mydumper]
#recipe = slapos.recipe.cmmi
#url = http://launchpad.net/mydumper/0.2/0.2.3/+download/mydumper-0.2.3.tar.gz
#md5sum = 36e6a1c97a9634a6882ddaac5e2697d5
#strip-top-level-dir = true
#location = ${buildout:parts-directory}/${:_buildout_section_name_}
#configure-command =
# ${cmake:location}/bin/cmake \
# -DCMAKE_INSTALL_PREFIX=${:location} \
# -DMYSQL_CONFIG=${mariadb:location}/bin/mysql_config \
# -DCMAKE_INCLUDE_PATH=${zlib:location}/include \
# -DCMAKE_LIBRARY_PATH=${zlib:location}/lib \
# .
#environment=
# PATH=$PATH:${buildout:bin-directory}
# PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig/:${pcre:location}/lib/pkgconfig/
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,7 @@
add_subdirectory(docs)
-set(CMAKE_C_FLAGS "-Wall -Wunused -Wwrite-strings -Wno-strict-aliasing -Wextra -Wshadow -Werror -O3 -g ${MYSQL_CFLAGS}")
+set(CMAKE_C_FLAGS "-Wall -Wunused -Wwrite-strings -Wno-strict-aliasing -Wextra -Wshadow -O3 -g ${MYSQL_CFLAGS}")
include_directories(${MYDUMPER_SOURCE_DIR} ${MYSQL_INCLUDE_DIR} ${GLIB2_INCLUDE_DIR} ${PCRE_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS})
[buildout]
extends =
../autoconf/buildout.cfg
../automake/buildout.cfg
../zlib/buildout.cfg
../bison/buildout.cfg
../flex/buildout.cfg
../groonga/buildout.cfg
../libtool/buildout.cfg
../ncurses/buildout.cfg
../pkgconfig/buildout.cfg
../readline/buildout.cfg
parts =
mysql-5.1
[mysql-5.1-sphinx-patch]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/${:filename}
md5sum = eefcd08c400c58d3e89542ab482a8429
filename = mysql-5.1-sphinx-2.0.1-beta.diff
download-only = true
[mysql-5.1-no_test-patch]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/${:filename}
md5sum = 22b0ef8baec5efc182e10d233c6f14ca
filename = mysql_create_system_tables__no_test.patch
download-only = true
[mysql-5.1]
recipe = slapos.recipe.cmmi
version = 5.1.58
url = http://mysql.he.net/Downloads/MySQL-5.1/mysql-${:version}.tar.gz
md5sum = ae5aef506088e521e4b1cc4f668e96d2
# compile directory is required to build mysql plugins.
keep-compile-dir = true
# configure: how to avoid searching for my.cnf?
# - like in mysql part in http://svn.zope.org/zodbshootout/trunk/buildout.cfg?view=markup
configure-command =
libtoolize -c -f
aclocal -I ${libtool:location}/share/aclocal -I config/ac-macros
autoheader
automake -c -a -f
autoconf
touch sql/sql_yacc.yy
./configure
# we use embeded yassl instead of openssl to avoid compilation errors on sphinx search engine.
configure-options =
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--disable-static
--enable-thread-safe-client
--enable-local-infile
--enable-assembler
--with-pic
--with-fast-mutexes
--with-charset=utf8
--with-collation=utf8_unicode_ci
--with-server-suffix=mysql-5.1
--without-readline
--with-ssl
--with-zlib-dir=${zlib:location}
make-options =
LIBTOOL=libtool
patch-options = -p0
patches =
${mysql-5.1-sphinx-patch:location}/${mysql-5.1-sphinx-patch:filename}
${mysql-5.1-no_test-patch:location}/${mysql-5.1-no_test-patch:filename}
environment =
PATH =${autoconf:location}/bin:${automake:location}/bin:${libtool:location}/bin:${bison:location}/bin:${flex:location}/bin:%(PATH)s
CPPFLAGS =-I${ncurses:location}/include -I${readline:location}/include
LDFLAGS =-L${readline:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${ncurses:location}/lib -Wl,-rpath=${readline:location}/lib
[groonga-storage-engine-mysql-5.1]
recipe = slapos.recipe.cmmi
url = http://github.com/downloads/mroonga/mroonga/groonga-storage-engine-1.0.0.tar.gz
md5sum = 289b8b7919e790599ea79b6fe9270e04
configure-options =
--with-mysql-source=${mysql-5.1:location}__compile__/mysql-${mysql-5.1:version}
--with-mysql-config=${mysql-5.1:location}/bin/mysql_config
environment =
PATH=${groonga:location}/bin:${pkgconfig:location}/bin:%(PATH)s
CPPFLAGS=-I${groonga:location}/include/groonga
LDFLAGS=-L${groonga:location}/lib
PKG_CONFIG_PATH=${groonga:location}/lib/pkgconfig
# 33_scripts__mysql_create_system_tables__no_test.dpatch by <ch@debian.org>
A user with no password prevents a normal user from login under certain
circumstances as it is checked first.
See http://bugs.debian.org/301741
and http://bugs.mysql.com/bug.php?id=6901
--- scripts/mysql_system_tables_data.sql 2008-12-04 22:59:44.000000000 +0100
+++ scripts/mysql_system_tables_data.sql 2008-12-04 23:00:07.000000000 +0100
@@ -11,8 +11,6 @@
-- Fill "db" table with default grants for anyone to
-- access database 'test' and 'test_%' if "db" table didn't exist
CREATE TEMPORARY TABLE tmp_db LIKE db;
-INSERT INTO tmp_db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');
-INSERT INTO tmp_db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');
INSERT INTO db SELECT * FROM tmp_db WHERE @had_db_table=0;
DROP TABLE tmp_db;
@@ -24,7 +22,5 @@
INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0 FROM dual WHERE LOWER( @current_hostname) != 'localhost';
REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
-INSERT INTO tmp_user (host,user) VALUES ('localhost','');
-INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE LOWER(@current_hostname ) != 'localhost';
INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0;
DROP TABLE tmp_user;
# This is software part of buildout for mysql with senna
# Originally made by Leonardo Rochael Almeida <leorochael@gmail.com> (thanks!)
# Original place: https://svn.erp5.org/repos/public/experimental/mysqlsenna.buildout/
[buildout]
extends =
../autoconf/buildout.cfg
../automake/buildout.cfg
../zlib/buildout.cfg
../bison/buildout.cfg
../flex/buildout.cfg
../libtool/buildout.cfg
../ncurses/buildout.cfg
../openssl/buildout.cfg
../readline/buildout.cfg
parts =
mysql-tritonn-5.0
[senna]
recipe = slapos.recipe.cmmi
shared = true
url = http://www.nexedi.org/static/tarballs/senna/senna-r1311.tar.gz
md5sum = 1cc51554789f81a9e5208da04a5c2f4c
configure-command =
echo 'AC_CONFIG_MACRO_DIR([m4])' >> configure.ac
echo 'ACLOCAL_AMFLAGS = -I m4' >> Makefile.am
ACLOCAL_ARGS=-I${libtool:location}/share/aclocal ./autogen.sh
./configure
configure-options =
--prefix=@@LOCATION@@
--without-mecab
--disable-glibtest
make-options =
LIBTOOL=libtool
environment =
PATH=${autoconf:location}/bin:${automake:location}/bin:${libtool:location}/bin:%(PATH)s
[mysql-5.0-tritonn-patch]
recipe = hexagonit.recipe.download
ignore-existing = true
url = http://dl.sourceforge.jp/tritonn/44472/${:filename}
md5sum = 257abe9c4afdc9b08033687fd486a595
filename = tritonn-1.0.12-mysql-5.0.87.diff
download-only = true
[mysql-5.0-sphinx-patch]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/${:filename}
md5sum = 4ca071cde319213a213ab3605e326d1c
filename = mysql-5.0.87-sphinx-1.10.diff
download-only = true
[mysql-tritonn-5.0]
recipe = slapos.recipe.cmmi
shared = true
url = http://www.nexedi.org/static/tarballs/mysql/mysql-5.0.87.tar.gz
md5sum = 65e6229cc98b6a8d4c5206d7fe16c7be
# configure: how to avoid searching for my.cnf?
# - like in mysql part in http://svn.zope.org/zodbshootout/trunk/buildout.cfg?view=markup
configure-command =
libtoolize -c -f
aclocal -I ${libtool:location}/share/aclocal -I config/ac-macros
autoheader
automake -c -a -f
autoconf
touch sql/sql_yacc.yy
./configure
configure-options =
--prefix=@@LOCATION@@
--with-senna
--with-openssl=${openssl:location}
--without-mecab
--enable-thread-safe-client
--with-charset=utf8
--with-collation=utf8_unicode_ci
--with-server-suffix=mysql-tritonn-5.0
--with-mysqlmanager
--enable-assembler
--without-readline
--with-sphinx-storage-engine
--with-zlib-dir=${zlib:location}
make-options =
LIBTOOL=libtool
LN_S='ln -s'
patch-options = -p1
patches =
${mysql-5.0-tritonn-patch:location}/${mysql-5.0-tritonn-patch:filename}
${mysql-5.0-sphinx-patch:location}/${mysql-5.0-sphinx-patch:filename}
environment =
PATH=${senna:location}/bin:${autoconf:location}/bin:${automake:location}/bin:${libtool:location}/bin:${bison:location}/bin:${flex:location}/bin:%(PATH)s
CPPFLAGS=-I${senna:location}/include/senna -I${ncurses:location}/include -I${readline5:location}/include
LDFLAGS=-L${senna:location}/lib -L${readline5:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${openssl:location}/lib -Wl,-rpath=${ncurses:location}/lib -Wl,-rpath=${readline5:location}/lib
[buildout]
# Work in progress
extends =
../xorg/buildout.cfg
../fontconfig/buildout.cfg
../dbus/buildout.cfg
../gtk-2/buildout.cfg
../libpng/buildout.cfg
parts =
opera
[opera]
recipe = slapos.recipe.build
slapos_promise =
file:opera
depends =
${liberation-fonts:location}
${ipaex-fonts:location}
x86 = http://arc.opera.com/pub/opera/linux/1151/opera-11.51-1087.i386.linux.tar.bz2 91db21fc001e736a6432627fbf93062f
x86-64 = todohttp://arc.opera.com/pub/opera/linux/1151/opera-11.51-1087.i386.linux.tar.bz2 91db21fc001e736a6432627fbf93062f
script =
if not self.options.get('url'): self.options['url'], self.options['md5sum'] = self.options[guessPlatform()].split(' ')
extract_dir = self.extract(self.download(self.options['url'], self.options.get('md5sum')))
workdir = guessworkdir(extract_dir)
self.copyTree(workdir, "%(location)s")
wrapper_location = os.path.join("%(location)s", "opera-slapos")
wrapper = open(wrapper_location, 'w')
wrapper.write("""#!/bin/sh
cd %(location)s
export LD_LIBRARY_PATH=${libXrender:location}/lib/:${fontconfig:location}/lib/:${dbus:location}/lib/:${dbus-glib:location}/lib/:${pango:location}/lib:${cairo:location}/lib:${glib:location}/lib:${gtk-2:location}/lib:${atk:location}/lib:${gdk-pixbuf:location}/lib:${libXt:location}/lib:${libpng15:location}/lib:${libSM:location}/lib:${libICE:location}/lib:%(location)s
export PATH=${fontconfig:location}/bin:$PATH
%(location)s/opera $*""")
wrapper.close()
profile_directory = os.path.join("%(location)s", "profile")
os.mkdir(profile_directory)
opera_config = open(os.path.join(profile_directory, "opera6.ini"), "w")
opera_config.write("""[State]
Reading Plugins=0
Accept License=1
Run=0""")
opera_config.close()
os.chmod(wrapper_location, 0766)
This diff is collapsed.
[buildout]
extends =
# ../openssl/buildout.cfg
../kerberos/buildout.cfg
# ../pkgconfig/buildout.cfg
parts =
python-kerberos
[python-kerberos]
recipe = zc.recipe.egg:custom
egg = kerberos
environment = python-kerberos-env
#setup-eggs = ${python-cryptography-prep:eggs}
[python-kerberos-env]
PATH = ${kerberos:location}/bin:%(PATH)s
#PKG_CONFIG_PATH = ${openssl:location}/lib/pkgconfig
LD_LIBRARY_PATH = ${kerberos:location}/lib
CPATH = ${kerberos:location}/include
[python-cryptography-prep]
recipe = zc.recipe.egg
eggs =
${python-cffi:egg}
enum34
pycparser
six
This component is not used anymore - but might be revived within 4 months.
If not used within 6 months, feel free to delete this.
# Sphinx - Open Source Search Server
# http://sphinxsearch.com/
[buildout]
parts = sphinx
extends =
../libexpat/buildout.cfg
../mariadb/buildout.cfg
../zlib/buildout.cfg
[sphinx-1.10-beta-snowball.patch]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/${:filename}
path = ${:filename}
md5sum = 65a5ee78bf27c030734674c018006287
download-only = true
filename = sphinx-1.10-beta-snowball.patch
[sphinx]
recipe = slapos.recipe.cmmi
url = http://sphinxsearch.com/files/sphinx-2.0.5-release.tar.gz
md5sum = e71fdb5b0c2911247d48fb30550b9584
configure-options =
--with-mysql
--with-mysql-includes=${mariadb:location}/include/mysql
--with-mysql-libs=${mariadb:location}/lib
--with-libstemmer
--with-iconv
--without-pgsql
--without-unixodbc
patch-options = -p1
patches =
${sphinx-1.10-beta-snowball.patch:location}/${sphinx-1.10-beta-snowball.patch:filename}
environment =
CPPFLAGS=-I${zlib:location}/include -I${libexpat:location}/include -fpermissive
LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${mariadb:location}/lib -L${libexpat:location}/lib -Wl,-rpath=${libexpat:location}/lib
# Note: -fpermissive added to allow compilation on recent gcc 4.7+
[buildout]
parts = spidermonkey
[spidermonkey-1.7]
recipe = slapos.recipe.build
url = http://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz
md5sum = 5571134c3863686b623ebe4e6b1f6fe6
install =
import os
url = self.download(options['url'], options['md5sum'])
extract_dir = self.extract(url)
workdir = os.path.join(guessworkdir(extract_dir), 'src')
env = self.environ
env['JS_DIST'] = location
call(['make', '-f', 'Makefile.ref', '-j1'], cwd=workdir, env=env)
call(['make', '-f', 'Makefile.ref', 'export'], cwd=workdir, env=env)
[spidermonkey]
<= spidermonkey-1.7
[buildout]
extends = ../openssl/buildout.cfg
parts =
stunnel
[stunnel]
recipe = slapos.recipe.cmmi
shared = true
url = https://www.stunnel.org/downloads/archive/5.x/stunnel-5.14.tar.gz
md5sum = e716501960dc6856d80f92547298f724
configure-options =
--enable-ipv6
--disable-libwrap
--disable-fips
--with-ssl=${openssl-1.0:location}
environment =
CPPFLAGS=-I${zlib:location}/include
LDFLAGS=-Wl,-rpath=${openssl-1.0:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
# xtrabackup: hot backup utility for MySQL
# http://www.percona.com/
# Depends on SlapOS patched buildout for _profile_base_location_ functionality
[buildout]
extends =
../autoconf/buildout.cfg
../automake/buildout.cfg
../bison/buildout.cfg
../flex/buildout.cfg
../libtool/buildout.cfg
../ncurses/buildout.cfg
../patch/buildout.cfg
../readline/buildout.cfg
../zlib/buildout.cfg
parts =
xtrabackup
[mysql-5.1-download]
recipe = hexagonit.recipe.download
ignore-existing = true
version = 5.1.56
url = http://s3.amazonaws.com/percona.com/downloads/community/mysql-${:version}.tar.gz
md5sum = 15161d67f4830aad3a8a89e083749d49
download-only = true
filename = mysql-${:version}.tar.gz
[libtar-download]
recipe = hexagonit.recipe.download
ignore-existing = true
version = 1.2.11
url = http://s3.amazonaws.com/percona.com/downloads/community/libtar-${:version}.tar.gz
md5sum = 604238e8734ce6e25347a58c4f1a1d7e
download-only = true
filename = libtar-${:version}.tar.gz
[xtrabackup]
recipe = slapos.recipe.cmmi
url = http://www.percona.com/downloads/XtraBackup/XtraBackup-1.6.3/source/xtrabackup-1.6.3.tar.gz
md5sum = d0b827fd18cd76416101eb7b7c56a311
make-binary = true
patches =
${:_profile_base_location_}/xtrabackup-1.6.2_build.patch#b1536fe65e32592e4a0a14bf3b159885
${:_profile_base_location_}/xtrabackup-allow_force_ibbackup.patch#d642ea7b30d1322a516fbece4ee100e0
patch-options = -p1
location = ${buildout:parts-directory}/${:_buildout_section_name_}
configure-command = ln -sf ${mysql-5.1-download:location}/${mysql-5.1-download:filename} ${libtar-download:location}/${libtar-download:filename} . && utils/build.sh innodb51_builtin ${:location} ${libtool:location}
environment =
CPPFLAGS =-I${zlib:location}/include -I${ncurses:location}/include -I${readline:location}/include
LDFLAGS =-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${readline:location}/lib -Wl,-rpath=${readline:location}/lib
PATH=${autoconf:location}/bin:${automake:location}/bin:${bison:location}/bin:${libtool:location}/bin:${flex:location}/bin:${patch:location}/bin:%(PATH)s
make-options =
-j1
diff -ur xtrabackup-1.6.2.orig/Makefile xtrabackup-1.6.2/Makefile
--- xtrabackup-1.6.2.orig/Makefile 2011-07-19 05:16:22.000000000 +0900
+++ xtrabackup-1.6.2/Makefile 2011-07-27 17:58:38.108925111 +0900
@@ -137,5 +137,5 @@
clean:
rm -f *.o xtrabackup_*
install:
- install -m 755 innobackupex-1.5.1 $(BIN_DIR)
+ install -m 755 innobackupex-1.5.1 $(BIN_DIR)/innobackupex
install -m 755 xtrabackup_* $(BIN_DIR)
diff -ur xtrabackup-1.6.2.orig/utils/build.sh xtrabackup-1.6.2/utils/build.sh
--- xtrabackup-1.6.2.orig/utils/build.sh 2011-07-19 05:16:22.000000000 +0900
+++ xtrabackup-1.6.2/utils/build.sh 2011-07-27 18:01:53.809212142 +0900
@@ -21,12 +21,14 @@
{
echo "Build an xtrabackup binary against the specified InnoDB flavor."
echo
- echo "Usage: `basename $0` CODEBASE"
+ echo "Usage: `basename $0` CODEBASE PREFIX LIBTOOL_LOCATION"
echo "where CODEBASE can be one of the following values or aliases:"
echo " innodb51_builtin | 5.1 build against built-in InnoDB in MySQL 5.1"
echo " innodb55 | 5.5 build against InnoDB in MySQL 5.5"
echo " xtradb51 | xtradb build against Percona Server with XtraDB 5.1"
echo " xtradb55 | xtradb55 build against Percona Server with XtraDB 5.5"
+ echo "where PREFIX is abolute path for install location"
+ echo "where LIBTOOL_LOCATION is abolute path of libtool"
exit -1
}
@@ -79,7 +81,11 @@
{
echo "Configuring the server"
cd $server_dir
- BUILD/autorun.sh
+ aclocal -I $libtool_location/share/aclocal -I config/ac-macros || die "Can't execute aclocal"
+ autoheader || die "Can't execute autoheader"
+ libtoolize --automake --force --copy || die "Can't execute libtoolize"
+ automake --add-missing --force --copy || die "Can't execute automake"
+ autoconf || die "Can't execute autoconf"
eval $configure_cmd
echo "Building the server"
@@ -92,12 +99,13 @@
echo "Building XtraBackup"
mkdir $build_dir
cp $top_dir/Makefile $top_dir/xtrabackup.c $build_dir
+ cp $top_dir/innobackupex $build_dir/innobackupex-1.5.1
# Read XTRABACKUP_VERSION from the VERSION file
. $top_dir/VERSION
cd $build_dir
- $MAKE_CMD $xtrabackup_target XTRABACKUP_VERSION=$XTRABACKUP_VERSION
+ $MAKE_CMD $xtrabackup_target XTRABACKUP_VERSION=$XTRABACKUP_VERSION PREFIX=$1
cd $top_dir
}
@@ -106,11 +114,36 @@
echo "Building tar4ibd"
unpack_and_patch libtar-1.2.11.tar.gz tar4ibd_libtar-1.2.11.patch
cd libtar-1.2.11
- ./configure
+ ./configure --prefix=$1
$MAKE_CMD
cd $topdir
}
+function install_server()
+{
+ echo "Installing the server"
+ cd $server_dir
+ $MAKE_CMD install
+ cd $top_dir
+}
+
+function install_xtrabackup()
+{
+ echo "Installing XtraBackup"
+ echo $build_dir
+ cd $build_dir
+ $MAKE_CMD PREFIX=$1 install
+ cd $top_dir
+}
+
+function install_tar4ibd()
+{
+ echo "Installing tar4ibd"
+ cd libtar-1.2.11
+ $MAKE_CMD install
+ cd $topdir
+}
+
################################################################################
# Do all steps to build the server, xtrabackup and tar4ibd
# Expects the following variables to be set before calling:
@@ -141,9 +174,15 @@
build_server
- build_xtrabackup
+ build_xtrabackup $1
+
+ build_tar4ibd $1
+
+ install_server
+
+ install_xtrabackup $1
- build_tar4ibd
+ install_tar4ibd
}
if ! test -f xtrabackup.c
@@ -153,6 +192,15 @@
fi
type=$1
+prefix=$2
+if [ "x$prefix" == "x" ] ; then
+ usage
+fi
+libtool_location=$3
+if [ "x$libtool_location" == "x" ] ; then
+ usage
+fi
+
top_dir=`pwd`
case "$type" in
@@ -166,9 +214,10 @@
--with-plugins=innobase \
--with-zlib-dir=bundled \
--enable-shared \
- --with-extra-charsets=all"
+ --with-extra-charsets=all \
+ --prefix=$2"
- build_all
+ build_all $2
;;
"innodb55" | "5.5")
commit c052380cf84e33b32268af97a7c1539c8a6771e5
Author: Łukasz Nowak <luke@nexedi.com>
Date: Mon Jun 6 13:29:32 2011 +0200
Really use option_ibbackup_binary.
diff --git a/innobackupex b/innobackupex
index 67d0d44..ed06294 100755
--- a/innobackupex
+++ b/innobackupex
@@ -214,6 +214,7 @@ check_args();
print_version();
# initialize global variables and perform some checks
+if ( $option_ibbackup_binary eq "autodetect" ){
if ($option_copy_back) {
$option_ibbackup_binary = 'xtrabackup_51';
} elsif ($option_apply_log) {
@@ -250,6 +251,7 @@ if ($option_copy_back) {
} else {
$option_ibbackup_binary = set_xtrabackup_version();
}
+}
init();
my $ibbackup_exit_code = 0;
...@@ -4,6 +4,8 @@ extends = ...@@ -4,6 +4,8 @@ extends =
../../component/git/buildout.cfg ../../component/git/buildout.cfg
../../component/matiec/buildout.cfg ../../component/matiec/buildout.cfg
../../component/open62541/buildout.cfg ../../component/open62541/buildout.cfg
../../component/numpy/buildout.cfg
../../component/lxml-python/buildout.cfg
../../stack/monitor/buildout.cfg ../../stack/monitor/buildout.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
...@@ -70,8 +72,8 @@ eggs = click ...@@ -70,8 +72,8 @@ eggs = click
Nevow Nevow
msgpack msgpack
autobahn autobahn
numpy ${numpy:egg}
lxml ${lxml-python:egg}
cycler cycler
opcua opcua
${beremiz:egg} ${beremiz:egg}
...@@ -121,9 +123,7 @@ txaio = 18.8.1 ...@@ -121,9 +123,7 @@ txaio = 18.8.1
idna = 2.10 idna = 2.10
click = 7.1.2 click = 7.1.2
lxml = 4.5.0
opcua = 0.98.13 opcua = 0.98.13
trollius = 2.2.1 trollius = 2.2.1
futures = 3.3.0 futures = 3.3.0
numpy = 1.16.6
cycler = 0.10.0 cycler = 0.10.0
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
# not need these here). # not need these here).
[template] [template]
filename = instance.cfg filename = instance.cfg
md5sum = 5bd72da73a8b84f70f568686924d7d6c md5sum = a0e249bc3e0af5c23c85c3b31314be5f
[template-default] [template-default]
filename = instance-default.cfg.jinja.in filename = instance-default.cfg.jinja.in
md5sum = 2aafd7708aac85847da3a8679b84fe34 md5sum = 96fb2221c8a91fb44dc5b931c29e0af9
...@@ -107,23 +107,43 @@ inline = ...@@ -107,23 +107,43 @@ inline =
--unixdomain-only=$${:socket}:$(id -u):$(id -g):0600 \ --unixdomain-only=$${:socket}:$(id -u):$(id -g):0600 \
--service "/:$(id -u):$(id -g):HOME:$${shell-environment:shell} -l" --service "/:$(id -u):$(id -g):HOME:$${shell-environment:shell} -l"
[shellinabox-frontend-certificate]
recipe = plone.recipe.command
command =
if [ ! -e $${:cert-file} ]
then
${openssl-output:openssl} req -x509 -nodes -days 3650 \
-subj "/C=AA/ST=X/L=X/O=Dis/CN=$${:common-name}" \
-newkey rsa:2048 -keyout $${:cert-file} \
-out $${:cert-file}
fi
update-command = $${:command}
cert-file = $${directory:var}/$${:_buildout_section_name_}.pem
common-name = $${:ipv6}
location =
$${:cert-file}
ipv6 = {{ partition_ipv6 }}
[shellinabox-frontend-config] [shellinabox-frontend-config]
recipe = slapos.recipe.template recipe = slapos.recipe.template:jinja2
url = ${stack-haproxy-default-backend-config:target}
output = $${directory:etc}/$${:_buildout_section_name_} output = $${directory:etc}/$${:_buildout_section_name_}
inline = context =
https://$${:hostname}:$${:port} { key pidfile :pidfile
bind $${:ipv6} key content :content
tls self_signed pidfile = $${:pidfile}
gzip content =
log stdout userlist auth
errors stderr user $${:username} insecure-password $${:passwd}
proxy / unix:$${shellinabox:socket}
basicauth $${:username} $${:passwd} { listen app
realm "Test Node $${testnode:test-node-title}" log global
/ acl auth_ok http_auth(auth)
} http-request auth realm "Test Node $${testnode:test-node-title}" unless auth_ok
} bind $${:ipv6}:$${:port} ssl crt $${shellinabox-frontend-certificate:cert-file} alpn h2,http/1.1
ipv6 = {{ partition_ipv6 }} server app unix@$${shellinabox:socket}
ipv6 = $${shellinabox-frontend-certificate:ipv6}
hostname = [$${:ipv6}] hostname = [$${:ipv6}]
port = 8080 port = 8080
username = testnode username = testnode
...@@ -131,24 +151,24 @@ passwd = $${pwgen:passwd} ...@@ -131,24 +151,24 @@ passwd = $${pwgen:passwd}
cert-file = $${directory:shellinabox}/public.crt cert-file = $${directory:shellinabox}/public.crt
key-file = $${directory:shellinabox}/private.key key-file = $${directory:shellinabox}/private.key
backend-url = https://$${:username}:$${:passwd}@$${:hostname}:$${:port} backend-url = https://$${:username}:$${:passwd}@$${:hostname}:$${:port}
pidfile = $${basedirectory:run}/shellinabox-haproxy.pid
[shellinabox-frontend] [shellinabox-frontend]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
wrapper-path = $${rootdirectory:bin}/$${:_buildout_section_name_} wrapper-path = $${rootdirectory:bin}/$${:_buildout_section_name_}
command-line = command-line =
${caddy:output} -conf $${shellinabox-frontend-config:output} -pidfile $${:pidfile} ${haproxy:location}/sbin/haproxy -f $${shellinabox-frontend-config:output}
url = $${shellinabox-frontend-config:backend-url} url = $${shellinabox-frontend-config:backend-url}
hostname = $${shellinabox-frontend-config:ipv6} hostname = $${shellinabox-frontend-config:ipv6}
port = $${shellinabox-frontend-config:port} port = $${shellinabox-frontend-config:port}
pidfile = $${basedirectory:run}/$${:_buildout_section_name_}.pid pidfile = $${shellinabox-frontend-config:pidfile}
[shellinabox-frontend-reload] [shellinabox-frontend-reload]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
wrapper-path = $${basedirectory:services}/$${:_buildout_section_name_} wrapper-path = $${basedirectory:services}/$${:_buildout_section_name_}
command-line = command-line =
${bash:location}/bin/bash -c ${bash:location}/bin/bash -c
"kill -s USR1 $$(${coreutils:location}/bin/cat $${shellinabox-frontend:pidfile}) \ "kill -s USR2 $$(${coreutils:location}/bin/cat $${shellinabox-frontend:pidfile}) \
&& ${coreutils:location}/bin/sleep infinity" && ${coreutils:location}/bin/sleep infinity"
hash-files = hash-files =
$${shellinabox-frontend-config:output} $${shellinabox-frontend-config:output}
......
...@@ -34,6 +34,6 @@ default-parameters = ...@@ -34,6 +34,6 @@ default-parameters =
"node-quantity": 1, "node-quantity": 1,
"test-suite-master-url": "", "test-suite-master-url": "",
"instance-dict": "", "instance-dict": "",
"software-path-list": ["https://lab.nexedi.com/nexedi/slapos/raw/1.0.210/software/seleniumrunner/software.cfg"], "software-path-list": ["https://lab.nexedi.com/nexedi/slapos/raw/1.0.300/software/seleniumrunner/software.cfg"],
"keep-log-days": 15 "keep-log-days": 15
} }
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
extends = extends =
buildout.hash.cfg buildout.hash.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
../../stack/haproxy/default-backend.cfg
../../component/git/buildout.cfg ../../component/git/buildout.cfg
../../component/lxml-python/buildout.cfg ../../component/lxml-python/buildout.cfg
../../component/zip/buildout.cfg ../../component/zip/buildout.cfg
../../component/bash/buildout.cfg ../../component/bash/buildout.cfg
../../component/caddy/buildout.cfg
../../component/coreutils/buildout.cfg ../../component/coreutils/buildout.cfg
../../component/shellinabox/buildout.cfg ../../component/shellinabox/buildout.cfg
../../component/pwgen/buildout.cfg ../../component/pwgen/buildout.cfg
......
[buildout]
extends =
../../slaprunner/development.cfg
testsuite.cfg
parts += template-erp5testnode
[template-resilient-test]
filename = instance-resilient-test.cfg.jinja2
md5sum = e4b04aa6fd3413bc6ae38823abdcc8fa
# We have to use an extra level of indentation here because this is substituted
# during software buildout to generate instance buildout, but the
# slapos.recipe.template recipe doing the substitution does string replacements
# without knowledge of the buildout syntax, so we want the second line to be
# indented in the final generated instance buildout.
extra-context =
raw slapos_repository_url ${slapos.cookbook-repository:repository}
raw slapos_repository_branch ${slapos.cookbook-repository:branch}
[exporter-default-configuration]
# Define shorter interaction to speed up tests
backup_wait_time = 1
...@@ -29,9 +29,6 @@ parts = ...@@ -29,9 +29,6 @@ parts =
helloweb-go helloweb-go
[gowork]
golang = ${golang1.17:location}
# Macro for jinja templates. The filename is set in buildout.hash.cfg # Macro for jinja templates. The filename is set in buildout.hash.cfg
# in the section using this template # in the section using this template
[jinja-template] [jinja-template]
......
...@@ -194,8 +194,12 @@ removing files: ...@@ -194,8 +194,12 @@ removing files:
from the partition (typically ``/srv/slapgrid/slappartNN/`` directory). from the partition (typically ``/srv/slapgrid/slappartNN/`` directory).
They will reappear automatically after some time, but as the old
``external-disk-amount`` approach is now disabled, they won't be updated.
The failure observed to confirm the situation can be found in The failure observed to confirm the situation can be found in
``.slappartNN_kvm-HASH.log`` with presence of message like:: ``.slappartNN_kvm-HASH.log`` with presence of message like::
qemu-system-x86_64: -drive file=/<instance_storage_home>/dataX/slappartNN/kvm_virtual_disk.qcow2,if=virtio,cache=writeback: Failed to get "write" lock ValueError: external-disk problems: conflicts with external-disk-number = XX, conflicts with already configured disks amount XX in /srv/slapgrid/slappartNN/etc/.data-disk-amount
Is another process using the image [/<instance_storage_home>/dataX/slappartNN/kvm_virtual_disk.qcow2]?
Where ``XX`` is the previously used ``external-disk-number`` and ``NN`` is the partition.
...@@ -59,7 +59,7 @@ md5sum = 6328f99728284847b8dd1146aadeae1b ...@@ -59,7 +59,7 @@ md5sum = 6328f99728284847b8dd1146aadeae1b
[template-kvm-run] [template-kvm-run]
filename = template/template-kvm-run.in filename = template/template-kvm-run.in
md5sum = 4ce3fc8072e1e010ee99651cb01d3b3d md5sum = 1663af08ea7afa8d3fa091bf0c2ea1ca
[template-kvm-controller] [template-kvm-controller]
filename = template/kvm-controller-run.in filename = template/kvm-controller-run.in
......
# Development profile of slaprunner. # Development profile of kvm.
# Exactly the same as software.cfg, but fetch the slapos.cookbook and # Exactly the same as software.cfg, but fetch the slapos.cookbook and
# slapos.toolbox from git repository instead of fetching stable version, # slapos.toolbox from git repository instead of fetching stable version,
# allowing to play with bleeding edge environment. # allowing to play with bleeding edge environment.
......
...@@ -48,13 +48,25 @@ external_disk_number = {{ parameter_dict.get("external-disk-number") }} ...@@ -48,13 +48,25 @@ external_disk_number = {{ parameter_dict.get("external-disk-number") }}
external_disk_size = {{ parameter_dict.get("external-disk-size") }} external_disk_size = {{ parameter_dict.get("external-disk-size") }}
external_disk_format = {{ repr(parameter_dict["external-disk-format"]) }} external_disk_format = {{ repr(parameter_dict["external-disk-format"]) }}
external_disk = {{ parameter_dict['external-disk'] }} external_disk = {{ parameter_dict['external-disk'] }}
if int(external_disk_number) > 0 and len(external_disk) > 0: etc_directory = '{{ parameter_dict.get("etc-directory") }}'.strip()
raise ValueError("external-disk-number and external-disk are mutually exclusive.") last_disk_num_f = os.path.join(etc_directory, '.data-disk-amount')
if os.path.exists(last_disk_num_f):
with open(last_disk_num_f, 'r') as lf:
last_amount = int(lf.readline())
else:
last_amount = 0
if len(external_disk) > 0:
conflict_list = []
if int(external_disk_number) > 0:
conflict_list.append('conflicts with external-disk-number = %s' % (external_disk_number,))
if last_amount > 0:
conflict_list.append('conflicts with already configured disks amount %s in %s' % (last_amount, last_disk_num_f))
if len(conflict_list) > 0:
raise ValueError('external-disk problems: ' + ', '.join(conflict_list))
instance_root = '{{ parameter_dict['instance-root'] }}' instance_root = '{{ parameter_dict['instance-root'] }}'
disk_storage_dict = {} disk_storage_dict = {}
disk_storage_list = """{{ parameter_dict.get("disk-storage-list") }}""".split('\n') disk_storage_list = """{{ parameter_dict.get("disk-storage-list") }}""".split('\n')
map_storage_list = [] map_storage_list = []
etc_directory = '{{ parameter_dict.get("etc-directory") }}'.strip()
httpd_port = {{ parameter_dict.get("httpd-port") }} httpd_port = {{ parameter_dict.get("httpd-port") }}
netcat_bin = '{{ parameter_dict.get("netcat-binary") }}'.strip() netcat_bin = '{{ parameter_dict.get("netcat-binary") }}'.strip()
cluster_doc_host = '{{ parameter_dict.get("cluster-doc-host") }}' cluster_doc_host = '{{ parameter_dict.get("cluster-doc-host") }}'
......
...@@ -1875,38 +1875,6 @@ class TestParameterCluster(TestParameterDefault): ...@@ -1875,38 +1875,6 @@ class TestParameterCluster(TestParameterDefault):
class ExternalDiskMixin(KvmMixin): class ExternalDiskMixin(KvmMixin):
def getRunningDriveList(self, kvm_instance_partition):
_match_drive = re.compile('file.*if=virtio.*').match
with self.slap.instance_supervisor_rpc as instance_supervisor:
kvm_pid = next(q for q in instance_supervisor.getAllProcessInfo()
if 'kvm-' in q['name'])['pid']
drive_list = []
for entry in psutil.Process(kvm_pid).cmdline():
m = _match_drive(entry)
if m:
path = m.group(0)
drive_list.append(
path.replace(kvm_instance_partition, '${partition}')
)
return drive_list
@skipUnlessKvm
class TestExternalDisk(InstanceTestCase, ExternalDiskMixin):
__partition_reference__ = 'ed'
kvm_instance_partition_reference = 'ed0'
@classmethod
def getInstanceSoftwareType(cls):
return 'default'
@classmethod
def getInstanceParameterDict(cls):
return {
'external-disk-number': 2,
'external-disk-size': 1
}
@classmethod @classmethod
def _prepareExternalStorageList(cls): def _prepareExternalStorageList(cls):
external_storage_path = os.path.join(cls.working_directory, 'STORAGE') external_storage_path = os.path.join(cls.working_directory, 'STORAGE')
...@@ -1966,6 +1934,38 @@ class TestExternalDisk(InstanceTestCase, ExternalDiskMixin): ...@@ -1966,6 +1934,38 @@ class TestExternalDisk(InstanceTestCase, ExternalDiskMixin):
with open(cls.slap._slapos_config, 'w') as fh: with open(cls.slap._slapos_config, 'w') as fh:
fh.write(''.join(slapos_config)) fh.write(''.join(slapos_config))
def getRunningDriveList(self, kvm_instance_partition):
_match_drive = re.compile('file.*if=virtio.*').match
with self.slap.instance_supervisor_rpc as instance_supervisor:
kvm_pid = next(q for q in instance_supervisor.getAllProcessInfo()
if 'kvm-' in q['name'])['pid']
drive_list = []
for entry in psutil.Process(kvm_pid).cmdline():
m = _match_drive(entry)
if m:
path = m.group(0)
drive_list.append(
path.replace(kvm_instance_partition, '${partition}')
)
return drive_list
@skipUnlessKvm
class TestExternalDisk(InstanceTestCase, ExternalDiskMixin):
__partition_reference__ = 'ed'
kvm_instance_partition_reference = 'ed0'
@classmethod
def getInstanceSoftwareType(cls):
return 'default'
@classmethod
def getInstanceParameterDict(cls):
return {
'external-disk-number': 2,
'external-disk-size': 1
}
@classmethod @classmethod
def _setUpClass(cls): def _setUpClass(cls):
super()._setUpClass() super()._setUpClass()
...@@ -2015,19 +2015,29 @@ class TestExternalDiskJson( ...@@ -2015,19 +2015,29 @@ class TestExternalDiskJson(
pass pass
@skipUnlessKvm class ExternalDiskModernMixin(object):
class TestExternalDiskModern(InstanceTestCase, ExternalDiskMixin):
__partition_reference__ = 'edm' __partition_reference__ = 'edm'
kvm_instance_partition_reference = 'edm0' kvm_instance_partition_reference = 'edm0'
@classmethod
def getInstanceSoftwareType(cls):
return 'default'
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
super().setUpClass() super().setUpClass()
@classmethod
def _setUpClass(cls):
super()._setUpClass()
cls.working_directory = tempfile.mkdtemp()
# setup the external_storage_list, to mimic part of slapformat
cls._prepareExternalStorageList()
# re-run the instance, as information has been updated
cls.waitForInstance()
@classmethod
def tearDownClass(cls):
cls._dropExternalStorageList()
super().tearDownClass()
shutil.rmtree(cls.working_directory)
def getExternalDiskInstanceParameterDict( def getExternalDiskInstanceParameterDict(
self, first, second, third, update_dict=None): self, first, second, third, update_dict=None):
parameter_dict = { parameter_dict = {
...@@ -2052,39 +2062,50 @@ class TestExternalDiskModern(InstanceTestCase, ExternalDiskMixin): ...@@ -2052,39 +2062,50 @@ class TestExternalDiskModern(InstanceTestCase, ExternalDiskMixin):
parameter_dict.update(update_dict) parameter_dict.update(update_dict)
return parameter_dict return parameter_dict
def test(self): def prepareEnv(self):
# Disks can't be created in /tmp, as it's specially mounted on testnodes # Disks can't be created in /tmp, as it's specially mounted on testnodes
# and then KVM can't use them: # and then KVM can't use them:
# -drive file=/tmp/tmpX/third_disk,if=virtio,cache=none: Could not open # -drive file=/tmp/tmpX/third_disk,if=virtio,cache=none: Could not open
# '/tmp/tmpX/third_disk': filesystem does not support O_DIRECT # '/tmp/tmpX/third_disk': filesystem does not support O_DIRECT
self.working_directory = tempfile.mkdtemp(dir=self.slap.instance_directory) self.working_directory = tempfile.mkdtemp(dir=self.slap.instance_directory)
self.addCleanup(shutil.rmtree, self.working_directory) self.addCleanup(shutil.rmtree, self.working_directory)
kvm_instance_partition = os.path.join( self.kvm_instance_partition = os.path.join(
self.slap.instance_directory, self.kvm_instance_partition_reference) self.slap.instance_directory, self.kvm_instance_partition_reference)
# find qemu_img from the tested SR via it's partition parameter, as # find qemu_img from the tested SR via it's partition parameter, as
# otherwise qemu-kvm would be dependency of test suite # otherwise qemu-kvm would be dependency of test suite
with open( with open(
os.path.join(self.computer_partition_root_path, 'buildout.cfg')) as fh: os.path.join(self.computer_partition_root_path, 'buildout.cfg')) as fh:
qemu_img = [ self.qemu_img = [
q for q in fh.readlines() q for q in fh.readlines()
if 'raw qemu_img_executable_location' in q][0].split()[-1] if 'raw qemu_img_executable_location' in q][0].split()[-1]
self.first_disk = os.path.join(self.working_directory, 'first_disk') self.first_disk = os.path.join(self.working_directory, 'first_disk')
subprocess.check_call([ subprocess.check_call([
qemu_img, "create", "-f", "qcow", self.first_disk, "1M"]) self.qemu_img, "create", "-f", "qcow", self.first_disk, "1M"])
second_disk = 'second_disk' self.second_disk_name = 'second_disk'
self.second_disk = os.path.join(kvm_instance_partition, second_disk) self.second_disk = os.path.join(
self.kvm_instance_partition, self.second_disk_name)
subprocess.check_call([ subprocess.check_call([
qemu_img, "create", "-f", "qcow2", os.path.join( self.qemu_img, "create", "-f", "qcow2", os.path.join(
kvm_instance_partition, self.second_disk), "1M"]) self.kvm_instance_partition, self.second_disk), "1M"])
self.third_disk = os.path.join(self.working_directory, 'third_disk') self.third_disk = os.path.join(self.working_directory, 'third_disk')
subprocess.check_call([ subprocess.check_call([
qemu_img, "create", "-f", "qcow2", self.third_disk, "1M"]) self.qemu_img, "create", "-f", "qcow2", self.third_disk, "1M"])
self.rerequestInstance({'_': json.dumps( self.rerequestInstance({'_': json.dumps(
self.getExternalDiskInstanceParameterDict( self.getExternalDiskInstanceParameterDict(
self.first_disk, second_disk, self.third_disk))}) self.first_disk, self.second_disk_name, self.third_disk))})
@classmethod
def getInstanceSoftwareType(cls):
return 'default'
@skipUnlessKvm
class TestExternalDiskModern(
ExternalDiskModernMixin, InstanceTestCase, ExternalDiskMixin):
def test(self):
self.prepareEnv()
self.waitForInstance() self.waitForInstance()
drive_list = self.getRunningDriveList(kvm_instance_partition) drive_list = self.getRunningDriveList(self.kvm_instance_partition)
self.assertEqual( self.assertEqual(
drive_list, drive_list,
[ [
...@@ -2097,16 +2118,39 @@ class TestExternalDiskModern(InstanceTestCase, ExternalDiskMixin): ...@@ -2097,16 +2118,39 @@ class TestExternalDiskModern(InstanceTestCase, ExternalDiskMixin):
self.working_directory) self.working_directory)
] ]
) )
update_dict = {
@skipUnlessKvm
class TestExternalDiskModernConflictAssurance(
ExternalDiskModernMixin, InstanceTestCase, ExternalDiskMixin):
def test(self):
self.prepareEnv()
# Create conflicting configuration
parameter_dict = {
"external-disk-number": 1, "external-disk-number": 1,
"external-disk-size": 100, "external-disk-size": 10,
"external-disk-format": "qcow2", "external-disk-format": "qcow2",
} }
parameter_dict = self.getExternalDiskInstanceParameterDict( self.rerequestInstance({'_': json.dumps(parameter_dict)})
self.first_disk, second_disk, self.third_disk, update_dict) self.waitForInstance()
# assert mutual exclusivity data_disk_ids = os.path.join(
self.kvm_instance_partition, 'etc', '.data-disk-ids')
data_disk_amount = os.path.join(
self.kvm_instance_partition, 'etc', '.data-disk-amount')
self.assertTrue(os.path.exists(data_disk_ids))
self.assertTrue(os.path.exists(data_disk_amount))
with open(data_disk_amount) as fh:
self.assertEqual(1, int(fh.read()))
parameter_dict.update(self.getExternalDiskInstanceParameterDict(
self.first_disk, self.second_disk_name, self.third_disk))
parameter_dict["external-disk-number"] = 0
# assert mutual exclusivity of old and modern
self.rerequestInstance({'_': json.dumps(parameter_dict)}) self.rerequestInstance({'_': json.dumps(parameter_dict)})
self.raising_waitForInstance(3) self.raising_waitForInstance(3)
# Fix the situation
with open(data_disk_amount, 'w') as fh:
fh.write("0")
self.waitForInstance()
@skipUnlessKvm @skipUnlessKvm
......
...@@ -35,7 +35,6 @@ path = ${template-matomo-instance:output} ...@@ -35,7 +35,6 @@ path = ${template-matomo-instance:output}
part-list = matomo-backup.sh matomo-backup-cron part-list = matomo-backup.sh matomo-backup-cron
db-name = matomo db-name = matomo
db-user = matomo db-user = matomo
db-password = 12345678
[template-matomo-instance] [template-matomo-instance]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
......
...@@ -52,6 +52,9 @@ class MatomoTestCase(SlapOSInstanceTestCase): ...@@ -52,6 +52,9 @@ class MatomoTestCase(SlapOSInstanceTestCase):
break break
self.assertTrue(self.matomo_path,"matomo path not found in %r" % (partition_path_list,)) self.assertTrue(self.matomo_path,"matomo path not found in %r" % (partition_path_list,))
self.connection_parameters = self.computer_partition.getConnectionParameterDict() self.connection_parameters = self.computer_partition.getConnectionParameterDict()
# parse <url> out of ['<url>']
url = self.connection_parameters['mariadb-url-list'][2:-2]
self.db_info = urllib.parse.urlparse(url)
#Check if matomo root directory is empty #Check if matomo root directory is empty
def test_matomo_dir(self): def test_matomo_dir(self):
...@@ -83,8 +86,9 @@ class MatomoTestCase(SlapOSInstanceTestCase): ...@@ -83,8 +86,9 @@ class MatomoTestCase(SlapOSInstanceTestCase):
self.assertEqual( self.assertEqual(
tree.xpath('//input[@name="dbname"]/@value'), tree.xpath('//input[@name="dbname"]/@value'),
['matomo']) ['matomo'])
self.assertTrue( self.assertEqual(
tree.xpath('//input[@name="password"]/@value')[0]) tree.xpath('//input[@name="password"]/@value'),
[self.db_info.password])
self.assertEqual( self.assertEqual(
tree.xpath('//input[@name="host"]/@value'), tree.xpath('//input[@name="host"]/@value'),
[f'{self._ipv4_address}:2099'] [f'{self._ipv4_address}:2099']
......
...@@ -19,8 +19,8 @@ parts = ...@@ -19,8 +19,8 @@ parts =
[metabase.jar] [metabase.jar]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = https://downloads.metabase.com/v0.44.1/metabase.jar url = https://downloads.metabase.com/v0.45.2/metabase.jar
md5sum = a97e8e67a0cc647f7c44ca787eb9a41a md5sum = cca1f4d663ebfa60b3a6d93705b340a0
[instance-profile] [instance-profile]
recipe = slapos.recipe.template recipe = slapos.recipe.template
......
...@@ -14,11 +14,7 @@ ...@@ -14,11 +14,7 @@
# not need these here). # not need these here).
[template] [template]
filename = instance.cfg filename = instance.cfg
md5sum = 072b276e0b0dd4b4a96a50348a04c7a7 md5sum = e1dd16a6f50468959b5c4572b8c82f23
[template-monitor]
_update_hash_filename_ = instance-monitor.cfg.jinja2
md5sum = 5afba85a7aca9e716f61d59a524adc12
[json-test-template] [json-test-template]
_update_hash_filename_ = json-test-template.json.in.jinja2 _update_hash_filename_ = json-test-template.json.in.jinja2
...@@ -26,7 +22,11 @@ md5sum = 2eb5596544d9c341acf653d4f7ce2680 ...@@ -26,7 +22,11 @@ md5sum = 2eb5596544d9c341acf653d4f7ce2680
[template-monitor-edgetest-basic] [template-monitor-edgetest-basic]
_update_hash_filename_ = instance-monitor-edgetest-basic.cfg.jinja2 _update_hash_filename_ = instance-monitor-edgetest-basic.cfg.jinja2
md5sum = efc528296ddf7fade335d5f4241c1828 md5sum = 6b933beb0744d97c7760e4601298e137
[template-node-monitoring]
_update_hash_filename_ = instance-node-monitoring.jinja2.cfg
md5sum = 2d8bd1224472983e54f36770d3e3f969
[network-bench-cfg] [network-bench-cfg]
filename = network_bench.cfg.in filename = network_bench.cfg.in
......
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"type": "object", "type": "object",
"properties": { "properties": {
"dummy": { "promise_cpu_temperature_frequency": {
"title": "dummy", "default": "2",
"description": "Dummy", "title": "Frequency at which CPU temperature promise will be run (unit: minutes)",
"type": "string" "description": "Frequency at which CPU temperature promise will be run (unit: minutes)",
"type": "number"
},
"promise_cpu_temperature_threshold": {
"default": "90",
"title": "CPU temperature promise threshold (unit: Celsius)",
"description": "Temperature threshold above which CPU temperature promise will fail (unit: Celsius)",
"type": "number"
},
"promise_cpu_avg_temperature_threshold": {
"default": "80",
"title": "Average CPU temperature promise threshold (unit: Celsius)",
"description": "If average temperature over specified duration reaches this threshold, promise will fail (unit: Celsius)",
"type": "number"
},
"promise_cpu_avg_temperature_threshold_duration": {
"default": "600",
"title": "Average CPU temperature promise threshold duration (unit: secondes)",
"description": "Duration during which average temperature should not exceed specified threshold (unit: secondes)",
"type": "number"
},
"promise_ram_available_frequency": {
"default": "2",
"title": "Frequency at which RAM availalble promise will be run (unit: minutes)",
"description": "Frequency at which RAM availalble promise will be run (unit: minutes)",
"type": "number"
},
"promise_ram_available_threshold": {
"default": "500",
"title": "Minimum available RAM promise threshold (unit: MB)",
"description": "Minimum available RAM threshold below which RAM available promise will fail (unit: MB)",
"type": "number"
},
"promise_ram_avg_available_threshold": {
"default": "1e3",
"title": "Minimum average available RAM promise threshold (unit: MB)",
"description": "If average available ram over specified duration reaches this threshold, promise will fail (unit: MB)",
"type": "number"
},
"promise_ram_avg_available_threshold_duration": {
"default": "600",
"title": "Minimum average available RAM promise threshold duration (unit: secondes)",
"description": "Duration during which average available RAM shall not be below specified threshold (unit: secondes)",
"type": "number"
},
"promise_network_errors_frequency": {
"default": "5",
"title": "Frequency at which network errors promise will be run (unit: minutes)",
"description": "Frequency at which network errors promise will be run (unit: minutes)",
"type": "number"
},
"promise_network_errors_threshold": {
"default": "100",
"title": "Maximum errors on Network per MB (unit: N/A)",
"description": "Maximum network errors threshold(per MB) above which the promise will fail (unit: N/A)",
"type": "number"
},
"promise_network_lost_packets_threshold": {
"default": "100",
"title": "Maximum lost packets on Network per MB (unit: N/A)",
"description": "Maximum network lost packets threshold(per MB) above which the promise will fail (unit: N/A)",
"type": "number"
},
"promise_network_transit_frequency": {
"default": "1",
"title": "Frequency at which network transit promise will be run (unit: minutes)",
"description": "Frequency at which network transit promise will be run (unit: minutes)",
"type": "number"
},
"promise_network_transit_max_data_threshold": {
"default": "1e6",
"title": "Maximum data amount on network (unit: MB)",
"description": "Maximum data amount on network below which the promise will fail (unit: MB)",
"type": "number"
},
"promise_network_transit_min_data_threshold": {
"default": "0",
"title": "Minimum data amount on network (unit: MB)",
"description": "Minimum data amount on network below which the promise will fail (unit: MB)",
"type": "number"
},
"promise_network_transit_duration": {
"default": "600",
"title": "Duration to check thresholds (unit: secondes)",
"description": "Duration during which data amount on network shall not be above maximum and below minimum (unit: secondes)",
"type": "number"
},
"promise_cpu_load_frequency": {
"default": "3",
"title": "Frequency at which CPU load promise will be run (unit: minutes)",
"description": "Frequency at which CPU load promise will be run (unit: minutes)",
"type": "number"
},
"promise_cpu_load_threshold": {
"default": "1.5",
"title": "Maximum CPU load ratio threshold (unit: N/A)",
"description": "Maximum CPU load ratio threshold above which the promise will fail (unit: N/A)",
"type": "number"
},
"promise_monitor_space_frequency": {
"default": "60",
"title": "Frequency at which monitor space promise will be run (unit: minutes)",
"description": "Frequency at which monitor space promise will be run (unit: minutes)",
"type": "number"
},
"promise_partition_space_threshold": {
"default": "0.08",
"title": "Minimum partition space ratio threshold (unit: N/A)",
"description": "Minimum partition space ratio threshold below which the promise will fail (unit: N/A)",
"type": "number"
},
"promise_free_disk_space_frequency": {
"default": "60",
"title": "Frequency at which free disk space promise will be run (unit: minutes)",
"description": "Frequency at which free disk space promise will be run (unit: minutes)",
"type": "number"
},
"promise_free_disk_space_threshold": {
"default": "0.08",
"title": "Minimum partition space ratio threshold (unit: N/A)",
"description": "Minimum partition space ratio threshold below which the promise will fail (unit: N/A)",
"type": "number"
},
"promise_free_disk_space_nb_days_predicted": {
"default": "10",
"title": "Number of days for prediction (unit: Days)",
"description": "Number of days (unit: Days) that will be take into account for prediction calculation",
"type": "number"
},
"promise_free_disk_space_display_partition": {
"default": true,
"title": "Boolean to display partition (unit: N/A)",
"description": "Enable partition display by setting boolean to True (unit: N/A)",
"type": "boolean"
},
"promise_free_disk_space_display_prediction": {
"default": true,
"title": "Boolean to display prediction (unit: N/A)",
"description": "Enable prediction display by setting boolean to True (unit: N/A)",
"type": "boolean"
} }
} }
} }
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema",
"description": "Values returned by Re6st Master instanciation", "title": "Values returned by node-monitoring instanciation",
"type": "object",
"properties": { "properties": {
"re6stry-url": { "promise_cpu_temperature_frequency": {
"description": "ipv6 url to access your re6st registry service", "description": "Frequency at which CPU temperature promise will be run (unit: minutes)",
"type": "string" "type": "number"
},
"promise_cpu_temperature_threshold": {
"description": "Temperature threshold above which CPU temperature promise will fail (unit: Celsius)",
"type": "number"
},
"promise_cpu_avg_temperature_threshold": {
"description": "If average temperature over specified duration reaches this threshold, promise will fail (unit: Celsius)",
"type": "number"
},
"promise_cpu_avg_temperature_threshold_duration": {
"description": "Duration during which average temperature should not exceed specified threshold (unit: secondes)",
"type": "number"
},
"promise_ram_available_frequency": {
"description": "Frequency at which RAM availalble promise will be run (unit: minutes)",
"type": "number"
},
"promise_ram_available_threshold": {
"description": "Minimum available RAM threshold below which RAM available promise will fail (unit: MB)",
"type": "number"
},
"promise_ram_avg_available_threshold": {
"description": "If average available ram over specified duration reaches this threshold, promise will fail (unit: MB)",
"type": "number"
},
"promise_ram_avg_available_threshold_duration": {
"description": "Duration during which average available RAM shall not be below specified threshold (unit: secondes)",
"type": "number"
},
"promise_network_errors_frequency": {
"description": "Frequency at which network errors promise will be run (unit: minutes)",
"type": "number"
},
"promise_network_errors_threshold": {
"description": "Maximum network errors threshold(per MB) above which the promise will fail (unit: N/A)",
"type": "number"
},
"promise_network_lost_packets_threshold": {
"description": "Maximum network lost packets threshold(per MB) above which the promise will fail (unit: N/A)",
"type": "number"
},
"promise_network_transit_frequency": {
"description": "Frequency at which network transit promise will be run (unit: minutes)",
"type": "number"
},
"promise_network_transit_max_data_threshold": {
"description": "Maximum data amount on network below which the promise will fail (unit: MB)",
"type": "number"
},
"promise_network_transit_min_data_threshold": {
"description": "Minimum data amount on network below which the promise will fail (unit: MB)",
"type": "number"
},
"promise_network_transit_duration": {
"description": "Duration during which data amount on network shall not be above maximum and below minimum (unit: secondes)",
"type": "number"
},
"promise_cpu_load_frequency": {
"description": "Frequency at which CPU load promise will be run (unit: minutes)",
"type": "number"
},
"promise_cpu_load_threshold": {
"description": "Maximum CPU load ratio threshold above which the promise will fail (unit: N/A)",
"type": "number"
},
"promise_monitor_space_frequency": {
"description": "Frequency at which monitor space promise will be run (unit: minutes)",
"type": "number"
},
"promise_partition_space_threshold": {
"description": "Minimum partition space ratio threshold below which the promise will fail (unit: N/A)",
"type": "number"
},
"promise_free_disk_space_frequency": {
"description": "Frequency at which free disk space promise will be run (unit: minutes)",
"type": "number"
},
"promise_free_disk_space_threshold": {
"description": "Minimum partition space ratio threshold below which the promise will fail (unit: N/A)",
"type": "number"
},
"promise_free_disk_space_nb_days_predicted": {
"description": "Number of days (unit: Days) that will be take into account for prediction calculation",
"type": "number"
},
"promise_free_disk_space_display_partition": {
"description": "Enable partition display by setting boolean to True (unit: N/A)",
"type": "boolean"
},
"promise_free_disk_space_display_prediction": {
"description": "Enable prediction display by setting boolean to True (unit: N/A)",
"type": "boolean"
} }
}, }
"type": "object"
} }
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#",
"description": "Values returned by Varnish instanciation", "description": "Values returned by Re6st Master instanciation",
"properties": { "properties": {
"url": { "re6stry-url": {
"description": "Varnish HTTP service access information", "description": "ipv6 url to access your re6st registry service",
"type": "string" "type": "string"
} }
}, },
......
...@@ -135,8 +135,43 @@ command = ${surykatka-status-json-{{ class }}:output} ...@@ -135,8 +135,43 @@ command = ${surykatka-status-json-{{ class }}:output}
{%- endfor %} {#- for class, class_check_list in CHECK_DICT.items() #} {%- endfor %} {#- for class, class_check_list in CHECK_DICT.items() #}
[buildout] [buildout]
extends = {{ instance_base_monitor }} extends = {{ monitor_template }}
parts += parts =
publish-connection-information
{% for part_id in sorted(PART_LIST) %} {% for part_id in sorted(PART_LIST) %}
{{ part_id }} {{ part_id }}
{% endfor %} {% endfor %}
[publish-connection-information]
recipe = slapos.cookbook:publish
monitor-setup-url = https://monitor.app.officejs.com/#page=settings_configurator&url=${monitor-publish-parameters:monitor-url}&username=${monitor-publish-parameters:monitor-user}&password=${monitor-publish-parameters:monitor-password}
server_log_url = ${monitor-publish-parameters:monitor-base-url}/${slap-configuration:private-hash}/
[monitor-directory]
service = ${buildout:directory}/etc/service
var = ${buildout:directory}/var
srv = ${buildout:directory}/srv
server-log = ${:private}/server-log
monitor-log = ${:private}/monitor-log
system-log = ${:private}/system-log
consumption = ${:log}/consumption
[pwgen]
recipe = slapos.cookbook:generate.password
user = admin
bytes = 16
[pwgen32]
recipe = slapos.cookbook:generate.password
user = admin
bytes = 16
[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}
private-hash = ${pwgen:passwd}${pwgen32:passwd}
frontend-domain =
[buildout]
extends = {{ monitor_template_output }}
parts =
cron
cron-network-bench
symlink-re6st-logs
symlink-collected-logs
python-symlink
monitor-collect-csv-wrapper
monitor-base
monitor-check-memory-usage
monitor-check-cpu-usage
publish-connection-information
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[cron-network-bench]
<= cron
recipe = slapos.cookbook:cron.d
name = network-bench-test
frequency = */10 * * * *
# skip to not fill cron log file.
# command = {{ buildout_bin }}/networkbench ${network-bench-configuration:output} ${monitor-directory:monitor-log}
command = true
[symlink-re6st-logs]
recipe = cns.recipe.symlink
symlink = /var/log/re6stnet = ${monitor-directory:system-log}/re6stnet
autocreate = true
[symlink-collected-logs]
recipe = cns.recipe.symlink
symlink = /srv/slapgrid/var/data-log = ${monitor-directory:server-log}/data-log
autocreate = true
[network-bench-configuration]
recipe = slapos.recipe.template:jinja2
url = {{ network_benck_cfg_output }}
output = ${monitor-directory:etc}/network_bench.cfg
context =
key slapparameter_dict slap-configuration:configuration
[pwgen]
recipe = slapos.cookbook:generate.password
user = admin
bytes = 16
[pwgen32]
recipe = slapos.cookbook:generate.password
user = admin
bytes = 16
[monitor-instance-parameter]
monitor-httpd-port = {{ slap_configuration['configuration.monitor-base-port'] }}
[monitor-directory]
service = ${buildout:directory}/etc/service
var = ${buildout:directory}/var
srv = ${buildout:directory}/srv
server-log = ${:private}/server-log
monitor-log = ${:private}/monitor-log
system-log = ${:private}/system-log
consumption = ${:log}/consumption
[python-symlink]
recipe = plone.recipe.command
command = ln -sf {{ buildout_bin }}/pythonwitheggs ${monitor-directory:bin}/python
update-command = ${:command}
[monitor-collect-csv-wrapper]
recipe = slapos.cookbook:wrapper
command-line =
${monitor-directory:bin}/python {{ monitor_collect_csv_dump }} --output_folder ${monitor-directory:consumption}
wrapper-path = ${monitor-directory:bin}/monitor-collect-csv-dump
[monitor-check-memory-usage]
<= monitor-promise-base
promise = check_command_execute
name = check-computer-memory-usage.py
config-command = {{ buildout_bin}}/check-computer-memory -db ${monitor-instance-parameter:collector-db} --threshold ${slap-parameter:memory-percent-threshold} --unit percent
[monitor-check-cpu-usage]
recipe = slapos.cookbook:promise.plugin
eggs =
slapos.toolbox
module = slapos.promise.plugin.check_server_cpu_load
output = ${directory:plugins}/system-CPU-load-check.py
config-cpu-load-threshold = ${slap-parameter:cpu-load-threshold}
[publish-connection-information]
recipe = slapos.cookbook:publish
monitor-setup-url = https://monitor.app.officejs.com/#page=settings_configurator&url=${monitor-publish-parameters:monitor-url}&username=${monitor-publish-parameters:monitor-user}&password=${monitor-publish-parameters:monitor-password}
server_log_url = ${monitor-publish-parameters:monitor-base-url}/${slap-configuration:private-hash}/
[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}
private-hash = ${pwgen:passwd}${pwgen32:passwd}
frontend-domain =
[slap-parameter]
# Max cpu load for one core on server
cpu-load-threshold = 3.0
memory-percent-threshold = 96
[buildout]
parts =
directory
check-disk-space.py
check-partition-space.py
check-cpu-temperature.py
check-ram-usage.py
check-network-errors.py
check-network-transit.py
check-cpu-load.py
publish-connection-information
extends = {{ monitor_template }}
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[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'] }}
[directory]
recipe = slapos.cookbook:mkdirectory
software = {{ buildout_directory }}
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
etc = ${:home}/etc
bin = ${:home}/bin
run = ${:var}/run
script = ${:etc}/run
service = ${:etc}/service
promise = ${:etc}/promise
log = ${:var}/log
[publish-connection-information]
recipe = slapos.cookbook:publish.serialised
<= monitor-publish
[macro.promise]
<= monitor-promise-base
name = ${:_buildout_section_name_}
[check-disk-space.py]
<= macro.promise
eggs = slapos.toolbox[prediction]
promise = check_free_disk_space
config-collectordb = ${monitor-instance-parameter:collector-db}
config-frequency = {{ slapparameter_dict.get("promise_free_disk_space_frequency", 60) }}
config-threshold = {{ slapparameter_dict.get("promise_free_disk_space_threshold", 0.08) }}
config-nb-days-predicted = {{ slapparameter_dict.get("promise_free_disk_space_nb_days_predicted", 10) }}
config-display-partition = {{ int(slapparameter_dict.get("promise_free_disk_space_display_partition", 1)) }}
config-display-prediction = {{ int(slapparameter_dict.get("promise_free_disk_space_display_prediction", 1)) }}
[check-partition-space.py]
<= macro.promise
eggs = slapos.toolbox[pandas]
promise = monitor_partition_space
config-collectordb = ${monitor-instance-parameter:collector-db}
config-frequency = {{ slapparameter_dict.get("promise_monitor_space_frequency", 60) }}
config-threshold-ratio = {{ slapparameter_dict.get("promise_partition_space_threshold", 0.08) }}
[check-cpu-temperature.py]
<= macro.promise
promise = check_cpu_temperature
config-testing = false
config-frequency = {{ slapparameter_dict.get("promise_cpu_temperature_frequency", 5) }}
config-max-spot-temp = {{ slapparameter_dict.get("promise_cpu_temperature_threshold", 90) }}
config-max-avg-temp = {{ slapparameter_dict.get("promise_cpu_avg_temperature_threshold", 80) }}
config-avg-temp-duration = {{ slapparameter_dict.get("promise_cpu_avg_temperature_threshold_duration", 600) }}
config-last-avg-computation-file = ${directory:var}/promise_cpu_temperature_last_avg_file
[check-ram-usage.py]
<= macro.promise
promise = check_ram_usage
config-frequency = {{ slapparameter_dict.get("promise_ram_available_frequency", 2) }}
config-min-threshold-ram = {{ slapparameter_dict.get("promise_ram_available_threshold", 500) }}
config-min-avg-ram = {{ slapparameter_dict.get("promise_ram_avg_available_threshold", 1e3) }}
config-avg-ram-period = {{ slapparameter_dict.get("promise_ram_avg_available_threshold_duration", 600) }}
config-last-avg-ram-file = ${directory:var}/promise_ram_space_last_avg_file
[check-network-errors.py]
<= macro.promise
promise = check_network_errors_packets
config-frequency = {{ slapparameter_dict.get("promise_network_errors_frequency", 5) }}
config-max-error-messages-per-MB = {{ slapparameter_dict.get("promise_network_errors_threshold", 100) }}
config-max-lost-packets-per-MB = {{ slapparameter_dict.get("promise_network_lost_packets_threshold", 100) }}
[check-network-transit.py]
<= macro.promise
promise = check_network_transit
config-frequency = {{ slapparameter_dict.get("promise_network_transit_frequency", 5) }}
config-max-data-amount = {{ slapparameter_dict.get("promise_network_transit_max_data_threshold", 1e6) }}
config-min-data-amount = {{ slapparameter_dict.get("promise_network_transit_min_data_threshold", 0) }}
config-transit-period = {{ slapparameter_dict.get("promise_network_transit_duration", 600) }}
config-last-transit-file = ${directory:var}/promise_network_last_transit_file
[check-cpu-load.py]
<= macro.promise
promise = check_server_cpu_load
config-frequency = {{ slapparameter_dict.get("promise_cpu_load_frequency", 3) }}
config-cpu-load-threshold = {{ slapparameter_dict.get("promise_cpu_load_threshold", 1.5) }}
...@@ -7,24 +7,10 @@ develop-eggs-directory = ${buildout:develop-eggs-directory} ...@@ -7,24 +7,10 @@ develop-eggs-directory = ${buildout:develop-eggs-directory}
[switch_softwaretype] [switch_softwaretype]
recipe = slapos.cookbook:switch-softwaretype recipe = slapos.cookbook:switch-softwaretype
default = instance-base-monitor:output default = instance-node-monitoring:output
edgetest-basic = instance-edgetest-basic:output edgetest-basic = instance-edgetest-basic:output
RootSoftwareInstance = $${:default} RootSoftwareInstance = $${:default}
[instance-base-monitor]
recipe = slapos.recipe.template:jinja2
url = ${template-monitor:target}
output = $${buildout:directory}/template-base-monitor.cfg
extensions = jinja2.ext.do
context = key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
key slapparameter_dict slap-configuration:configuration
section slap_configuration slap-configuration
raw buildout_bin ${buildout:bin-directory}
raw monitor_template_output ${monitor-template:output}
raw network_benck_cfg_output ${network-bench-cfg:output}
raw monitor_collect_csv_dump ${monitor-collect-csv-dump:target}
[instance-template] [instance-template]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do extensions = jinja2.ext.do
...@@ -36,13 +22,16 @@ context = ...@@ -36,13 +22,16 @@ context =
key eggs_directory buildout:eggs-directory key eggs_directory buildout:eggs-directory
key slapparameter_dict slap-configuration:configuration key slapparameter_dict slap-configuration:configuration
key slap_software_type slap-configuration:slap-software-type key slap_software_type slap-configuration:slap-software-type
key instance_base_monitor instance-base-monitor:output
raw buildout_bin ${buildout:bin-directory} raw buildout_bin ${buildout:bin-directory}
raw monitor_template ${monitor2-template:output}
$${:extra-context} $${:extra-context}
[surykatka] [instance-node-monitoring]
binary = ${buildout:bin-directory}/${surykatka:script-name} <= instance-template
ini = ${template-surykatka-ini:target} url = ${template-node-monitoring:target}
extra-context =
raw buildout_directory ${buildout:directory}
section slap_connection slap-connection
[instance-edgetest-basic] [instance-edgetest-basic]
<= instance-template <= instance-template
...@@ -52,6 +41,10 @@ extra-context = ...@@ -52,6 +41,10 @@ extra-context =
key template_surykatka_ini surykatka:ini key template_surykatka_ini surykatka:ini
key surykatka_binary surykatka:binary key surykatka_binary surykatka:binary
[surykatka]
binary = ${buildout:bin-directory}/${surykatka:script-name}
ini = ${template-surykatka-ini:target}
[slap-configuration] [slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised recipe = slapos.cookbook:slapconfiguration.serialised
computer = $${slap-connection:computer-id} computer = $${slap-connection:computer-id}
......
...@@ -4,31 +4,35 @@ extends = ...@@ -4,31 +4,35 @@ extends =
buildout.hash.cfg buildout.hash.cfg
../../component/pycurl/buildout.cfg ../../component/pycurl/buildout.cfg
../../component/python-cryptography/buildout.cfg ../../component/python-cryptography/buildout.cfg
../../component/python3/buildout.cfg
../../component/pandas/buildout.cfg
../../component/scipy/buildout.cfg
../../component/statsmodels/buildout.cfg
../../component/defaults.cfg
../../stack/monitor/buildout.cfg ../../stack/monitor/buildout.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
../../component/python3/buildout.cfg
parts = parts =
slapos-cookbook slapos-cookbook
network-bench-cfg network-bench-cfg
json-test-template json-test-template
template template
template-monitor
[template] [template]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg output = ${buildout:directory}/template.cfg
[template-monitor] [template-monitor-edgetest-basic]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_update_hash_filename_} url = ${:_profile_base_location_}/${:_update_hash_filename_}
[template-monitor-edgetest-basic] [template-surykatka-ini]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_update_hash_filename_} url = ${:_profile_base_location_}/${:_update_hash_filename_}
[template-surykatka-ini] [template-node-monitoring]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_update_hash_filename_} url = ${:_profile_base_location_}/${:_update_hash_filename_}
...@@ -68,3 +72,14 @@ miniupnpc = 2.0.2 ...@@ -68,3 +72,14 @@ miniupnpc = 2.0.2
peewee = 3.14.4 peewee = 3.14.4
python-whois = 0.7.3 python-whois = 0.7.3
future = 0.18.2 future = 0.18.2
# Build GCC with Fortran for OpenBLAS (scipy & numpy)
[gcc]
max_version = 0
[slapos-toolbox-dependencies]
eggs +=
${pandas:egg}
${statsmodels:egg}
${scipy:egg}
{ {
"name": "Monitor", "name": "Monitor",
"description": "Software release for Monitoring purpose", "description": "Software release for Monitoring purpose",
"serialisation": "xml", "serialisation": "json-in-xml",
"software-type": { "software-type": {
"default": { "default": {
"title": "Default", "title": "Default",
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"title": "Edge Test Basic", "title": "Edge Test Basic",
"description": "Basic URL monitoring configuration", "description": "Basic URL monitoring configuration",
"request": "instance-edgetest-basic-input-schema.json", "request": "instance-edgetest-basic-input-schema.json",
"response": "instance-default-output-schema.json", "response": "instance-edgetest-basic-output-schema.json",
"serialisation": "json-in-xml", "serialisation": "json-in-xml",
"index": 1 "index": 1
} }
......
...@@ -533,3 +533,41 @@ URL = ...@@ -533,3 +533,41 @@ URL =
self.assertSurykatkaPromises() self.assertSurykatkaPromises()
self.assertSurykatkaCron() self.assertSurykatkaCron()
self.assertConnectionParameterDict() self.assertConnectionParameterDict()
class TestNodeMonitoring(SlapOSInstanceTestCase):
"""Test class for node monitoring instanciation"""
@classmethod
def getInstanceParameterDict(cls):
return {'_': json.dumps({
'promise_cpu_temperature_frequency': 2,
'promise_cpu_temperature_threshold': 90,
'promise_cpu_avg_temperature_threshold': 80,
'promise_cpu_avg_temperature_threshold_duration': 600,
'promise_ram_available_frequency': 2,
'promise_ram_available_threshold': 500,
'promise_ram_avg_available_threshold': 1e3,
'promise_ram_avg_available_threshold_duration': 600,
'promise_network_errors_frequency': 5,
'promise_network_errors_threshold': 100,
'promise_network_lost_packets_threshold': 100,
'promise_network_transit_frequency': 1,
'promise_network_transit_max_data_threshold': 1e6,
'promise_network_transit_min_data_threshold': 0,
'promise_network_transit_duration': 600,
'promise_cpu_load_threshold': 1.5,
'promise_monitor_space_frequency': 5,
'promise_partition_space_threshold': 0.08,
'promise_free_disk_space_frequency': 3,
'promise_free_disk_space_threshold': 0.08,
'promise_free_disk_space_nb_days_predicted': 10,
'promise_free_disk_space_display_partition': True,
'promise_free_disk_space_display_prediction': True,
})}
@classmethod
def getInstanceSoftwareType(cls):
return 'default'
def test_node_monitoring_instance(self):
pass
...@@ -39,7 +39,6 @@ path = ${template-nextcloud-instance:output} ...@@ -39,7 +39,6 @@ path = ${template-nextcloud-instance:output}
part-list = nextcloud-install.sh part-list = nextcloud-install.sh
db-name = nextcloud db-name = nextcloud
db-user = nextcloud db-user = nextcloud
db-password = insecure
[nc-download-unpacked] [nc-download-unpacked]
recipe = slapos.recipe.build:download-unpacked recipe = slapos.recipe.build:download-unpacked
......
...@@ -31,6 +31,8 @@ import json ...@@ -31,6 +31,8 @@ import json
import glob import glob
import re import re
from six.moves.urllib.parse import urlparse
from slapos.recipe.librecipe import generateHashFromFiles from slapos.recipe.librecipe import generateHashFromFiles
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
...@@ -63,13 +65,17 @@ class NextCloudTestCase(InstanceTestCase): ...@@ -63,13 +65,17 @@ class NextCloudTestCase(InstanceTestCase):
self.nextcloud_path, self.nextcloud_path,
"Nextcloud path not found in %r" % (partition_path_list,)) "Nextcloud path not found in %r" % (partition_path_list,))
# parse database info from mariadb url
d = self.computer_partition.getConnectionParameterDict()
db_url = d['mariadb-url-list'][2:-2] # parse <url> out of "['<url>']"
self._db_info = urlparse(db_url)
def getNextcloudConfig(self, config_dict={}): def getNextcloudConfig(self, config_dict={}):
data_dict = dict( data_dict = dict(
datadirectory=self.partition_dir + "/srv/data", datadirectory=self.partition_dir + "/srv/data",
dbhost="%s:2099" % self._ipv4_address, dbhost="%s:2099" % self._ipv4_address,
dbname="nextcloud", dbname="nextcloud",
dbpassword="insecure", dbpassword=self._db_info.password,
dbport="", dbport="",
dbuser="nextcloud", dbuser="nextcloud",
mail_domain="nextcloud@example.com", mail_domain="nextcloud@example.com",
......
...@@ -104,7 +104,7 @@ md5sum = 40cf5389fd91845f4426ef159fb20fc0 ...@@ -104,7 +104,7 @@ md5sum = 40cf5389fd91845f4426ef159fb20fc0
[baseband-latency-promise] [baseband-latency-promise]
_update_hash_filename_ = promise/check_baseband_latency.py _update_hash_filename_ = promise/check_baseband_latency.py
md5sum = 983b179735527f6b38393d28bd858400 md5sum = 4f115e2d9bde9f268c77264dc0deb2a3
[amarisoft-stats-log-promise] [amarisoft-stats-log-promise]
_update_hash_filename_ = promise/check_amarisoft_stats_log.py _update_hash_filename_ = promise/check_amarisoft_stats_log.py
......
...@@ -66,6 +66,9 @@ class RunPromise(GenericPromise): ...@@ -66,6 +66,9 @@ class RunPromise(GenericPromise):
def sense(self): def sense(self):
testing = self.getConfig('testing') == "True" testing = self.getConfig('testing') == "True"
if testing:
self.logger.info("skipping promise")
return
amarisoft_stats_log = self.getConfig('amarisoft-stats-log') amarisoft_stats_log = self.getConfig('amarisoft-stats-log')
stats_period = int(self.getConfig('stats-period')) stats_period = int(self.getConfig('stats-period'))
min_txrx_delay = float(self.getConfig('min-txrx-delay', 5)) min_txrx_delay = float(self.getConfig('min-txrx-delay', 5))
......
...@@ -333,19 +333,27 @@ Solution 1 (iptables) ...@@ -333,19 +333,27 @@ Solution 1 (iptables)
It is a good idea then to go on the node where the instance is It is a good idea then to go on the node where the instance is
and set some ``iptables`` rules like (if using default ports):: and set some ``iptables`` rules like (if using default ports)::
iptables -t nat -A PREROUTING -p tcp -d {public_ipv4} --dport 443 -j DNAT --to-destination {listening_ipv4}:4443 iptables -t nat -A PREROUTING -p tcp -d ${public_ipv4} --dport 443 -j DNAT --to-destination ${listening_ipv4}:4443
iptables -t nat -A PREROUTING -p tcp -d {public_ipv4} --dport 80 -j DNAT --to-destination {listening_ipv4}:8080 iptables -t nat -A PREROUTING -p udp -d ${public_ipv4} --dport 443 -j DNAT --to-destination ${listening_ipv4}:4443
ip6tables -t nat -A PREROUTING -p tcp -d {public_ipv6} --dport 443 -j DNAT --to-destination {listening_ipv6}:4443 iptables -t nat -A PREROUTING -p tcp -d ${public_ipv4} --dport 80 -j DNAT --to-destination ${listening_ipv4}:8080
ip6tables -t nat -A PREROUTING -p tcp -d {public_ipv6} --dport 80 -j DNAT --to-destination {listening_ipv6}:8080 ip6tables -t nat -A PREROUTING -p tcp -d ${public_ipv6} --dport 443 -j DNAT --to-destination ${listening_ipv6}:4443
ip6tables -t nat -A PREROUTING -p tcp -d ${public_ipv6} --dport 80 -j DNAT --to-destination ${listening_ipv6}:8080
Where ``{public_ipv[46]}`` is the public IP of your server, or at least the LAN IP to where your NAT will forward to, and ``{listening_ipv[46]}`` is the private ipv4 (like 10.0.34.123) that the instance is using and sending as connection parameter. Where ``{public_ipv[46]}`` is the public IP of your server, or at least the LAN IP to where your NAT will forward to, and ``{listening_ipv[46]}`` is the private ipv4 (like 10.0.34.123) that the instance is using and sending as connection parameter.
Additionally in order to access the server by itself such entries are needed in ``OUTPUT`` chain (as the internal packets won't appear in the ``PREROUTING`` chain):: Additionally in order to access the server by itself such entries are needed in ``OUTPUT`` chain (as the internal packets won't appear in the ``PREROUTING`` chain)::
iptables -t nat -A OUTPUT -p tcp -d {public_ipv4} --dport 443 -j DNAT --to {listening_ipv4}:4443 iptables -t nat -A OUTPUT -p tcp -d ${public_ipv4} --dport 443 -j DNAT --to ${listening_ipv4}:4443
iptables -t nat -A OUTPUT -p tcp -d {public_ipv4} --dport 80 -j DNAT --to {listening_ipv4}:8080 iptables -t nat -A OUTPUT -p udp -d ${public_ipv4} --dport 443 -j DNAT --to ${listening_ipv4}:4443
ip6tables -t nat -A OUTPUT -p tcp -d {public_ipv6} --dport 443 -j DNAT --to {listening_ipv6}:4443 iptables -t nat -A OUTPUT -p tcp -d ${public_ipv4} --dport 80 -j DNAT --to ${listening_ipv4}:8080
ip6tables -t nat -A OUTPUT -p tcp -d {public_ipv6} --dport 80 -j DNAT --to {listening_ipv6}:8080 ip6tables -t nat -A OUTPUT -p tcp -d ${public_ipv6} --dport 443 -j DNAT --to ${listening_ipv6}:4443
ip6tables -t nat -A OUTPUT -p tcp -d ${public_ipv6} --dport 80 -j DNAT --to ${listening_ipv6}:8080
**Note regarding ports**:
* the port seen by application in case of IPv4 TCP will be "correct" - the ``443`` or ``80``
* the port seen by application in case of IPv6 and IPv4 UDP will be "incorrect" - the ``4443`` or ``8080``
Solution 2 (network capability) Solution 2 (network capability)
------------------------------- -------------------------------
...@@ -359,6 +367,10 @@ Then specify in the master instance parameters: ...@@ -359,6 +367,10 @@ Then specify in the master instance parameters:
* set ``port`` to ``443`` * set ``port`` to ``443``
* set ``plain_http_port`` to ``80`` * set ``plain_http_port`` to ``80``
**Note regarding securitry**:
* such configuration results with all partitions being able to bind to low ports using this binary
Authentication to the backend Authentication to the backend
============================= =============================
...@@ -479,4 +491,6 @@ Experimental QUIC ...@@ -479,4 +491,6 @@ Experimental QUIC
QUIC with HTTP3 is available as experimental feature. It has to be enabled on each node separately by using ``-frontend-i-experimental-haproxy-quic``. Then given node will reply with proper headers on HTTPS to advertise QUIC. Please note that ``-frontend-i-experimental-haproxy-flavour`` has to be set to ``quic`` on this node too. QUIC with HTTP3 is available as experimental feature. It has to be enabled on each node separately by using ``-frontend-i-experimental-haproxy-quic``. Then given node will reply with proper headers on HTTPS to advertise QUIC. Please note that ``-frontend-i-experimental-haproxy-flavour`` has to be set to ``quic`` on this node too.
Please note that due to limitations of iptables method used to expose low ports, the ``-frontend-i-experimental-quic-port`` is by default ``443``, which is used when advertisting the QUIC/HTTP3 port to the client.
Note that then all frontends will be served with QUIC advertised on such node, so it's important to run such experiments very carefully, for example on same zone/region with DNS. Note that then all frontends will be served with QUIC advertised on such node, so it's important to run such experiments very carefully, for example on same zone/region with DNS.
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# not need these here). # not need these here).
[template] [template]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = a7cd4f5e23208bd9bf37cec03ad92fcd md5sum = f249b268bd3e74f6f2dcdd437b1c9f71
[profile-common] [profile-common]
filename = instance-common.cfg.in filename = instance-common.cfg.in
...@@ -22,15 +22,15 @@ md5sum = 5784bea3bd608913769ff9a8afcccb68 ...@@ -22,15 +22,15 @@ md5sum = 5784bea3bd608913769ff9a8afcccb68
[profile-frontend] [profile-frontend]
filename = instance-frontend.cfg.in filename = instance-frontend.cfg.in
md5sum = daf89318c2c155132c34b91105c68806 md5sum = 2f0b4af26c5e947f77cf85ab44e0fe5d
[profile-master] [profile-master]
filename = instance-master.cfg.in filename = instance-master.cfg.in
md5sum = b026a6df40f3d1090ceaa3451a9293fe md5sum = 2aaab85bad51136b38f6a16d662a7b3e
[profile-slave-list] [profile-slave-list]
filename = instance-slave-list.cfg.in filename = instance-slave-list.cfg.in
md5sum = ca2e775e7bd2a96e46113a628461a46f md5sum = b26f4536102ff2cdc1356f6626928975
[profile-master-publish-slave-information] [profile-master-publish-slave-information]
filename = instance-master-publish-slave-information.cfg.in filename = instance-master-publish-slave-information.cfg.in
...@@ -38,11 +38,11 @@ md5sum = cba4d995962f7fbeae3f61c9372c4181 ...@@ -38,11 +38,11 @@ md5sum = cba4d995962f7fbeae3f61c9372c4181
[template-frontend-haproxy-configuration] [template-frontend-haproxy-configuration]
_update_hash_filename_ = templates/frontend-haproxy.cfg.in _update_hash_filename_ = templates/frontend-haproxy.cfg.in
md5sum = 4af0e29ac2399aac10de116b4fa3ac25 md5sum = 2e964dbe75f725c4e45e62720a77bba3
[template-frontend-haproxy-crt-list] [template-frontend-haproxy-crt-list]
_update_hash_filename_ = templates/frontend-haproxy-crt-list.in _update_hash_filename_ = templates/frontend-haproxy-crt-list.in
md5sum = 13c294af9950939c76021eb19305f3ab md5sum = 238760d48d2875f087ad2d784e2a8fcd
[template-not-found-html] [template-not-found-html]
_update_hash_filename_ = templates/notfound.html _update_hash_filename_ = templates/notfound.html
......
{% import "caucase" as caucase with context %} {% import "caucase" as caucase with context %}
{%- set TRUE_VALUES = ['y', 'yes', '1', 'true'] -%} {%- set TRUE_VALUES = ['y', 'yes', '1', 'true'] -%}
{%- set QUIC_PORT = instance_parameter_dict.get('configuration.frontend-quic-port', '443') %}
{%- if instance_parameter_dict.get('configuration.frontend-haproxy-flavour', 'basic') == 'quic' %} {%- if instance_parameter_dict.get('configuration.frontend-haproxy-flavour', 'basic') == 'quic' %}
{%- set FRONTEND_HAPROXY_EXECUTABLE = software_parameter_dict['haproxy_quic_executable'] %} {%- set FRONTEND_HAPROXY_EXECUTABLE = software_parameter_dict['haproxy_quic_executable'] %}
{%- if instance_parameter_dict.get('configuration.frontend-haproxy-quic', 'false').lower() in TRUE_VALUES %} {%- if instance_parameter_dict.get('configuration.frontend-haproxy-quic', 'false').lower() in TRUE_VALUES %}
...@@ -371,6 +372,7 @@ organizational-unit = {{ instance_parameter_dict['configuration.frontend-name'] ...@@ -371,6 +372,7 @@ organizational-unit = {{ instance_parameter_dict['configuration.frontend-name']
backend-client-caucase-url = {{ slapparameter_dict['backend-client-caucase-url'] }} backend-client-caucase-url = {{ slapparameter_dict['backend-client-caucase-url'] }}
partition_ipv6 = ${slap-configuration:ipv6-random} partition_ipv6 = ${slap-configuration:ipv6-random}
url-ready-file = ${directory:var}/url-ready.txt url-ready-file = ${directory:var}/url-ready.txt
quic = {{ FRONTEND_HAPROXY_QUIC }}
extra-context = extra-context =
key backend_client_caucase_url :backend-client-caucase-url key backend_client_caucase_url :backend-client-caucase-url
import furl_module furl import furl_module furl
...@@ -384,6 +386,7 @@ extra-context = ...@@ -384,6 +386,7 @@ extra-context =
key empty_template software-release-path:template-empty key empty_template software-release-path:template-empty
key template_expose_csr_nginx_conf software-release-path:template-expose-csr-nginx-conf key template_expose_csr_nginx_conf software-release-path:template-expose-csr-nginx-conf
key software_type :software_type key software_type :software_type
key quic :quic
key frontend_lazy_graceful_reload frontend-haproxy-lazy-graceful:output key frontend_lazy_graceful_reload frontend-haproxy-lazy-graceful:output
key monitor_base_url monitor-instance-parameter:monitor-base-url key monitor_base_url monitor-instance-parameter:monitor-base-url
key node_id frontend-node-id:value key node_id frontend-node-id:value
...@@ -485,6 +488,7 @@ local_ipv4 = {{ dumps(instance_parameter_dict['ipv4-random']) }} ...@@ -485,6 +488,7 @@ local_ipv4 = {{ dumps(instance_parameter_dict['ipv4-random']) }}
version-hash = ${version-hash:value} version-hash = ${version-hash:value}
node-id = ${frontend-node-id:value} node-id = ${frontend-node-id:value}
quic = {{ FRONTEND_HAPROXY_QUIC }} quic = {{ FRONTEND_HAPROXY_QUIC }}
quic-port = {{ QUIC_PORT }}
# BBB: SlapOS Master non-zero knowledge BEGIN # BBB: SlapOS Master non-zero knowledge BEGIN
[get-self-signed-fallback-access] [get-self-signed-fallback-access]
......
...@@ -171,6 +171,8 @@ context = ...@@ -171,6 +171,8 @@ context =
{% do config_dict.__setitem__('frontend-haproxy-flavour', slapparameter_dict.get(frontend_haproxy_flavour_key) or 'basic') %} {% do config_dict.__setitem__('frontend-haproxy-flavour', slapparameter_dict.get(frontend_haproxy_flavour_key) or 'basic') %}
{% set frontend_haproxy_quic_key = "-frontend-%s-experimental-haproxy-quic" % i %} {% set frontend_haproxy_quic_key = "-frontend-%s-experimental-haproxy-quic" % i %}
{% do config_dict.__setitem__('frontend-haproxy-quic', slapparameter_dict.get(frontend_haproxy_quic_key) or 'False') %} {% do config_dict.__setitem__('frontend-haproxy-quic', slapparameter_dict.get(frontend_haproxy_quic_key) or 'False') %}
{% set frontend_quic_port_key = "-frontend-%s-experimental-quic-port" % i %}
{% do config_dict.__setitem__('frontend-quic-port', slapparameter_dict.get(frontend_quic_port_key) or '443') %}
# Filling request dict for slave # Filling request dict for slave
{% set request_content_dict = { {% set request_content_dict = {
'config': config_dict, 'config': config_dict,
......
...@@ -9,6 +9,12 @@ ...@@ -9,6 +9,12 @@
{%- set backend_haproxy_http_url = 'http://%s:%s' % (instance_parameter_dict['ipv4-random'], backend_haproxy_configuration['http-port']) %} {%- set backend_haproxy_http_url = 'http://%s:%s' % (instance_parameter_dict['ipv4-random'], backend_haproxy_configuration['http-port']) %}
{%- set backend_haproxy_https_url = 'http://%s:%s' % (instance_parameter_dict['ipv4-random'], backend_haproxy_configuration['https-port']) %} {%- set backend_haproxy_https_url = 'http://%s:%s' % (instance_parameter_dict['ipv4-random'], backend_haproxy_configuration['https-port']) %}
{%- set TRUE_VALUES = ['y', 'yes', '1', 'true'] %} {%- set TRUE_VALUES = ['y', 'yes', '1', 'true'] %}
{%- set ALPN_HTTP11 = "alpn http/1.1,http/1.0" %}
{%- if quic.lower() in TRUE_VALUES %}
{%- set ALPN_HTTP2PLUS = "alpn h3,h2,http/1.1,http/1.0" %}
{%- else %}
{%- set ALPN_HTTP2PLUS = "alpn h2,http/1.1,http/1.0" %}
{%- endif %}
{%- set generic_instance_parameter_dict = { 'cache_access': cache_access, 'local_ipv4': instance_parameter_dict['ipv4-random'], 'http_port': configuration['plain_http_port'], 'https_port': configuration['port']} %} {%- set generic_instance_parameter_dict = { 'cache_access': cache_access, 'local_ipv4': instance_parameter_dict['ipv4-random'], 'http_port': configuration['plain_http_port'], 'https_port': configuration['port']} %}
{%- set slave_log_dict = {} %} {%- set slave_log_dict = {} %}
{%- set slave_instance_information_list = [] %} {%- set slave_instance_information_list = [] %}
...@@ -243,10 +249,12 @@ context = ...@@ -243,10 +249,12 @@ context =
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
{%- do slave_instance.__setitem__('websocket-path-list', websocket_path_list) %} {%- do slave_instance.__setitem__('websocket-path-list', websocket_path_list) %}
{%- do slave_instance.__setitem__('enable_h2', slave_instance['enable-http2']) %} {#- Handle alpn negotiation -#}
{%- if slave_instance['type'] in ['notebook', 'websocket'] %} {%- if slave_instance['type'] in ['notebook', 'websocket'] or not slave_instance['enable-http2'] %}
{# websocket style needs http 1.1 max #} {# websocket style needs http 1.1 max, just like non-http2 frontends #}
{%- do slave_instance.__setitem__('enable_h2', False) %} {%- do slave_instance.__setitem__('alpn', ALPN_HTTP11) %}
{%- else %}
{%- do slave_instance.__setitem__('alpn', ALPN_HTTP2PLUS) %}
{%- endif %} {%- endif %}
[slave-log-directory-dict] [slave-log-directory-dict]
......
...@@ -91,7 +91,6 @@ configuration.caucase_port = 8890 ...@@ -91,7 +91,6 @@ configuration.caucase_port = 8890
configuration.caucase_backend_client_port = 8990 configuration.caucase_backend_client_port = 8990
configuration.apache-key = configuration.apache-key =
configuration.apache-certificate = configuration.apache-certificate =
configuration.open-port = 80 443
configuration.disk-cache-size = 8G configuration.disk-cache-size = 8G
configuration.ram-cache-size = 1G configuration.ram-cache-size = 1G
configuration.re6st-verification-url = http://[2001:67c:1254:4::1]/index.html configuration.re6st-verification-url = http://[2001:67c:1254:4::1]/index.html
......
...@@ -108,6 +108,7 @@ haproxy_executable = ${haproxy:location}/sbin/haproxy ...@@ -108,6 +108,7 @@ haproxy_executable = ${haproxy:location}/sbin/haproxy
haproxy_quic_executable = ${haproxy-quic:location}/sbin/haproxy haproxy_quic_executable = ${haproxy-quic:location}/sbin/haproxy
rsyslogd_executable = ${rsyslogd:location}/sbin/rsyslogd rsyslogd_executable = ${rsyslogd:location}/sbin/rsyslogd
curl = ${curl:location} curl = ${curl:location}
curl_http3 = ${curl-http3:location}
dash = ${dash:location} dash = ${dash:location}
gzip = ${gzip:location} gzip = ${gzip:location}
logrotate = ${logrotate:location} logrotate = ${logrotate:location}
......
...@@ -6,11 +6,7 @@ ...@@ -6,11 +6,7 @@
{%- if slave['ciphers'] %} {%- if slave['ciphers'] %}
{%- do sslbindconf.append('ciphers %s' % (slave['ciphers']),) %} {%- do sslbindconf.append('ciphers %s' % (slave['ciphers']),) %}
{%- endif %} {%- endif %}
{%- if slave['enable_h2'] %} {%- do sslbindconf.append(slave['alpn']) %}
{%- do sslbindconf.append('alpn h2,http/1.1,http/1.0') %}
{%- else %}
{%- do sslbindconf.append('alpn http/1.1,http/1.0') %}
{%- endif %}
{%- do entry_list.append('[' + ' '.join(sslbindconf) + ']') %} {%- do entry_list.append('[' + ' '.join(sslbindconf) + ']') %}
{#- <snifilter> #} {#- <snifilter> #}
{%- do entry_list.extend(slave['host_list']) %} {%- do entry_list.extend(slave['host_list']) %}
......
...@@ -82,9 +82,9 @@ frontend https-frontend ...@@ -82,9 +82,9 @@ frontend https-frontend
{%- if QUIC %} {%- if QUIC %}
bind quic4@{{ configuration['local-ipv4'] }}:{{ configuration['https-port'] }} ssl crt-list {{ crt_list }} alpn h3 bind quic4@{{ configuration['local-ipv4'] }}:{{ configuration['https-port'] }} ssl crt-list {{ crt_list }} alpn h3
bind quic6@{{ configuration['global-ipv6'] }}:{{ configuration['https-port'] }} ssl crt-list {{ crt_list }} alpn h3 bind quic6@{{ configuration['global-ipv6'] }}:{{ configuration['https-port'] }} ssl crt-list {{ crt_list }} alpn h3
http-response set-header alt-svc "h3=\":%fp\";ma=900;" http-response set-header alt-svc "h3=\":{{ configuration['quic-port'] }}\"; ma=3600"
{#- Ask Chromium to use QUIC #} {#- Ask Chromium to use QUIC #}
http-response set-header alternate-protocol %fp:quic http-response set-header alternate-protocol {{ configuration['quic-port'] }}:quic
{%- endif %} {%- endif %}
{{ frontend_common() }} {{ frontend_common() }}
{%- for slave_instance in frontend_slave_list -%} {%- for slave_instance in frontend_slave_list -%}
......
...@@ -6761,6 +6761,7 @@ class TestPassedRequestParameter(HttpFrontendTestCase): ...@@ -6761,6 +6761,7 @@ class TestPassedRequestParameter(HttpFrontendTestCase):
'frontend-haproxy-flavour': 'basic', 'frontend-haproxy-flavour': 'basic',
'frontend-haproxy-quic': 'False', 'frontend-haproxy-quic': 'False',
'frontend-name': 'caddy-frontend-1', 'frontend-name': 'caddy-frontend-1',
'frontend-quic-port': '443',
'kedifa-caucase-url': kedifa_caucase_url, 'kedifa-caucase-url': kedifa_caucase_url,
'monitor-cors-domains': 'monitor.app.officejs.com', 'monitor-cors-domains': 'monitor.app.officejs.com',
'monitor-httpd-port': 8411, 'monitor-httpd-port': 8411,
...@@ -6788,6 +6789,7 @@ class TestPassedRequestParameter(HttpFrontendTestCase): ...@@ -6788,6 +6789,7 @@ class TestPassedRequestParameter(HttpFrontendTestCase):
'frontend-haproxy-flavour': 'basic', 'frontend-haproxy-flavour': 'basic',
'frontend-haproxy-quic': 'False', 'frontend-haproxy-quic': 'False',
'frontend-name': 'caddy-frontend-2', 'frontend-name': 'caddy-frontend-2',
'frontend-quic-port': '443',
'kedifa-caucase-url': kedifa_caucase_url, 'kedifa-caucase-url': kedifa_caucase_url,
'monitor-cors-domains': 'monitor.app.officejs.com', 'monitor-cors-domains': 'monitor.app.officejs.com',
'monitor-httpd-port': 8412, 'monitor-httpd-port': 8412,
...@@ -6815,6 +6817,7 @@ class TestPassedRequestParameter(HttpFrontendTestCase): ...@@ -6815,6 +6817,7 @@ class TestPassedRequestParameter(HttpFrontendTestCase):
'frontend-haproxy-flavour': 'basic', 'frontend-haproxy-flavour': 'basic',
'frontend-haproxy-quic': 'False', 'frontend-haproxy-quic': 'False',
'frontend-name': 'caddy-frontend-3', 'frontend-name': 'caddy-frontend-3',
'frontend-quic-port': '443',
'kedifa-caucase-url': kedifa_caucase_url, 'kedifa-caucase-url': kedifa_caucase_url,
'monitor-cors-domains': 'monitor.app.officejs.com', 'monitor-cors-domains': 'monitor.app.officejs.com',
'monitor-httpd-port': 8413, 'monitor-httpd-port': 8413,
...@@ -7364,6 +7367,86 @@ backend _health-check-default-http ...@@ -7364,6 +7367,86 @@ backend _health-check-default-http
self.assertEqual(result.status_code, http.client.SERVICE_UNAVAILABLE) self.assertEqual(result.status_code, http.client.SERVICE_UNAVAILABLE)
class TestSlaveQuic(SlaveHttpFrontendTestCase, TestDataMixin, AtsMixin):
@classmethod
def getInstanceParameterDict(cls):
return {
'domain': 'example.com',
'port': HTTPS_PORT,
'plain_http_port': HTTP_PORT,
'kedifa_port': KEDIFA_PORT,
'caucase_port': CAUCASE_PORT,
'request-timeout': '12',
'-frontend-1-experimental-haproxy-quic': True,
'-frontend-1-experimental-haproxy-flavour': 'quic',
'-frontend-1-experimental-quic-port': HTTPS_PORT,
}
@classmethod
def getSlaveParameterDictDict(cls):
return {
'url': {
'url': cls.backend_url,
},
'enable_cache': {
'url': cls.backend_url,
'enable_cache': True,
},
}
def get_curl_http3(self):
# Very hacky way to fetch curl from own software release instead of
# polluting slapos-sr-testing
with open(os.path.join(self.software_path, '.installed.cfg')) as fh:
for line in fh.readlines():
if line.startswith('location =') and 'curl-http3' in line:
return '/'.join([line.strip().split()[-1], 'bin/curl'])
def assertHttp3(self, domain, direct=True):
alt_svc = tempfile.NamedTemporaryFile(delete=False)
curl_command = [self.get_curl_http3()]
if direct:
curl_command.append('--http3')
else:
curl_command.extend(['--alt-svc', alt_svc.name])
curl_command.extend([
'-k',
'-v',
'-D', '-',
'-o', '/dev/null',
'-H', 'Host: %s' % (domain,),
'--resolve', '%(domain)s:%(https_port)s:%(ip)s' % dict(
ip=TEST_IP, domain=domain, https_port=HTTPS_PORT),
'https://%(domain)s:%(https_port)s/' % dict(
domain=domain, https_port=HTTPS_PORT),
])
def call_curl():
prc = subprocess.Popen(
curl_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
out, err = prc.communicate()
assert prc.returncode == 0, "Problem running %r. "\
"Output:\n%s\nError:\n%s" % (
' '.join(curl_command), out, err)
return [q.strip() for q in out.decode().splitlines()]
if not direct:
# curl with alt-svc does not switch to HTTP3 in one request
self.assertEqual('HTTP/2 200', call_curl()[0])
self.assertEqual('HTTP/3 200', call_curl()[0])
def test_url(self):
parameter_dict = self.assertSlaveBase('url')
self.assertHttp3(parameter_dict['domain'])
self.assertHttp3(parameter_dict['domain'], direct=False)
def test_enable_cache(self):
parameter_dict = self.assertSlaveBase('enable_cache')
self.assertHttp3(parameter_dict['domain'])
self.assertHttp3(parameter_dict['domain'], direct=False)
if __name__ == '__main__': if __name__ == '__main__':
class HTTP6Server(ThreadedHTTPServer): class HTTP6Server(ThreadedHTTPServer):
address_family = socket.AF_INET6 address_family = socket.AF_INET6
......
...@@ -107,6 +107,7 @@ ...@@ -107,6 +107,7 @@
"frontend-haproxy-flavour": "basic", "frontend-haproxy-flavour": "basic",
"frontend-haproxy-quic": "False", "frontend-haproxy-quic": "False",
"frontend-name": "caddy-frontend-1", "frontend-name": "caddy-frontend-1",
"frontend-quic-port": "443",
"kedifa-caucase-url": "http://[@@_ipv6_address@@]:15090", "kedifa-caucase-url": "http://[@@_ipv6_address@@]:15090",
"master-key-download-url": "https://[@@_ipv6_address@@]:15080/@@master-key-download-url_endpoint@@", "master-key-download-url": "https://[@@_ipv6_address@@]:15080/@@master-key-download-url_endpoint@@",
"monitor-cors-domains": "monitor.app.officejs.com", "monitor-cors-domains": "monitor.app.officejs.com",
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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