Commit 5612f133 authored by Cédric de Saint Martin's avatar Cédric de Saint Martin

Merge branch 'kvm'

Conflicts:
	software/kvm/software.cfg
	stack/kvm.cfg
parents 92222210 b086cbd5
......@@ -61,8 +61,7 @@ class Recipe(BaseSlapRecipe):
noVNC_conf = self.installNoVnc(source_ip = self.getGlobalIPv6Address(),
source_port = 6080,
target_ip = kvm_conf['vnc_ip'],
target_port = vnc_port,
python_path = kvm_conf['python_path'])
target_port = vnc_port)
self.linkBinary()
self.computer_partition.setConnectionDict(dict(
......@@ -167,8 +166,7 @@ class Recipe(BaseSlapRecipe):
return kvm_conf
def installNoVnc(self, source_ip, source_port, target_ip, target_port,
python_path):
def installNoVnc(self, source_ip, source_port, target_ip, target_port):
"""
Create noVNC configuration dictionnary and instanciate Websockify proxy
......@@ -181,14 +179,20 @@ class Recipe(BaseSlapRecipe):
noVNC_conf = {}
noVNC_conf['source_ip'] = source_ip
noVNC_conf['source_ip'] = source_ip
noVNC_conf['source_port'] = source_port
# Install numpy.
# XXX-Cedric : this looks like a hack. Do we have better solution, knowing
# That websockify is not an egg?
numpy = zc.buildout.easy_install.install(['numpy'], self.options['eggs-directory'])
environment = dict(PYTHONPATH='%s' % numpy.entries[0])
# Instanciate Websockify
websockify_runner_path = zc.buildout.easy_install.scripts([('websockify',
'slapos.recipe.librecipe.execute', 'execute_wait')], self.ws,
'slapos.recipe.librecipe.execute', 'executee_wait')], self.ws,
sys.executable, self.wrapper_directory, arguments=[
[python_path.strip(),
[sys.executable.strip(),
self.options['websockify_path'],
'--web',
self.options['noVNC_location'],
......@@ -197,7 +201,8 @@ class Recipe(BaseSlapRecipe):
'--ssl-only',
'%s:%s' % (source_ip, source_port),
'%s:%s' % (target_ip, target_port)],
[self.certificate_path, self.key_path]]
[self.certificate_path, self.key_path],
environment]
)[0]
self.path_list.append(websockify_runner_path)
......
......@@ -39,6 +39,25 @@ def executee(args):
env[k] = v
os.execve(exec_list[0], exec_list + sys.argv[1:], env)
def executee_wait(args):
"""Portable execution with process replacement and environment manipulation"""
exec_list = list(args[0])
file_list = list(args[1])
environment = args[2]
env = os.environ.copy()
for k,v in environment.iteritems():
env[k] = v
sleep = 60
while True:
ready = True
for f in file_list:
if not os.path.exists(f):
print 'File %r does not exists, sleeping for %s' % (f, sleep)
ready = False
if ready:
break
time.sleep(sleep)
os.execve(exec_list[0], exec_list + sys.argv[1:], env)
def sig_handler(signal, frame):
print 'Received signal %r, killing children and exiting' % signal
......
......@@ -15,71 +15,63 @@ command =
update-command =
[versions]
Jinja2 = 2.5.5
Werkzeug = 0.6.2
Jinja2 = 2.6
Werkzeug = 0.7.1
buildout-versions = 1.6
hexagonit.recipe.cmmi = 1.5.0
lxml = 2.3
meld3 = 0.6.7
numpy = 1.6.1
plone.recipe.command = 1.1
slapos.cookbook = 0.15
slapos.recipe.template = 1.1
z3c.recipe.scripts = 1.0.1
# Required by:
# slapos.core==0.9
# slapos.core==0.14
Flask = 0.7.2
# Required by:
# slapos.cookbook==0.15
# slapos.cookbook==0.20
PyXML = 0.8.4
# Required by:
# slapos.recipe.template==1.1
collective.recipe.template = 1.8
collective.recipe.template = 1.9
# Required by:
# hexagonit.recipe.cmmi==1.5.0
hexagonit.recipe.download = 1.5.0
# Required by:
# slapos.cookbook==0.15
# slapos.cookbook==0.20
netaddr = 0.7.5
# Required by:
# slapos.core==0.9
# slapos.core==0.14
netifaces = 0.5
# Required by:
# slapos.cookbook==0.15
# slapos.core==0.9
# slapos.cookbook==0.20
# slapos.core==0.14
# zc.buildout==1.5.3-dev-SlapOS-005
# zc.recipe.egg==1.3.2
setuptools = 0.6c12dev-r88846
# Required by:
# slapos.cookbook==0.15
slapos.core = 0.9
# slapos.cookbook==0.20
slapos.core = 0.14
# Required by:
# slapos.core==0.9
# slapos.core==0.14
supervisor = 3.0a10
# Required by:
# slapos.cookbook==0.15
# slapos.cookbook==0.20
xml-marshaller = 0.9.7
# Required by:
# slapos.cookbook==0.15
# slapos.cookbook==0.20
zc.recipe.egg = 1.3.2
# Required by:
# slapos.core==0.9
zope.interface = 3.6.4
# Required by:
# novnc==0.1
numpy = 1.6.1
# XXX-CEDRIC Quick and dirty workaround to avoid m2crypto problems.
# should not be used elsewhere unless for urgent cases.
slapos.libnetworkcache = 0.2
# slapos.core==0.14
zope.interface = 3.7.0
......@@ -25,10 +25,6 @@ extends =
# Websockify (socket <-> websocket proxy server) when it is ready.
# May solve previous XXX depending on the implementation.
#XXX-Cedric: Check status of
# https://www.tiolive.com/nexedi/bug_module/20110819-11F4F70 for
# Chrome >= 14 and Firefox >=7 can access to noVNC.
parts =
template
gnutls
......@@ -105,4 +101,4 @@ eggs =
numpy
[versions]
zc.buildout = 1.5.3-dev-SlapOS-005
zc.buildout = 1.5.3-dev-SlapOS-009
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