Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
isaak yansane-sisk
slapos
Commits
c52f1520
Commit
c52f1520
authored
Aug 13, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'slaprunner'
parents
f0b93939
6d29cac1
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
183 additions
and
152 deletions
+183
-152
component/apache/buildout.cfg
component/apache/buildout.cfg
+2
-2
component/cloud9/buildout.cfg
component/cloud9/buildout.cfg
+3
-5
setup.py
setup.py
+1
-0
slapos/recipe/check_url_available/template/check_url.in
slapos/recipe/check_url_available/template/check_url.in
+8
-2
slapos/recipe/requestoptional.py
slapos/recipe/requestoptional.py
+107
-0
slapos/recipe/slaprunner/__init__.py
slapos/recipe/slaprunner/__init__.py
+1
-1
slapos/recipe/slaprunner/template/slapos.cfg.in
slapos/recipe/slaprunner/template/slapos.cfg.in
+1
-0
software/drupal/software.cfg
software/drupal/software.cfg
+2
-2
software/slaprunner/instance-runner.cfg
software/slaprunner/instance-runner.cfg
+7
-6
software/slaprunner/software.cfg
software/slaprunner/software.cfg
+48
-31
stack/lamp/buildout.cfg
stack/lamp/buildout.cfg
+1
-101
stack/lamp/instance-apache-php.cfg
stack/lamp/instance-apache-php.cfg
+2
-2
No files found.
component/apache/buildout.cfg
View file @
c52f1520
...
...
@@ -30,10 +30,10 @@ md5sum = 52b31b33fb1aa16e65ddaefc76e41151
recipe = hexagonit.recipe.cmmi
depends =
${gdbm:version}
version = 2.4.
1
version = 2.4.
2
revision = 1
url = http://mir2.ovh.net/ftp.apache.org/dist/httpd/httpd-${:version}.tar.bz2
md5sum =
7d3001c7a26b985d17caa367a868f11c
md5sum =
6bb12f726e22656f0ad2baf91f1f8329
configure-command = cp -ar ${apr:location}/apr-${apr:version} srclib/apr/; cp -ar ${apr-util:location}/apr-util-${apr-util:version} srclib/apr-util; ./configure
configure-options = --prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--disable-static
...
...
component/cloud9/buildout.cfg
View file @
c52f1520
...
...
@@ -28,13 +28,11 @@ environment =
# NODE_PATH=${:destination}/node_modules ${nodejs:node_location} ${:cloud9_js_location}
recipe = plone.recipe.command
stop-on-error = true
commit =
9caeac82317bdf8e9942fd17676325234cfadac8
commit =
1f46081df51e6654cef17c205fbf589b219133a7
repository = https://github.com/ajaxorg/cloud9.git
location = ${buildout:parts-directory}/${:_buildout_section_name_}
git-binary = ${git:location}/bin/git
npm-binary = ${nodejs:location}/bin/node ${nodejs:location}/bin/npm
environment = export GIT_SSL_NO_VERIFY=true; export PATH=${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};
command = ${:environment} (${:git-binary} clone --quiet ${:repository} ${:location} && cd ${:location} && ${:git-binary} reset --hard ${:commit} && ${node-sm:location}/node_modules/.bin/sm install) || (rm -fr ${:location}; exit 1)
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};
command = ${:environment} (git clone --quiet ${:repository} ${:location} && cd ${:location} && git reset --hard ${:commit} && ${node-sm:location}/node_modules/.bin/sm install) || (rm -fr ${:location}; exit 1)
update-command =
[cloud9-npm]
...
...
setup.py
View file @
c52f1520
...
...
@@ -100,6 +100,7 @@ setup(name=name,
'pwgen = slapos.recipe.pwgen:Recipe'
,
'proactive = slapos.recipe.proactive:Recipe'
,
'request = slapos.recipe.request:Recipe'
,
'requestoptional = slapos.recipe.requestoptional:Recipe'
,
'seleniumrunner = slapos.recipe.seleniumrunner:Recipe'
,
'sheepdogtestbed = slapos.recipe.sheepdogtestbed:SheepDogTestBed'
,
'shell = slapos.recipe.shell:Recipe'
,
...
...
slapos/recipe/check_url_available/template/check_url.in
View file @
c52f1520
...
...
@@ -3,14 +3,20 @@
# BEWARE: It will be overwritten automatically
URL="%(url)s"
if [ -z $URL ]; then
echo "No URL specified." >&2
exit 3
fi
CODE=$(%(curl_path)s -k -sL $URL -w %%{http_code} -o /dev/null)
if [ $CODE -eq 000 ]; then
echo "$URL is not available (server not reachable)" >&2
echo "$URL is not available (server not reachable)
.
" >&2
exit 1
fi
if ! [ $CODE -eq 200 ]; then
echo "$URL is not available (returned $CODE)" >&2
echo "$URL is not available (returned $CODE)
.
" >&2
exit 2
fi
slapos/recipe/requestoptional.py
0 → 100644
View file @
c52f1520
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
logging
from
slapos
import
slap
as
slapmodule
class
Recipe
(
object
):
""" Request a SlapOS instance. Won't fail if instance is not ready.
"""
def
__init__
(
self
,
buildout
,
name
,
options
):
self
.
logger
=
logging
.
getLogger
(
name
)
slap
=
slapmodule
.
slap
()
self
.
software_release_url
=
options
[
'software-url'
]
self
.
name
=
options
[
'name'
]
slap
.
initializeConnection
(
options
[
'server-url'
],
options
.
get
(
'key-file'
),
options
.
get
(
'cert-file'
),
)
computer_partition
=
slap
.
registerComputerPartition
(
options
[
'computer-id'
],
options
[
'partition-id'
])
self
.
request
=
computer_partition
.
request
self
.
isSlave
=
False
if
'slave'
in
options
:
self
.
isSlave
=
options
[
'slave'
].
lower
()
in
[
'y'
,
'yes'
,
'true'
,
'1'
]
self
.
return_parameters
=
[]
if
'return'
in
options
:
self
.
return_parameters
=
[
str
(
parameter
).
strip
()
for
parameter
in
options
[
'return'
].
split
()]
else
:
self
.
logger
.
debug
(
"No parameter to return to main instance."
"Be careful about that..."
)
software_type
=
'RootSoftwareInstance'
if
'software-type'
in
options
:
software_type
=
options
[
'software-type'
]
filter_kw
=
{}
if
'sla'
in
options
:
for
sla_parameter
in
options
[
'sla'
].
split
():
filter_kw
[
sla_parameter
]
=
options
[
'sla-%s'
%
sla_parameter
]
partition_parameter_kw
=
{}
if
'config'
in
options
:
for
config_parameter
in
options
[
'config'
].
split
():
partition_parameter_kw
[
config_parameter
]
=
\
options
[
'config-%s'
%
config_parameter
]
self
.
instance
=
self
.
request
(
options
[
'software-url'
],
software_type
,
self
.
name
,
partition_parameter_kw
=
partition_parameter_kw
,
filter_kw
=
filter_kw
,
shared
=
self
.
isSlave
)
self
.
failed
=
None
for
param
in
self
.
return_parameters
:
try
:
options
[
'connection-%s'
%
param
]
=
str
(
self
.
instance
.
getConnectionParameter
(
param
))
except
slapmodule
.
NotFoundError
:
options
[
'connection-%s'
%
param
]
=
''
if
self
.
failed
is
None
:
self
.
failed
=
param
def
install
(
self
):
if
self
.
failed
is
not
None
:
# Check instance status to know if instance has been deployed
try
:
status
=
self
.
instance
.
getState
()
except
slapmodule
.
NotFoundError
:
status
=
'not ready yet'
except
AttributeError
:
status
=
'unknown'
error_message
=
'Connection parameter %s not found. '
\
'Requested instance is currently %s. If this error persists, '
\
'check status of this instance.'
%
(
self
.
failed
,
status
)
self
.
logger
.
error
(
error_message
)
return
[]
update
=
install
slapos/recipe/slaprunner/__init__.py
View file @
c52f1520
...
...
@@ -58,7 +58,7 @@ class Recipe(GenericBaseRecipe):
supervisord_config
=
os
.
path
.
join
(
self
.
instance_directory
,
'etc'
,
'supervisord.conf'
),
runner_workdir
=
self
.
workdir
,
etc
=
self
.
etc
,
etc
_dir
=
self
.
options
[
'etc_dir'
]
,
runner_host
=
self
.
ipv6
,
runner_port
=
self
.
runner_port
,
ipv4_address
=
self
.
ipv4
,
...
...
slapos/recipe/slaprunner/template/slapos.cfg.in
View file @
c52f1520
...
...
@@ -19,6 +19,7 @@ runner_host = %(runner_host)s
runner_port = %(runner_port)s
ipv4_address = %(ipv4_address)s
ipv6_address = %(ipv6_address)s
etc_dir = %(etc_dir)s
[slapproxy]
host = %(proxy_host)s
...
...
software/drupal/software.cfg
View file @
c52f1520
...
...
@@ -5,8 +5,8 @@ extends =
[application]
recipe = slapos.recipe.build:download-unpacked
url = http://ftp.drupal.org/files/projects/drupal-7.1
4
.tar.gz
md5sum =
af7abd95c03ecad4e1567ed94a43833
4
url = http://ftp.drupal.org/files/projects/drupal-7.1
5
.tar.gz
md5sum =
f42c9baccd74e1d035d61ff537ae21b
4
[application-template]
recipe = slapos.recipe.download
...
...
software/slaprunner/instance-runner.cfg
View file @
c52f1520
...
...
@@ -41,10 +41,10 @@ project = $${:home}/project
software-root = $${:home}/software
instance-root = $${:home}/instance
#Create password for slaprunner
[
slapunner-passwd
]
#Create password
recovery code
for slaprunner
[
recovery-code
]
recipe = slapos.cookbook:generate.password
storage-path = $${rootdirectory:etc}/.
passwd
storage-path = $${rootdirectory:etc}/.
rcode
bytes = 4
# Deploy cloud9 and slaprunner
...
...
@@ -71,7 +71,8 @@ working-directory = $${runnerdirectory:home}
project-directory = $${runnerdirectory:project}
software-directory = $${runnerdirectory:software-root}
instance-directory = $${runnerdirectory:instance-root}
etc = $${rootdirectory:etc}
etc_dir = $${rootdirectory:etc}
log_dir = $${basedirectory:log}
ssh_client = $${sshkeys-dropbear:wrapper}
public_key = $${sshkeys-dropbear:public-key}
private_key = $${sshkeys-dropbear:private-key}
...
...
@@ -125,7 +126,7 @@ key = $${slap-parameter:authorized-key}
# Request frontend
[request-frontend]
<= slap-connection
recipe = slapos.cookbook:request
recipe = slapos.cookbook:request
optional
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
...
...
@@ -142,7 +143,7 @@ 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}
passw
d = $${slapunner-passwd
:passwd}
passw
ord_recovery_code = $${recovery-code
:passwd}
[slap-parameter]
# Default value if no ssh key is specified
...
...
software/slaprunner/software.cfg
View file @
c52f1520
...
...
@@ -23,14 +23,14 @@ md5sum = 5307e4200f044ae57b504ad68444491c
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner.cfg
output = ${buildout:directory}/template-runner.cfg
md5sum = 9
c7daf59883c4c330064632fdaf329fa
md5sum = 9
63ef5b43cd52a5804a6d254d842cae5
mode = 0644
[eggs]
recipe = z3c.recipe.scripts
eggs =
slapos.libnetworkcache
slapos.toolbox
slapos.toolbox
[flask_auth]
slapos.core
[networkcache]
...
...
@@ -52,46 +52,39 @@ signature-certificate-list =
-----END CERTIFICATE-----
[versions]
Flask-Auth = 0.8
Jinja2 = 2.6
Pygments = 1.5
Werkzeug = 0.8.3
apache-libcloud = 0.1
0
.1
apache-libcloud = 0.1
1
.1
async = 0.6.1
buildout-versions = 1.7
docutils = 0.9.1
gitdb = 0.5.4
hexagonit.recipe.cmmi = 1.6
ipython = 0.13
lxml = 2.3.4
meld3 = 0.6.8
netaddr = 0.7.7
plone.recipe.command = 1.1
pycrypto = 2.6
slapos.cookbook = 0.58
slapos.core = 0.26.2
slapos.cookbook = 0.59
slapos.libnetworkcache = 0.12
slapos.recipe.build = 0.
9
slapos.recipe.template = 2.4
slapos.toolbox = 0.2
6.1
slapos.recipe.build = 0.
10.2
slapos.recipe.template = 2.4
.1
slapos.toolbox = 0.2
8
smmap = 0.8.2
xml-marshaller = 0.9.7
z3c.recipe.scripts = 1.0.1
# Required by:
# slapos.core==0.2
6.2
# slapos.toolbox==0.2
6.1
# slapos.core==0.2
7
# slapos.toolbox==0.2
8
Flask = 0.9
# Required by:
# hexagonit.recipe.cmmi==1.6
hexagonit.recipe.download = 1.5.1
# Required by:
# slapos.toolbox==0.26.1
# slapos.toolbox==0.28
GitPython = 0.3.2.RC1
# Required by:
# slapos.cookbook==0.5
8
# slapos.cookbook==0.5
9
PyXML = 0.8.4
# Required by:
...
...
@@ -99,46 +92,70 @@ PyXML = 0.8.4
Sphinx = 1.1.3
# Required by:
# slapos.toolbox==0.2
6.1
# slapos.toolbox==0.2
8
atomize = 0.1.1
# Required by:
# slapos.toolbox==0.2
6.1
# slapos.toolbox==0.2
8
feedparser = 5.1.2
# Required by:
# slapos.cookbook==0.58
# hexagonit.recipe.cmmi==1.6
hexagonit.recipe.download = 1.5.1
# Required by:
# slapos.cookbook==0.59
inotifyx = 0.2.0
# Required by:
# slapos.core==0.26.2
# slapos.core==0.27
# slapos.toolbox==0.28
# xml-marshaller==0.9.7
lxml = 2.3.5
# Required by:
# slapos.cookbook==0.59
netaddr = 0.7.7
# Required by:
# slapos.core==0.27
netifaces = 0.8
# Required by:
# slapos.toolbox==0.2
6.1
# slapos.toolbox==0.2
8
paramiko = 1.7.7.2
# Required by:
# slapos.toolbox==0.2
6.1
# slapos.toolbox==0.2
8
psutil = 0.5.1
# Required by:
# slapos.cookbook==0.5
8
# slapos.core==0.2
6.2
# slapos.cookbook==0.5
9
# slapos.core==0.2
7
# slapos.libnetworkcache==0.12
# slapos.toolbox==0.2
6.1
# slapos.toolbox==0.2
8
# supervisor==3.0a12
# zc.buildout==1.6.0-dev-SlapOS-006
# zc.recipe.egg==1.3.2
# zope.interface==4.0.1
setuptools = 0.6c12dev-r88846
# Required by:
# slapos.core==0.26.2
# slapos.cookbook==0.59
slapos.core = 0.27
# Required by:
# slapos.core==0.27
supervisor = 3.0a12
# Required by:
# slapos.cookbook==0.58
# slapos.cookbook==0.59
xml-marshaller = 0.9.7
# Required by:
# slapos.cookbook==0.59
zc.recipe.egg = 1.3.2
# Required by:
# slapos.core==0.2
6.2
# slapos.core==0.2
7
zope.interface = 4.0.1
stack/lamp/buildout.cfg
View file @
c52f1520
...
...
@@ -66,7 +66,7 @@ mode = 0644
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-apache-php.cfg
output = ${buildout:directory}/template-apache-php.cfg
md5sum =
ae9c0f8c70a62f13eb948424c99d71e2
md5sum =
8bb0b03689d2be9566ed1ef3e96b4403
mode = 0644
[template-apache-backup]
...
...
@@ -190,103 +190,3 @@ signature-certificate-list =
-----END CERTIFICATE-----
[versions]
Jinja2 = 2.6
Pygments = 1.5
Werkzeug = 0.8.3
apache-libcloud = 0.10.1
async = 0.6.1
buildout-versions = 1.7
docutils = 0.9.1
gitdb = 0.5.4
hexagonit.recipe.cmmi = 1.5.1
ipython = 0.12.1
meld3 = 0.6.8
pycrypto = 2.6
rdiff-backup = 1.0.5
slapos.cookbook = 0.55
slapos.recipe.build = 0.9
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.4
slapos.toolbox = 0.25
smmap = 0.8.2
# Required by:
# slapos.core==0.25
# slapos.toolbox==0.25
Flask = 0.8
# Required by:
# slapos.toolbox==0.25
GitPython = 0.3.2.RC1
# Required by:
# slapos.cookbook==0.55
PyXML = 0.8.4
# Required by:
# netaddr==0.7.7
Sphinx = 1.1.3
# Required by:
# slapos.toolbox==0.25
atomize = 0.1.1
# Required by:
# slapos.toolbox==0.25
feedparser = 5.1.2
# Required by:
# slapos.cookbook==0.55
inotifyx = 0.2.0
# Required by:
# slapos.cookbook==0.55
# slapos.core==0.25
# xml-marshaller==0.9.7
lxml = 2.3.4
# Required by:
# slapos.cookbook==0.55
netaddr = 0.7.7
# Required by:
# slapos.core==0.25
netifaces = 0.8
# Required by:
# slapos.toolbox==0.25
paramiko = 1.7.7.2
# Required by:
# slapos.toolbox==0.25
psutil = 0.4.1
# Required by:
# slapos.cookbook==0.55
# slapos.core==0.25
# slapos.toolbox==0.25
# zc.buildout==1.6.0-dev-SlapOS-006
# zc.recipe.egg==1.3.2
setuptools = 0.6c12dev-r88846
# Required by:
# slapos.cookbook==0.55
# slapos.toolbox==0.25
slapos.core = 0.25
# Required by:
# slapos.core==0.25
supervisor = 3.0a12
# Required by:
# slapos.cookbook==0.55
# slapos.toolbox==0.25
xml-marshaller = 0.9.7
# Required by:
# slapos.cookbook==0.55
zc.recipe.egg = 1.3.2
# Required by:
# slapos.core==0.25
zope.interface = 4.0.1
stack/lamp/instance-apache-php.cfg
View file @
c52f1520
...
...
@@ -66,7 +66,7 @@ stunnel-binary = ${stunnel:location}/bin/stunnel
remote-host = $${mariadb-urlparse:host}
remote-port = $${mariadb-urlparse:port}
local-host = $${slap-network-information:local-ipv4}
local-port = 3306
local-port = 3306
0
log-file = $${basedirectory:log}/stunnel.log
config-file = $${directory:stunnel-conf}/stunnel.conf
key-file = $${directory:stunnel-conf}/stunnel.key
...
...
@@ -201,7 +201,7 @@ command = $${logrotate:wrapper}
# Request frontend
[request-frontend]
<= slap-connection
recipe = slapos.cookbook:request
recipe = slapos.cookbook:request
optional
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment