Commit a982699b authored by Alain Takoudjou's avatar Alain Takoudjou

Add recipe and update SR for webrunner test

parent 6f92c092
......@@ -126,6 +126,7 @@ setup(name=name,
'slapmonitor = slapos.recipe.slapmonitor:Recipe',
'slapreport = slapos.recipe.slapreport:Recipe',
'slaprunner = slapos.recipe.slaprunner:Recipe',
'slaprunner.test = slapos.recipe.slaprunner:Test',
'softwaretype = slapos.recipe.softwaretype:Recipe',
'sphinx= slapos.recipe.sphinx:Recipe',
'sshkeys_authority.request = slapos.recipe.sshkeys_authority:Request',
......
......@@ -93,3 +93,68 @@ class Recipe(GenericBaseRecipe):
path_list.append(wrapper)
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
......@@ -2,6 +2,7 @@
parts =
cloud9
slaprunner
test-runner
sshkeys-dropbear
dropbear-server-add-authorized-key
sshkeys-authority
......@@ -11,7 +12,7 @@ parts =
cloud9-promise
dropbear-promise
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
......@@ -38,13 +39,18 @@ services = $${rootdirectory:etc}/run/
run = $${rootdirectory:var}/run/
backup = $${rootdirectory:srv}/backup/
promises = $${rootdirectory:etc}/promise/
test = $${rootdirectory:etc}/test/
[runnerdirectory]
recipe = slapos.cookbook:mkdirectory
home = $${rootdirectory:srv}/runner/
test = $${rootdirectory:srv}/test/
project = $${:home}/project
software-root = $${:home}/software
instance-root = $${:home}/instance
project-test = $${:test}/project
software-test = $${:test}/software
instance-test = $${:test}/instance
#Create password recovery code for slaprunner
[recovery-code]
......@@ -95,6 +101,18 @@ recipe = slapos.cookbook:mkdirectory
requests = $${directory:sshkeys}/requests/
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}/slaprunner-test
etc_dir = $${basedirectory:test}
[sshkeys-authority]
recipe = slapos.cookbook:sshkeys_authority
request-directory = $${sshkeys-directory:requests}
......
[buildout]
develop =
/srv/slapgrid/slappart19/srv//runner/project/slapos
/srv/slapgrid/slappart19/srv//runner/project/slapos.toolbox
extends =
../../stack/slapos.cfg
../../stack/flask.cfg
......@@ -25,7 +29,7 @@ md5sum = 5307e4200f044ae57b504ad68444491c
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner.cfg
output = ${buildout:directory}/template-runner.cfg
md5sum = b57ebff565595fa92cd7d5adc6a22c7e
md5sum = 2f19b2e799ea8cf66c67ac25e283ed48
mode = 0644
[eggs]
......@@ -53,105 +57,3 @@ signature-certificate-list =
If1a2ZoqHRxoNo2yTmm7TSYRORWVS+vvfjY=
-----END CERTIFICATE-----
[versions]
Flask-Auth = 0.8
Jinja2 = 2.6
Werkzeug = 0.8.3
apache-libcloud = 0.11.1
async = 0.6.1
buildout-versions = 1.7
gitdb = 0.5.4
hexagonit.recipe.cmmi = 1.6
meld3 = 0.6.8
plone.recipe.command = 1.1
pycrypto = 2.6
slapos.cookbook = 0.64.2
slapos.libnetworkcache = 0.13.2
slapos.recipe.build = 0.11
slapos.recipe.template = 2.4.2
slapos.toolbox = 0.30
smmap = 0.8.2
z3c.recipe.scripts = 1.0.1
# Required by:
# slapos.core==0.30
# slapos.toolbox==0.30
Flask = 0.9
# Required by:
# slapos.toolbox==0.30
GitPython = 0.3.2.RC1
# Required by:
# slapos.cookbook==0.64.2
PyXML = 0.8.4
# Required by:
# slapos.toolbox==0.30
atomize = 0.1.1
# Required by:
# slapos.toolbox==0.30
feedparser = 5.1.2
# Required by:
# hexagonit.recipe.cmmi==1.6
hexagonit.recipe.download = 1.5.1
# Required by:
# slapos.cookbook==0.64.2
inotifyx = 0.2.0
# Required by:
# slapos.core==0.30
# slapos.toolbox==0.30
# xml-marshaller==0.9.7
lxml = 3.0alpha2
# Required by:
# slapos.cookbook==0.64.2
netaddr = 0.7.9
# Required by:
# slapos.core==0.30
netifaces = 0.8
# Required by:
# slapos.toolbox==0.30
paramiko = 1.7.7.2
# Required by:
# slapos.toolbox==0.30
psutil = 0.6.1
# Required by:
# slapos.cookbook==0.64.2
# slapos.core==0.30
# slapos.libnetworkcache==0.13.2
# slapos.toolbox==0.30
# supervisor==3.0a12
# zc.buildout==1.6.0-dev-SlapOS-007
# zc.recipe.egg==1.3.2
# zope.interface==4.0.1
setuptools = 0.6c12dev-r88846
# Required by:
# slapos.cookbook==0.64.2
slapos.core = 0.30
# Required by:
# slapos.core==0.30
supervisor = 3.0a12
# Required by:
# slapos.cookbook==0.64.2
xml-marshaller = 0.9.7
# Required by:
# slapos.cookbook==0.64.2
zc.recipe.egg = 1.3.2
# Required by:
# slapos.core==0.30
zope.interface = 4.0.1
pe.egg = 1.3.2
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