instance-runner.cfg 6.1 KB
Newer Older
1 2
[buildout]
parts =
3
  cloud9
4
  slaprunner
5
  test-runner
6 7
  sshkeys-dropbear
  dropbear-server-add-authorized-key
8
  sshkeys-authority
9
  publish-connection-informations
10 11 12 13
  slaprunner-promise
  slaprunner-frontend-promise
  cloud9-promise
  dropbear-promise
14
  symlinks
15

16

17 18 19 20
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true

21 22

# Create all needed directories
23
[directory]
24 25 26 27 28 29
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/
var = $${buildout:directory}/var/
srv = $${buildout:directory}/srv/
bin = $${buildout:directory}/bin/

30 31 32 33 34 35 36 37 38
sshkeys = $${:srv}/sshkeys
services = $${:etc}/service/
scripts = $${:etc}/run/
ssh = $${:etc}/ssh/
log = $${:var}/log/
run = $${:var}/run/
backup = $${:srv}/backup/
promises = $${:etc}/promise/
test = $${:etc}/test/
39 40 41

[runnerdirectory]
recipe = slapos.cookbook:mkdirectory
42 43
home = $${directory:srv}/runner/
test = $${directory:srv}/test/
44 45 46
project = $${:home}/project
software-root = $${:home}/software
instance-root = $${:home}/instance
47 48 49
project-test = $${:test}/project
software-test = $${:test}/software
instance-test = $${:test}/instance
50
sessions = $${buildout:directory}/.sessions
51

52 53
#Create password recovery code for slaprunner
[recovery-code]
54
recipe = slapos.cookbook:generate.password
55
storage-path = $${directory:etc}/.rcode
56 57
bytes = 4

58 59 60 61
# Deploy cloud9 and slaprunner
[cloud9]
recipe = slapos.cookbook:cloud9
ip = $${slap-network-information:global-ipv6}
Jean-Baptiste Petre's avatar
Jean-Baptiste Petre committed
62
port = 30000
63
wrapper = $${directory:services}/cloud9
64 65
working-directory = $${runnerdirectory:home}
git-binary = ${git:location}/bin/git
Cédric de Saint Martin's avatar
Cédric de Saint Martin committed
66
node-binary = ${nodejs:location}/bin/node
67
cloud9 = ${cloud9:executable}
68 69 70

[slaprunner]
recipe = slapos.cookbook:slaprunner
71 72 73 74 75
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
76
git-binary = ${git:location}/bin/git
77
slapos.cfg = $${directory:etc}/slapos.cfg
78 79 80 81
working-directory = $${runnerdirectory:home}
project-directory = $${runnerdirectory:project}
software-directory = $${runnerdirectory:software-root}
instance-directory = $${runnerdirectory:instance-root}
82 83 84
etc_dir = $${directory:etc}
log_dir =  $${directory:log}
run_dir = $${directory:run}
85 86 87
ssh_client = $${sshkeys-dropbear:wrapper}
public_key = $${sshkeys-dropbear:public-key}
private_key = $${sshkeys-dropbear:private-key}
88 89
ipv4 = $${slap-network-information:local-ipv4}
ipv6 = $${slap-network-information:global-ipv6}
Jean-Baptiste Petre's avatar
Jean-Baptiste Petre committed
90 91
proxy_port = 50000
runner_port = 50000
92
partition-amount = $${slap-parameter:instance-amount}
93
cloud9-url = $${cloud9:access-url}
94
wrapper = $${directory:services}/slaprunner
95
debug = $${slap-parameter:debug}
96

97 98 99 100
[test-runner]
<= slaprunner
recipe = slapos.cookbook:slaprunner.test
slaprunnertest = ${buildout:directory}/bin/slaprunnertest
101
slapos.cfg = $${directory:etc}/slapos-test.cfg
102 103 104 105
working-directory = $${runnerdirectory:test}
project-directory = $${runnerdirectory:project-test}
software-directory = $${runnerdirectory:software-test}
instance-directory = $${runnerdirectory:instance-test}
106
proxy_port = 8602
107 108 109 110 111 112 113 114 115
wrapper = $${directory:bin}/runTestSuite
etc_dir = $${directory:test}


# Deploy dropbear (minimalist SSH server)
[sshkeys-directory]
recipe = slapos.cookbook:mkdirectory
requests = $${directory:sshkeys}/requests/
keys = $${directory:sshkeys}/keys/
116

117 118 119 120
[sshkeys-authority]
recipe = slapos.cookbook:sshkeys_authority
request-directory = $${sshkeys-directory:requests}
keys-directory = $${sshkeys-directory:keys}
121
wrapper = $${directory:services}/sshkeys_authority
122 123 124 125 126 127 128
keygen-binary = ${dropbear:location}/bin/dropbearkey

[dropbear-server]
recipe = slapos.cookbook:dropbear
host = $${slap-network-information:global-ipv6}
port = 2222
home = $${directory:ssh}
129
wrapper = $${directory:bin}/raw_sshd
130 131 132 133 134 135 136 137 138 139 140 141
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}
142
wrapper = $${directory:services}/sshd
143 144 145 146 147 148 149

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


150 151 152
# Request frontend
[request-frontend]
<= slap-connection
153
recipe = slapos.cookbook:requestoptional
154 155 156 157 158 159 160 161 162
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


163 164 165
# Send informations to SlapOS Master
[publish-connection-informations]
recipe = slapos.cookbook:publish
166 167
backend_url = $${slaprunner:access-url}
url =  $${request-frontend:connection-site_url}
168 169
cloud9_url = $${cloud9:access-url}
ssh_command = ssh $${dropbear-server:host} -p $${dropbear-server:port}
170
password_recovery_code = $${recovery-code:passwd}
171

Jean-Baptiste Petre's avatar
Jean-Baptiste Petre committed
172 173

# Deploy promises scripts
174 175
[slaprunner-promise]
recipe = slapos.cookbook:check_port_listening
176
path = $${directory:promises}/slaprunner
177 178
hostname = $${slaprunner:ipv6}
port = $${slaprunner:runner_port}
Jean-Baptiste Petre's avatar
Jean-Baptiste Petre committed
179

180
[slaprunner-frontend-promise]
Jean-Baptiste Petre's avatar
Jean-Baptiste Petre committed
181
recipe = slapos.cookbook:check_url_available
182
path = $${directory:promises}/slaprunner_frontend
Jean-Baptiste Petre's avatar
Jean-Baptiste Petre committed
183 184 185 186
url = $${request-frontend:connection-site_url}
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl

187 188
[cloud9-promise]
recipe = slapos.cookbook:check_url_available
189
path = $${directory:promises}/cloud9
190
url = http://$${cloud9:ip}:$${cloud9:port}
191 192 193 194 195
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl

[dropbear-promise]
recipe = slapos.cookbook:check_port_listening
196
path = $${directory:promises}/dropbear
197 198 199
hostname = $${dropbear-server:host}
port = $${dropbear-server:port}

200 201
[symlinks]
recipe = cns.recipe.symlink
202
symlink_target = $${directory:bin}
203
symlink_base = ${buildout:directory}/bin
204 205 206 207

[slap-parameter]
# Default value if no ssh key is specified
authorized-key =
208
# Default value of instances number in slaprunner
209
instance-amount = 10
210
debug = false