Commit 74ae0f5f authored by Jérome Perrin's avatar Jérome Perrin

Merge remote-tracking branch 'origin/master' into zope4py2

parents f082ad99 f95765bf
......@@ -22,16 +22,16 @@ extends =
[apr]
recipe = slapos.recipe.cmmi
shared = true
version = 1.5.2
md5sum = 4e9769f3349fe11fc0a5e1b224c236aa
version = 1.7.0
md5sum = 7a14a83d664e87599ea25ff4432e48a7
url = https://archive.apache.org/dist/apr/apr-${:version}.tar.bz2
[apr-util]
recipe = slapos.recipe.cmmi
shared = true
version = 1.5.4
version = 1.6.1
url = https://archive.apache.org/dist/apr/apr-util-${:version}.tar.bz2
md5sum = 2202b18f269ad606d70e1864857ed93c
md5sum = 8ff5dc36fa39a2a3db1df196d3ed6086
configure-options =
--with-apr=${apr:location}
--with-expat=${libexpat:location}
......@@ -39,9 +39,9 @@ configure-options =
[apache]
recipe = slapos.recipe.cmmi
shared = true
version = 2.4.53
version = 2.4.54
url = https://archive.apache.org/dist/httpd/httpd-${:version}.tar.bz2
md5sum = f594f137137b5bdff3998dc17e3e9526
md5sum = 861b43073ab416d689f1fc4dfa087711
configure-options = --disable-static
--enable-authn-alias
--enable-bucketeer
......
......@@ -14,7 +14,7 @@ recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/cloudooo.git
branch = master
git-executable = ${git:location}/bin/git
revision = 0b5ff71a2ede76499e81659aed392057ae910917
revision = 78d15e091df750952998a6a23f49300a5a0faa53
[cloudooo]
recipe = zc.recipe.egg
......@@ -27,7 +27,7 @@ entry-points =
cloudooo_tester=cloudooo.bin.cloudooo_tester:main
runCloudoooUnitTest=cloudooo.tests.runHandlerUnitTest:run
runCloudoooTestSuite=cloudooo.tests.runTestSuite:run
scripts =
scripts =
paster=cloudooo_paster
runCloudoooUnitTest
runCloudoooTestSuite
......@@ -14,8 +14,8 @@ extends =
[fish-shell]
recipe = slapos.recipe.cmmi
shared = true
url = https://github.com/fish-shell/fish-shell/releases/download/3.4.1/fish-3.4.1.tar.xz
md5sum = 80733d30a14ffa50bf48cce96296aa7a
url = https://github.com/fish-shell/fish-shell/releases/download/3.5.0/fish-3.5.0.tar.xz
md5sum = aea858def631da76e1313936e79651fd
configure-command = ${cmake:location}/bin/cmake
configure-options =
-DCMAKE_INSTALL_PREFIX=${:location}
......
......@@ -19,7 +19,11 @@ shared = true
configure-command = :
location = @@LOCATION@@
make-binary =
make-targets= cd src && unset GOBIN && ./all.bash && cp -alf .. ${:location}
# build and test Go and its standard library
# clean intermediate cache before installing
# contrary to build cache in gowork, build cache, that Go uses during its own build, is not reused anywhere:
# https://github.com/golang/go/blob/go1.18.2-0-g8ed0e51b5e/src/cmd/dist/build.go#L239-L242
make-targets= cd src && unset GOBIN && ./all.bash && GOCACHE=`pwd`/../pkg/obj/go-build ../bin/go clean -cache && cp -alf .. ${:location}
# some testdata files have an issue with slapos.extension.strip.
post-install = ${findutils:location}/bin/find ${:location}/src -type d -name testdata -exec rm -rf {} \; || true
environment =
......@@ -42,6 +46,8 @@ patches =
url = https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz
md5sum = dbf727a4b0e365bf88d97cbfde590016
environment-extra =
# build Go without testing it
# NOTE go1.4 does not have build cache
make-targets= cd src && unset GOBIN && ./make.bash && cp -alf .. ${:location}
# skip-chown-tests.patch does not apply to go1.4, but we don't run go1.4 tests.
......
......@@ -15,12 +15,12 @@ extends =
[groonga]
recipe = slapos.recipe.cmmi
shared = true
url = https://packages.groonga.org/source/groonga/groonga-11.0.9.tar.gz
md5sum = 9c66445d92c8b7536f1b28119ac1855b
url = https://packages.groonga.org/source/groonga/groonga-12.0.4.tar.gz
md5sum = a7c6416301e5b5899ef517193c510bd0
groonga-plugin-dir = @@LOCATION@@/lib/groonga/plugins/
# temporary patch to respect more tokens in natural language mode.
patches =
${:_profile_base_location_}/groonga.patch#5d831331ddfdcd87e91b68949c339a1d
${:_profile_base_location_}/groonga.patch#cc6a678acd478fc074e678c7b7dd09d8
patch-options = -p1
configure-options =
--disable-static
......@@ -48,8 +48,8 @@ environment =
[groonga-normalizer-mysql]
recipe = slapos.recipe.cmmi
shared = true
url = https://packages.groonga.org/source/groonga-normalizer-mysql/groonga-normalizer-mysql-1.1.5.tar.gz
md5sum = 842d02becc6dcc25a02fa7e789c2cba7
url = https://packages.groonga.org/source/groonga-normalizer-mysql/groonga-normalizer-mysql-1.1.8.tar.gz
md5sum = a1520691da3083e14bdc65a9ec57a620
groonga-plugin-dir = @@LOCATION@@/lib/groonga/plugins/
pre-configure = mkdir -p ${:groonga-plugin-dir}
make-targets = GROONGA_PLUGINS_DIR=${:groonga-plugin-dir} install
......
--- a/lib/ii.c
+++ b/lib/ii.c
@@ -10387,7 +10387,9 @@
? (data->optarg->similarity_threshold > GRN_HASH_SIZE(h)
@@ -10874,7 +10874,9 @@
? ((uint32_t)(data->optarg->similarity_threshold) > GRN_HASH_SIZE(h)
? GRN_HASH_SIZE(h)
: data->optarg->similarity_threshold)
:(uint32_t)(data->optarg->similarity_threshold))
- : (GRN_HASH_SIZE(h) >> 3) + 1;
+ : (GRN_HASH_SIZE(h) < 8
+ ? GRN_HASH_SIZE(h)
+ : ((GRN_HASH_SIZE(h) - 8) >> 3) + 8);
if (GRN_HASH_SIZE(h)) {
grn_id j, id;
int w2, rep;
float w2;
[buildout]
extends =
../bison/buildout.cfg
../flex/buildout.cfg
[libpcap]
recipe = slapos.recipe.cmmi
shared = true
url = https://www.tcpdump.org/release/libpcap-1.10.1.tar.gz
md5sum = 28e17495004036567c2cc884b51eba45
environment =
PATH=${bison:location}/bin:${flex:location}/bin:%(PATH)s
......@@ -12,8 +12,8 @@ parts =
[libxml2]
recipe = slapos.recipe.cmmi
shared = true
url = http://xmlsoft.org/sources/libxml2-2.9.10.tar.gz
md5sum = 10942a1dc23137a8aa07f0639cbfece5
url = https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.14.tar.xz
md5sum = b7b3029ac6beb32a7925225515f83ca3
configure-options =
--disable-static
--without-python
......
......@@ -7,8 +7,8 @@ parts =
libxslt
[libxslt]
url = ftp://xmlsoft.org/libxslt/libxslt-1.1.34.tar.gz
md5sum = db8765c8d076f1b6caafd9f2542a304a
url = https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.35.tar.xz
md5sum = 5b3a634b77effd8a6268c21173575053
recipe = slapos.recipe.cmmi
shared = true
# --disable-static is temporarilly removed due to build error
......
......@@ -4,11 +4,12 @@ extends =
[virtual-env-base]
recipe = slapos.recipe.build
_name = ${:_buildout_section_name_}
name = ${:_buildout_section_name_}
default-instance = true
init =
from zc.buildout.easy_install import working_set
import os
name = options['_name']
name = options['name']
eggs = options['eggs']
try:
scripts = "scripts = " + options['scripts']
......@@ -25,6 +26,26 @@ init =
<= python-interpreter
eggs += %(eggs)s
""" % locals())
if is_true(options.get('default-instance')):
cookbook = "{slapos-cookbook:recipe}"
self.buildout.parse("""
[.%(name)s.instance]
recipe = slapos.recipe.template
output = ${buildout:directory}/instance.cfg
depends = $%(cookbook)s
inline =
[buildout]
parts = publish
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
[publish]
recipe = slapos.cookbook:publish
activate-script = %(location)s
""" % locals())
install =
with open(location, "w") as f:
f.write(options['template'] % {
......
......@@ -30,8 +30,8 @@ parts =
recipe = slapos.recipe.cmmi
shared = true
url = https://archive.mariadb.org//mariadb-${:version}/source/mariadb-${:version}.tar.gz
version = 10.4.22
md5sum = 0d5e1b9e3694322e18819811a2bf81fa
version = 10.4.25
md5sum = 76e6ee973adb7deb15d7936f710eb5a4
pre-configure =
set '\bSET(PLUGIN_AUTH_PAM YES CACHE BOOL "")' cmake/build_configurations/mysql_release.cmake
grep -q "$@"
......@@ -82,7 +82,7 @@ environment =
patch-options = -p1
patches =
https://sources.debian.org/data/main/m/mariadb-10.3/1:10.3.34-0+deb10u1/debian/patches/0024-Revert-to-using-system-pcre-library.patch#1c6a0f2634f5a56122299674b77b1131
post-install =
post-install =
ldd=`ldd %(location)s/lib/plugin/ha_rocksdb.so`
for x in ${lz4:location} ${snappy:location} ${zstd:location}
do echo "$ldd" |grep -qF " $x/lib/"
......@@ -99,9 +99,9 @@ post-install =
# as plugin-dir ( https://mariadb.com/kb/en/server-system-variables/#plugin_dir )
recipe = slapos.recipe.cmmi
shared = true
url = https://packages.groonga.org/source/mroonga/mroonga-11.09.tar.gz
md5sum = 8b1786332edc61c41a769f225e6063b2
pre-configure =
url = https://packages.groonga.org/source/mroonga/mroonga-12.04.tar.gz
md5sum = 1d154e6cb4540f7be5791b5fb376a5de
pre-configure =
rm -rf fake_mariadb_source
mkdir -p fake_mariadb_source
cd fake_mariadb_source
......@@ -117,8 +117,9 @@ configure-options =
--disable-document
post-install =
cp -rs ${mariadb:location}/lib/plugin/* ${:plugin-dir}
cat @@LOCATION@@/share/mroonga/install.sql @@LOCATION@@/share/mroonga/update.sql > ${:install-sql}
plugin-dir = @@LOCATION@@/lib/plugin
install-sql = @@LOCATION@@/share/mroonga/install.sql
install-sql = @@LOCATION@@/share/mroonga/install-and-update.sql
make-targets = plugindir=${:plugin-dir} install
patch-options = -p1
patches =
......@@ -134,8 +135,8 @@ environment =
### (we just override here for easier revert)
[mariadb-10.3]
<= mariadb-10.4
version = 10.3.32
md5sum = 12341dc150c810c0072a40e55825ca57
version = 10.3.35
md5sum = b7a2e69d103eda3dd61c8bad8775c7bd
post-install =
ldd=`ldd %(location)s/lib/plugin/ha_rocksdb.so`
for x in ${lz4:location} ${snappy:location} ${zstd:location}
......
......@@ -8,8 +8,8 @@ parts =
recipe = slapos.recipe.cmmi
shared = true
url = https://github.com/mesonbuild/meson/releases/download/${:version}/meson-${:version}.tar.gz
version = 0.57.2
md5sum = 4a07b6d42d7a46a6b6e9604fae7da9aa
version = 0.62.1
md5sum = 2f5301d0e7fd5544ab0004393ba44cbe
configure-command = true
make-binary = true
post-install =
......
......@@ -17,8 +17,8 @@ parts =
[openssl]
recipe = slapos.recipe.cmmi
shared = true
url = https://www.openssl.org/source/openssl-1.1.1n.tar.gz
md5sum = 2aad5635f9bb338bc2c6b7d19cbc9676
url = https://www.openssl.org/source/openssl-1.1.1o.tar.gz
md5sum = d05e96e200d2ff0aef20c114cb5f17bf
location = @@LOCATION@@
# 'prefix' option to override --openssldir/--prefix (which is useful
# when combined with DESTDIR). Used by slapos.package.git/obs
......
[buildout]
extends =
../libpcap/buildout.cfg
../python-PyYAML/buildout.cfg
parts =
eggs
[python-pim-dm]
recipe = zc.recipe.egg:custom
egg = pim-dm
include-dirs =
${libpcap:location}/include
library-dirs =
${libpcap:location}/lib
rpath =
${libpcap:location}/lib/
[eggs]
recipe = zc.recipe.egg
eggs =
igmp
ipaddress
netifaces
${python-pim-dm:egg}
prettytable
py-mld
pyroute2
${python-PyYAML:egg}
[buildout]
extends =
../defaults.cfg
../attr/buildout.cfg
../bzip2/buildout.cfg
../gnutls/buildout.cfg
......@@ -12,22 +13,19 @@ extends =
../meson/buildout.cfg
../ncurses/buildout.cfg
../ninja/buildout.cfg
../patch/buildout.cfg
../pkgconfig/buildout.cfg
../xorg/buildout.cfg
../zlib/buildout.cfg
../glib/buildout.cfg
[gcc]
min_version = 7.4
[qemu]
recipe = slapos.recipe.cmmi
shared = true
url = https://download.qemu.org/qemu-5.2.0.tar.xz
md5sum = 179f86928835da857c237b42f4b2df73
patches =
# backport (2021-03-20)
https://gitlab.com/qemu-project/qemu/-/commit/3eacf70bb5a83e4775ad8003cbca63a40f70c8c2.patch#c4330b02f331a827145009d85e4f6862
patch-binary = ${patch:location}/bin/patch
patch-options = -p1
url = https://download.qemu.org/qemu-7.0.0.tar.xz
md5sum = bfb5b09a0d1f887c8c42a6d5f26971ab
pre-configure =
sed -i '/^libmigration\b/s/$/ dependencies: [zlib],/' meson.build
sed -i 's/\bsnappy,/zlib, \0/' dump/meson.build
......
......@@ -5,6 +5,8 @@ extends =
../geoip2/buildout.cfg
../openvpn/buildout.cfg
../python-cryptography/buildout.cfg
../python-PyYAML/buildout.cfg
../python-pim-dm/buildout.cfg
parts =
re6stnet
......@@ -18,6 +20,7 @@ eggs =
${maxminddb-python:egg}
${python-cffi:egg}
${python-cryptography:egg}
${python-PyYAML:egg}
pyOpenSSL
re6stnet[geoip]
......@@ -26,4 +29,54 @@ eggs =
initialization =
import os
os.environ['GEOIP2_MMDB'] = "${geolite2-country:location}/GeoLite2-Country.mmdb"
os.environ['PATH'] = "${openvpn:location}/sbin:${babeld:location}/bin:${openssl:location}/bin:${python:location}/bin:" + os.environ.get('PATH', '/usr/sbin:/usr/bin:/sbin:/bin')
os.environ['PATH'] = "${openvpn:location}/sbin:${babeld:location}/bin:${openssl:location}/bin:${python:location}/bin:${pim-dm-buildout:location}/bin:" + os.environ.get('PATH', '/usr/sbin:/usr/bin:/sbin:/bin')
[pim-dm-buildout]
recipe = slapos.recipe.build
base = ${:_profile_base_location_}
python = ${python3:executable}
install =
import os
from zc.buildout.buildout import _isurl, urljoin
from slapos.rebootstrap.bootstrap import setup_script
base = options['base']
if _isurl(base):
extends = lambda path: urljoin(base + '/', path)
else:
extends = lambda path: os.path.realpath(os.path.join(base, path))
buildout_extra = []
buildout_section = self.buildout['buildout']
for option_name in ('download-cache', 'newest', 'shared-part-list'):
option_value = buildout_section.get(option_name)
if option_value:
buildout_extra.append('%s = %s' % (option_name, option_value))
os.mkdir(location)
with open(os.path.join(location, 'buildout.cfg'), 'w') as buildout_conf:
buildout_conf.write(
options['template'] % {
'extends': '\n '.join(map(extends, (
'../../stack/slapos.cfg',
'../python-pim-dm/buildout.cfg',
))),
'buildout': '\n'.join(buildout_extra),
}
)
buildout = os.path.join(location, 'bin', 'buildout')
os.mkdir(os.path.dirname(buildout))
setup_script(buildout, options['python'])
call((buildout, '-U'), cwd=location)
template =
[buildout]
extends = %(extends)s
extends-cache = ${buildout:extends-cache}
extensions -= slapos.rebootstrap
%(buildout)s
[libpcap]
recipe =
location = ${libpcap:location}
environment =
[libyaml]
recipe =
location = ${libyaml:location}
pre-configure =
......@@ -31,8 +31,7 @@ md5sum = e39331f32ad14009b9ff49cc10c5e751
configure-options =
--enable-multibyte
--disable-static
environment =
PATH=${patch:location}/bin:%(PATH)s
patch-binary = ${patch:location}/bin/patch
[readline]
recipe = slapos.recipe.cmmi
......@@ -47,3 +46,4 @@ configure-options =
environment =
CPPFLAGS=-I${ncurses:location}/include
LDFLAGS=-L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib
patch-binary = ${patch:location}/bin/patch
......@@ -29,8 +29,8 @@ download-cache = download-cache
init +=
buildout = self.buildout['buildout']
assert buildout['directory'] == buildout['destdir'] + buildout['rootdir'], (
"Buildout MUST BE launched in destdir/rootdir (currently launched in %s but should be launched in %s)",
buildout['directory'], buildout['destdir'] + buildout['rootdir'])
"Buildout MUST BE launched in destdir/rootdir (currently launched in %s but should be launched in %s)" %
(buildout['directory'], buildout['destdir'] + buildout['rootdir']))
[python3-common]
configure-options +=
......
......@@ -12,4 +12,5 @@ url = http://www.dest-unreach.org/socat/download/Archive/socat-${:version}.tar.g
version = 1.7.3.2
md5sum = aec3154f7854580cfab0c2d81e910519
environment =
CPPFLAGS=-I${openssl:location}/include
LDFLAGS=-L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib
......@@ -71,7 +71,17 @@ install =
extract_dir = self.extract(self.download(url, md5sum))
destination_dir = os.path.join(options['location'], extension_name)
self.copyTree(guessworkdir(extract_dir), destination_dir)
patches = options.get(extension_name + '-patches')
if patches:
self.applyPatchList(
patches,
patch_options=options.get(extension_name + '-patch-options', '-p1'),
patch_binary=options['patch-binary'],
cwd=destination_dir,
)
os.chmod(destination_dir, 0o750)
patch-binary = ${patch:location}/bin/patch
ms-python-python-patches = ${:_profile_base_location_}/${ms-python-disable-jedi-buildout.patch:_update_hash_filename_} ${ms-python-disable-jedi-buildout.patch:md5sum}
[package.json]
content =
......@@ -106,7 +116,6 @@ content =
"**/.git/**": true,
"**/node_modules/**": true
},
"editor.multiCursorModifier": "ctrlCmd",
"editor.tabSize": 2,
"plantuml.server": "https://plantuml.host.vifib.net/svg/",
"plantuml.render": "PlantUMLServer",
......
......@@ -20,3 +20,7 @@ md5sum = 8157c22134200bd862a07c6521ebf799
[yarn.lock]
_update_hash_filename_ = yarn.lock
md5sum = b1012625be07ad6a3daf27b9ed6004f0
[ms-python-disable-jedi-buildout.patch]
_update_hash_filename_ = ms-python-disable-jedi-buildout.patch
md5sum = 0ec840ffecceaf7e91a037d439962415
jedi: Disable discover_buildout_paths
This slows down jedi a lot and can make it crash on some scripts.
See also https://github.com/davidhalter/jedi/issues/1325
---
extension/pythonFiles/lib/python/jedi/inference/sys_path.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/extension/pythonFiles/lib/python/jedi/inference/sys_path.py b/extension/pythonFiles/lib/python/jedi/inference/sys_path.py
index 5b82ec1..256b19c 100644
--- a/extension/pythonFiles/lib/python/jedi/inference/sys_path.py
+++ b/extension/pythonFiles/lib/python/jedi/inference/sys_path.py
@@ -137,6 +137,7 @@ def check_sys_path_modifications(module_context):
def discover_buildout_paths(inference_state, script_path):
buildout_script_paths = set()
+ return buildout_script_paths
for buildout_script_path in _get_buildout_script_paths(script_path):
for path in _get_paths_from_buildout_script(inference_state, buildout_script_path):
......@@ -24,8 +24,8 @@ min_version = 8
[trafficserver]
recipe = slapos.recipe.cmmi
url = https://dlcdn.apache.org/trafficserver/trafficserver-9.1.1.tar.bz2
md5sum = 666945652942cce8c3ff0ae2757cc3c6
url = https://dlcdn.apache.org/trafficserver/trafficserver-9.1.2.tar.bz2
md5sum = 4dbe434e6cc2bd6ab9a0bf48af312f4b
shared = true
patch-options = -p1
configure-options =
......
......@@ -28,7 +28,7 @@ from setuptools import setup, find_packages
import glob
import os
version = '1.0.244'
version = '1.0.246'
name = 'slapos.cookbook'
long_description = open("README.rst").read()
......
......@@ -67,7 +67,7 @@ def generic_exec(args, extra_environ=None, wait_list=None,
else:
# With chained shebangs, several paths may be inserted at the beginning.
n = len(args)
for i in xrange(1+len(running)-n):
for i in six.moves.xrange(1+len(running)-n):
if args == running[i:n+i]:
sys.exit("Already running with pid %s." % pid)
with open(pidfile, 'w') as f:
......@@ -91,16 +91,19 @@ def generic_exec(args, extra_environ=None, wait_list=None,
uid = os.getuid()
gid = os.getgid()
unshare(CLONE_NEWUSER |CLONE_NEWNS)
with open('/proc/self/setgroups', 'wb') as f: f.write('deny')
with open('/proc/self/uid_map', 'wb') as f: f.write('%s %s 1' % (uid, uid))
with open('/proc/self/gid_map', 'wb') as f: f.write('%s %s 1' % (gid, gid))
with open('/proc/self/setgroups', 'w') as f:
f.write('deny')
with open('/proc/self/uid_map', 'w') as f:
f.write('%s %s 1' % (uid, uid))
with open('/proc/self/gid_map', 'w') as f:
f.write('%s %s 1' % (gid, gid))
for size, path in private_tmpfs:
try:
os.mkdir(path)
except OSError as e:
if e.errno != errno.EEXIST:
raise
mount('tmpfs', path, 'tmpfs', 0, 'size=' + size)
mount(b'tmpfs', path.encode(), b'tmpfs', 0, ('size=' + size).encode())
if extra_environ:
env = os.environ.copy()
......
......@@ -52,13 +52,15 @@ class Re6stnetTest(unittest.TestCase):
return makeRecipe(
re6stnet.Recipe,
options=self.options,
slap_connection={
buildout={
'slap-connection': {
'computer-id': 'comp-test',
'partition-id': 'slappart0',
'server-url': 'http://server.com',
'software-release-url': 'http://software.com',
'key-file': '/path/to/key',
'cert-file': '/path/to/cert'
}
},
name='re6stnet')
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
import errno
import functools
import os
import shutil
import subprocess
import sys
import tempfile
import textwrap
import time
import unittest
from slapos.recipe import wrapper
from slapos.test.utils import makeRecipe
class WrapperTestCase(unittest.TestCase):
def getOptions(self):
raise NotImplementedError()
def setUp(self):
self.buildout_directory = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, self.buildout_directory)
self.getTempPath = functools.partial(os.path.join, self.buildout_directory)
self.wrapper_path = self.getTempPath('wrapper')
self.recipe = makeRecipe(
wrapper.Recipe,
options=self.getOptions(),
name="wrapper",
buildout={'buildout': {
'directory': self.buildout_directory,
}})
def terminate_process(self, process):
try:
process.terminate()
except OSError as e:
if e.errno != errno.ESRCH:
raise
process.wait()
class TestSimpleCommandLineWrapper(WrapperTestCase):
def getOptions(self):
return {
'command-line': 'echo hello world',
'wrapper-path': self.wrapper_path,
}
def test_install_and_execute(self):
installed = self.recipe.install()
self.assertEqual(installed, self.wrapper_path)
self.assertEqual(
subprocess.check_output(installed, universal_newlines=True),
'hello world\n')
class TestEscapeCommandLine(WrapperTestCase):
def getOptions(self):
return {
'command-line': "echo esca $PE",
'wrapper-path': self.wrapper_path,
}
def test_install_and_execute(self):
installed = self.recipe.install()
self.assertEqual(installed, self.wrapper_path)
self.assertEqual(
subprocess.check_output(installed, universal_newlines=True),
"esca $PE\n")
class TestEnvironment(WrapperTestCase):
def getOptions(self):
return {
'command-line': 'sh -c "echo $FOO"',
'wrapper-path': self.wrapper_path,
'environment': 'FOO=bar',
}
def test_install_and_execute(self):
installed = self.recipe.install()
self.assertEqual(installed, self.wrapper_path)
output = subprocess.check_output(
installed, universal_newlines=True, env={'FOO': 'foo'})
self.assertEqual(output, 'bar\n')
class TestHashFiles(WrapperTestCase):
def getOptions(self):
hashed_file = self.getTempPath('hashed_file')
with open(hashed_file, 'w') as f:
f.write('hello world')
return {
'command-line': "cat " + hashed_file,
'wrapper-path': self.wrapper_path,
'hash-files': hashed_file
}
def test_install_and_execute(self):
installed = self.recipe.install()
# 83af3240d992b2165abbd245a3e43368 is hashlib.md5(b'11\nhello world').hexdigest()
self.assertEqual(
installed, self.wrapper_path + '-83af3240d992b2165abbd245a3e43368')
self.assertEqual(
subprocess.check_output(installed, universal_newlines=True),
"hello world")
class TestPidFile(WrapperTestCase):
def getOptions(self):
self.pidfile = self.getTempPath('hello.pid')
return {
'command-line': "/bin/sleep 10",
'wrapper-path': self.wrapper_path,
'pidfile': self.pidfile
}
def test_install_and_execute(self):
installed = self.recipe.install()
self.assertEqual(installed, self.wrapper_path)
process = subprocess.Popen(
installed,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True,
)
self.addCleanup(self.terminate_process, process)
if process.poll():
self.fail(process.stdout.read())
for _ in range(20):
time.sleep(0.1)
if os.path.exists(self.pidfile):
break
with open(self.pidfile) as f:
pid = int(f.read())
self.assertEqual(process.pid, pid)
with self.assertRaises(subprocess.CalledProcessError) as ctx:
subprocess.check_output(
installed, stderr=subprocess.STDOUT, universal_newlines=True)
self.assertEqual(
ctx.exception.output, 'Already running with pid %s.\n' % pid)
def test_stale_pidfile_is_ignored(self):
installed = self.recipe.install()
self.assertEqual(installed, self.wrapper_path)
with open(self.pidfile, 'w') as f:
f.write('1234')
process = subprocess.Popen(
installed,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True,
)
self.addCleanup(self.terminate_process, process)
if process.poll():
self.fail(process.stdout.read())
for _ in range(20):
time.sleep(0.1)
with open(self.pidfile) as f:
pid = int(f.read())
if process.pid == pid:
break
else:
self.fail('pidfile not updated', process.stdout.read())
class TestWaitForFiles(WrapperTestCase):
def getOptions(self):
self.waitfile = self.getTempPath('wait')
return {
'command-line': "/bin/echo done",
'wrapper-path': self.wrapper_path,
'wait-for-files': self.waitfile,
}
def test_install_and_execute(self):
installed = self.recipe.install()
self.assertEqual(installed, self.wrapper_path)
process = subprocess.Popen(
installed,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True,
)
self.addCleanup(self.terminate_process, process)
if process.poll():
self.fail(process.stdout.read())
# nothing happens when file is not there
for _ in range(10):
time.sleep(0.1)
if process.poll():
self.fail(process.stdout.read())
open(self.waitfile, 'w').close()
for _ in range(20):
time.sleep(0.1)
if process.poll() is not None:
self.assertEqual(process.stdout.read(), 'done\n')
self.assertEqual(process.returncode, 0)
break
else:
self.fail('process did not start after file was created')
class TestPrivateTmpFS(WrapperTestCase):
def getOptions(self):
self.tmpdir = self.getTempPath('tmpdir')
self.tmpfile = self.getTempPath('tmpdir', 'file')
self.program = self.getTempPath('program')
with open(self.program, 'w') as f:
f.write(
textwrap.dedent(
'''\
#!{sys_executable}
import os
with open({tmpfile!r}, 'w') as f:
f.write('ok')
with open({tmpfile!r}, 'r') as f:
print(f.read())
''').format(sys_executable=sys.executable, tmpfile=self.tmpfile))
os.chmod(self.program, 0o700)
return {
'command-line': self.program,
'wrapper-path': self.wrapper_path,
'private-tmpfs': '1000 ' + self.tmpdir
}
def test_install_and_execute(self):
installed = self.recipe.install()
self.assertEqual(installed, self.wrapper_path)
output = subprocess.check_output(
installed,
universal_newlines=True,
)
self.assertEqual(output, 'ok\n')
self.assertFalse(os.path.exists(self.tmpfile))
class TestReserveCPU(WrapperTestCase):
def getOptions(self):
self.slapos_cpu_exclusive = self.getTempPath('.slapos-cpu-exclusive')
self.program = self.getTempPath('program')
with open(self.program, 'w') as f:
f.write(
textwrap.dedent(
'''\
#!{sys_executable}
import os
with open({slapos_cpu_exclusive!r}, 'r') as f:
print('ok' if int(f.read()) == os.getpid() else 'error')
''').format(
sys_executable=sys.executable,
slapos_cpu_exclusive=self.slapos_cpu_exclusive,
))
os.chmod(self.program, 0o700)
return {
'command-line': self.program,
'wrapper-path': self.wrapper_path,
'reserve-cpu': 'true',
}
def test_install_and_execute(self):
installed = self.recipe.install()
self.assertEqual(installed, self.wrapper_path)
output = subprocess.check_output(
installed,
universal_newlines=True,
env={'HOME': self.buildout_directory})
self.assertEqual(output, 'ok\n')
......@@ -2,18 +2,18 @@
"""
import os
import sys
import six
def makeRecipe(recipe_class, options, name='test', slap_connection=None):
"""Instanciate a recipe of `recipe_class` with `options` with a buildout
mapping containing a python and an empty `slapos-connection` mapping, unless
provided as `slap_connection`.
def makeRecipe(recipe_class, options, name='test', buildout=None):
"""Instantiate a recipe of `recipe_class` with `options` with a `buildout`
mapping containing by default a python and an empty slap-connection.
This function expects the test suite to have set SLAPOS_TEST_EGGS_DIRECTORY
and SLAPOS_TEST_DEVELOP_EGGS_DIRECTORY environment variables, so that the
test recipe does not need to install eggs again when using working set.
"""
buildout = {
_buildout = {
'buildout': {
'bin-directory': '',
'find-links': '',
......@@ -32,15 +32,17 @@ def makeRecipe(recipe_class, options, name='test', slap_connection=None):
'software-release-url': '',
}
}
if slap_connection is not None:
buildout['slap-connection'] = slap_connection
buildout['buildout']['eggs-directory'] = os.environ['SLAPOS_TEST_EGGS_DIRECTORY']
buildout['buildout']['develop-eggs-directory'] = os.environ['SLAPOS_TEST_DEVELOP_EGGS_DIRECTORY']
_buildout['buildout']['eggs-directory'] = os.environ['SLAPOS_TEST_EGGS_DIRECTORY']
_buildout['buildout']['develop-eggs-directory'] = os.environ['SLAPOS_TEST_DEVELOP_EGGS_DIRECTORY']
if buildout:
for section, _options in six.iteritems(buildout):
_buildout.setdefault(section, {}).update(**_options)
# Prevent test from accidentally writing to the buildout's eggs
buildout['buildout']['newest'] = False
buildout['buildout']['offline'] = True
_buildout['buildout']['newest'] = False
_buildout['buildout']['offline'] = True
return recipe_class(buildout=buildout, name=name, options=options)
return recipe_class(buildout=_buildout, name=name, options=options)
......@@ -86,9 +86,9 @@ eggs +=
[beremiz]
recipe = slapos.recipe.build:download-unpacked
# download beremiz at revision 86b02aa32d413437ddcb9ab6cf4cc72aad394b3e
url = https://github.com/beremiz/beremiz/archive/86b02aa32d413437ddcb9ab6cf4cc72aad394b3e.tar.gz
md5sum = 0b46be8c8e849bd612373dc999427912
# download beremiz at revision 8171447dc479012a58fae0f2ffd233ade7d28d6a
url = https://github.com/beremiz/beremiz/archive/8171447dc479012a58fae0f2ffd233ade7d28d6a.tar.gz
md5sum = 48070804b00b633d79dfc4bae3a73646
[beremiz-setup]
recipe = zc.recipe.egg:develop
......
[buildout]
extends =
../../stack/slapos.cfg
../../component/macros/virtual-env.cfg
../../stack/slapos.cfg
../../component/macros/virtual-env.cfg
parts =
instance
slapos-cookbook
[python]
part = python3
django-env
[django-env]
<= virtual-env-base
location = ${buildout:directory}/activate
eggs = Django
[instance]
recipe = slapos.recipe.template
output = ${buildout:directory}/instance.cfg
inline =
[buildout]
parts = publish
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
[publish]
recipe = slapos.cookbook:publish
activate-script = ${django-env:location}
[python]
part = python3
[versions]
Django = 3.2.12
......
......@@ -97,7 +97,7 @@
},
"publisher-timeout": {
"description": "How long a publisher-initiated transaction may last, in seconds",
"default": null,
"default": 300,
"type": [
"number",
"null"
......@@ -339,6 +339,7 @@
},
"zodb-zeo": {
"description": "Common settings ZEO servers",
"additionalProperties": false,
"properties": {
"tcpv4-port": {
"allOf": [
......@@ -464,6 +465,7 @@
},
"jupyter": {
"description": "Jupyter subinstance parameters",
"additionalProperties": false,
"properties": {
"enable": {
"description": "Whether to enable creation of associated Jupyter subinstance",
......@@ -480,6 +482,7 @@
},
"wcfs": {
"description": "Parameters for wendelin.core filesystem",
"additionalProperties": false,
"properties": {
"enable": {
"description": "Whether to enable WCFS filesystem and use it to access ZBigArray/ZBigFile data. In WCFS mode wendelin.core clients (Zope/ERP5 processes) share in-RAM cache for in-ZODB data without duplicating it for every client. This cache sharing does not affect correctness as isolation property is continued to be provided to every client.",
......@@ -495,22 +498,27 @@
},
"caucase": {
"description": "Caucase certificate authority parameters",
"properties": {
"url": {
"title": "Caucase URL",
"description": "URL of existing caucase instance to use. If empty, a new caucase instance will be deployed. If not empty, other properties in this section will be ignored.",
"default": "",
"type": "string",
"format": "uri"
"allOf": [
{
"properties": {
"url": {
"title": "Caucase URL",
"description": "URL of existing caucase instance to use. If empty, a new caucase instance will be deployed. If not empty, other properties in this section will be ignored.",
"default": "",
"type": "string",
"format": "uri"
}
}
},
{
"$ref": "../caucase/instance-caucase-input-schema.json"
}
},
"additionalProperties": {
"$ref": "../caucase/instance-caucase-input-schema.json"
},
],
"type": "object"
},
"test-runner": {
"description": "Test runner parameters.",
"additionalProperties": false,
"properties": {
"enabled": {
"description": "Generate helper scripts to run test suite.",
......@@ -650,6 +658,7 @@
},
"ssl": {
"description": "HTTPS certificate generation parameters",
"additionalProperties": false,
"properties": {
"frontend-caucase-url-list": {
"title": "Frontend Caucase URL List",
......
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"tcpv4-port": {
"allOf": [
......
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"tcpv4-port": {
"allOf": [
......
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"tcpv4-port": {
"allOf": [
......
......@@ -6,7 +6,6 @@
"default": {
"title": "Default",
"software-type": "default",
"description": "No automated database modification (ERP5Site is not automatically created).",
"request": "instance-erp5-input-schema.json",
"response": "instance-erp5-output-schema.json",
"index": 0
......
......@@ -166,10 +166,11 @@ class BalancerTestCase(ERP5InstanceTestCase):
'backend-path-dict': {
'default': '',
},
'ssl-authentication-dict': {},
'ssl-authentication-dict': {'default': False},
'ssl': {
'caucase-url': cls.getManagedResource("caucase", CaucaseService).url,
},
'timeout-dict': {'default': None},
'family-path-routing-dict': {},
'path-routing-list': [],
}
......@@ -186,18 +187,51 @@ class BalancerTestCase(ERP5InstanceTestCase):
class SlowHTTPServer(ManagedHTTPServer):
"""An HTTP Server which reply after 2 seconds.
"""An HTTP Server which reply after a timeout.
Timeout is 2 seconds by default, and can be specified in the path of the URL
"""
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
# type: () -> None
self.send_response(200)
self.send_header("Content-Type", "text/plain")
time.sleep(2)
timeout = 2
try:
timeout = int(self.path[1:])
except ValueError:
pass
time.sleep(timeout)
self.end_headers()
self.wfile.write(b"OK\n")
log_message = logging.getLogger(__name__ + '.SlowHandler').info
log_message = logging.getLogger(__name__ + '.SlowHTTPServer').info
class TestTimeout(BalancerTestCase, CrontabMixin):
__partition_reference__ = 't'
@classmethod
def _getInstanceParameterDict(cls):
# type: () -> dict
parameter_dict = super(TestTimeout, cls)._getInstanceParameterDict()
# use a slow server instead
parameter_dict['dummy_http_server'] = [[cls.getManagedResource("slow_web_server", SlowHTTPServer).netloc, 1, False]]
# and set timeout of 1 second
parameter_dict['timeout-dict'] = {'default': 1}
return parameter_dict
def test_timeout(self):
# type: () -> None
self.assertEqual(
requests.get(
six.moves.urllib.parse.urljoin(self.default_balancer_url, '/1'),
verify=False).status_code,
requests.codes.ok)
self.assertEqual(
requests.get(
six.moves.urllib.parse.urljoin(self.default_balancer_url, '/5'),
verify=False).status_code,
requests.codes.gateway_timeout)
class TestLog(BalancerTestCase, CrontabMixin):
......@@ -753,6 +787,7 @@ class TestFrontendXForwardedFor(BalancerTestCase):
'default': False,
'default-auth': True,
}
parameter_dict['timeout-dict']['default-auth'] = None
parameter_dict['ssl']['frontend-caucase-url-list'] = [frontend_caucase.url]
return parameter_dict
......@@ -926,6 +961,8 @@ class TestPathBasedRouting(BalancerTestCase):
] = parameter_dict['zope-family-dict'][
'default'
]
parameter_dict['timeout-dict']['second'] = None
parameter_dict['ssl-authentication-dict']['second'] = False
# Routing rules outermost slashes mean nothing. They are internally
# stripped and rebuilt in order to correctly represent the request's URL.
parameter_dict['family-path-routing-dict'] = {
......
......@@ -406,7 +406,7 @@ class TestWatchActivities(ERP5InstanceTestCase):
__partition_reference__ = 'wa'
def test(self):
# "watch_activites" scripts use watch command. We'll fake a watch command
# "watch_activities" scripts use watch command. We'll fake a watch command
# that executes the actual command only once to check the output.
tmpdir = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, tmpdir)
......@@ -443,12 +443,86 @@ class TestWatchActivities(ERP5InstanceTestCase):
self.assertIn(' dict ', output)
class ZopeTestMixin(CrontabMixin):
class ZopeSkinsMixin(object):
"""Mixins with utility methods to test zope behaviors.
"""
@classmethod
def _setUpClass(cls):
super(ZopeSkinsMixin, cls)._setUpClass()
param_dict = cls.getRootPartitionConnectionParameterDict()
with cls.getXMLRPCClient() as erp5_xmlrpc_client:
# wait for ERP5 to be ready (TODO: this should probably be a promise)
for _ in range(120):
time.sleep(1)
try:
erp5_xmlrpc_client.getTitle()
except (six.moves.xmlrpc_client.ProtocolError,
six.moves.xmlrpc_client.Fault):
pass
else:
break
@classmethod
def _getAuthenticatedZopeUrl(cls, path, family_name='default'):
"""Returns a URL to access a zope family through balancer,
with credentials in the URL.
path is joined with urllib.parse.urljoin to the URL of the portal.
"""
param_dict = cls.getRootPartitionConnectionParameterDict()
parsed = six.moves.urllib.parse.urlparse(param_dict['family-' + family_name])
base_url = parsed._replace(
netloc='{}:{}@{}:{}'.format(
param_dict['inituser-login'],
param_dict['inituser-password'],
parsed.hostname,
parsed.port,
),
path=param_dict['site-id'] + '/',
).geturl()
return six.moves.urllib_parse.urljoin(base_url, path)
@classmethod
@contextlib.contextmanager
def getXMLRPCClient(cls):
# don't verify certificate
ssl_context = ssl.create_default_context()
ssl_context.check_hostname = False
ssl_context.verify_mode = ssl.CERT_NONE
erp5_xmlrpc_client = six.moves.xmlrpc_client.ServerProxy(
cls._getAuthenticatedZopeUrl(''),
context=ssl_context,
)
# BBB use as a context manager only on python3
if sys.version_info < (3, ):
yield erp5_xmlrpc_client
else:
with erp5_xmlrpc_client:
yield erp5_xmlrpc_client
@classmethod
def _addPythonScript(cls, script_id, params, body):
with cls.getXMLRPCClient() as erp5_xmlrpc_client:
custom = erp5_xmlrpc_client.portal_skins.custom
try:
custom.manage_addProduct.PythonScripts.manage_addPythonScript(
script_id)
except six.moves.xmlrpc_client.ProtocolError as e:
if e.errcode != 302:
raise
getattr(custom, script_id).ZPythonScriptHTML_editAction(
'',
'',
params,
body,
)
class ZopeTestMixin(ZopeSkinsMixin, CrontabMixin):
"""Mixin class for zope features.
"""
wsgi = NotImplemented # type: bool
__partition_reference__ = 'z'
@classmethod
......@@ -469,74 +543,14 @@ class ZopeTestMixin(CrontabMixin):
@classmethod
def _setUpClass(cls):
super(ZopeTestMixin, cls)._setUpClass()
cls.zope_base_url = cls._getAuthenticatedZopeUrl('')
param_dict = cls.getRootPartitionConnectionParameterDict()
# rebuild an url with user and password
parsed = six.moves.urllib.parse.urlparse(param_dict['family-default'])
cls.zope_base_url = parsed._replace(
netloc='{}:{}@{}:{}'.format(
param_dict['inituser-login'],
param_dict['inituser-password'],
parsed.hostname,
parsed.port,
),
path=param_dict['site-id'] + '/',
).geturl()
cls.zope_deadlock_debugger_url = six.moves.urllib_parse.urljoin(
cls.zope_base_url,
cls.zope_deadlock_debugger_url = cls._getAuthenticatedZopeUrl(
'/manage_debug_threads?{deadlock-debugger-password}'.format(
**param_dict),
)
@contextlib.contextmanager
def getXMLRPCClient():
# don't verify certificate
ssl_context = ssl.create_default_context()
ssl_context.check_hostname = False
ssl_context.verify_mode = ssl.CERT_NONE
erp5_xmlrpc_client = six.moves.xmlrpc_client.ServerProxy(
cls.zope_base_url,
context=ssl_context,
)
# BBB use as a context manager only on python3
if sys.version_info < (3, ):
yield erp5_xmlrpc_client
else:
with erp5_xmlrpc_client:
yield erp5_xmlrpc_client
with getXMLRPCClient() as erp5_xmlrpc_client:
# wait for ERP5 to be ready (TODO: this should probably be a promise)
for _ in range(120):
time.sleep(1)
try:
erp5_xmlrpc_client.getTitle()
except (six.moves.xmlrpc_client.ProtocolError,
six.moves.xmlrpc_client.Fault):
pass
else:
break
def addPythonScript(script_id, params, body):
with getXMLRPCClient() as erp5_xmlrpc_client:
custom = erp5_xmlrpc_client.portal_skins.custom
try:
custom.manage_addProduct.PythonScripts.manage_addPythonScript(
script_id)
except six.moves.xmlrpc_client.ProtocolError as e:
if e.errcode != 302:
raise
getattr(custom, script_id).ZPythonScriptHTML_editAction(
'',
'',
params,
body,
)
**param_dict))
# a python script to verify activity processing
addPythonScript(
cls._addPythonScript(
script_id='ERP5Site_verifyActivityProcessing',
params='mode',
body='''if 1:
......@@ -556,7 +570,7 @@ class ZopeTestMixin(CrontabMixin):
'ERP5Site_verifyActivityProcessing',
)
# a python script logging to event log
addPythonScript(
cls._addPythonScript(
script_id='ERP5Site_logMessage',
params='name',
body='''if 1:
......@@ -569,14 +583,14 @@ class ZopeTestMixin(CrontabMixin):
'ERP5Site_logMessage',
)
# a python script issuing a long request
addPythonScript(
cls._addPythonScript(
script_id='ERP5Site_executeLongRequest',
params='',
body='''if 1:
import time
for _ in range(5):
time.sleep(1)
return "done"
return "done"
''',
)
cls.zope_long_request_url = six.moves.urllib_parse.urljoin(
......@@ -850,3 +864,67 @@ class TestZopeWSGI(ZopeTestMixin, ERP5InstanceTestCase):
@unittest.expectedFailure
def test_basic_authentication_user_in_access_log(self):
super(TestZopeWSGI, self).test_basic_authentication_user_in_access_log(self)
class TestZopePublisherTimeout(ZopeSkinsMixin, ERP5InstanceTestCase):
__partition_reference__ = 't'
@classmethod
def getInstanceParameterDict(cls):
return {
'_':
json.dumps({
# a default timeout of 3
"publisher-timeout": 3,
# and a family without timeout
"family-override": {
"no-timeout": {
"publisher-timeout": None,
},
},
"zope-partition-dict": {
# a family to process activities, so that our test
# does not hit a zope node processing activities
"activity": {
"family": "activity",
},
"default": {
"family": "default",
"port-base": 2210,
},
"no-timeout": {
"family": "no-timeout",
"port-base": 22220,
},
},
})
}
@classmethod
def _setUpClass(cls):
super(TestZopePublisherTimeout, cls)._setUpClass()
cls._addPythonScript(
'ERP5Site_doSlowRequest',
'',
'''if 1:
import time
def recurse(o):
time.sleep(0.1)
for sub in o.objectValues():
recurse(sub)
recurse(context.getPortalObject())
'''
)
def test_long_request_interupted_on_default_family(self):
ret = requests.get(self._getAuthenticatedZopeUrl(
'ERP5Site_doSlowRequest', family_name='default'), verify=False)
self.assertIn('TimeoutReachedError', ret.text)
self.assertEqual(ret.status_code, requests.codes.server_error)
def test_long_request_not_interupted_on_no_timeout_family(self):
with self.assertRaises(requests.exceptions.Timeout):
requests.get(
self._getAuthenticatedZopeUrl('ERP5Site_doSlowRequest', family_name='no-timeout'),
verify=False,
timeout=6)
This diff is collapsed.
......@@ -55,8 +55,8 @@ return =
url
backend-url
ipv6
nat-rule-port-443
nat-rule-port-80
nat-rule-port-tcp-443
nat-rule-port-tcp-80
[directory]
recipe = slapos.cookbook:mkdirectory
......
......@@ -12,6 +12,7 @@ parts =
recipe = zc.recipe.egg
eggs =
erp5.util
requests
interpreter = ${:_buildout_section_name_}
[python2.7-with-eggs]
......@@ -70,3 +71,6 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
mode = 0644
[versions]
erp5.util = 0.4.69
......@@ -11,4 +11,4 @@ parts =
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg
md5sum = 9fccb9600a085691ab0f9a20cd615c01
md5sum = 0385b31519c3489fb8d0919621e02ac7
......@@ -118,11 +118,11 @@ Technical notes
Updating boot-image-url-select
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* download the new OS installation image
* calculate it's sha512sum and store as <SHA512>
* calculate it's md5sum and store as <MD5>
* upload it to shacache
* construct download url: ``https://shacache.nxdcdn.com/<SHA512>#<MD5>``
* update the ``boot-image-url-select`` in:
* ``instance-kvm-input-schema.json``
* ``instance-kvm-cluster-input-schema.json``
* download the new OS installation image
* calculate it's sha512sum and store as <SHA512>
* calculate it's md5sum and store as <MD5>
* upload it to shacache
* construct download url: ``https://shacache.nxdcdn.com/<SHA512>#<MD5>``
* update the ``boot-image-url-select`` in:
* ``instance-kvm-input-schema.json``
* ``instance-kvm-cluster-input-schema.json``
......@@ -19,15 +19,15 @@ md5sum = 7e90da1f6dac4233e1aa3248f48e357c
[template-kvm]
filename = instance-kvm.cfg.jinja2
md5sum = fb8f9a962cc1c0d986305c6a6ce59082
md5sum = 4a3f999a8d1705c0cabf58d563953d4d
[template-kvm-cluster]
filename = instance-kvm-cluster.cfg.jinja2.in
md5sum = 8562882ac4a888d18db50e2a22e3ca86
md5sum = 406bf455afe1c71cb0e8cc04dd877f1d
[template-kvm-resilient]
filename = instance-kvm-resilient.cfg.jinja2
md5sum = a0fd4911401cbbda74323e8d1c7b18ad
md5sum = 839fc16c112d3b87e2dbd2e382e326de
[template-kvm-import]
filename = instance-kvm-import.cfg.jinja2.in
......@@ -55,7 +55,7 @@ md5sum = a8cf453d20f01c707f02c4b4014580d8
[template-kvm-run]
filename = template/template-kvm-run.in
md5sum = 395ee373ccda3382d257fde1ff4222b0
md5sum = 6c100eec00de5e53f64b075dd69a9865
[template-kvm-controller]
filename = template/kvm-controller-run.in
......@@ -71,7 +71,7 @@ md5sum = 752c91a4a6b72f5cf8226d6b940015f8
[template-qemu-ready]
filename = template/qemu-is-ready.in
md5sum = fb330a796fadb6cd5c85217f80a42af3
md5sum = a97ba5a5afcfd6f6bb9f4e77f37555dd
[template-httpd]
filename = instance-kvm-http.cfg.in
......@@ -79,11 +79,11 @@ md5sum = 438192aab9f11e40dc521b46a4854dcf
[image-download-controller]
filename = template/image-download-controller.py
md5sum = 4d48b3da5bc611fc6533335b5953c840
md5sum = 3cc10323fd4d2db4cfbac536b66eae7c
[image-download-config-creator]
filename = template/image-download-config-creator.py
md5sum = 8fbe05c4175a7f31b6bffced9ad4e91d
md5sum = 22ed19d9b8f7b983c97c52caa686bcd7
[whitelist-firewall-download-controller]
filename = template/whitelist-firewall-download-controller.py
......
......@@ -32,7 +32,6 @@ global-ipv6 = {{ ipv6 }}
{% endfor -%}
[request-common]
recipe = slapos.cookbook:request
software-url = ${slap-connection:software-release-url}
server-url = ${slap-connection:server-url}
key-file = ${slap-connection:key-file}
......@@ -47,6 +46,7 @@ config-use-ipv6 = {{ dumps(slapparameter_dict.get('use-ipv6', False)) }}
{% set use_nat = kvm_parameter_dict.get('use-nat', True) -%}
[{{ section }}]
<= request-common
recipe = slapos.cookbook:request.serialised
software-type = kvm
name = {{ instance_name }}
{% if kvm_parameter_dict.get('sticky-computer', '') -%}
......@@ -319,7 +319,7 @@ private-path-list +=
[publish-connection-information]
<= monitor-publish
-extends = publish-early
recipe = slapos.cookbook:publish
recipe = slapos.cookbook:publish.serialised
{% for name, value in publish_dict.items() -%}
{{ name }} = {{ value }}
{% endfor %}
......
......@@ -204,7 +204,7 @@
"title": "Size of additional disk to create for virtual machine, in Gigabytes",
"description": "Specify the size of additional disk to create for virtual machine in data folder of SlapOS Node. Requires instance_storage_home to be configured on SlapOS Node.",
"type": "integer",
"minimum": 10,
"minimum": 1,
"default": 20
},
"external-disk-format": {
......
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"$schema": "http://json-schema.org/draft-06/schema",
"allOf": [
{
"$ref": "instance-kvm-input-schema.json#/"
"$ref": "./instance-kvm-input-schema.json#"
},
{
"properties": {
......
......@@ -61,6 +61,7 @@ etc = ${buildout:directory}/etc
# Bubble down the parameters of the requested instance to the user
[request-kvm]
recipe = slapos.cookbook:request.serialised
# Note: += doesn't work.
return =
# Resilient related parameters
......
......@@ -6,19 +6,19 @@
{% endif %}
{% endfor %}
{% set additional_frontend = slapparameter_dict.get('frontend-additional-instance-guid') %}
{% set enable_http = str(slapparameter_dict.get('enable-http-server', False)).lower() == 'true' -%}
{% set use_tap = str(slapparameter_dict.get('use-tap', True)).lower() == 'true' -%}
{% set use_nat = str(slapparameter_dict.get('use-nat', True)).lower() == 'true' -%}
{% set wipe_disk = str(slapparameter_dict.get('wipe-disk-ondestroy', False)).lower() == 'true' -%}
{% set nat_restrict = str(slapparameter_dict.get('nat-restrict-mode', False)).lower() == 'true' -%}
{% set enable_http = slapparameter_dict.get('enable-http-server', False) -%}
{% set use_tap = slapparameter_dict.get('use-tap', True) -%}
{% set use_nat = slapparameter_dict.get('use-nat', True) -%}
{% set wipe_disk = slapparameter_dict.get('wipe-disk-ondestroy', False) -%}
{% set nat_restrict = slapparameter_dict.get('nat-restrict-mode', False) -%}
{% set name = slapparameter_dict.get('name', 'localhost') -%}
{% set disable_ansible_promise = str(slapparameter_dict.get('disable-ansible-promise', True)).lower() == 'true' -%}
{% set disable_ansible_promise = slapparameter_dict.get('disable-ansible-promise', True) -%}
{% set instance_type = slapparameter_dict.get('type', 'standalone') -%}
{% set nat_rule_list = slapparameter_dict.get('nat-rules', '22 80 443') -%}
{% set disk_device_path = slapparameter_dict.get('disk-device-path', None) -%}
{% set whitelist_domains = slapparameter_dict.get('whitelist-domains', '') -%}
{% set virtual_hard_drive_url_enabled = 'virtual-hard-drive-url' in slapparameter_dict %}
{% set virtual_hard_drive_url_gzipped = str(slapparameter_dict.get('virtual-hard-drive-gzipped', False)).lower() == 'true' %}
{% set virtual_hard_drive_url_gzipped = slapparameter_dict.get('virtual-hard-drive-gzipped', False) %}
{% set boot_image_url_list_enabled = 'boot-image-url-list' in slapparameter_dict %}
{% set boot_image_url_select_enabled = 'boot-image-url-select' in slapparameter_dict %}
{% set bootstrap_script_url = slapparameter_dict.get('bootstrap-script-url') -%}
......@@ -434,7 +434,7 @@ network-adapter = ${slap-parameter:network-adapter}
pid-file-path = ${kvm-controller-parameter-dict:pid-file}
socket-path = ${kvm-controller-parameter-dict:socket-path}
{%- set enable_device_hotplug = slapparameter_dict.get('enable-device-hotplug', 'false').lower() == 'true' %}
{%- set enable_device_hotplug = slapparameter_dict.get('enable-device-hotplug', False) %}
smp-max-count = {{ cpu_max_count }}
ram-max-size = {{ ram_max_size }}
{%- if enable_device_hotplug %}
......@@ -819,7 +819,7 @@ blank-line =
[publish-connection-information]
<= monitor-publish
recipe = slapos.cookbook:publish
recipe = slapos.cookbook:publish.serialised
ipv6 = ${slap-network-information:global-ipv6}
backend-url = https://[${novnc-instance:ip}]:${novnc-instance:port}/vnc.html?auto=1&encrypt=1&password=${kvm-controller-parameter-dict:vnc-passwd}
url = ${request-slave-frontend:connection-secure_access}/vnc.html?auto=1&encrypt=1&password=${kvm-controller-parameter-dict:vnc-passwd}
......
[buildout]
extends =
software.cfg
[python]
part = python3
......@@ -40,6 +40,9 @@ parts = ${:common-parts}
#XXX-Cedric : add list of keyboard layouts (azerty/us querty/...) parameter to qemu
[python]
part = python3
[python-with-eggs]
recipe = zc.recipe.egg
interpreter = ${:_buildout_section_name_}
......
......@@ -5,6 +5,7 @@
"software-type": {
"default": {
"title": "Default",
"serialisation": "json-in-xml",
"description": "Standalone KVM",
"request": "instance-kvm-input-schema.json",
"response": "instance-kvm-output-schema.json",
......
......@@ -49,6 +49,10 @@ if __name__ == "__main__":
image_list.append({
'md5sum': md5sum,
'url': url,
# Note: The destination here it's the waneted md5sum on purpose, as
# it allows to assume, that correctly downloaded and hashed
# image stored at this filename matches the md5sum, so it does
# not have to be hashed on each download run.
'destination': md5sum,
'destination-tmp': md5sum + '_tmp',
'image-number': '%03i' % (image_number,),
......
......@@ -68,13 +68,17 @@ if __name__ == "__main__":
destination = os.path.join(
config['destination-directory'], image['destination'])
if os.path.exists(destination):
if md5Checksum(destination) == image['md5sum']:
print('INF: %s : already downloaded' % (image['url'],))
continue
else:
print('INF: %s : Removed, as expected checksum does not match %s' % (
image['url'], image['md5sum']))
os.remove(destination)
# Note: There is no need to recheck md5sum here
# The image name is its md5sum, so if it exists, it means it has
# correct md5sum
# Calculating md5sum of big images takes more time than processing
# of the partition and running promises and this leads to endless
# loop of never ending promise failures
# Of course, someone nasty can come to the partition and damage
# this image, but it's another story, and shall not be fixed
# during download phase.
print('INF: %s : already downloaded' % (image['url'],))
continue
# key is str, as the dict is dumped to JSON which does not accept tuples
md5sum_state_key = '%s#%s' % (image['url'], image['md5sum'])
md5sum_state_amount = md5sum_state_dict.get(md5sum_state_key, 0)
......
#!{{ dash }}
FILE="{{ qemu_ready_path }}"
# don't start checks too fast
sleep 2
if [ -f "$FILE" ]; then
if [ "$(cat $FILE)" = "" ]; then
echo "VM correctly started."
......
......@@ -130,7 +130,7 @@ def getMapStorageList(disk_storage_dict, external_disk_number):
# ID are writen in one line: data1 data3 data2 ...
content = mf.readline()
for id in content.split(' '):
if disk_storage_dict.has_key(id):
if id in disk_storage_dict:
id_list.append(id)
else:
# Mean that this disk path has been removed (disk unmounted)
......
This diff is collapsed.
......@@ -13,13 +13,9 @@
# section inheritance (< = ...) are NOT supported (but you should really
# not need these here).
[template-apache-httpd]
filename = apache-httpd.conf.in
md5sum = 9940e05d5e624a7884f4e6e062355798
[template-matomo-instance]
filename = matomo-instance.cfg.in
md5sum = f82fd755c4ca5569836e0638a7502306
md5sum = 9ff98282480b9edf9af75fca5da5f349
[template-matomo-backup.sh]
filename = matomo-backup.sh.in
......
......@@ -5,22 +5,6 @@ dir-backup = ${directory:backup}
find-bin = {{ findutils_location }}
diff-bin = {{ diffutils_location }}
#php.ini parameters
php.memory_limit = 512M
php.date.timezone = Europe/Paris
php.upload_max_filesize = 10240M
php.post_max_size = 10240M
php.session.cookie_secure = True
php.max_execution_time = 1800
php.max_input_time = 3600
php.output_buffering = 'Off'
php.max_file_uploads = 100
[php-bin]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:bin}/php
command-line = ${instance-parameter:php-bin} -c ${php.ini-conf:output}
[matomo-backup-cron]
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
......@@ -28,13 +12,6 @@ name = matomo-backup
frequency = 0 0 * * *
command = ${matomo-backup.sh:output}
[matomo-apache-httpd]
recipe = slapos.recipe.template:jinja2
url = {{ matomo_apache_httpd }}
output = ${directory:apache.d}/matomo.conf
context =
section parameter_dict apache-php-configuration
[matomo-backup.sh]
recipe = slapos.recipe.template:jinja2
url = {{ matomo_backup_sh }}
......@@ -42,6 +19,3 @@ output = ${directory:scripts}/matomo-backup
context =
section parameter_dict instance-parameter
key php_bin php-bin:wrapper-path
[slap-parameter]
instance.cli-url = ${apache-php-configuration:url}
......@@ -12,10 +12,8 @@ parts =
# Call installation of slapos.cookbook egg defined in stack/slapos.cfg (needed
# in 99,9% of Slapos Software Releases)
slapos-cookbook
# to create file instance-matomo.cfg in instance of apache-php
template-matomo-instance
# to create file instance.cfg of all instances
instance
lamp-instance
# download bas
# inherited by modules that need to download files
......@@ -28,12 +26,16 @@ url = ${:_profile_base_location_}/${:filename}
[application]
url = https://builds.matomo.org/matomo-4.7.1.zip
md5sum = 8d592676bc2c0d51363ad7b2caf171fe
archive-root = matomo
# give the location of the instance-matomo.cfg fil
# Without it the instance-matomo.cfg file will not be executed
[custom-application-deployment]
path = ${template-matomo-instance:output}
part-list = matomo-backup.sh matomo-backup-cron matomo-apache-httpd
part-list = matomo-backup.sh matomo-backup-cron
db-name = matomo
db-user = matomo
db-password = 12345678
[template-matomo-instance]
recipe = slapos.recipe.template:jinja2
......@@ -43,16 +45,9 @@ extensions = jinja2.ext.do
context =
key findutils_location findutils:location
key diffutils_location diffutils:location
key gzip_location gzip:location
key python3_location python3:location
key php_location apache-php:location
key matomo_apache_httpd template-apache-httpd:target
key matomo_backup_sh template-matomo-backup.sh:target
# download apache-httpd.conf.in
[template-apache-httpd]
<= matomo-download
# download matomo-backup.sh.in
[template-matomo-backup.sh]
<= matomo-download
......@@ -22,8 +22,8 @@ part = python3
[metabase.jar]
recipe = slapos.recipe.build:download
url = https://downloads.metabase.com/v0.41.4/metabase.jar
md5sum = 9b81838e5c40302b552c66df5a767f8e
url = https://downloads.metabase.com/v0.43.1/metabase.jar
md5sum = 8033ba58825239e7dff29be8d4c885a7
[instance-profile]
recipe = slapos.recipe.template
......
<VirtualHost *:{{ parameter_dict['port'] }}>
ServerAdmin admin@example.com
DocumentRoot {{ parameter_dict['document-root'] }}
SetEnvIf Origin "^http(s)?://(.+\.)?(app\.officejs\.com)$" ORIGIN_DOMAIN=$0
Header always set Access-Control-Allow-Origin "%{ORIGIN_DOMAIN}e" env=ORIGIN_DOMAIN
Header always set Access-Control-Allow-Credentials "true" env=ORIGIN_DOMAIN
Header always set Access-Control-Allow-Methods "PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK, PUT, GETLIB, VERSION-CONTROL, CHECKIN, CHECKOUT, UNCHECKOUT, REPORT, UPDATE, CANCELUPLOAD, HEAD, OPTIONS, GET, POST" env=ORIGIN_DOMAIN
Header always set Access-Control-Allow-Headers "Overwrite, Destination, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control, Authorization" env=ORIGIN_DOMAIN
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
</IfModule>
<Directory {{ parameter_dict['document-root'] }}>
Options +FollowSymlinks
AllowOverride All
Require all granted
SetEnv HOME {{ parameter_dict['document-root'] }}
SetEnv HTTP_HOME {{ parameter_dict['document-root'] }}
<IfModule mod_dav.c>
Dav off
</IfModule>
</Directory>
ErrorLog "{{ parameter_dict['log-dir'] }}/nextcloud-error.log"
CustomLog "{{ parameter_dict['log-dir'] }}/nextcloud-access.log" combined
</VirtualHost>
......@@ -16,14 +16,10 @@
filename = nextcloud-install.sh.in
md5sum = 094c26b177fdde69b41d81b89bab542b
[template-apache-httpd]
filename = apache-httpd.conf.in
md5sum = f7e8f6ea20f8685bb4e42cacaee4116f
[template-nextcloud-config.json]
filename = nextcloud-config.json.in
md5sum = 6f42f0a8c5e5c0c657541a65c4d9ee57
[template-nextcloud-instance]
filename = nextcloud-instance.cfg.in
md5sum = 4426b5e62c61efec2e68e7f548bc6463
md5sum = e144dc4cdc3bd0a9be81ac0cc2cfdbd4
......@@ -55,17 +55,6 @@ cli-url = ${slap-parameter:instance.cli-url}
data-dir = ${nc-directory:data}
redis-socket = ${service-redis:unixsocket}
#php.ini parameters
php.memory_limit = 512M
php.date.timezone = Europe/Paris
php.upload_max_filesize = 10240M
php.post_max_size = 10240M
php.session.cookie_secure = True
php.max_execution_time = 1800
php.max_input_time = 3600
php.output_buffering = 'Off'
php.max_file_uploads = 100
#SMTP settings
mail.from = ${slap-parameter:instance.mail-from}
mail.domain = ${slap-parameter:instance.mail-domain}
......@@ -93,7 +82,6 @@ depends =
${redis-promise:recipe}
${nextcloud-cron:recipe}
${nextcloud-optimize:recipe}
${nextcloud-apache-httpd:recipe}
${nextcloud-backup-cron:recipe}
${nextcloud-news-updater:recipe}
${nextcloud-config-update:recipe}
......@@ -120,13 +108,6 @@ input = inline:#!/bin/bash
output = ${directory:bin}/check-nc-install
mode = 744
[nextcloud-apache-httpd]
recipe = slapos.recipe.template:jinja2
url = {{ nextcloud_apache_httpd }}
output = ${directory:apache.d}/nextcloud.conf
context =
section parameter_dict apache-php-configuration
[nextcloud-cron]
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
......@@ -199,11 +180,6 @@ input = inline:#!/bin/sh
${php-bin:wrapper-path} ${instance-parameter:nextcloud}/occ config:import ${nextcloud-config.json:output}
mode = 744
[php-bin]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:bin}/php
command-line = ${instance-parameter:php-bin} -c ${php.ini-conf:output}
[publish-connection-information]
admin-user = ${instance-parameter:admin-user}
admin-password = ${instance-parameter:admin-password}
......
......@@ -12,10 +12,7 @@ url = ${:_profile_base_location_}/${:filename}
url = https://download.nextcloud.com/server/releases/nextcloud-16.0.3.tar.bz2
md5sum = d81902d2dec5d547779bec6336a438be
[template-nextcloud-install.sh]
<= nc-download
[template-apache-httpd]
[template-nextcloud-install.sh]
<= nc-download
[template-nextcloud-config.json]
......@@ -26,7 +23,7 @@ recipe = slapos.recipe.template:jinja2
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance-nextcloud.cfg
extensions = jinja2.ext.do
context =
context =
key gzip_location gzip:location
key python3_location python3:location
key news_updater_location news-updater:location
......@@ -34,13 +31,15 @@ context =
raw redis_bin ${redis:location}/bin/redis-server
raw redis_cli ${redis:location}/bin/redis-cli
key nextcloud_install_sh template-nextcloud-install.sh:target
key nextcloud_apache_httpd template-apache-httpd:target
key nextcloud_parameter_json template-nextcloud-config.json:target
section nextcloud_apps nextcloud-apps
[custom-application-deployment]
path = ${template-nextcloud-instance:output}
part-list = nextcloud-install.sh
db-name = nextcloud
db-user = nextcloud
db-password = insecure
[nc-download-unpacked]
recipe = slapos.recipe.build:download-unpacked
......
......@@ -44,11 +44,11 @@ md5sum = d33163012d6c98efc59161974c649557
[enb.jinja2.cfg]
filename = config/enb.jinja2.cfg
md5sum = 890642570bb905033d88c8ef7426850b
md5sum = aeb1e8ff149db6ecaf2734cf7dc326aa
[gnb.jinja2.cfg]
filename = config/gnb.jinja2.cfg
md5sum = f90764f76dcc707da55aa91db847d2bb
md5sum = 2830e108184cca7740e5373e9bc4920a
[ltelogs.jinja2.sh]
filename = ltelogs.jinja2.sh
......@@ -64,7 +64,7 @@ md5sum = e561ec26a70943c61557def1781cf65f
[sdr-busy-promise]
_update_hash_filename_ = promise/check_sdr_busy.py
md5sum = 9e867282d7dd80c4255e87a82a47a19d
md5sum = f7436ff76fea58e37a401d4712275422
[interface-up-promise]
_update_hash_filename_ = promise/check_interface_up.py
......
......@@ -23,7 +23,7 @@
- 'max_size': set the maximum size of the hex dump. 0 means no
hex dump. -1 means no limit.
*/
log_options: "all.level=info,all.max_size=32,file.rotate=1G,file.path={{ directory['tmp'] }}",
log_options: "all.level=debug,all.max_size=32,file.rotate=1G,file.path={{ directory['tmp'] }}",
log_filename: "{{ directory['log'] }}/enb.log",
/* Enable remote API and Web interface */
......
......@@ -17,7 +17,7 @@
#define USE_SRS 0
{
log_options: "all.level=info,all.max_size=32,file.rotate=1G,file.path={{ directory['tmp'] }}",
log_options: "all.level=debug,all.max_size=32,file.rotate=1G,file.path={{ directory['tmp'] }}",
log_filename: "{{ directory['log'] }}/gnb.log",
/* Enable remote API and Web interface */
......
......@@ -7,13 +7,13 @@
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 70
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 30
"default": 40
},
"dl_earfcn": {
"title": "DL EARFCN",
......@@ -40,4 +40,4 @@
"default": "0x1A2D0"
}
}
}
\ No newline at end of file
}
......@@ -7,13 +7,13 @@
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 70
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 30
"default": 40
},
"dl_earfcn": {
"title": "DL EARFCN",
......@@ -40,4 +40,4 @@
"default": "0x1A2D0"
}
}
}
\ No newline at end of file
}
......@@ -7,13 +7,13 @@
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 70
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 50
"default": 40
},
"dl_nr_arfcn": {
"title": "DL NR ARFCN",
......@@ -52,4 +52,4 @@
"default": 1000
}
}
}
\ No newline at end of file
}
......@@ -7,13 +7,13 @@
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 70
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 50
"default": 40
},
"dl_nr_arfcn": {
"title": "DL NR ARFCN",
......@@ -52,4 +52,4 @@
"default": 1000
}
}
}
\ No newline at end of file
}
......@@ -7,13 +7,13 @@
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 70
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 30
"default": 40
},
"dl_earfcn": {
"title": "DL EARFCN",
......@@ -40,4 +40,4 @@
"default": "0x1A2D0"
}
}
}
\ No newline at end of file
}
......@@ -7,13 +7,13 @@
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 70
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 30
"default": 40
},
"dl_earfcn": {
"title": "DL EARFCN",
......@@ -40,4 +40,4 @@
"default": "0x1A2D0"
}
}
}
\ No newline at end of file
}
......@@ -7,13 +7,13 @@
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 70
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 50
"default": 40
},
"dl_nr_arfcn": {
"title": "DL NR ARFCN",
......@@ -52,4 +52,4 @@
"default": 10000000
}
}
}
\ No newline at end of file
}
......@@ -7,13 +7,13 @@
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 70
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 50
"default": 40
},
"dl_nr_arfcn": {
"title": "DL NR ARFCN",
......@@ -52,4 +52,4 @@
"default": 10000000
}
}
}
\ No newline at end of file
}
......@@ -7,13 +7,13 @@
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 70
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 30
"default": 40
},
"dl_earfcn": {
"title": "DL EARFCN",
......@@ -40,4 +40,4 @@
"default": "0x1A2D0"
}
}
}
\ No newline at end of file
}
......@@ -7,13 +7,13 @@
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 70
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 30
"default": 40
},
"dl_earfcn": {
"title": "DL EARFCN",
......@@ -40,4 +40,4 @@
"default": "0x1A2D0"
}
}
}
\ No newline at end of file
}
......@@ -7,13 +7,13 @@
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 70
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 50
"default": 40
},
"dl_nr_arfcn": {
"title": "DL NR ARFCN",
......@@ -52,4 +52,4 @@
"default": 10000000
}
}
}
\ No newline at end of file
}
......@@ -7,13 +7,13 @@
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 70
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 50
"default": 40
},
"dl_nr_arfcn": {
"title": "DL NR ARFCN",
......@@ -52,4 +52,4 @@
"default": 10000000
}
}
}
\ No newline at end of file
}
......@@ -7,13 +7,13 @@
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 70
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 30
"default": 40
},
"dl_earfcn": {
"title": "DL EARFCN",
......@@ -40,4 +40,4 @@
"default": "0x1A2D0"
}
}
}
\ No newline at end of file
}
......@@ -7,13 +7,13 @@
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 70
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 30
"default": 40
},
"dl_earfcn": {
"title": "DL EARFCN",
......@@ -40,4 +40,4 @@
"default": "0x1A2D0"
}
}
}
\ No newline at end of file
}
......@@ -7,13 +7,13 @@
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 70
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 50
"default": 40
},
"dl_nr_arfcn": {
"title": "DL NR ARFCN",
......@@ -52,4 +52,4 @@
"default": 10000000
}
}
}
\ No newline at end of file
}
......@@ -7,13 +7,13 @@
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 70
"default": 78
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 50
"default": 40
},
"dl_nr_arfcn": {
"title": "DL NR ARFCN",
......@@ -52,4 +52,4 @@
"default": 10000000
}
}
}
\ No newline at end of file
}
......@@ -17,7 +17,7 @@ class RunPromise(GenericPromise):
Sets the configuration and the periodicity.
"""
super(RunPromise, self).__init__(config)
self.setPeriodicity(minute=2)
self.setPeriodicity(minute=1)
def sense(self):
......@@ -53,4 +53,4 @@ class RunPromise(GenericPromise):
In this case, fail if two out of the last three results are negative.
"""
return self._anomaly(result_count=3, failure_amount=2)
return self._anomaly(result_count=1, failure_amount=1)
......@@ -5,12 +5,12 @@ import os
# Values: 6 (1.4 MHz), 15 (3MHz), 25 (5MHz), 50 (10MHz), 75 (15MHz), 100 (20MHz)
LTE_N_RB_DL=100
LTE_TX_GAIN=70
LTE_RX_GAIN=30
LTE_TX_GAIN=78
LTE_RX_GAIN=40
NR_BANDWIDTH=40
NR_TX_GAIN=70
NR_RX_GAIN=50
NR_TX_GAIN=78
NR_RX_GAIN=40
global_context = {
'generated_file_message': "This file was generated using a jinja2 template and the render-templates script, don't modify directly."
......
......@@ -8,15 +8,15 @@ default-dl-earfcn = 38350
default-lte-dl-freq = 1890.0
default-lte-band = 39
default-lte-n-rb-dl = 100
default-lte-tx-gain = 70
default-lte-rx-gain = 30
default-lte-tx-gain = 78
default-lte-rx-gain = 40
default-dl-nr-arfcn = 378000
default-nr-band = 39
default-nr-dl-freq = 1890.0
default-nr-bandwidth = 40
default-nr-tx-gain = 70
default-nr-rx-gain = 50
default-nr-tx-gain = 78
default-nr-rx-gain = 40
default-nr-ssb-pos-bitmap = 1000
min-frequency = 1880.0
......
......@@ -8,15 +8,15 @@ default-dl-earfcn = 38050
default-lte-dl-freq = 2600.0
default-lte-band = 38
default-lte-n-rb-dl = 100
default-lte-tx-gain = 70
default-lte-rx-gain = 30
default-lte-tx-gain = 78
default-lte-rx-gain = 40
default-dl-nr-arfcn = 520000
default-nr-band = 38
default-nr-dl-freq = 2600.0
default-nr-bandwidth = 40
default-nr-tx-gain = 70
default-nr-rx-gain = 50
default-nr-tx-gain = 78
default-nr-rx-gain = 40
default-nr-ssb-pos-bitmap = 10000000
min-frequency = 2570
......
......@@ -8,15 +8,15 @@ default-dl-earfcn = 42590
default-lte-dl-freq = 3500.0
default-lte-band = 42
default-lte-n-rb-dl = 100
default-lte-tx-gain = 70
default-lte-rx-gain = 30
default-lte-tx-gain = 78
default-lte-rx-gain = 40
default-dl-nr-arfcn = 632628
default-nr-band = 78
default-nr-dl-freq = 3489.42
default-nr-bandwidth = 40
default-nr-tx-gain = 70
default-nr-rx-gain = 50
default-nr-tx-gain = 78
default-nr-rx-gain = 40
default-nr-ssb-pos-bitmap = 10000000
min-frequency = 3400
......
......@@ -8,15 +8,15 @@ default-dl-earfcn = 44590
default-lte-dl-freq = 3700.0
default-lte-band = 43
default-lte-n-rb-dl = 100
default-lte-tx-gain = 70
default-lte-rx-gain = 30
default-lte-tx-gain = 78
default-lte-rx-gain = 40
default-dl-nr-arfcn = 646666
default-nr-band = 78
default-nr-dl-freq = 3699.99
default-nr-bandwidth = 40
default-nr-tx-gain = 70
default-nr-rx-gain = 50
default-nr-tx-gain = 78
default-nr-rx-gain = 40
default-nr-ssb-pos-bitmap = 10000000
min-frequency = 3600
......
......@@ -19,6 +19,7 @@ extra =
helloworld ${slapos.test.helloworld-setup:setup}
hugo ${slapos.test.hugo-setup:setup}
jupyter ${slapos.test.jupyter-setup:setup}
kvm ${slapos.test.kvm-setup:setup}
matomo ${slapos.test.matomo-setup:setup}
monitor ${slapos.test.monitor-setup:setup}
nextcloud ${slapos.test.nextcloud-setup:setup}
......
......@@ -350,7 +350,6 @@ tests =
# here, to check there's no promise issue when slapos node runs with Python 2.
erp5 ${slapos.test.erp5-setup:setup}
fluentd ${slapos.test.fluentd-setup:setup}
kvm ${slapos.test.kvm-setup:setup}
metabase ${slapos.test.metabase-setup:setup}
###
${:extra}
......
......@@ -15,4 +15,4 @@
[template]
filename = instance.cfg
md5sum = 850dedff7af48a70208361cabf688724
md5sum = 3112bf86fa543df52548a551f5413f99
......@@ -47,6 +47,10 @@ output = $${caucase:location}/host_setting.sh
<= download-source
repository = ${slapos.libnetworkcache-repository:location}
[slapcache]
<= download-source
repository = ${slapcache-repository:location}
[erp5.util]
<= download-source
repository = ${erp5.util-repository:location}
......@@ -177,6 +181,12 @@ inline =
cwd="""$${slapos.libnetworkcache:location}""",
summaryf=UnitTest.summary,
)
TestCase(
"slapcache",
['python', '-m', 'unittest', 'discover', '-v', '--start', 'slapcache/test'],
cwd="""$${slapcache:location}""",
summaryf=UnitTest.summary,
)
TestCase(
"slapos.rebootstrap",
['python', '-m', 'unittest', '-v', 'slapos.rebootstrap.tests.test_suite'],
......
......@@ -55,6 +55,11 @@ depends = ${caucase-setup:egg}
egg = slapos.libnetworkcache
setup = ${slapos.libnetworkcache-repository:location}
[slapcache-setup]
<= setup-develop-egg
egg = slapcache
setup = ${slapcache-repository:location}
[erp5.util-setup]
<= setup-develop-egg
# XXX erp5.util does not have `test` extra require, but has a `testnode` extra require with same dependencies
......@@ -132,6 +137,7 @@ eggs +=
${slapos.recipe.template-setup:egg}
${slapos.toolbox-setup:egg}
${slapos.libnetworkcache-setup:egg}
${slapcache-setup:egg}
${slapos.rebootstrap-setup:egg}
${rubygemsrecipe-setup:egg}
zope.testing
......@@ -178,6 +184,10 @@ repository = https://lab.nexedi.com/nexedi/slapos.recipe.template.git
<= git-clone-repository
repository = https://lab.nexedi.com/nexedi/slapos.libnetworkcache.git
[slapcache-repository]
<= git-clone-repository
repository = https://lab.nexedi.com/nexedi/slapcache.git
[slapos.recipe.build-repository]
<= git-clone-repository
repository = https://lab.nexedi.com/nexedi/slapos.recipe.build.git
......@@ -249,3 +259,4 @@ zope.testing = 4.6.2
urllib3 = 1.24.1
pathlib = 1.0.1
psycopg2 = 2.8.6
iniparse = 0.5
# Theia software release
Theia is a cloud (and desktop) IDE https://www.theia-ide.org
This version comes pre-configured with a few plugins, but does not come with python plugin, to let
you choose between theia and vscode one.
## jedi
[jedi](https://github.com/davidhalter/jedi) which is used by both thiea and vscode python plugins has
some support for `zc.buildout`. It looks up for a `buildout.cfg` file and if found will load all scripts
from the bin directory from this buildout to add eggs to sys.path. In webrunner we have almost 100 scripts
in bin directory, with maybe 30 eggs in each scripts, so this makes jedi so slow it's unusable. Also, if
an error occurs parsing these scripts, jedi won't be usable. This issue is tracked in
https://github.com/davidhalter/jedi/issues/1325
A simple workaround is to create and empty `buildout.cfg` file at the root of project folder.
......@@ -15,7 +15,7 @@
[instance-theia]
_update_hash_filename_ = instance-theia.cfg.jinja.in
md5sum = 7d146ca31d7e44e909386e21e0a562ec
md5sum = f1b06742154b97d4173dd11e0949569d
[instance]
_update_hash_filename_ = instance.cfg.in
......
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$schema": "http://json-schema.org/draft-06/schema",
"type": "object",
"description": "Parameters to instantiate Theia",
"additionalProperties": false,
"properties": {
"autorun": {
"title": "Automatically Run Sofware/Instance",
"title": "Automatically Run Software/Instance",
"description": "The option used to pilot automatic build and run of software and instances hosted inside Theia. When 'running', build and run is done automatically in the background. When 'stopped' build and run processes are stopped and need to be run manually. When 'user-controlled', the user can manage it directly in the local supervisord. ",
"type": "string",
"enum": [
......@@ -19,6 +19,7 @@
"title": "Initial Embedded Instance Configuration",
"description": "One-shot optional JSON preconfiguration for an embedded instance. Only applied once when Theia is instantiated. Changing this option afterward will have no effect.",
"type": "string",
"textarea": true,
"examples": [
"{\"software-url\": \"~/srv/project/slapos/software/html5as-base/software.cfg\"}",
"{\"software-url\": \"~/srv/project/slapos/software/html5as/software.cfg\", \"software-type\": \"replicate\", \"instance-parameters\": {\"replicate-quantity\": 3}}"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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