Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Paul Graydon
slapos
Commits
cbcf3c5a
Commit
cbcf3c5a
authored
Dec 02, 2020
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Plain Diff
Update Release Candidate
parents
93c3563a
1d57188a
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
245 additions
and
447 deletions
+245
-447
component/gcc/buildout.cfg
component/gcc/buildout.cfg
+1
-0
component/gcc/glibc2.30-ipc_perm.patch
component/gcc/glibc2.30-ipc_perm.patch
+12
-0
component/openblas/buildout.cfg
component/openblas/buildout.cfg
+3
-7
component/openblas/disable_openmp_if_single_core.patch
component/openblas/disable_openmp_if_single_core.patch
+0
-12
component/pygolang/buildout.cfg
component/pygolang/buildout.cfg
+2
-14
setup.py
setup.py
+1
-4
slapos/recipe/README.libcloud.rst
slapos/recipe/README.libcloud.rst
+0
-4
slapos/recipe/libcloud/__init__.py
slapos/recipe/libcloud/__init__.py
+0
-127
slapos/recipe/libcloud/run.py
slapos/recipe/libcloud/run.py
+0
-6
slapos/recipe/libcloud/template/cloudmgr.cnf.in
slapos/recipe/libcloud/template/cloudmgr.cnf.in
+0
-1
slapos/recipe/libcloudrequest.py
slapos/recipe/libcloudrequest.py
+0
-14
slapos/recipe/siptester/__init__.py
slapos/recipe/siptester/__init__.py
+0
-51
slapos/recipe/siptester/template/init_caller.in
slapos/recipe/siptester/template/init_caller.in
+0
-4
slapos/recipe/siptester/template/init_receiver.in
slapos/recipe/siptester/template/init_receiver.in
+0
-4
slapos/recipe/siptester/template/pjsua_caller.conf.in
slapos/recipe/siptester/template/pjsua_caller.conf.in
+0
-33
slapos/recipe/siptester/template/pjsua_receiver.conf.in
slapos/recipe/siptester/template/pjsua_receiver.conf.in
+0
-35
slapos/recipe/zero_knowledge.py
slapos/recipe/zero_knowledge.py
+4
-4
slapos/test/recipe/test_zero_knowledge.py
slapos/test/recipe/test_zero_knowledge.py
+45
-0
software/slapos-sr-testing/README.md
software/slapos-sr-testing/README.md
+1
-1
software/slapos-sr-testing/software-py3.cfg
software/slapos-sr-testing/software-py3.cfg
+2
-2
software/slapos-sr-testing/software.cfg
software/slapos-sr-testing/software.cfg
+5
-6
software/theia/test/test.py
software/theia/test/test.py
+2
-2
software/turnserver/buildout.hash.cfg
software/turnserver/buildout.hash.cfg
+6
-2
software/turnserver/instance-insecure-turnserver.cfg.jinja2.in
...are/turnserver/instance-insecure-turnserver.cfg.jinja2.in
+91
-0
software/turnserver/instance-turnserver.cfg.jinja2.in
software/turnserver/instance-turnserver.cfg.jinja2.in
+1
-0
software/turnserver/instance.cfg.in
software/turnserver/instance.cfg.in
+8
-0
software/turnserver/software.cfg
software/turnserver/software.cfg
+3
-0
software/turnserver/test/test.py
software/turnserver/test/test.py
+58
-0
software/unstable/libcloud-requester/instance.cfg
software/unstable/libcloud-requester/instance.cfg
+0
-19
software/unstable/libcloud-requester/software.cfg
software/unstable/libcloud-requester/software.cfg
+0
-31
software/unstable/libcloud/instance.cfg
software/unstable/libcloud/instance.cfg
+0
-21
software/unstable/libcloud/software.cfg
software/unstable/libcloud/software.cfg
+0
-43
No files found.
component/gcc/buildout.cfg
View file @
cbcf3c5a
...
...
@@ -64,6 +64,7 @@ patch-binary = ${patch:location}/bin/patch
patch-options = -p1
patches =
${:_profile_base_location_}/libsanitizer_Use_pre-computed_size_of_struct_ustat_for_Linux.patch#1e5f33e89f9fe1ca3e406eabcc621762
${:_profile_base_location_}/glibc2.30-ipc_perm.patch#563b7f5a38c2ea6bf741c328422b4c98
[gcc-8.4]
<= gcc-common
...
...
component/gcc/glibc2.30-ipc_perm.patch
0 → 100644
View file @
cbcf3c5a
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h 2020-02-28 11:49:29.763277856 +0000
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h 2020-02-28 11:49:45.092909823 +0000
@@ -198,8 +198,7 @@
unsigned long long __unused1;
unsigned long long __unused2;
#else
- unsigned short mode;
- unsigned short __pad1;
+ unsigned int mode;
unsigned short __seq;
unsigned short __pad2;
#if defined(__x86_64__) && !defined(_LP64)
component/openblas/buildout.cfg
View file @
cbcf3c5a
[buildout]
extends =
../patch/buildout.cfg
../perl/buildout.cfg
parts =
...
...
@@ -9,11 +8,8 @@ parts =
[openblas]
recipe = slapos.recipe.cmmi
shared = true
url = http://github.com/xianyi/OpenBLAS/archive/v0.2.18.tar.gz
md5sum = 805e7f660877d588ea7e3792cda2ee65
patch-options = -p0
patches =
${:_profile_base_location_}/disable_openmp_if_single_core.patch#ee553ccaf9dd4bc37374588e49956f62
url = https://github.com/xianyi/OpenBLAS/archive/v0.3.10.tar.gz
md5sum = 4727a1333a380b67c8d7c7787a3d9c9a
build-common-options = NO_STATIC=1 USE_OPENMP=1 USE_THREAD=1 DYNAMIC_ARCH=1
...
...
@@ -35,4 +31,4 @@ make-options =
make-targets =
PREFIX="@@LOCATION@@" install
environment =
PATH=
${patch:location}/bin:$
{perl:location}/bin:%(PATH)s
PATH={perl:location}/bin:%(PATH)s
component/openblas/disable_openmp_if_single_core.patch
deleted
100644 → 0
View file @
93c3563a
diff --git Makefile.system Makefile.system
index 42ad498..d43aa7a 100644
--- Makefile.system
+++ Makefile.system
@@ -171,6 +171,7 @@
endif
ifeq ($(NUM_THREADS), 1)
override USE_THREAD = 0
+override USE_OPENMP = 0
endif
ifdef USE_THREAD
component/pygolang/buildout.cfg
View file @
cbcf3c5a
...
...
@@ -37,21 +37,9 @@ interpreter = python
# interpreter code that buildout generates cannot process `-m pytest --<pytest-option>`
# -> use pymain from gpython to workaround that.
initialization =
# minimal support for -O argument.
if '-O' in sys.argv:
import os
with open(sys.argv[0]) as f:
executable = f.readlines()[0][2:-1]
sys.argv.remove('-O')
os.execve(executable, sys.argv, dict(os.environ, PYTHONOPTIMIZE='1'))
# set sys.executable to self, so that subprocess and friends go through us
# and this way spawn children with correct sys.path where all eggs that
# parent have are present. TODO consider migrating this into pymain
sys.executable = sys.argv[0]
# tail to pymain
from gpython import pymain
pymain(sys.argv
[1:]
)
pymain(sys.argv)
sys.exit(0)
# don't install scripts from listed eggs (avoid conflict with other sections
# that use zc.recipe.egg with eggs overlapping with ${:eggs} - ex neoppod)
...
...
@@ -62,4 +50,4 @@ scripts = ${:interpreter}
[versions]
pygolang = 0.0.
7.post1
pygolang = 0.0.
8
setup.py
View file @
cbcf3c5a
...
...
@@ -28,7 +28,7 @@ from setuptools import setup, find_packages
import
glob
import
os
version
=
'1.0.1
67
'
version
=
'1.0.1
71
'
name
=
'slapos.cookbook'
long_description
=
open
(
"README.rst"
).
read
()
...
...
@@ -116,8 +116,6 @@ setup(name=name,
'ipv6toipv4 = slapos.recipe.6tunnel:SixToFour'
,
'jsondump = slapos.recipe.jsondump:Recipe'
,
'kvm.frontend = slapos.recipe.kvm_frontend:Recipe'
,
'libcloud = slapos.recipe.libcloud:Recipe'
,
'libcloudrequest = slapos.recipe.libcloudrequest:Recipe'
,
'logrotate = slapos.recipe.logrotate:Recipe'
,
'logrotate.d = slapos.recipe.logrotate:Part'
,
'mkdirectory = slapos.recipe.mkdirectory:Recipe'
,
...
...
@@ -159,7 +157,6 @@ setup(name=name,
'signalwrapper= slapos.recipe.signal_wrapper:Recipe'
,
'simplelogger = slapos.recipe.simplelogger:Recipe'
,
'simplehttpserver = slapos.recipe.simplehttpserver:Recipe'
,
'siptester = slapos.recipe.siptester:SipTesterRecipe'
,
'slapconfiguration = slapos.recipe.slapconfiguration:Recipe'
,
'slapconfiguration.serialised = slapos.recipe.slapconfiguration:Serialised'
,
'slapconfiguration.jsondump = slapos.recipe.slapconfiguration:JsonDump'
,
...
...
slapos/recipe/README.libcloud.rst
deleted
100644 → 0
View file @
93c3563a
libcloud
========
Slapified recipe to interact with any libcloud supported IaaS system
slapos/recipe/libcloud/__init__.py
deleted
100644 → 0
View file @
93c3563a
from
slapos.recipe.librecipe
import
BaseSlapRecipe
import
os
import
sys
import
zc.buildout
import
zc.recipe.egg
from
slapos.slap.slap
import
ServerError
from
slapos.tool.cloudmgr.cloudinterface
import
NodeInterface
from
pprint
import
pformat
class
SlavePartitionError
(
Exception
):
pass
class
Recipe
(
BaseSlapRecipe
):
SECURITY_GROUP_NAME
=
'VifibEC2Security'
def
__init__
(
self
,
buildout
,
name
,
options
):
BaseSlapRecipe
.
__init__
(
self
,
buildout
,
name
,
options
)
self
.
destroy_wrapper_location
=
os
.
path
.
join
(
self
.
bin_directory
,
'destroy'
)
self
.
running_wrapper_location
=
os
.
path
.
join
(
self
.
bin_directory
,
'run'
)
# wrapper parts
options
[
'scripts'
]
=
'''
run
destroy
'''
options
[
'entry-points'
]
=
'''
run=slapos.recipe.libcloud.run:run
destroy=slapos.recipe.libcloud.destroy:destroy
'''
self
.
egg
=
zc
.
recipe
.
egg
.
Egg
(
buildout
,
''
,
options
)
self
.
configuration_file
=
os
.
path
.
join
(
self
.
etc_directory
,
'cloudmgr.cnf'
)
def
_loadSecretAndKey
(
self
):
"""Loads security parameters for connection"""
self
.
secret
=
open
(
os
.
path
.
join
(
self
.
work_directory
,
'secret.txt'
)
).
read
().
strip
()
self
.
key
=
open
(
os
.
path
.
join
(
self
.
work_directory
,
'key.txt'
)
).
read
().
strip
()
def
_updateConfigurationFile
(
self
):
configuration_dict
=
dict
(
key
=
self
.
key
,
secret
=
self
.
secret
,
node_list
=
self
.
slave_partition_configuration_dict_list
)
self
.
_writeFile
(
self
.
configuration_file
,
pformat
(
configuration_dict
))
def
_install
(
self
):
"""libcloud compatible machine is installed by creating wrapper, which
will run succesfully as long as the machine is available.
"""
self
.
_loadSecretAndKey
()
self
.
slave_partition_configuration_dict_list
=
[]
self
.
egg
.
extra_paths
=
sys
.
path
for
slave_partition
in
[
self
.
slap
.
registerComputerPartition
(
self
.
computer_id
,
slave_id
)
for
slave_id
in
self
.
computer_partition
\
.
getInstanceParameterDict
()[
'slave_id_list'
]]:
try
:
self
.
slave_partition_configuration_dict_list
.
append
(
self
.
_installSlavePartition
(
slave_partition
))
except
SlavePartitionError
as
e
:
self
.
logger
.
warning
(
'Slave Parttion %r not installed, issue: %r'
%
(
slave_partition
.
getId
(),
e
))
# Installs wrappers
self
.
_updateConfigurationFile
()
self
.
options
[
'arguments'
]
=
"server_binary = %r, configuration_file = %r"
%
(
self
.
options
[
'server_binary'
],
self
.
configuration_file
)
self
.
egg
.
install
()
os
.
chmod
(
os
.
path
.
join
(
self
.
running_wrapper_location
),
int
(
'0700'
,
8
))
os
.
chmod
(
os
.
path
.
join
(
self
.
destroy_wrapper_location
),
int
(
'0700'
,
8
))
return
[]
def
_installSlavePartition
(
self
,
slave_partition
):
requested_dict
=
slave_partition
.
getInstanceParameterDict
()
requested_dict
.
setdefault
(
'service'
,
'EC2_EU_WEST'
)
requested_dict
.
setdefault
(
'location'
,
'0'
)
requested_dict
.
setdefault
(
'image'
,
'ami-05cae171'
)
requested_dict
.
setdefault
(
'size'
,
'm1.smal'
)
requested_dict
.
setdefault
(
'security_group'
,
'VifibEC2Security'
)
connection_dict
=
slave_partition
.
getConnectionDict
()
node_kw
=
dict
(
key
=
self
.
key
,
secret
=
self
.
secret
,
service
=
requested_dict
[
'service'
],
location
=
requested_dict
[
'location'
],
node_uuid
=
connection_dict
.
get
(
'node_uuid'
,
None
),
ssh_key
=
connection_dict
.
get
(
'ssh_key'
,
None
)
)
node
=
NodeInterface
(
**
node_kw
)
update_kw
=
dict
(
image
=
requested_dict
[
'image'
],
size
=
requested_dict
[
'size'
],
security_group
=
requested_dict
[
'security_group'
],
)
self
.
logger
.
info
(
'Updating %r'
%
slave_partition
.
getId
())
connection_dict
.
update
(
node
.
update
(
**
update_kw
))
self
.
logger
.
info
(
'Fetching public ip of %r'
%
slave_partition
.
getId
())
connection_dict
.
update
(
node
.
getPublicIpList
())
slave_partition
.
available
()
connection_dict
.
setdefault
(
'username'
,
'root'
)
slave_partition
.
setConnectionDict
(
connection_dict
)
requested_dict
.
update
(
connection_dict
)
slave_partition_state
=
slave_partition
.
getState
()
# as cloudmgr is not related with slap and runs as async process to recipe
# assume that whatever came from slave is correctly done
if
slave_partition_state
in
[
'started'
,
'stopped'
]:
# stopped cannot be supported, because in case of libcloud it is equal
# to destroyed
# even worse: stopped is the first state for installed partition
try
:
getattr
(
slave_partition
,
slave_partition_state
)()
except
ServerError
:
# Recipe is becoming responsible for system state, so it have to
# not die in case of slap server error
pass
requested_dict
[
'requested_state'
]
=
'started'
elif
slave_partition_state
==
'destroyed'
:
requested_dict
[
'requested_state'
]
=
slave_partition_state
try
:
slave_partition
.
destroyed
()
except
ServerError
:
# Recipe is becoming responsible for system state, so it have to
# not die in case of slap server error
pass
return
requested_dict
slapos/recipe/libcloud/run.py
deleted
100644 → 0
View file @
93c3563a
from
os
import
execl
import
sys
def
run
(
server_binary
,
configuration_file
):
sys
.
stdout
.
flush
()
execl
(
server_binary
,
server_binary
,
configuration_file
)
slapos/recipe/libcloud/template/cloudmgr.cnf.in
deleted
100644 → 0
View file @
93c3563a
slapos/recipe/libcloudrequest.py
deleted
100644 → 0
View file @
93c3563a
from
slapos.recipe.librecipe
import
BaseSlapRecipe
import
zc.buildout
class
Recipe
(
BaseSlapRecipe
):
def
_install
(
self
):
amazon
=
self
.
request
(
'https://svn.erp5.org/repos/public/slapos/trunk/software_release/libcloud/software.cfg'
,
'Amazon EC Image'
,
'Amazon EC Connector Partition'
,
True
)
amazon_dict
=
amazon
.
getConnectionDict
()
if
amazon_dict
==
{}:
raise
zc
.
buildout
.
UserError
(
'Slave not installed yet'
)
self
.
computer_partition
.
setConnectionDict
(
amazon
.
getConnectionDict
())
return
[]
slapos/recipe/siptester/__init__.py
deleted
100644 → 0
View file @
93c3563a
import
os
import
pkg_resources
from
slapos.recipe.librecipe
import
BaseSlapRecipe
class
SipTesterRecipe
(
BaseSlapRecipe
):
def
__init__
(
self
,
buildout
,
name
,
options
):
BaseSlapRecipe
.
__init__
(
self
,
buildout
,
name
,
options
)
self
.
pjsua_configuration_file
=
os
.
path
.
join
(
self
.
etc_directory
,
'pjsua.conf'
)
def
_createPJSUAConfiguration
(
self
,
template_name
):
pjsua_input
=
pkg_resources
.
resource_string
(
__name__
,
os
.
path
.
join
(
'template'
,
template_name
))
if
self
.
_writeFile
(
self
.
pjsua_configuration_file
,
pjsua_input
%
self
.
options
):
# XXX: How to inform slap/slapgrid that something changed and it might
# be not bad idea to restart CP?
pass
return
self
.
pjsua_configuration_file
def
_install
(
self
):
path
=
self
.
_createPJSUAConfiguration
(
self
.
config_template
)
d
=
{}
d
.
update
(
self
.
options
)
d
[
'pjsua_configuration_file'
]
=
self
.
pjsua_configuration_file
# XXX Hardcoded path
d
[
'pjsua_binary'
]
=
os
.
path
.
join
(
self
.
buildout
[
'software_definition'
][
'software_home'
].
strip
(),
'parts'
,
'pjproject-1.7'
,
'bin'
,
'pjsua'
)
d
[
'siptester_binary'
]
=
os
.
path
.
join
(
self
.
buildout
[
'software_definition'
][
'software_home'
].
strip
(),
'bin'
,
'siptester'
)
self
.
running_wrapper_location
=
pkg_resources
.
resource_filename
(
__name__
,
os
.
path
.
join
(
'template'
,
self
.
wrapper_template
))
self
.
_createRunningWrapper
(
d
)
return
[
path
,
wrapper_path
]
update
=
install
class
ReceiverRecipe
(
SipTesterRecipe
):
config_template
=
"pjsua_receiver.conf.in"
wrapper_template
=
"init_receiver.in"
class
CallerRecipe
(
SipTesterRecipe
):
config_template
=
"pjsua_caller.conf.in"
wrapper_template
=
"init_caller.in"
def
_install
(
self
):
# First of all, ask for a sipreceiver
self
.
request
(
self
.
software_release_url
,
'sipreceiver'
)
return
SipTesterRecipe
.
_install
(
self
)
slapos/recipe/siptester/template/init_caller.in
deleted
100644 → 0
View file @
93c3563a
#!/bin/sh
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
exec
%
(
siptester_binary
)
s %
(
pjsua_binary
)
s %
(
pjsua_configuration_file
)
s %
(
caller_destination
)
s
slapos/recipe/siptester/template/init_receiver.in
deleted
100644 → 0
View file @
93c3563a
#!/bin/sh
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
exec
%
(
siptester_binary
)
s %
(
pjsua_binary
)
s %
(
pjsua_configuration_file
)
s
slapos/recipe/siptester/template/pjsua_caller.conf.in
deleted
100644 → 0
View file @
93c3563a
#
# Logging options:
#
--log-level 0
--app-log-level 0
#
# Account 0:
#
--id %(caller_id)s
--registrar %(caller_registrar)s
--realm %(caller_realm)s
--username %(caller_username)s
--password %(caller_password)s
--reg-timeout 300
#
# Network settings:
#
--local-port 5060
#
# Media settings:
#
--null-audio
--playback-lat 100
--rtp-port 4000
#
# User agent:
#
--max-calls 4
--duration 300
slapos/recipe/siptester/template/pjsua_receiver.conf.in
deleted
100644 → 0
View file @
93c3563a
#
# Logging options:
#
--log-level 0
--app-log-level 0
#
# Account 0:
#
--id %(receiver_id)s
--registrar %(receiver_registrar)s
--realm %(receiver_realm)s
--username %(receiver_username)s
--password %(receiver_password)s
--reg-timeout 300
#
# Network settings:
#
--local-port 5060
#
# Media settings:
#
--null-audio
--auto-play
--play-file %(wav_path)s
--playback-lat 100
--rtp-port 4000
#
# User agent:
#
--auto-answer 200
--max-calls 4
slapos/recipe/zero_knowledge.py
View file @
cbcf3c5a
...
...
@@ -25,7 +25,7 @@
#
##############################################################################
import
ConfigP
arser
from
six.moves
import
configp
arser
import
os
import
zc.buildout
...
...
@@ -53,7 +53,7 @@ class WriteRecipe(GenericBaseRecipe):
def
install
(
self
):
# Set up the parser, and write config file if needed
self
.
parser
=
ConfigP
arser
.
ConfigParser
()
self
.
parser
=
configp
arser
.
ConfigParser
()
try
:
self
.
parser
.
read
(
self
.
path
)
#clean_options(options)
...
...
@@ -63,7 +63,7 @@ class WriteRecipe(GenericBaseRecipe):
with
open
(
self
.
path
,
'w'
)
as
file
:
self
.
parser
.
write
(
file
)
# If the file or section do not exist
except
(
ConfigP
arser
.
NoSectionError
,
IOError
)
as
e
:
except
(
configp
arser
.
NoSectionError
,
IOError
)
as
e
:
self
.
full_install
()
def
full_install
(
self
):
...
...
@@ -94,7 +94,7 @@ class ReadRecipe(GenericBaseRecipe):
self
.
path
=
options
[
'file-path'
].
strip
()
# Set up the parser, and write config file if needed
self
.
parser
=
ConfigP
arser
.
ConfigParser
()
self
.
parser
=
configp
arser
.
ConfigParser
()
if
os
.
path
.
exists
(
self
.
path
):
self
.
parser
.
read
(
self
.
path
)
for
section
in
self
.
parser
.
sections
():
...
...
slapos/test/recipe/test_zero_knowledge.py
0 → 100644
View file @
cbcf3c5a
import
os
import
shutil
import
tempfile
import
unittest
import
zc.buildout.testing
from
slapos.recipe
import
zero_knowledge
class
ZeroKnowledgeTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
tmp_dir
=
tempfile
.
mkdtemp
()
self
.
addCleanup
(
shutil
.
rmtree
,
self
.
tmp_dir
)
self
.
buildout
=
zc
.
buildout
.
testing
.
Buildout
()
self
.
buildout
[
'buildout'
][
'directory'
]
=
self
.
tmp_dir
def
test_write_read
(
self
):
buildout
=
self
.
buildout
buildout
[
'zero-knowledge-write'
]
=
{
'filename'
:
'zero-knowledge.cfg'
,
'recipe'
:
'slapos.cookbook:zero-knowledge.read'
,
'secret'
:
'?'
,
}
buildout
[
'zero-knowledge-read'
]
=
{
'filename'
:
'zero-knowledge.cfg'
,
'recipe'
:
'slapos.cookbook:zero-knowledge.read'
,
}
write_recipe
=
zero_knowledge
.
WriteRecipe
(
buildout
,
'zero-knowledge-write'
,
buildout
[
'zero-knowledge-write'
],
)
write_recipe
.
install
()
self
.
assertTrue
(
os
.
path
.
exists
(
os
.
path
.
join
(
self
.
tmp_dir
,
'zero-knowledge.cfg'
,)))
zero_knowledge
.
ReadRecipe
(
buildout
,
'zero-knowledge-read'
,
buildout
[
'zero-knowledge-read'
],
)
self
.
assertEqual
(
buildout
[
'zero-knowledge-read'
][
'secret'
],
'?'
)
software/slapos-sr-testing/README.md
View file @
cbcf3c5a
...
...
@@ -18,7 +18,7 @@ changes to the code, run tests and publish changes.
```
bash
# install this software release and request an instance
SR
=
https://lab.nexedi.com/nexedi/slapos/raw/1.0/software/slapos-sr-testing/software.cfg
COMP
=
slaprunner
# or "local" if using theia
COMP
=
slaprunner
INSTANCE_NAME
=
$COMP
slapos supply
$SR
$COMP
...
...
software/slapos-sr-testing/software-py3.cfg
View file @
cbcf3c5a
...
...
@@ -5,8 +5,8 @@ extends =
[python]
part = python3
[
eggs
]
eggs +=
[
python-interpreter
]
e
xtra-e
ggs +=
# plantuml 0.3.0 is only available for Python 3
${slapos.test.plantuml-setup:egg}
...
...
software/slapos-sr-testing/software.cfg
View file @
cbcf3c5a
...
...
@@ -167,9 +167,9 @@ branch = master
egg = slapos.core
setup = ${slapos.core-repository:location}
[
eggs
]
<= python-interpreter
e
ggs +
=
[
python-interpreter
]
eggs += ${:extra-eggs}
e
xtra-eggs
=
${lxml-python:egg}
${slapos.core-setup:egg}
${pillow-python:egg}
...
...
@@ -216,7 +216,7 @@ PyPDF2-patch-options = -p1
[eggs/scripts]
recipe = zc.recipe.egg
eggs = ${
eggs
:eggs}
eggs = ${
python-interpreter
:eggs}
scripts =
slapos
supervisord
...
...
@@ -243,7 +243,7 @@ context =
key nxdtest_instance nxdtest-instance.cfg:rendered
key git_location git:location
key slapos_location slapos-repository:location
key interpreter
eggs
:interpreter
key interpreter
python-interpreter
:interpreter
key curl_location curl:location
key openssl_location openssl-output:bin
key faketime_location faketime:location
...
...
@@ -272,7 +272,6 @@ extra =
gitlab ${slapos.test.gitlab-setup:setup}
cloudooo ${slapos.test.cloudooo-setup:setup}
dream ${slapos.test.dream-setup:setup}
repman ${slapos.test.repman-setup:setup}
[versions]
# slapos.core is used from the clone always
...
...
software/theia/test/test.py
View file @
cbcf3c5a
...
...
@@ -160,8 +160,8 @@ class TestTheiaEmbeddedSlapOSShutdown(SlapOSInstanceTestCase):
os
.
path
.
join
(
self
.
computer_partition_root_path
,
'srv'
,
'
slapos
'
,
'inst'
,
'
runner
'
,
'inst
ance
'
,
),
self
.
logger
)
# Wait a bit for this supervisor to be started.
...
...
software/turnserver/buildout.hash.cfg
View file @
cbcf3c5a
...
...
@@ -15,8 +15,12 @@
[instance-cfg]
filename = instance.cfg.in
md5sum =
d027a2dccaf15ae6e7d3a28cc02d70c3
md5sum =
776c7de2054f78ba79382c22d85018be
[template-turnserver]
filename = instance-turnserver.cfg.jinja2.in
md5sum = 539417d669c15b853ac8525f8d5cbc44
md5sum = df8768f165036dbe0435bd1678b9deb3
[template-insecure-turnserver]
filename = instance-insecure-turnserver.cfg.jinja2.in
md5sum = 0e0807eef75a1ee6f9aef3a6a566a729
software/turnserver/instance-insecure-turnserver.cfg.jinja2.in
0 → 100644
View file @
cbcf3c5a
{% set part_list = [] -%}
{% set server_name = slapparameter_dict.get('server-name', 'turn.example.com') -%}
[directory]
recipe = slapos.cookbook:mkdirectory
etc = ${buildout:directory}/etc
bin = ${buildout:directory}/bin
srv = ${buildout:directory}/srv
var = ${buildout:directory}/var
run = ${:var}/run
log = ${:var}/log
scripts = ${:etc}/run
services = ${:etc}/service
plugins = ${:etc}/plugin
[turnserver-password]
recipe = slapos.cookbook:generate.password
bytes = 8
{% set turn_port = slapparameter_dict.get('port', 3478) -%}
{% set turn_tls_port = slapparameter_dict.get('tls-port', 5349) -%}
{% set listining_ip = slapparameter_dict.get('listening-ip', (ipv4 | list)[0]) -%}
[turnserver-config]
recipe = collective.recipe.template
user = nxdturn
input = inline:
listening-port={{ turn_port }}
lt-cred-mech
realm={{ server_name }}
{% if slapparameter_dict.get('external-ip', '') %}
external-ip={{ slapparameter_dict['external-ip'] }}
{% endif %}
fingerprint
listening-ip={{ listining_ip }}
server-name={{ server_name }}
no-stdout-log
simple-log
log-file=${directory:log}/turnserver.log
pidfile=${directory:run}/turnserver.pid
verbose
user=${:user}:${turnserver-password:passwd}
output = ${directory:etc}/turnserver.conf
mode = 644
[turnserver-wrapper]
recipe = slapos.cookbook:wrapper
# XXX on first invocation of read-secret, the secret file is not yet generated
# so on first buildout run turnserver-config has an empty secret.
# We don't want to start the server when config file is not complete.
command-line =
{{ parameter_dict['turnserver-location'] }}/bin/turnserver -c ${turnserver-config:output}
wrapper-path = ${directory:services}/turnserver
hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
[promise-check-turnserver-port]
<= monitor-promise-base
module = check_port_listening
name = turnserver-port-listening.py
config-hostname = {{ listining_ip }}
config-port = {{ turn_port }}
[promise-check-turnserver-tls-port]
<= monitor-promise-base
module = check_port_listening
name = turnserver-tls-port-listening.py
config-hostname = {{ listining_ip }}
config-port = {{ turn_tls_port }}
[publish-connection-information]
<= monitor-publish
recipe = slapos.cookbook:publish
turn-url = {{ server_name ~ ':' ~ turn_port }}
user = ${turnserver-config:user}
password = ${turnserver-password:passwd}
[buildout]
extends = {{ template_monitor }}
parts =
publish-connection-information
# Complete parts with sections
{{ part_list | join('\n ') }}
# turn server
turnserver-wrapper
promise-check-turnserver-tls-port
promise-check-turnserver-port
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
software/turnserver/instance-turnserver.cfg.jinja2.in
View file @
cbcf3c5a
...
...
@@ -99,6 +99,7 @@ input = inline:
no-tlsv1
no-tlsv1_1
no-stdout-log
simple-log
log-file=${directory:log}/turnserver.log
userdb=${directory:srv}/turndb
pidfile=${directory:run}/turnserver.pid
...
...
software/turnserver/instance.cfg.in
View file @
cbcf3c5a
...
...
@@ -10,6 +10,7 @@ offline = true
[switch-softwaretype]
recipe = slapos.cookbook:softwaretype
default = $${dynamic-template-turnserver:rendered}
insecure = $${dynamic-template-insecure-turnserver:rendered}
RootSoftwareInstance = $${:default}
[slap-configuration]
...
...
@@ -50,3 +51,10 @@ template = ${template-turnserver:location}/${template-turnserver:filename}
filename = instance-turnserver.cfg
extra-context =
section parameter_dict dynamic-template-turnserver-parameters
[dynamic-template-insecure-turnserver]
<= jinja2-template-base
template = ${template-insecure-turnserver:location}/${template-insecure-turnserver:filename}
filename = instance-insecure-turnserver.cfg
extra-context =
section parameter_dict dynamic-template-turnserver-parameters
software/turnserver/software.cfg
View file @
cbcf3c5a
...
...
@@ -28,5 +28,8 @@ output = ${buildout:directory}/instance.cfg
[template-turnserver]
<= download-base
[template-insecure-turnserver]
<= download-base
[versions]
slapos.recipe.template = 4.4
software/turnserver/test/test.py
View file @
cbcf3c5a
...
...
@@ -188,3 +188,61 @@ verbose""" % {'instance_path': self.partition_path,
current_config
=
f
.
read
().
strip
()
self
.
assertEqual
(
current_config
.
splitlines
(),
expected_config
.
splitlines
())
class
TestInsecureServices
(
TurnServerTestCase
):
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
'insecure'
def
test_process_list
(
self
):
hash_list
=
[
'software_release/buildout.cfg'
,
]
expected_process_names
=
[
'bootstrap-monitor'
,
'turnserver-{hash}-on-watch'
,
'certificate_authority-{hash}-on-watch'
,
'crond-{hash}-on-watch'
,
'monitor-httpd-{hash}-on-watch'
,
'monitor-httpd-graceful'
,
]
with
self
.
slap
.
instance_supervisor_rpc
as
supervisor
:
process_name_list
=
[
process
[
'name'
]
for
process
in
supervisor
.
getAllProcessInfo
()]
hash_file_list
=
[
os
.
path
.
join
(
self
.
computer_partition_root_path
,
path
)
for
path
in
hash_list
]
for
name
in
expected_process_names
:
h
=
generateHashFromFiles
(
hash_file_list
)
expected_process_name
=
name
.
format
(
hash
=
h
)
self
.
assertIn
(
expected_process_name
,
process_name_list
)
def
test_default_deployment
(
self
):
self
.
assertTrue
(
os
.
path
.
exists
(
self
.
partition_path
))
connection_parameter_dict
=
self
.
computer_partition
\
.
getConnectionParameterDict
()
password
=
connection_parameter_dict
[
'password'
]
expected_config
=
"""listening-port=3478
lt-cred-mech
realm=turn.example.com
fingerprint
listening-ip=%(ipv4)s
server-name=turn.example.com
no-stdout-log
simple-log
log-file=%(instance_path)s/var/log/turnserver.log
pidfile=%(instance_path)s/var/run/turnserver.pid
verbose
user=nxdturn:%(password)"""
%
{
'instance_path'
:
self
.
partition_path
,
'password'
:
password
,
'ipv4'
:
self
.
_ipv4_address
}
with
open
(
os
.
path
.
join
(
self
.
partition_path
,
'etc/turnserver.conf'
))
as
f
:
current_config
=
f
.
read
().
strip
()
self
.
assertEqual
(
current_config
.
splitlines
(),
expected_config
.
splitlines
())
software/unstable/libcloud-requester/instance.cfg
deleted
100644 → 0
View file @
93c3563a
# Version: 0.0.1
[buildout]
parts =
libcloud-requester
# instance shall be offline
offline = true
eggs-directory = ${software_definition:software_home}/eggs
develop-eggs-directory = ${software_definition:software_home}/develop-eggs
[libcloud-requester]
# slap connection information
slap_computer_id = ${slap_computer_id}
slap_computer_partition_id = ${slap_computer_partition_id}
slap_server_url = ${slap_server_url}
slap_software_release_url = ${slap_software_release_url}
# select recipe
recipe = slapos.recipe.libcloudrequest
software/unstable/libcloud-requester/software.cfg
deleted
100644 → 0
View file @
93c3563a
# Version: 0.0.1
[buildout]
parts =
workaround-downloadcache
libcloudrequestertemplate
eggs
find-links =
http://www.nexedi.org/static/packages/source/slapos.buildout/
versions = versions
[workaround-downloadcache]
recipe = plone.recipe.command
command =
rm -rf ${buildout:directory}/downloads
update-command = ${:command}
[libcloudrequestertemplate]
recipe = slapos.recipe.hrdownload
url = ${:_profile_base_location_}/instance.cfg
filename = template.cfg
destination = ${buildout:directory}
download-only = true
[eggs]
recipe = zc.recipe.egg
eggs =
slapos.recipe.libcloudrequest
[versions]
zc.buildout = 1.5.3-dev-SlapOS-001
software/unstable/libcloud/instance.cfg
deleted
100644 → 0
View file @
93c3563a
# Version: 0.0.4dev
[buildout]
parts =
libcloud-instance
# instance shall be offline
offline = true
eggs-directory = ${software_definition:software_home}/eggs
develop-eggs-directory = ${software_definition:software_home}/develop-eggs
[libcloud-instance]
# slap connection information
slap_computer_id = ${slap_computer_id}
slap_computer_partition_id = ${slap_computer_partition_id}
slap_server_url = ${slap_server_url}
slap_software_release_url = ${slap_software_release_url}
# select recipe
recipe = slapos.recipe.libcloud
server_binary = ${software_definition:software_home}/bin/cloudmgr
software/unstable/libcloud/software.cfg
deleted
100644 → 0
View file @
93c3563a
# Version: 0.0.5dev
[buildout]
parts =
workaround-downloadcache
libcloudtemplate
paramiko-wrokaround-dependency
paramiko-wrokaround
eggs
versions = paramiko-workaround-versions
[paramiko-workaround-versions]
paramiko = 1.7.6
[paramiko-wrokaround-dependency]
recipe = zc.recipe.egg
eggs =
pycrypto
[paramiko-wrokaround]
recipe = zc.recipe.egg
index =
eggs =
paramiko
[workaround-downloadcache]
recipe = plone.recipe.command
command =
rm -rf ${buildout:directory}/downloads
update-command = ${:command}
[libcloudtemplate]
recipe = slapos.recipe.hrdownload
url =
filename = template.cfg
destination = ${buildout:directory}
download-only = true
[eggs]
recipe = zc.recipe.egg
eggs =
slapos.tool.cloudmgr
slapos.recipe.libcloud
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment