[buildout] parts = cloud9 slaprunner test-runner sshkeys-dropbear dropbear-server-add-authorized-key sshkeys-authority publish-connection-informations slaprunner-promise slaprunner-frontend-promise cloud9-promise dropbear-promise eggs-directory = ${buildout:eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory} offline = true # 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/ 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] recipe = slapos.cookbook:generate.password storage-path = $${rootdirectory:etc}/.rcode bytes = 4 # Deploy cloud9 and slaprunner [cloud9] recipe = slapos.cookbook:cloud9 ip = $${slap-network-information:global-ipv6} port = 30000 wrapper = $${basedirectory:services}/cloud9 working-directory = $${runnerdirectory:home} git-binary = ${git:location}/bin/git node-binary = ${nodejs:location}/bin/node cloud9 = ${cloud9:executable} [slaprunner] recipe = slapos.cookbook:slaprunner 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 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} etc_dir = $${rootdirectory:etc} log_dir = $${basedirectory:log} run_dir = $${basedirectory:run} ssh_client = $${sshkeys-dropbear:wrapper} public_key = $${sshkeys-dropbear:public-key} private_key = $${sshkeys-dropbear:private-key} ipv4 = $${slap-network-information:local-ipv4} ipv6 = $${slap-network-information:global-ipv6} proxy_port = 50000 runner_port = 50000 partition-amount = $${slap-parameter:instance-amount} cloud9-url = $${cloud9:access-url} wrapper = $${basedirectory:services}/slaprunner debug = $${slap-parameter:debug} # Deploy dropbear (minimalist ssh server) [sshkeys-directory] 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} proxy_port = 8602 wrapper = $${rootdirectory:bin}/runTestSuite etc_dir = $${basedirectory:test} [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} # Request frontend [request-frontend] <= slap-connection recipe = slapos.cookbook:requestoptional 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 # Send informations to SlapOS Master [publish-connection-informations] recipe = slapos.cookbook:publish backend_url = $${slaprunner:access-url} url = $${request-frontend:connection-site_url} cloud9_url = $${cloud9:access-url} ssh_command = ssh $${dropbear-server:host} -p $${dropbear-server:port} password_recovery_code = $${recovery-code:passwd} # Deploy promises scripts [slaprunner-promise] recipe = slapos.cookbook:check_port_listening path = $${basedirectory:promises}/slaprunner hostname = $${slaprunner:ipv6} port = $${slaprunner:runner_port} [slaprunner-frontend-promise] recipe = slapos.cookbook:check_url_available path = $${basedirectory:promises}/slaprunner_frontend url = $${request-frontend:connection-site_url} dash_path = ${dash:location}/bin/dash curl_path = ${curl:location}/bin/curl [cloud9-promise] recipe = slapos.cookbook:check_url_available path = $${basedirectory:promises}/cloud9 url = http://$${cloud9:ip}:$${cloud9:port} dash_path = ${dash:location}/bin/dash curl_path = ${curl:location}/bin/curl [dropbear-promise] recipe = slapos.cookbook:check_port_listening path = $${basedirectory:promises}/dropbear hostname = $${dropbear-server:host} port = $${dropbear-server:port} [slap-parameter] # Default value if no ssh key is specified authorized-key = # Default value of instances number in slaprunner instance-amount = 10 debug = false