instance-runner.cfg 4.92 KB
Newer Older
1 2
[buildout]
parts =
3
  cloud9-stable
4
  slaprunner
5 6
  sshkeys-dropbear
  dropbear-server-add-authorized-key
7
  sshkeys-authority
8
  publish-connection-informations
Jean-Baptiste Petre's avatar
Jean-Baptiste Petre committed
9
  frontend-promise
10

Jean-Baptiste Petre's avatar
Jean-Baptiste Petre committed
11
  
12 13 14 15
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true

16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45

# Create all needed directories
[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/

[basedirectory]
recipe = slapos.cookbook:mkdirectory
log = $${rootdirectory:var}/log/
services = $${rootdirectory:etc}/run/
run = $${rootdirectory:var}/run/
backup = $${rootdirectory:srv}/backup/
promises = $${rootdirectory:etc}/promise/

[runnerdirectory]
recipe = slapos.cookbook:mkdirectory
home = $${rootdirectory:srv}/runner/
project = $${:home}/project
software-root = $${:home}/software
instance-root = $${:home}/instance

46 47
#Create password recovery code for slaprunner
[recovery-code]
48
recipe = slapos.cookbook:generate.password
49
storage-path = $${rootdirectory:etc}/.rcode
50 51
bytes = 4

52 53 54 55
# Deploy cloud9 and slaprunner
[cloud9]
recipe = slapos.cookbook:cloud9
ip = $${slap-network-information:global-ipv6}
Jean-Baptiste Petre's avatar
Jean-Baptiste Petre committed
56
port = 30000
57 58 59
wrapper = $${basedirectory:services}/cloud9
working-directory = $${runnerdirectory:home}
git-binary = ${git:location}/bin/git
60 61
node-binary = ${nodejs-0.4:location}/bin/node
cloud9 = ${cloud9-stable:location}/server.js
62 63 64

[slaprunner]
recipe = slapos.cookbook:slaprunner
65 66 67 68 69
slaprunner = ${buildout:directory}/bin/slaprunner
slapgrid_sr = ${buildout:directory}/bin/slapgrid-sr
slapgrid_cp = ${buildout:directory}/bin/slapgrid-cp
slapproxy = ${buildout:directory}/bin/slapproxy
supervisor = ${buildout:directory}/bin/slapgrid-supervisorctl
70 71 72 73 74 75
git-binary = ${git:location}/bin/git
slapos.cfg = $${rootdirectory:etc}/slapos.cfg
working-directory = $${runnerdirectory:home}
project-directory = $${runnerdirectory:project}
software-directory = $${runnerdirectory:software-root}
instance-directory = $${runnerdirectory:instance-root}
76 77
etc_dir = $${rootdirectory:etc}
log_dir =  $${basedirectory:log}
78 79 80
ssh_client = $${sshkeys-dropbear:wrapper}
public_key = $${sshkeys-dropbear:public-key}
private_key = $${sshkeys-dropbear:private-key}
81 82
ipv4 = $${slap-network-information:local-ipv4}
ipv6 = $${slap-network-information:global-ipv6}
Jean-Baptiste Petre's avatar
Jean-Baptiste Petre committed
83 84
proxy_port = 50000
runner_port = 50000
85 86 87
partition-amount = 7
cloud9-url = $${cloud9:access-url}
wrapper = $${basedirectory:services}/slaprunner
88

89
# Deploy dropbear (minimalist ssh server)
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
[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 = $${basedirectory:services}/sshkeys_authority
keygen-binary = ${dropbear:location}/bin/dropbearkey

[dropbear-server]
recipe = slapos.cookbook:dropbear
host = $${slap-network-information:global-ipv6}
port = 2222
home = $${directory:ssh}
wrapper = $${rootdirectory:bin}/raw_sshd
shell = /bin/bash
rsa-keyfile = $${directory:ssh}/server_key.rsa
dropbear-binary = ${dropbear:location}/sbin/dropbear

[sshkeys-dropbear]
<= sshkeys-authority
recipe = slapos.cookbook:sshkeys_authority.request
name = dropbear
type = rsa
executable = $${dropbear-server:wrapper}
public-key = $${dropbear-server:rsa-keyfile}.pub
private-key = $${dropbear-server:rsa-keyfile}
wrapper = $${basedirectory:services}/sshd

[dropbear-server-add-authorized-key]
<= dropbear-server
recipe = slapos.cookbook:dropbear.add_authorized_key
key = $${slap-parameter:authorized-key}


128 129 130
# Request frontend
[request-frontend]
<= slap-connection
131
recipe = slapos.cookbook:requestoptional
132 133 134 135 136 137 138 139 140
name = Frontend
# XXX We have hardcoded SR URL here.
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
slave = true
config = url
config-url = $${slaprunner:access-url}
return = site_url


141 142 143
# Send informations to SlapOS Master
[publish-connection-informations]
recipe = slapos.cookbook:publish
144 145
backend_url = $${slaprunner:access-url}
url =  $${request-frontend:connection-site_url}
146 147
cloud9_url = $${cloud9:access-url}
ssh_command = ssh $${dropbear-server:host} -p $${dropbear-server:port}
148
password_recovery_code = $${recovery-code:passwd}
149 150 151 152

[slap-parameter]
# Default value if no ssh key is specified
authorized-key =
Jean-Baptiste Petre's avatar
Jean-Baptiste Petre committed
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169



# Deploy promises scripts
#[promise]
#recipe = slapos.cookbook:check_port_listening
#path = $${basedirectory:promises}/apache
#hostname = $${apache-php:ip}
#port = $${apache-php:port}

[frontend-promise]
recipe = slapos.cookbook:check_url_available
path = $${basedirectory:promises}/frontend
url = $${request-frontend:connection-site_url}
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl