Commit 63d74677 authored by Alain Takoudjou's avatar Alain Takoudjou

Update Slaprunner recipe to use Git and Dropbear

parent 79c55a10
...@@ -62,17 +62,24 @@ class Recipe(BaseSlapRecipe): ...@@ -62,17 +62,24 @@ class Recipe(BaseSlapRecipe):
ipv6_address=ipv6, ipv6_address=ipv6,
proxy_host=ipv4, proxy_host=ipv4,
proxy_port=proxy_port, proxy_port=proxy_port,
proxy_database=os.path.join(workdir, 'proxy.db') proxy_database=os.path.join(workdir, 'proxy.db'),
git=self.options['git'],
ssh_client=self.options['ssh_client'],
public_key=self.options['public_key'],
private_key=self.options['private_key']
) )
config_file = self.createConfigurationFile('slapos.cfg', config_file = self.createConfigurationFile('slapos.cfg',
self.substituteTemplate(pkg_resources.resource_filename(__name__, self.substituteTemplate(pkg_resources.resource_filename(__name__,
'template/slapos.cfg.in'), configuration)) 'template/slapos.cfg.in'), configuration))
self.path_list.append(config_file) self.path_list.append(config_file)
execute_arguments = dict(path = os.environ['PATH'], environment = dict(
launch_args = [self.options['slaprunner'].strip(), config_file]) PATH=os.path.dirname(self.options['git']) + ':' + os.environ['PATH'],
GIT_SSH=self.options['ssh_client']
)
launch_args = [self.options['slaprunner'].strip(), config_file, '--debug']
self.path_list.extend(zc.buildout.easy_install.scripts([('slaprunner', self.path_list.extend(zc.buildout.easy_install.scripts([('slaprunner',
'slapos.recipe.slaprunner.execute', 'execute')], self.ws, sys.executable, 'slapos.recipe.librecipe.execute', 'executee')], self.ws, sys.executable,
self.wrapper_directory, arguments=execute_arguments)) self.wrapper_directory, arguments=[launch_args, environment]))
self.setConnectionDict(dict(url='http://[%s]:%s' % (ipv6, runner_port))) self.setConnectionDict(dict(url='http://[%s]:%s' % (ipv6, runner_port)))
return self.path_list return self.path_list
...@@ -23,3 +23,11 @@ ipv6_address = %(ipv6_address)s ...@@ -23,3 +23,11 @@ ipv6_address = %(ipv6_address)s
host = %(proxy_host)s host = %(proxy_host)s
port = %(proxy_port)s port = %(proxy_port)s
database_uri = %(proxy_database)s database_uri = %(proxy_database)s
[sshkeys_authority]
ssh_client = %(ssh_client)s
public_key = %(public_key)s
private_key = %(private_key)s
[gitclient]
git = %(git)s
[buildout] [buildout]
parts = parts =
instance instance
sshkeys-authority
sshkeys-dropbear
dropbear-client
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
...@@ -12,4 +15,51 @@ slapgrid_sr = ${buildout:directory}/bin/slapgrid-sr ...@@ -12,4 +15,51 @@ slapgrid_sr = ${buildout:directory}/bin/slapgrid-sr
slapgrid_cp = ${buildout:directory}/bin/slapgrid-cp slapgrid_cp = ${buildout:directory}/bin/slapgrid-cp
slapproxy = ${buildout:directory}/bin/slapproxy slapproxy = ${buildout:directory}/bin/slapproxy
supervisor = ${buildout:directory}/bin/slapgrid-supervisorctl supervisor = ${buildout:directory}/bin/slapgrid-supervisorctl
git = ${git:location}/bin/git
ssh_client = $${sshkeys-dropbear:wrapper}
public_key = $${sshkeys-dropbear:public-key}
private_key = $${sshkeys-dropbear:private-key}
[sshkeys-directory]
recipe = slapos.cookbook:mkdirectory
requests = $${directory:sshkeys}/requests/
keys = $${directory:sshkeys}/keys/
[sshkeys-authority]
recipe = slapos.cookbook:sshkeys_authority
request-directory = $${sshkeys-directory:requests}
keys-directory = $${sshkeys-directory:keys}
wrapper = $${directory:services}/sshkeys_authority
keygen-binary = ${dropbear:location}/bin/dropbearkey
[sshkeys-dropbear]
<= sshkeys-authority
recipe = slapos.cookbook:sshkeys_authority.request
name = dropbear
type = rsa
executable = $${dropbear-client:wrapper}
public-key = $${dropbear-client:identity-file}.pub
private-key = $${dropbear-client:identity-file}
wrapper = $${rootdirectory:bin}/dbclient
[dropbear-client]
recipe = slapos.cookbook:dropbear.client
dbclient-binary = ${dropbear:location}/bin/dbclient
identity-file = $${directory:ssh}/id_rsa
wrapper = $${rootdirectory:bin}/dbclient_raw
home = $${rootdirectory:etc}/ssh/
force-host-key = True
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/
var = $${buildout:directory}/var/
srv = $${buildout:directory}/srv/
bin = $${buildout:directory}/bin/
[directory]
recipe = slapos.cookbook:mkdirectory
sshkeys = $${rootdirectory:srv}/sshkeys
services = $${rootdirectory:etc}/run/
ssh = $${rootdirectory:etc}/ssh/
...@@ -2,11 +2,18 @@ ...@@ -2,11 +2,18 @@
extends = extends =
../../stack/flask.cfg ../../stack/flask.cfg
../../stack/shacache-client.cfg ../../stack/shacache-client.cfg
../../component/dropbear/buildout.cfg
../../component/git/buildout.cfg
develop =
/home/alain/nexedi/slapos.toolbox
/opt/slapdev/
parts = parts =
template template
eggs eggs
instance-recipe-egg instance-recipe-egg
dropbear
find-links += find-links +=
http://www.nexedi.org/static/packages/source/slapos.buildout/ http://www.nexedi.org/static/packages/source/slapos.buildout/
...@@ -27,7 +34,7 @@ recipe = slapos.recipe.template ...@@ -27,7 +34,7 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg output = ${buildout:directory}/template.cfg
mode = 0644 mode = 0644
md5sum = e2cbd8fe7b8e4c7e92a19cd775de0aa6 md5sum = cd69efd5c3a7e9adca7387b9a401590a
[eggs] [eggs]
eggs += eggs +=
...@@ -37,7 +44,7 @@ eggs += ...@@ -37,7 +44,7 @@ eggs +=
[versions] [versions]
# Use SlapOS patched zc.buildout # Use SlapOS patched zc.buildout
zc.buildout = 1.5.3-dev-SlapOS-010 zc.buildout = 1.6.0-dev-SlapOS-003
# Pinned to old version (2.4 does not compile well everywhere) # Pinned to old version (2.4 does not compile well everywhere)
pycrypto = 2.3 pycrypto = 2.3
...@@ -48,10 +55,8 @@ apache-libcloud = 0.5.2 ...@@ -48,10 +55,8 @@ apache-libcloud = 0.5.2
buildout-versions = 1.7 buildout-versions = 1.7
hexagonit.recipe.cmmi = 1.5.0 hexagonit.recipe.cmmi = 1.5.0
meld3 = 0.6.7 meld3 = 0.6.7
slapos.cookbook = 0.31
slapos.libnetworkcache = 0.10 slapos.libnetworkcache = 0.10
slapos.recipe.template = 2.2 slapos.recipe.template = 2.2
slapos.toolbox = 0.8
# Required by: # Required by:
# slapos.core==0.18 # slapos.core==0.18
...@@ -77,7 +82,7 @@ netaddr = 0.7.6 ...@@ -77,7 +82,7 @@ netaddr = 0.7.6
# Required by: # Required by:
# slapos.core==0.18 # slapos.core==0.18
netifaces = 0.5 netifaces = 0.6
# Required by: # Required by:
# slapos.toolbox==0.8 # slapos.toolbox==0.8
...@@ -112,4 +117,4 @@ zc.recipe.egg = 1.3.2 ...@@ -112,4 +117,4 @@ zc.recipe.egg = 1.3.2
# Required by: # Required by:
# slapos.core==0.18 # slapos.core==0.18
zope.interface = 3.8.0 zope.interface = 3.8.0
\ No newline at end of file
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