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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tristan Cavelier
slapos
Commits
667a1e13
Commit
667a1e13
authored
Oct 02, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'slaprunner'
parents
f1a575a3
56d98c13
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
128 additions
and
37 deletions
+128
-37
setup.py
setup.py
+1
-0
slapos/recipe/check_url_available/template/check_url.in
slapos/recipe/check_url_available/template/check_url.in
+12
-1
slapos/recipe/slaprunner/__init__.py
slapos/recipe/slaprunner/__init__.py
+71
-2
slapos/recipe/slaprunner/execute.py
slapos/recipe/slaprunner/execute.py
+0
-8
software/slaprunner/instance-runner.cfg
software/slaprunner/instance-runner.cfg
+23
-2
software/slaprunner/software.cfg
software/slaprunner/software.cfg
+21
-24
No files found.
setup.py
View file @
667a1e13
...
@@ -130,6 +130,7 @@ setup(name=name,
...
@@ -130,6 +130,7 @@ setup(name=name,
'slapmonitor = slapos.recipe.slapmonitor:Recipe'
,
'slapmonitor = slapos.recipe.slapmonitor:Recipe'
,
'slapreport = slapos.recipe.slapreport:Recipe'
,
'slapreport = slapos.recipe.slapreport:Recipe'
,
'slaprunner = slapos.recipe.slaprunner:Recipe'
,
'slaprunner = slapos.recipe.slaprunner:Recipe'
,
'slaprunner.test = slapos.recipe.slaprunner:Test'
,
'softwaretype = slapos.recipe.softwaretype:Recipe'
,
'softwaretype = slapos.recipe.softwaretype:Recipe'
,
'sphinx= slapos.recipe.sphinx:Recipe'
,
'sphinx= slapos.recipe.sphinx:Recipe'
,
'sshkeys_authority.request = slapos.recipe.sshkeys_authority:Request'
,
'sshkeys_authority.request = slapos.recipe.sshkeys_authority:Request'
,
...
...
slapos/recipe/check_url_available/template/check_url.in
View file @
667a1e13
...
@@ -9,11 +9,22 @@ if [ -z $URL ]; then
...
@@ -9,11 +9,22 @@ if [ -z $URL ]; then
exit 3
exit 3
fi
fi
CODE=$(%(curl_path)s -k -sL $URL -w %%{http_code} -o /dev/null)
CODE=$(%(curl_path)s -g -k -sL $URL -w %%{http_code} -o /dev/null)
if [ $? -eq 3 ]; then
echo "URL malformed: $URL." >&2
exit 1
fi
if [ $? -eq 7 ]; then
echo "Failed to connect to host: $URL." >&2
exit 1
fi
if [ ! $CODE ]; then
if [ ! $CODE ]; then
echo "$URL is not available (server not reachable)." >&2
echo "$URL is not available (server not reachable)." >&2
exit 1
exit 1
fi
if [ $CODE -eq 000 ]; then
if [ $CODE -eq 000 ]; then
echo "$URL is not available (server not reachable)." >&2
echo "$URL is not available (server not reachable)." >&2
...
...
slapos/recipe/slaprunner/__init__.py
View file @
667a1e13
...
@@ -39,6 +39,7 @@ class Recipe(GenericBaseRecipe):
...
@@ -39,6 +39,7 @@ class Recipe(GenericBaseRecipe):
self
.
instance_directory
=
options
[
'instance-directory'
].
strip
()
self
.
instance_directory
=
options
[
'instance-directory'
].
strip
()
self
.
partition_amount
=
options
[
'partition-amount'
].
strip
()
self
.
partition_amount
=
options
[
'partition-amount'
].
strip
()
self
.
cloud9_url
=
options
[
'cloud9-url'
].
strip
()
self
.
cloud9_url
=
options
[
'cloud9-url'
].
strip
()
self
.
log_file
=
os
.
path
.
join
(
options
[
'log_dir'
].
strip
(),
'slaprunner.log'
)
# Set slaprunner access URL
# Set slaprunner access URL
options
[
'access-url'
]
=
'http://[%s]:%s'
%
(
self
.
ipv6
,
self
.
runner_port
)
options
[
'access-url'
]
=
'http://[%s]:%s'
%
(
self
.
ipv6
,
self
.
runner_port
)
...
@@ -79,10 +80,12 @@ class Recipe(GenericBaseRecipe):
...
@@ -79,10 +80,12 @@ class Recipe(GenericBaseRecipe):
path_list
.
append
(
config_file
)
path_list
.
append
(
config_file
)
environment
=
dict
(
environment
=
dict
(
PATH
=
os
.
path
.
dirname
(
self
.
options
[
'git-binary'
])
+
':'
+
os
.
environ
[
'PATH'
],
PATH
=
os
.
path
.
dirname
(
self
.
options
[
'git-binary'
])
+
':'
+
os
.
environ
[
'PATH'
],
GIT_SSH
=
self
.
options
[
'ssh_client'
]
GIT_SSH
=
self
.
options
[
'ssh_client'
]
)
)
launch_args
=
[
self
.
options
[
'slaprunner'
].
strip
(),
config_file
]
launch_args
=
[
self
.
options
[
'slaprunner'
].
strip
(),
config_file
,
'--logfile'
,
self
.
log_file
]
if
self
.
optionIsTrue
(
'debug'
,
default
=
False
):
if
self
.
optionIsTrue
(
'debug'
,
default
=
False
):
launch_args
.
append
(
'--debug'
)
launch_args
.
append
(
'--debug'
)
...
@@ -93,3 +96,69 @@ class Recipe(GenericBaseRecipe):
...
@@ -93,3 +96,69 @@ class Recipe(GenericBaseRecipe):
path_list
.
append
(
wrapper
)
path_list
.
append
(
wrapper
)
return
path_list
return
path_list
class
Test
(
GenericBaseRecipe
):
def
_options
(
self
,
options
):
self
.
ipv4
=
options
[
'ipv4'
].
strip
()
self
.
ipv6
=
options
[
'ipv6'
].
strip
()
self
.
proxy_port
=
options
[
'proxy_port'
].
strip
()
self
.
runner_port
=
options
[
'runner_port'
].
strip
()
self
.
workdir
=
options
[
'working-directory'
].
strip
()
self
.
software_directory
=
options
[
'software-directory'
].
strip
()
self
.
instance_directory
=
options
[
'instance-directory'
].
strip
()
self
.
partition_amount
=
options
[
'partition-amount'
].
strip
()
self
.
cloud9_url
=
options
[
'cloud9-url'
].
strip
()
# Set slaprunner access URL
options
[
'access-url'
]
=
'http://[%s]:%s'
%
(
self
.
ipv6
,
self
.
runner_port
)
def
install
(
self
):
path_list
=
[]
configuration
=
dict
(
software_root
=
self
.
software_directory
,
instance_root
=
self
.
instance_directory
,
master_url
=
'http://%s:%s/'
%
(
self
.
ipv4
,
self
.
proxy_port
),
computer_id
=
'slaprunner'
,
partition_amount
=
self
.
partition_amount
,
slapgrid_sr
=
self
.
options
[
'slapgrid_sr'
],
slapgrid_cp
=
self
.
options
[
'slapgrid_cp'
],
slapproxy
=
self
.
options
[
'slapproxy'
],
supervisor
=
self
.
options
[
'supervisor'
],
supervisord_config
=
os
.
path
.
join
(
self
.
instance_directory
,
'etc'
,
'supervisord.conf'
),
runner_workdir
=
self
.
workdir
,
etc_dir
=
self
.
options
[
'etc_dir'
],
runner_host
=
self
.
ipv6
,
runner_port
=
self
.
runner_port
,
ipv4_address
=
self
.
ipv4
,
ipv6_address
=
self
.
ipv6
,
proxy_host
=
self
.
ipv4
,
proxy_port
=
self
.
proxy_port
,
proxy_database
=
os
.
path
.
join
(
self
.
workdir
,
'proxy.db'
),
git
=
self
.
options
[
'git-binary'
],
ssh_client
=
self
.
options
[
'ssh_client'
],
public_key
=
self
.
options
[
'public_key'
],
private_key
=
self
.
options
[
'private_key'
],
cloud9_url
=
self
.
cloud9_url
)
config_file
=
self
.
createFile
(
self
.
options
[
'slapos.cfg'
],
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'slapos.cfg.in'
),
configuration
))
path_list
.
append
(
config_file
)
environment
=
dict
(
PATH
=
os
.
path
.
dirname
(
self
.
options
[
'git-binary'
])
+
':'
+
os
.
environ
[
'PATH'
],
GIT_SSH
=
self
.
options
[
'ssh_client'
],
CONFIG_FILE_PATH
=
config_file
)
launch_args
=
[
self
.
options
[
'slaprunnertest'
].
strip
()]
wrapper
=
self
.
createPythonScript
(
self
.
options
[
'wrapper'
],
'slapos.recipe.librecipe.execute.executee'
,
(
launch_args
,
environment
)
)
path_list
.
append
(
wrapper
)
return
path_list
slapos/recipe/slaprunner/execute.py
deleted
100644 → 0
View file @
f1a575a3
import
os
def
execute
(
args
):
"""Portable execution with process replacement"""
if
args
.
get
(
"path"
,
None
):
os
.
environ
[
'PATH'
]
=
args
[
"path"
]
os
.
execv
(
args
[
"launch_args"
][
0
],
args
[
"launch_args"
])
software/slaprunner/instance-runner.cfg
View file @
667a1e13
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
parts =
parts =
cloud9
cloud9
slaprunner
slaprunner
test-runner
sshkeys-dropbear
sshkeys-dropbear
dropbear-server-add-authorized-key
dropbear-server-add-authorized-key
sshkeys-authority
sshkeys-authority
...
@@ -38,13 +39,18 @@ services = $${rootdirectory:etc}/run/
...
@@ -38,13 +39,18 @@ services = $${rootdirectory:etc}/run/
run = $${rootdirectory:var}/run/
run = $${rootdirectory:var}/run/
backup = $${rootdirectory:srv}/backup/
backup = $${rootdirectory:srv}/backup/
promises = $${rootdirectory:etc}/promise/
promises = $${rootdirectory:etc}/promise/
test = $${rootdirectory:etc}/test/
[runnerdirectory]
[runnerdirectory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
home = $${rootdirectory:srv}/runner/
home = $${rootdirectory:srv}/runner/
test = $${rootdirectory:srv}/test/
project = $${:home}/project
project = $${:home}/project
software-root = $${:home}/software
software-root = $${:home}/software
instance-root = $${:home}/instance
instance-root = $${:home}/instance
project-test = $${:test}/project
software-test = $${:test}/software
instance-test = $${:test}/instance
#Create password recovery code for slaprunner
#Create password recovery code for slaprunner
[recovery-code]
[recovery-code]
...
@@ -85,9 +91,10 @@ ipv4 = $${slap-network-information:local-ipv4}
...
@@ -85,9 +91,10 @@ ipv4 = $${slap-network-information:local-ipv4}
ipv6 = $${slap-network-information:global-ipv6}
ipv6 = $${slap-network-information:global-ipv6}
proxy_port = 50000
proxy_port = 50000
runner_port = 50000
runner_port = 50000
partition-amount =
7
partition-amount =
$${slap-parameter:instance-amount}
cloud9-url = $${cloud9:access-url}
cloud9-url = $${cloud9:access-url}
wrapper = $${basedirectory:services}/slaprunner
wrapper = $${basedirectory:services}/slaprunner
debug = False
# Deploy dropbear (minimalist ssh server)
# Deploy dropbear (minimalist ssh server)
[sshkeys-directory]
[sshkeys-directory]
...
@@ -95,6 +102,18 @@ recipe = slapos.cookbook:mkdirectory
...
@@ -95,6 +102,18 @@ recipe = slapos.cookbook:mkdirectory
requests = $${directory:sshkeys}/requests/
requests = $${directory:sshkeys}/requests/
keys = $${directory:sshkeys}/keys/
keys = $${directory:sshkeys}/keys/
[test-runner]
<= slaprunner
recipe = slapos.cookbook:slaprunner.test
slaprunnertest = ${buildout:directory}/bin/slaprunnertest
slapos.cfg = $${rootdirectory:etc}/slapos-test.cfg
working-directory = $${runnerdirectory:test}
project-directory = $${runnerdirectory:project-test}
software-directory = $${runnerdirectory:software-test}
instance-directory = $${runnerdirectory:instance-test}
wrapper = $${rootdirectory:bin}/runTestSuite
etc_dir = $${basedirectory:test}
[sshkeys-authority]
[sshkeys-authority]
recipe = slapos.cookbook:sshkeys_authority
recipe = slapos.cookbook:sshkeys_authority
request-directory = $${sshkeys-directory:requests}
request-directory = $${sshkeys-directory:requests}
...
@@ -182,3 +201,5 @@ port = $${dropbear-server:port}
...
@@ -182,3 +201,5 @@ port = $${dropbear-server:port}
[slap-parameter]
[slap-parameter]
# Default value if no ssh key is specified
# Default value if no ssh key is specified
authorized-key =
authorized-key =
# Default value of instances number in slaprunner
instance-amount = 10
software/slaprunner/software.cfg
View file @
667a1e13
...
@@ -25,7 +25,7 @@ md5sum = 5307e4200f044ae57b504ad68444491c
...
@@ -25,7 +25,7 @@ md5sum = 5307e4200f044ae57b504ad68444491c
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner.cfg
url = ${:_profile_base_location_}/instance-runner.cfg
output = ${buildout:directory}/template-runner.cfg
output = ${buildout:directory}/template-runner.cfg
md5sum = b
57ebff565595fa92cd7d5adc6a22c7e
md5sum = b
d1c73c149b4adf2fbab80bc29c782c8
mode = 0644
mode = 0644
[eggs]
[eggs]
...
@@ -62,36 +62,34 @@ async = 0.6.1
...
@@ -62,36 +62,34 @@ async = 0.6.1
buildout-versions = 1.7
buildout-versions = 1.7
gitdb = 0.5.4
gitdb = 0.5.4
hexagonit.recipe.cmmi = 1.6
hexagonit.recipe.cmmi = 1.6
meld3 = 0.6.
8
meld3 = 0.6.
9
plone.recipe.command = 1.1
plone.recipe.command = 1.1
pycrypto = 2.6
pycrypto = 2.6
slapos.cookbook = 0.64.2
slapos.libnetworkcache = 0.13.2
slapos.libnetworkcache = 0.13.2
slapos.recipe.build = 0.11
slapos.recipe.build = 0.11
.4
slapos.recipe.template = 2.4.2
slapos.recipe.template = 2.4.2
slapos.toolbox = 0.30
smmap = 0.8.2
smmap = 0.8.2
z3c.recipe.scripts = 1.0.1
z3c.recipe.scripts = 1.0.1
# Required by:
# Required by:
# slapos.core==0.30
# slapos.core==0.30
# slapos.toolbox==0.3
0
# slapos.toolbox==0.3
1-dev
Flask = 0.9
Flask = 0.9
# Required by:
# Required by:
# slapos.toolbox==0.3
0
# slapos.toolbox==0.3
1-dev
GitPython = 0.3.2.RC1
GitPython = 0.3.2.RC1
# Required by:
# Required by:
# slapos.cookbook==0.6
4.2
# slapos.cookbook==0.6
7-dev
PyXML = 0.8.4
PyXML = 0.8.4
# Required by:
# Required by:
# slapos.toolbox==0.3
0
# slapos.toolbox==0.3
1-dev
atomize = 0.1.1
atomize = 0.1.1
# Required by:
# Required by:
# slapos.toolbox==0.3
0
# slapos.toolbox==0.3
1-dev
feedparser = 5.1.2
feedparser = 5.1.2
# Required by:
# Required by:
...
@@ -99,59 +97,58 @@ feedparser = 5.1.2
...
@@ -99,59 +97,58 @@ feedparser = 5.1.2
hexagonit.recipe.download = 1.5.1
hexagonit.recipe.download = 1.5.1
# Required by:
# Required by:
# slapos.cookbook==0.6
4.2
# slapos.cookbook==0.6
7-dev
inotifyx = 0.2.0
inotifyx = 0.2.0
# Required by:
# Required by:
# slapos.core==0.30
# slapos.core==0.30
# slapos.toolbox==0.3
0
# slapos.toolbox==0.3
1-dev
# xml-marshaller==0.9.7
# xml-marshaller==0.9.7
lxml = 3.0alpha2
lxml = 3.0alpha2
# Required by:
# Required by:
# slapos.cookbook==0.6
4.2
# slapos.cookbook==0.6
7-dev
netaddr = 0.7.
9
netaddr = 0.7.
10
# Required by:
# Required by:
# slapos.core==0.30
# slapos.core==0.30
netifaces = 0.8
netifaces = 0.8
# Required by:
# Required by:
# slapos.toolbox==0.3
0
# slapos.toolbox==0.3
1-dev
paramiko = 1.7.7.2
paramiko = 1.7.7.2
# Required by:
# Required by:
# slapos.toolbox==0.3
0
# slapos.toolbox==0.3
1-dev
psutil = 0.6.1
psutil = 0.6.1
# Required by:
# Required by:
# slapos.cookbook==0.6
4.2
# slapos.cookbook==0.6
7-dev
# slapos.core==0.30
# slapos.core==0.30
# slapos.libnetworkcache==0.13.2
# slapos.libnetworkcache==0.13.2
# slapos.toolbox==0.3
0
# slapos.toolbox==0.3
1-dev
# supervisor==3.0
a12
# supervisor==3.0
b1
# zc.buildout==1.6.0-dev-SlapOS-007
# zc.buildout==1.6.0-dev-SlapOS-007
# zc.recipe.egg==1.3.2
# zc.recipe.egg==1.3.2
# zope.interface==4.0.1
# zope.interface==4.0.1
setuptools = 0.6c12dev-r88846
setuptools = 0.6c12dev-r88846
# Required by:
# Required by:
# slapos.cookbook==0.6
4.2
# slapos.cookbook==0.6
7-dev
slapos.core = 0.30
slapos.core = 0.30
# Required by:
# Required by:
# slapos.core==0.30
# slapos.core==0.30
supervisor = 3.0
a12
supervisor = 3.0
b1
# Required by:
# Required by:
# slapos.cookbook==0.6
4.2
# slapos.cookbook==0.6
7-dev
xml-marshaller = 0.9.7
xml-marshaller = 0.9.7
# Required by:
# Required by:
# slapos.cookbook==0.6
4.2
# slapos.cookbook==0.6
7-dev
zc.recipe.egg = 1.3.2
zc.recipe.egg = 1.3.2
# Required by:
# Required by:
# slapos.core==0.30
# slapos.core==0.30
zope.interface = 4.0.1
zope.interface = 4.0.1
pe.egg = 1.3.2
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