Commit e44784da authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Merge remote-tracking branch 'origin/master' into erp5-component

parents 4a028ce3 8d2e014d
Changes Changes
======= =======
0.85 (2013-12-03)
-----------------
* Slaprunner: recipe replaced by a buildout profile [14fbcd92]
* Slaprunner: import instances can automatically deploy Software Releases [64c48388]
* Slaprunner: backup script passes basic authentification [8877615]
* Slaprunner: backup doesn't destroy symlinks for Software Releases [f519a078]
* Shellinabox: now uses uid and gid to start [e9349c65]
* Shellinabox: can do autoconnection [516e772]
* Librecipe-generic: correction of bash code for /bin/sh compatibility [bee8c9c8]
0.84.2 (2013-10-04) 0.84.2 (2013-10-04)
------------------- -------------------
......
...@@ -19,7 +19,7 @@ recipe = slapos.recipe.build:npm ...@@ -19,7 +19,7 @@ recipe = slapos.recipe.build:npm
packages = sm@0.2.11 packages = sm@0.2.11
node = nodejs node = nodejs
environment = environment =
PATH=${nodejs:location}/bin:%(PATH)s PATH=${nodejs-0.6:location}/bin:%(PATH)s
[cloud9-stable] [cloud9-stable]
# Online IDE written in javascript/node.js # Online IDE written in javascript/node.js
...@@ -49,7 +49,34 @@ recipe = hexagonit.recipe.download ...@@ -49,7 +49,34 @@ recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
filename = cloud9-socket.patch filename = cloud9-socket.patch
download-only = true download-only = true
#md5sum = 5dc8cc28447ed3747b8a53c768d872aa md5sum = c581456cb3a76841898f79f9600e3a1e
[cloud9-file-already-exist.patch]
# This patch prevents the error "File already exists"
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
filename = cloud9-file_already_exist.patch
download-only = true
md5sum = 0bc104af8176388d60cbf884b72c8318
[cloud9-remove-all-listeners.patch]
# This patch prevents cloud9 to die every
# time a tab is closed
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
filename = cloud9-removeAllListeners.patch
download-only = true
md5sum = 357915330d677f4917140e02a55646b7
[cloud9-git-download]
recipe = slapos.recipe.build:gitclone
repository = https://github.com/ajaxorg/cloud9.git
revision = f7d102bc225c922f116d2cea52a746d64343ea59
location = ${buildout:parts-directory}/cloud9
git-executable = ${git:location}/bin/git
develop = true
use-cache = true
ignore-ssl-certificate = true
[cloud9-git] [cloud9-git]
# Online IDE written in javascript/node.js # Online IDE written in javascript/node.js
...@@ -58,13 +85,10 @@ download-only = true ...@@ -58,13 +85,10 @@ download-only = true
# NODE_PATH=${:destination}/node_modules ${nodejs:node_location} ${:cloud9_js_location} # NODE_PATH=${:destination}/node_modules ${nodejs:node_location} ${:cloud9_js_location}
recipe = plone.recipe.command recipe = plone.recipe.command
stop-on-error = true stop-on-error = true
commit = f7d102bc225c922f116d2cea52a746d64343ea59 environment = export GIT_SSL_NO_VERIFY=true; export PATH=${git:location}/bin:${nodejs-0.6:location}/bin:${node-sm:location}/node_modules/.bin/:$PATH; export CPPFLAGS="-I${libxml2:location}/include -I${nodejs-0.6:location}/include"; export LDFLAGS="-L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib"; export HOME=${cloud9-git-download:location};
repository = https://github.com/ajaxorg/cloud9.git command = ${:environment} (cd ${cloud9-git-download:location} && ${node-sm:location}/node_modules/.bin/sm install && patch -p1 < ${cloud9-session-directory.patch:location}/${cloud9-session-directory.patch:filename} && patch -p1 < ${cloud9-socket.patch:location}/${cloud9-socket.patch:filename} && patch -p1 < ${cloud9-file-already-exist.patch:location}/${cloud9-file-already-exist.patch:filename} && patch -p1 < ${cloud9-remove-all-listeners.patch:location}/${cloud9-remove-all-listeners.patch:filename}) || (rm -fr ${cloud9-git-download:location}; exit 1)
location = ${buildout:parts-directory}/${:_buildout_section_name_} update-command = true
environment = export GIT_SSL_NO_VERIFY=true; export PATH=${git:location}/bin:${nodejs:location}/bin:${node-sm:location}/node_modules/sm/bin:$PATH; export CPPFLAGS="-I${libxml2:location}/include -I${nodejs:location}/include"; export LDFLAGS="-L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib"; export HOME=${:location}; executable = ${cloud9-git-download:location}/server.js
command = ${:environment} (git clone --quiet ${:repository} ${:location} && cd ${:location} && git reset --hard ${:commit} && ${node-sm:location}/node_modules/.bin/sm install && patch -p1 < ${cloud9-session-directory.patch:location}/${cloud9-session-directory.patch:filename} && ${node-sm:location}/node_modules/.bin/sm install && patch -p1 < ${cloud9-socket.patch:location}/${cloud9-socket.patch:filename}) || (rm -fr ${:location}; exit 1)
update-command =
executable = ${:location}/server.js
[cloud9-npm] [cloud9-npm]
# Online IDE written in javascript/node.js # Online IDE written in javascript/node.js
......
diff --git a/node_modules/vfs-local/localfs.js b/node_modules/vfs-local/localfs.js
index 7ce9981..1dd07b7 100644
--- a/node_modules/vfs-local/localfs.js
+++ b/node_modules/vfs-local/localfs.js
@@ -677,7 +677,7 @@ module.exports = function setup(fsOptions) {
else {
var err = new Error("File already exists.");
err.code = "EEXIST";
- callback(err);
+ //callback(err);
}
});
});
diff --git a/plugins-server/cloud9.ide.watcher/file_watcher.js b/plugins-server/cloud9.ide.watcher/file_watcher.
index b7ed7da..36dcd05 100644
--- a/plugins-server/cloud9.ide.watcher/file_watcher.js
+++ b/plugins-server/cloud9.ide.watcher/file_watcher.js
@@ -69,11 +69,11 @@ util.inherits(FileWatcher, EventEmitter);
this.close = function() {
if (this.watcher) {
- this.watcher.removeAllListeners();
+ //this.watcher.removeAllListeners();
this.watcher.close();
this.emit("close");
}
this.watcher = null;
};
-}).call(FileWatcher.prototype);
\ No newline at end of file
+}).call(FileWatcher.prototype);
...@@ -28,7 +28,7 @@ from setuptools import setup, find_packages ...@@ -28,7 +28,7 @@ from setuptools import setup, find_packages
import glob import glob
import os import os
version = '0.84.2' version = '0.85'
name = 'slapos.cookbook' name = 'slapos.cookbook'
long_description = open("README.txt").read() + "\n" + \ long_description = open("README.txt").read() + "\n" + \
open("CHANGES.txt").read() + "\n" open("CHANGES.txt").read() + "\n"
...@@ -184,7 +184,6 @@ setup(name=name, ...@@ -184,7 +184,6 @@ setup(name=name,
'slapmonitor = slapos.recipe.slapmonitor:MonitorRecipe', 'slapmonitor = slapos.recipe.slapmonitor:MonitorRecipe',
'slapmonitor-xml = slapos.recipe.slapmonitor:MonitorXMLRecipe', 'slapmonitor-xml = slapos.recipe.slapmonitor:MonitorXMLRecipe',
'slapreport = slapos.recipe.slapreport:Recipe', 'slapreport = slapos.recipe.slapreport:Recipe',
'slaprunner = slapos.recipe.slaprunner:Recipe',
'slaprunner.test = slapos.recipe.slaprunner:Test', 'slaprunner.test = slapos.recipe.slaprunner:Test',
'slaprunner.export = slapos.recipe.slaprunner.backup:ExportRecipe', 'slaprunner.export = slapos.recipe.slaprunner.backup:ExportRecipe',
'slaprunner.import = slapos.recipe.slaprunner.backup:ImportRecipe', 'slaprunner.import = slapos.recipe.slaprunner.backup:ImportRecipe',
......
...@@ -155,7 +155,7 @@ class GenericBaseRecipe(object): ...@@ -155,7 +155,7 @@ class GenericBaseRecipe(object):
pidfile=%s pidfile=%s
if [ -e $pidfile ]; then if [ -e $pidfile ]; then
pid=$(cat $pidfile) pid=$(cat $pidfile)
if [[ ! -z $(ps -p "$pid" | grep $(basename %s)) ]]; then if [ ! -z $(ps -p "$pid" | grep $(basename %s)) ]; then
echo "Already running with pid $pid." echo "Already running with pid $pid."
exit 1 exit 1
else else
......
...@@ -34,7 +34,11 @@ from slapos.recipe.librecipe import GenericBaseRecipe ...@@ -34,7 +34,11 @@ from slapos.recipe.librecipe import GenericBaseRecipe
def login_shell(args): def login_shell(args):
password = args['password'] password = args['password']
entered_password = getpass()
if (password != ''):
entered_password = getpass()
else:
entered_password = ''
if entered_password != password: if entered_password != password:
return 1 return 1
...@@ -54,11 +58,11 @@ def shellinabox(args): ...@@ -54,11 +58,11 @@ def shellinabox(args):
with open(args['ssl_certificate']) as public_key_file: with open(args['ssl_certificate']) as public_key_file:
print >> certificate_file, public_key_file.read() print >> certificate_file, public_key_file.read()
user = pwd.getpwuid(os.getuid()).pw_name user = pwd.getpwuid(os.getuid()).pw_uid
group = grp.getgrgid(os.getgid()).gr_name group = grp.getgrgid(os.getgid()).gr_gid
service = '/:%(user)s:%(group)s:%(directory)s:%(command)s' % { service = '/:%(user)s:%(group)s:%(directory)s:%(command)s' % {
'user': group, 'user': user,
'group': user, 'group': group,
'directory': args['directory'], 'directory': args['directory'],
'command': args['login_shell'], 'command': args['login_shell'],
} }
......
...@@ -27,78 +27,8 @@ ...@@ -27,78 +27,8 @@
from slapos.recipe.librecipe import GenericBaseRecipe from slapos.recipe.librecipe import GenericBaseRecipe
import os import os
class Recipe(GenericBaseRecipe): #XXX-Nicolas This recipe has to be deleted as soon as possible
#No changes allowed, except full-replacement using buildout
def _options(self, options):
self.ipv4 = options['ipv4'].strip()
self.ipv6 = options['ipv6'].strip()
self.proxy_port = options['proxy_port'].strip()
self.runner_port = options['runner_port'].strip()
self.workdir = options['working-directory'].strip()
self.software_directory = options['software-directory'].strip()
self.instance_directory = options['instance-directory'].strip()
self.partition_amount = options['partition-amount'].strip()
self.cloud9_url = options.get('cloud9-url', '').strip()
self.log_file = os.path.join(options['log_dir'].strip(), 'slaprunner.log')
# Set slaprunner access URL, CLN Beware ipv6 access is made throught nginx
options['access-url'] = 'https://[%s]:%s' % (self.ipv6, self.runner_port)
def install(self):
path_list = []
configuration = dict(
software_root=self.software_directory,
instance_root=self.instance_directory,
master_url='http://%s:%s' % (self.ipv4, self.proxy_port),
computer_id='slaprunner',
partition_amount=self.partition_amount,
slapgrid_sr=self.options['slapgrid_sr'],
slapgrid_cp=self.options['slapgrid_cp'],
slapproxy=self.options['slapproxy'],
supervisor=self.options['supervisor'],
supervisord_config=os.path.join(self.instance_directory, 'etc',
'supervisord.conf'),
runner_workdir=self.workdir,
etc_dir=self.options['etc_dir'],
run_dir=self.options['run_dir'],
log_dir=self.options['log_dir'],
runner_host=self.ipv4,
runner_port=self.runner_port,
ipv4_address=self.ipv4,
ipv6_address=self.ipv6,
proxy_host=self.ipv4,
proxy_port=self.proxy_port,
proxy_database=os.path.join(self.workdir, 'proxy.db'),
git=self.options['git-binary'],
ssh_client=self.options['ssh_client'],
public_key=self.options['public_key'],
private_key=self.options['private_key'],
cloud9_url=self.cloud9_url
)
config_file = self.createFile(self.options['slapos.cfg'],
self.substituteTemplate(self.getTemplateFilename('slapos.cfg.in'),
configuration))
path_list.append(config_file)
environment = dict(
PATH=os.path.dirname(
self.options['git-binary']) + ':' + os.environ['PATH'],
GIT_SSH=self.options['ssh_client']
)
launch_args = [self.options['slaprunner'].strip(), config_file,
'--log_file', self.log_file]
if self.optionIsTrue('debug', default=False):
launch_args.append('--debug')
wrapper = self.createPythonScript(self.options['wrapper'],
'slapos.recipe.librecipe.execute.executee',
(launch_args, environment)
)
path_list.append(wrapper)
return path_list
class Test(GenericBaseRecipe): class Test(GenericBaseRecipe):
def _options(self, options): def _options(self, options):
self.ipv4 = options['ipv4'].strip() self.ipv4 = options['ipv4'].strip()
......
...@@ -70,7 +70,7 @@ class ExportRecipe(GenericBaseRecipe): ...@@ -70,7 +70,7 @@ class ExportRecipe(GenericBaseRecipe):
fi fi
done done
} }
sync_element %(srv-directory)s/runner %(backup-directory)s/runner/ instance project proxy.db softwareLink sync_element %(srv-directory)s/runner %(backup-directory)s/runner/ instance project proxy.db
sync_element %(etc-directory)s %(backup-directory)s/etc/ .rcode .project .users .htpasswd ssh sync_element %(etc-directory)s %(backup-directory)s/etc/ .rcode .project .users .htpasswd ssh
if [ -d %(backup-directory)s/runner/software ]; then if [ -d %(backup-directory)s/runner/software ]; then
rm %(backup-directory)s/runner/software/* rm %(backup-directory)s/runner/software/*
...@@ -119,13 +119,14 @@ class ImportRecipe(GenericBaseRecipe): ...@@ -119,13 +119,14 @@ class ImportRecipe(GenericBaseRecipe):
fi fi
done done
} }
restore_element %(backup-directory)s/runner/ %(srv-directory)s/runner instance project proxy.db softwareLink restore_element %(backup-directory)s/runner/ %(srv-directory)s/runner instance project proxy.db
restore_element %(backup-directory)s/etc/ %(etc-directory)s .rcode .project .users .htpasswd ssh restore_element %(backup-directory)s/etc/ %(etc-directory)s .rcode .project .users .htpasswd ssh
ifs=$IFS IFS=';' ifs=$IFS IFS=';'
read user pass remaining < %(etc-directory)s/.users read user pass remaining < %(etc-directory)s/.users
IFS=$ifs IFS=$ifs
%(curl-binary)s --insecure -vg6L -F clogin="$user" -F cpwd="$pass" --dump-header login_cookie %(backend-url)s/doLogin; %(curl-binary)s --insecure -vg6L -F clogin="$user" -F cpwd="$pass" --dump-header login_cookie %(backend-url)s/doLogin;
%(curl-binary)s --insecure -vg6LX POST --cookie login_cookie --max-time 5 %(backend-url)s/runSoftwareProfile; %(curl-binary)s --insecure -vg6L --cookie login_cookie --max-time 5 %(backend-url)s/isSRReady;
%(curl-binary)s --insecure -vg6LX POST --cookie login_cookie --max-time 5 %(backend-url)s/runSoftwareProfile --user "$user":"$pass";
rm -f login_cookie rm -f login_cookie
""" % self.options) """ % self.options)
self.createExecutable(wrapper, content=content) self.createExecutable(wrapper, content=content)
......
...@@ -28,3 +28,74 @@ instance-amount ...@@ -28,3 +28,74 @@ instance-amount
Optional parameter. Optional parameter.
Default: 10 Default: 10
AUTO-DEPLOYMENT
---------------
You can automatically deploy a software release while deploying the webrunner itself, using the paramater XML.
To do this, you only need to pass as a parameter named "slapos-software" : "AAA/BBB", where AAA is the folder of slapos.git where is located your BBB software.
For example, to deploy the hello-world software, you need to pass : software/helloworld
This is possible because the slapos.git is automatically downloaded when the webrunner is deployed.
It is also possible to download you own git repository, by providing the url in the "slapos-repository" parameter.
Last but not least, it is also possible to switch the branch with the parameter "slapos-reference" (by default pointing on master)
Resilience :
------------
To order a resilient runner, you have to request a runner with the option: "--type resilient"
You can then decide on which node you want to deploy each instance, with the parameters.xml :
<?xml version='1.0' encoding='utf-8'?>
<instance>
<parameter id="-sla-runner2-computer_guid">COMP-XXXX</parameter>
<parameter id="-sla-pbs2-computer_guid">COMP-XXXX</parameter>
<parameter id="-sla-pbs1-computer_guid">COMP-XXXX</parameter>
<parameter id="-sla-runner1-computer_guid">COMP-XXXX</parameter>
<parameter id="-sla-runner0-computer_guid">COMP-XXXX</parameter>
</instance>
If you want to check by yourself that the pull-backup instances do their job, you can change directory to the slappart of runner0, and run ./bin/exporter (after creating your account, using the given backend_url or url): it would fill ./srv/backup/runner with data. If you then go to an import instance (runner1 or runner2) on the port 50005, you should be able to sign in the runner.
Tips :
~~~~~
To find in which partition the instance has been deployed, you can open the page of this specific instance, and look for "slappartXX" on the page.
Tests :
-------
To test the runner, start by ordering a runner with default type. Then READ the important note below :
/!\ IMPORTANT NOTE ON THE TESTS /!\ : in order to make them work, you have to comment the last line of the file __init__.py in the runner module (which is just : "run()"). Indeed, this line is used to load the config, when importing this module throught Gunicorn (the wsgi server). But the test suite loads itself the configuration, in fonction of the tested scenarios, etc... (You can find the module in the SR folder directory, under ./eggs/slapos.toolbox, or under parts/slapos.toolbox if you have a development version)
Then, su in the concerned slapuserX and run "./bin/runTestSuite".
For the tests on the resiliency of the webrunner, please refer to the README in slapos.toolbox.git/slapos/resiliencytest
Request custom frontend :
-------------------------
While deploying a server in your instance, you may need to ask for a custom ipv4 frontend.
The way to do that is to send a new parameter to your runner instance, using the parameters XML. The name of it is "custom-frontend-backend-url".
To create the frontend, you now have to wait the slaprunner to be processed.
If you deploy a server, which uses basic auth, you also have to declare the parameter "custom-frontend-basic-auth" as true, or your slaprunner instance won't show as correctly instanciated.
Example :
<?xml version='1.0' encoding='utf-8'?>
<instance>
<parameter id="custom-frontend-backend-url">http(s)://[THE_IPV6_ADDRESS]:PORT</parameter>
<parameter id="custom-frontend-basic-auth">true</parameter>
</instance>
Things to notice for the nex developer :
----------------------------------------
As you can see in instance-runner-*.cfg, the buildout section extends a hard-coded template file. If one day you need to modify the filename, do not forget to modify it in instance.cfg, but also in these files ! (the problem is that the content of instance.cfg is not known by buildout while the deployment of the software release)
- Use https to connect to the runner. !!! Critical
- resilient sr: Cloned instances should not launch slapgrid-sr if it was not launched on export instance - resilient sr: Cloned instances should not launch slapgrid-sr if it was not launched on export instance
- shellinabox password should be the same in all the resilient instances
...@@ -9,6 +9,9 @@ extends = ...@@ -9,6 +9,9 @@ extends =
../../component/lxml-python/buildout.cfg ../../component/lxml-python/buildout.cfg
../../component/nginx/buildout.cfg ../../component/nginx/buildout.cfg
../../component/rsync/buildout.cfg ../../component/rsync/buildout.cfg
../../component/python-2.7/buildout.cfg
../../component/shellinabox/buildout.cfg
../../component/busybox/buildout.cfg
../../stack/flask.cfg ../../stack/flask.cfg
../../stack/shacache-client.cfg ../../stack/shacache-client.cfg
../../stack/resilient/buildout.cfg ../../stack/resilient/buildout.cfg
...@@ -25,7 +28,7 @@ parts = ...@@ -25,7 +28,7 @@ parts =
instance-runner-import instance-runner-import
instance-runner-export instance-runner-export
slapos-cookbook slapos-cookbook
slapos-cfg-template
# XXX: we have to manually add this for resilience # XXX: we have to manually add this for resilience
rdiff-backup rdiff-backup
collective.recipe.template-egg collective.recipe.template-egg
...@@ -76,48 +79,50 @@ command = ...@@ -76,48 +79,50 @@ command =
recipe = slapos.recipe.template 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
md5sum = 92a2f3bcd5ff79e3b61ca4a8bacb73ec md5sum = 8a47421ac6158b4ee476acab212c67d9
mode = 0644 mode = 0644
[template-runner] [template-runner]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner.cfg url = ${:_profile_base_location_}/instance-runner.cfg
output = ${buildout:directory}/template-runner.cfg output = ${buildout:directory}/template-runner.cfg.in
md5sum = bcd1ee4dd126d2c6e9461f7753fc83b7 md5sum = e1f7b39241c1c211410ad5ef75845c68
mode = 0644 mode = 0644
[instance-runner-import] [instance-runner-import]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner-import.cfg.in url = ${:_profile_base_location_}/instance-runner-import.cfg.in
output = ${buildout:directory}/instance-runner-import.cfg output = ${buildout:directory}/instance-runner-import.cfg
md5sum = f16cb60bb16632e652bea69cd5cdd9b7 md5sum = 93e3c496c0955a0f7e09570bbe44e3ea
mode = 0644 mode = 0644
[instance-runner-export] [instance-runner-export]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner-export.cfg.in url = ${:_profile_base_location_}/instance-runner-export.cfg.in
output = ${buildout:directory}/instance-runner-export.cfg output = ${buildout:directory}/instance-runner-export.cfg
md5sum = 9ce3482e64a0c957f7a5f25ad0dc03ae md5sum = 3a69ef9a2743dbb4ab0708a7675d100c
mode = 0644 mode = 0644
[template-resilient] [template-resilient]
recipe = slapos.recipe.download recipe = slapos.recipe.download
url = ${:_profile_base_location_}/instance-resilient.cfg.jinja2 url = ${:_profile_base_location_}/instance-resilient.cfg.jinja2
md5sum = 2562a6ac6893cc71a7328d7064aff599 md5sum = c23e8eb84b4e8375543e104e0993a019
filename = instance-resilient.cfg.jinja2 filename = instance-resilient.cfg.jinja2
mode = 0644 mode = 0644
[template-resilient-test] [template-resilient-test]
recipe = slapos.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/instance-resilient-test.cfg.jinja2 url = ${:_profile_base_location_}/instance-resilient-test.cfg.jinja2
md5sum = ac772d3a1cce4072acfabd563df449bb download-only = true
md5sum = 18269f9c88f9c3bb1c2b535e44f64f56
filename = instance-resilient-test.cfg.jinja2 filename = instance-resilient-test.cfg.jinja2
mode = 0644 mode = 0644
[template_nginx_conf] [template_nginx_conf]
recipe = slapos.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/nginx_conf.in url = ${:_profile_base_location_}/nginx_conf.in
md5sum = 09b7677dfc6b23c1f58e67fd06a7625e download-only = true
md5sum = e169a8f217fab490ffb435d4b2d07ef3
filename = nginx_conf.in filename = nginx_conf.in
mode = 0644 mode = 0644
...@@ -129,6 +134,15 @@ filename = launcher.in ...@@ -129,6 +134,15 @@ filename = launcher.in
mode = 0644 mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
[slapos-cfg-template]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/${:filename}
md5sum = 6e90b4d037ba549640345827370f8dc3
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = slapos.cfg.in
download-only = true
mode = 0644
[eggs] [eggs]
recipe = z3c.recipe.scripts recipe = z3c.recipe.scripts
eggs = eggs =
...@@ -145,6 +159,8 @@ eggs = ...@@ -145,6 +159,8 @@ eggs =
slapos.core slapos.core
xml_marshaller xml_marshaller
pytz pytz
collective.recipe.environment
Gunicorn
# Add slapos.libnetworkcache to path of slapos.core so that slaprunner can build SRs using cache # Add slapos.libnetworkcache to path of slapos.core so that slaprunner can build SRs using cache
[slapos-cookbook] [slapos-cookbook]
...@@ -162,4 +178,3 @@ eggs = ...@@ -162,4 +178,3 @@ eggs =
xml_marshaller xml_marshaller
pytz pytz
slapos.libnetworkcache slapos.libnetworkcache
...@@ -26,20 +26,21 @@ develop = ...@@ -26,20 +26,21 @@ develop =
[slapos.toolbox-repository] [slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.toolbox.git repository = http://git.erp5.org/repos/slapos.toolbox.git
branch = kvmresiliency branch = slaprunner-paas
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
[slapos.cookbook-repository] [slapos.cookbook-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.git repository = http://git.erp5.org/repos/slapos.git
branch = slaprunner branch = slaprunner-paas-test
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
# Used for resiliency tests only # Used for resiliency tests only
[erp5.util-repository] [erp5.util-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/erp5.git repository = http://git.erp5.org/repos/erp5.git
branch = scalability-master2 #branch = scalability-master2
revision = f9a812f4e97ffeed359bc5611366a5c8675ec749
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
#[slapos.core-repository] #[slapos.core-repository]
......
...@@ -46,10 +46,13 @@ config = resiliency-backup-periodicity frontend-domain cloud9-frontend-domain {{ ...@@ -46,10 +46,13 @@ config = resiliency-backup-periodicity frontend-domain cloud9-frontend-domain {{
{% for key, value in cluster_parameter_dict.items() -%} {% for key, value in cluster_parameter_dict.items() -%}
config-{{ key }} = {{ dumps(value) }} config-{{ key }} = {{ dumps(value) }}
{% endfor -%} {% endfor -%}
config-resiliency-backup-periodicity = * config-resiliency-backup-periodicity = * * * * *
# XXX hardcoded # XXX hardcoded
config-frontend-domain = google.com config-frontend-domain = google.com
config-cloud9-frontend-domain = google.com config-cloud9-frontend-domain = google.com
# XXX Hack to deploy Root Instance on the same computer as the type-test Instance
sla = computer_guid
sla-computer_guid = ${slap-connection:computer-id}
return = backend_url return = backend_url
[slap-parameter] [slap-parameter]
...@@ -17,17 +17,19 @@ parts += ...@@ -17,17 +17,19 @@ parts +=
# Bubble up the parameters # Bubble up the parameters
[request-runner] [request-runner]
return = url ssh-public-key ssh-url notification-id ip backend_url url cloud9_url ssh_command password_recovery_code cloud9_backend_url return = url ssh-public-key ssh-url notification-id ip backend_url url cloud9_url ssh_command password_recovery_code cloud9_backend_url shell_password access_url
[publish-connection-informations] [publish-connection-informations]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
1_info = Set your passord in slaprunner in order to access cloud9 1_info = Set your passord in slaprunner in order to access cloud9
backend_url = ${request-runner:connection-backend_url} backend_url = ${request-runner:connection-backend_url}
access_url = ${request-runner:connection-access_url}
url = ${request-runner:connection-url} url = ${request-runner:connection-url}
cloud9_url = ${request-runner:connection-cloud9_url} cloud9_url = ${request-runner:connection-cloud9_url}
cloud9_backend_url = ${request-runner:connection-cloud9_backend_url} cloud9_backend_url = ${request-runner:connection-cloud9_backend_url}
ssh_command = ${request-runner:connection-ssh_command} ssh_command = ${request-runner:connection-ssh_command}
password_recovery_code = ${request-runner:connection-password_recovery_code} password_recovery_code = ${request-runner:connection-password_recovery_code}
shell_password = ${request-runner:connection-shell_password}
[slap-parameter] [slap-parameter]
# Default parameters for distributed deployment # Default parameters for distributed deployment
......
[buildout] [buildout]
extends = ${template-runner:output} extends = template-runner.cfg
${pbsready-export:output} ${pbsready-export:output}
parts += parts +=
...@@ -9,20 +9,28 @@ parts += ...@@ -9,20 +9,28 @@ parts +=
certificate-authority certificate-authority
ca-nginx ca-nginx
ca-node-frontend ca-node-frontend
slaprunner ca-shellinabox
gunicorn-launcher
gunicorn-graceful
test-runner test-runner
sshkeys-dropbear-runner sshkeys-dropbear-runner
dropbear-server-add-authorized-key dropbear-server-add-authorized-key
sshkeys-authority sshkeys-authority
publish-connection-informations
slaprunner-promise slaprunner-promise
slaprunner-frontend-promise slaprunner-frontend-promise
cloud9-promise cloud9-promise
cloud9-frontend-promise cloud9-frontend-promise
dropbear-promise dropbear-promise
shellinabox-promise
symlinks symlinks
request-cloud9-frontend
node-frontend-promise node-frontend-promise
nginx-promise nginx-promise
publish-connection-informations shellinabox
slapos-cfg
slapos-repo-config
prepare-software
cron-entry-backup cron-entry-backup
[exporter] [exporter]
......
[buildout] [buildout]
extends = ${template-runner:output} extends = template-runner.cfg
${pbsready-import:output} ${pbsready-import:output}
parts += parts +=
...@@ -9,7 +9,9 @@ parts += ...@@ -9,7 +9,9 @@ parts +=
certificate-authority certificate-authority
ca-nginx ca-nginx
ca-node-frontend ca-node-frontend
slaprunner ca-shellinabox
gunicorn-launcher
gunicorn-graceful
test-runner test-runner
sshkeys-dropbear-runner sshkeys-dropbear-runner
dropbear-server-add-authorized-key dropbear-server-add-authorized-key
...@@ -17,8 +19,14 @@ parts += ...@@ -17,8 +19,14 @@ parts +=
slaprunner-promise slaprunner-promise
cloud9-promise cloud9-promise
dropbear-promise dropbear-promise
shellinabox-promise
nginx-promise
shellinabox
symlinks symlinks
nginx-promise nginx-promise
slapos-cfg
slapos-repo-config
prepare-software
# have to repeat the next one, as it's not inherited from pbsready-import # have to repeat the next one, as it's not inherited from pbsready-import
import-on-notification import-on-notification
......
This diff is collapsed.
...@@ -7,16 +7,30 @@ develop-eggs-directory = ${buildout:develop-eggs-directory} ...@@ -7,16 +7,30 @@ develop-eggs-directory = ${buildout:develop-eggs-directory}
[switch_softwaretype] [switch_softwaretype]
recipe = slapos.cookbook:softwaretype recipe = slapos.cookbook:softwaretype
default = ${template-runner:output} default = $${instance-base-runner:rendered}
resilient = $${instance-resilient:rendered} resilient = $${instance-resilient:rendered}
test = $${instance-resilient-test:rendered} test = $${instance-resilient-test:rendered}
runner = ${template-runner:output} runner = $${instance-base-runner:rendered}
runner-import = ${instance-runner-import:output} runner-import = ${instance-runner-import:output}
runner-export = ${instance-runner-export:output} runner-export = ${instance-runner-export:output}
frozen = ${instance-frozen:output} frozen = ${instance-frozen:output}
pull-backup = ${template-pull-backup:output} pull-backup = ${template-pull-backup:output}
[instance-base-runner]
recipe = slapos.recipe.template:jinja2
template = ${template-runner:output}
rendered = $${buildout:directory}/template-runner.cfg
extensions = jinja2.ext.do
context = key buildout buildout:bin-directory
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
key slapparameter_dict slap-configuration:configuration
raw curl_executable_location ${curl:location}/bin/curl
raw dash_executable_location ${dash:location}/bin/dash
raw dcron_executable_location ${dcron:location}/sbin/crond
mode = 0644
[instance-resilient] [instance-resilient]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${template-resilient:target} template = ${template-resilient:target}
...@@ -50,4 +64,4 @@ computer = $${slap-connection:computer-id} ...@@ -50,4 +64,4 @@ computer = $${slap-connection:computer-id}
partition = $${slap-connection:partition-id} partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url} url = $${slap-connection:server-url}
key = $${slap-connection:key-file} key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file} cert = $${slap-connection:cert-file}
\ No newline at end of file
...@@ -55,16 +55,39 @@ http { ...@@ -55,16 +55,39 @@ http {
fastcgi_temp_path {{ param_tempdir['fastcgi_temp_path'] }}; fastcgi_temp_path {{ param_tempdir['fastcgi_temp_path'] }};
uwsgi_temp_path {{ param_tempdir['uwsgi_temp_path'] }}; uwsgi_temp_path {{ param_tempdir['uwsgi_temp_path'] }};
scgi_temp_path {{ param_tempdir['scgi_temp_path'] }}; scgi_temp_path {{ param_tempdir['scgi_temp_path'] }};
error_page 401 /login;
location / { location / {
proxy_pass http://{{ param_nginx_frontend['runner-ip'] }}:{{ param_nginx_frontend['runner-port'] }}; auth_basic "Restricted";
auth_basic_user_file {{ param_nginx_frontend['etc_dir'] }}/.htpasswd;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Accel-Mapping /private/;
proxy_pass http://unix:{{ socket }};
}
location ~ ^(/login|/doLogin|/static|/setAccount|/configAccount|/slapgridResult|/isSRReady) {
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Accel-Mapping /private/;
proxy_pass http://unix:{{ socket }};
}
location /shellinabox {
proxy_pass http://[{{ param_nginx_frontend['global-ip'] }}]:{{ shellinabox_port }}/;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
auth_basic "Restricted";
auth_basic_user_file {{ param_nginx_frontend['etc_dir'] }}/.htpasswd;
proxy_redirect off; proxy_redirect off;
proxy_buffering off; proxy_buffering off;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $http_host; proxy_set_header X-Forwarded-Host $http_host;
} }
} }
} }
This diff is collapsed.
[slapos]
software_root = {{ software_root }}
instance_root = {{instance_root }}
master_url = http://{{ ipv4 }}:{{ proxy_port }}
computer_id = slaprunner
maximal_delay = 0
[slapformat]
partition_amount = {{ partition_amount }}
[slaprunner]
slapgrid_sr = {{ slapgrid_sr }}
slapgrid_cp = {{ slapgrid_cp }}
slapproxy = {{ slapproxy }}
supervisor = {{ supervisor }}
supervisord_config = {{ supervisord_config }}
runner_workdir = {{ runner_workdir }}
runner_host = {{ ipv4 }}
runner_port = {{ runner_port }}
ipv4_address = {{ ipv4 }}
ipv6_address = {{ ipv6 }}
etc_dir = {{ etc_dir }}
run_dir = {{ run_dir }}
log_dir = {{ log_dir }}
console = {{ console }}
verbose = {{ verbose }}
debug = {{ debug }}
auto_deploy = {{ auto_deploy }}
[slapproxy]
host = {{ proxy_host }}
port = {{ proxy_port }}
database_uri = {{ proxy_database }}
[sshkeys_authority]
ssh_client = {{ ssh_client }}
public_key = {{ public_key }}
private_key = {{ private_key }}
[gitclient]
git = {{ git }}
[cloud9_IDE]
cloud9 = {{ cloud9_url }}
...@@ -141,7 +141,7 @@ parts = ...@@ -141,7 +141,7 @@ parts =
[slapos.cookbook-repository] [slapos.cookbook-repository]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.git repository = http://git.erp5.org/repos/slapos.git
branch = erp5-component branch = erp5
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
[check-recipe] [check-recipe]
......
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