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
Jean-Paul Smets
slapos
Commits
b7416aa7
Commit
b7416aa7
authored
Jan 08, 2013
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into lamp
parents
8b3915a6
572b8e6d
Changes
27
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
521 additions
and
168 deletions
+521
-168
component/postgresql/buildout.cfg
component/postgresql/buildout.cfg
+19
-3
slapos/recipe/apachephp/__init__.py
slapos/recipe/apachephp/__init__.py
+23
-13
slapos/recipe/apacheproxy/__init__.py
slapos/recipe/apacheproxy/__init__.py
+17
-12
slapos/recipe/postgres/__init__.py
slapos/recipe/postgres/__init__.py
+41
-41
slapos/recipe/slapconfiguration.py
slapos/recipe/slapconfiguration.py
+11
-0
software/maarch/development.cfg
software/maarch/development.cfg
+70
-0
software/maarch/software.cfg
software/maarch/software.cfg
+38
-1
software/postgres/instance.cfg.in
software/postgres/instance.cfg.in
+4
-3
software/postgres/software.cfg
software/postgres/software.cfg
+1
-1
software/wordpress/development.cfg
software/wordpress/development.cfg
+60
-0
software/wordpress/software.cfg
software/wordpress/software.cfg
+2
-2
stack/lamp/apache/instance-apache-php.cfg.in
stack/lamp/apache/instance-apache-php.cfg.in
+1
-1
stack/lamp/buildout.cfg
stack/lamp/buildout.cfg
+34
-60
stack/lamp/mariadb/instance-mariadb-export.cfg.in
stack/lamp/mariadb/instance-mariadb-export.cfg.in
+7
-1
stack/lamp/mariadb/instance-mariadb-import.cfg.in
stack/lamp/mariadb/instance-mariadb-import.cfg.in
+6
-1
stack/lamp/mariadb/instance-mariadb.cfg.in
stack/lamp/mariadb/instance-mariadb.cfg.in
+1
-1
stack/lapp/README.txt
stack/lapp/README.txt
+3
-3
stack/lapp/apache/instance-apache-backup.cfg.in
stack/lapp/apache/instance-apache-backup.cfg.in
+1
-1
stack/lapp/apache/instance-apache-php.cfg.in
stack/lapp/apache/instance-apache-php.cfg.in
+1
-1
stack/lapp/buildout.cfg
stack/lapp/buildout.cfg
+83
-5
stack/lapp/postgres/instance-postgres-export.cfg.in
stack/lapp/postgres/instance-postgres-export.cfg.in
+6
-3
stack/lapp/postgres/instance-postgres-import.cfg.in
stack/lapp/postgres/instance-postgres-import.cfg.in
+4
-1
stack/lapp/postgres/instance-postgres.cfg.in
stack/lapp/postgres/instance-postgres.cfg.in
+10
-10
stack/resilient/README.txt
stack/resilient/README.txt
+74
-0
stack/resilient/buildout.cfg
stack/resilient/buildout.cfg
+2
-2
stack/resilient/instance-pull-backup.cfg.in
stack/resilient/instance-pull-backup.cfg.in
+1
-1
stack/resilient/pbsready.cfg.in
stack/resilient/pbsready.cfg.in
+1
-1
No files found.
component/postgresql/buildout.cfg
View file @
b7416aa7
...
...
@@ -6,11 +6,27 @@ extends =
../ncurses/buildout.cfg
parts = postgresql
[postgresql]
<= postgresql92
[postgresql91]
recipe = hexagonit.recipe.cmmi
url = http://ftp.postgresql.org/pub/source/v9.1.
6/postgresql-9.1.6
.tar.bz2
md5sum =
000755f66c0de58bbd4cd2b89b45b8e2
url = http://ftp.postgresql.org/pub/source/v9.1.
7/postgresql-9.1.7
.tar.bz2
md5sum =
eaf7b67493d59d1a60767ffdfbd65ce9
configure-options = --with-openssl
environment =
CPPFLAGS=-I${zlib:location}/include -I${readline:location}/include -I${openssl:location}/include -I${ncurses:location}/lib
LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${readline:location}/lib -Wl,-rpath=${readline:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib
[postgresql92]
recipe = hexagonit.recipe.cmmi
url = http://ftp.postgresql.org/pub/source/v9.2.2/postgresql-9.2.2.tar.bz2
md5sum = 1cc388988e69bf75c6b55d59070100f6
configure-options = --with-openssl
environment =
CPPFLAGS=-I${zlib:location}/include -I${readline:location}/include -I${openssl:location}/include -I${ncurses:location}/lib
LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${readline:location}/lib -Wl,-rpath=${readline:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib
slapos/recipe/apachephp/__init__.py
View file @
b7416aa7
...
...
@@ -24,13 +24,17 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
shutil
import
os
import
signal
import
subprocess
from
binascii
import
b2a_uu
as
uuencode
from
slapos.recipe.librecipe
import
GenericBaseRecipe
class
Recipe
(
GenericBaseRecipe
):
def
install
(
self
):
...
...
@@ -66,11 +70,13 @@ class Recipe(GenericBaseRecipe):
)
path_list
.
append
(
httpd_conf
)
wrapper
=
self
.
createPythonScript
(
self
.
options
[
'wrapper'
],
'slapos.recipe.librecipe.execute.execute'
,
[
self
.
options
[
'httpd-binary'
],
'-f'
,
self
.
options
[
'httpd-conf'
],
'-DFOREGROUND'
]
)
wrapper
=
self
.
createWrapper
(
name
=
self
.
options
[
'wrapper'
],
command
=
self
.
options
[
'httpd-binary'
],
parameters
=
[
'-f'
,
self
.
options
[
'httpd-conf'
],
'-DFOREGROUND'
])
path_list
.
append
(
wrapper
)
secret_key_filename
=
os
.
path
.
join
(
self
.
buildout
[
'buildout'
][
'directory'
],
...
...
@@ -110,12 +116,16 @@ class Recipe(GenericBaseRecipe):
self
.
substituteTemplate
(
self
.
options
[
'template'
],
application_conf
))
path_list
.
append
(
config
)
if
os
.
path
.
exists
(
self
.
options
[
'pid-file'
]):
# Reload apache configuration
with
open
(
self
.
options
[
'pid-file'
])
as
pid_file
:
pid
=
int
(
pid_file
.
read
().
strip
(),
10
)
try
:
os
.
kill
(
pid
,
signal
.
SIGUSR1
)
# Graceful restart
except
OSError
:
pass
# Reload apache configuration.
# notez-bien: a graceful restart or a SIGUSR1 can somehow hang the apache threads.
subprocess
.
call
([
self
.
options
[
'httpd-binary'
],
'-f'
,
self
.
options
[
'httpd-conf'
],
'-k'
,
'graceful'
])
return
path_list
slapos/recipe/apacheproxy/__init__.py
View file @
b7416aa7
...
...
@@ -24,8 +24,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
os
import
signal
import
subprocess
from
slapos.recipe.librecipe
import
GenericBaseRecipe
...
...
@@ -50,17 +49,23 @@ class Recipe(GenericBaseRecipe):
)
path_list
.
append
(
httpd_conf
)
wrapper
=
self
.
createPythonScript
(
self
.
options
[
'wrapper'
],
'slapos.recipe.librecipe.execute.execute'
,
[
self
.
options
[
'httpd-binary'
],
'-f'
,
self
.
options
[
'httpd-conf'
],
'-DFOREGROUND'
]
)
wrapper
=
self
.
createWrapper
(
name
=
self
.
options
[
'wrapper'
],
command
=
self
.
options
[
'httpd-binary'
],
parameters
=
[
'-f'
,
self
.
options
[
'httpd-conf'
],
'-DFOREGROUND'
,
])
path_list
.
append
(
wrapper
)
if
os
.
path
.
exists
(
self
.
options
[
'pid-file'
]):
# Reload apache configuration
with
open
(
self
.
options
[
'pid-file'
])
as
pid_file
:
pid
=
int
(
pid_file
.
read
().
strip
(),
10
)
os
.
kill
(
pid
,
signal
.
SIGUSR1
)
# Graceful restart
subprocess
.
call
([
self
.
options
[
'httpd-binary'
],
'-f'
,
self
.
options
[
'httpd-conf'
],
'-k'
,
'graceful'
,
])
return
path_list
slapos/recipe/postgres/__init__.py
View file @
b7416aa7
...
...
@@ -40,7 +40,7 @@ class Recipe(GenericBaseRecipe):
This recipe creates:
- a Postgres cluster
- configuration to allow connections from IP
V6 only (or unix socket)
- configuration to allow connections from IP
v4, IPv6 or unix socket.
- a superuser with provided name and generated password
- a database with provided name
- a foreground start script in the services directory
...
...
@@ -49,27 +49,16 @@ class Recipe(GenericBaseRecipe):
The URL can be used as-is (ie. in sqlalchemy) or by the _urlparse.py recipe.
"""
def
fetch_ipv6_host
(
self
,
options
):
"""
Returns a string represtation of ipv6_host.
May receive a regular string, a set or a string serialized by buildout.
"""
ipv6_host
=
options
[
'ipv6_host'
]
if
isinstance
(
ipv6_host
,
set
):
return
ipv6_host
.
pop
()
else
:
return
ipv6_host
def
_options
(
self
,
options
):
options
[
'password'
]
=
self
.
generatePassword
()
options
[
'url'
]
=
'postgresql://%(user)s:%(password)s@[%(ipv
4_host
)s]:%(port)s/%(dbname)s'
%
options
options
[
'url'
]
=
'postgresql://%(user)s:%(password)s@[%(ipv
6_random
)s]:%(port)s/%(dbname)s'
%
options
def
install
(
self
):
pgdata
=
self
.
options
[
'pgdata-directory'
]
# if the pgdata already exists, skip all steps, we don't need to do anything.
if
not
os
.
path
.
exists
(
pgdata
):
self
.
createCluster
()
self
.
createConfig
()
...
...
@@ -77,10 +66,12 @@ class Recipe(GenericBaseRecipe):
self
.
createSuperuser
()
self
.
createRunScript
()
return
[
# XXX should we really return something here?
# os.path.join(pgdata, 'postgresql.conf')
]
# install() methods usually return the pathnames of managed files.
# If they are missing, they will be rebuilt.
# In this case, we already check for the existence of pgdata,
# so we don't need to return anything here.
return
[]
def
check_exists
(
self
,
path
):
...
...
@@ -89,6 +80,13 @@ class Recipe(GenericBaseRecipe):
def
createCluster
(
self
):
"""
\
A Postgres cluster is "a collection of databases that is managed
by a single instance of a running database server".
Here we create an empty cluster. The authentication for this
command is through the unix socket.
"""
initdb_binary
=
os
.
path
.
join
(
self
.
options
[
'bin'
],
'initdb'
)
self
.
check_exists
(
initdb_binary
)
...
...
@@ -106,10 +104,12 @@ class Recipe(GenericBaseRecipe):
def
createConfig
(
self
):
pgdata
=
self
.
options
[
'pgdata-directory'
]
ipv4
=
self
.
options
[
'ipv4'
]
ipv6
=
self
.
options
[
'ipv6'
]
with
open
(
os
.
path
.
join
(
pgdata
,
'postgresql.conf'
),
'wb'
)
as
cfg
:
cfg
.
write
(
textwrap
.
dedent
(
"""
\
listen_addresses = '%s
,%s
'
listen_addresses = '%s'
logging_collector = on
log_rotation_size = 50MB
max_connections = 100
...
...
@@ -124,25 +124,29 @@ class Recipe(GenericBaseRecipe):
unix_socket_directory = '%s'
unix_socket_permissions = 0700
"""
%
(
self
.
options
[
'ipv4_host'
],
self
.
fetch_ipv6_host
(
self
.
options
),
','
.
join
(
ipv4
.
union
(
ipv6
)),
pgdata
,
)))
with
open
(
os
.
path
.
join
(
pgdata
,
'pg_hba.conf'
),
'wb'
)
as
cfg
:
# see http://www.postgresql.org/docs/9.1/static/auth-pg-hba-conf.html
cfg
.
write
(
textwrap
.
dedent
(
"""
\
# TYPE DATABASE USER ADDRESS METHOD
cfg_lines
=
[
'# TYPE DATABASE USER ADDRESS METHOD'
,
''
,
'# "local" is for Unix domain socket connections only (check unix_socket_permissions!)'
,
'local all all ident'
,
'host all all 127.0.0.1/32 md5'
,
'host all all ::1/128 md5'
,
]
for
ip
in
ipv4
:
cfg_lines
.
append
(
'host all all %s/32 md5'
%
ip
)
# "local" is for Unix domain socket connections only (check unix_socket_permissions!)
local all all ident
host all all 127.0.0.1/32 md5
host all all %s/32 md5
host all all ::1/128 md5
host all all %s/128 md5
"""
%
(
self
.
options
[
'ipv4_host'
],
self
.
fetch_ipv6_host
(
self
.
options
))))
for
ip
in
ipv6
:
cfg_lines
.
append
(
'host all all %s/128 md5'
%
ip
)
cfg
.
write
(
'
\
n
'
.
join
(
cfg_lines
))
def
createDatabase
(
self
):
...
...
@@ -150,7 +154,7 @@ class Recipe(GenericBaseRecipe):
def
createSuperuser
(
self
):
"""
"""
\
Creates a Postgres superuser - other than "slapuser#" for use by the application.
"""
...
...
@@ -166,7 +170,7 @@ class Recipe(GenericBaseRecipe):
def
runPostgresCommand
(
self
,
cmd
):
"""
"""
\
Executes a command in single-user mode, with no daemon running.
Multiple commands can be executed by providing newlines,
...
...
@@ -190,7 +194,7 @@ class Recipe(GenericBaseRecipe):
def
createRunScript
(
self
):
"""
"""
\
Creates a script that runs postgres in the foreground.
'exec' is used to allow easy control by supervisor.
"""
...
...
@@ -207,14 +211,13 @@ class Recipe(GenericBaseRecipe):
class
ExportRecipe
(
GenericBaseRecipe
):
def
install
(
self
):
pgdata
=
self
.
options
[
'pgdata-directory'
]
wrapper
=
self
.
options
[
'wrapper'
]
self
.
createBackupScript
(
wrapper
)
return
[
wrapper
]
def
createBackupScript
(
self
,
wrapper
):
"""
"""
\
Create a script to backup the database in 'custom' format.
"""
content
=
textwrap
.
dedent
(
"""
\
...
...
@@ -233,14 +236,13 @@ class ExportRecipe(GenericBaseRecipe):
class
ImportRecipe
(
GenericBaseRecipe
):
def
install
(
self
):
pgdata
=
self
.
options
[
'pgdata-directory'
]
wrapper
=
self
.
options
[
'wrapper'
]
self
.
createRestoreScript
(
wrapper
)
return
[
wrapper
]
def
createRestoreScript
(
self
,
wrapper
):
"""
"""
\
Create a script to restore the database from 'custom' format.
"""
content
=
textwrap
.
dedent
(
"""
\
...
...
@@ -256,5 +258,3 @@ class ImportRecipe(GenericBaseRecipe):
self
.
createExecutable
(
wrapper
,
content
=
content
)
slapos/recipe/slapconfiguration.py
View file @
b7416aa7
...
...
@@ -64,6 +64,10 @@ class Recipe(object):
Set of IPv4 addresses.
ipv6
Set of IPv6 addresses.
ipv4_random
One of the IPv4 addresses.
ipv6_random
One of the IPv6 addresses.
tap
Set of TAP interfaces.
configuration
...
...
@@ -109,6 +113,13 @@ class Recipe(object):
# XXX: emit warning on unknown address type ?
options
[
'ipv4'
]
=
ipv4_set
options
[
'ipv6'
]
=
ipv6_set
# also export single ip values for those recipes that don't support sets.
if
ipv4_set
:
options
[
'ipv4_random'
]
=
list
(
ipv4_set
)[
0
]
if
ipv6_set
:
options
[
'ipv6_random'
]
=
list
(
ipv6_set
)[
0
]
options
[
'tap'
]
=
tap_set
options
[
'configuration'
]
=
parameter_dict
match
=
self
.
OPTCRE_match
...
...
software/maarch/development.cfg
0 → 100644
View file @
b7416aa7
# Exactly the same as software.cfg, but fetch the slapos.cookbook and
# slapos.toolbox from git repository instead of fetching stable version,
# allowing to play with bleeding edge environment.
# You'll need to run buildout twice for this profile.
[buildout]
extends =
../../component/git/buildout.cfg
software.cfg
parts +=
# Development parts
slapos.cookbook-repository
slapos.core-repository
slapos.toolbox-repository
slapos.recipe.maarch-repository
check-recipe
develop =
${:parts-directory}/slapos.cookbook-repository
${:parts-directory}/slapos.core-repository
${:parts-directory}/slapos.toolbox-repository
${:parts-directory}/slapos.recipe.maarch-repository
[slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.toolbox.git
branch = master
git-executable = ${git:location}/bin/git
[slapos.cookbook-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.git
branch = lapp-resilient3
git-executable = ${git:location}/bin/git
[slapos.core-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.core.git
branch = master
git-executable = ${git:location}/bin/git
[slapos.recipe.maarch-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.recipe.maarch.git
branch = master
git-executable = ${git:location}/bin/git
[check-recipe]
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
command =
grep parts ${buildout:develop-eggs-directory}/slapos.cookbook.egg-link &&
grep parts ${buildout:develop-eggs-directory}/slapos.core.egg-link &&
grep parts ${buildout:develop-eggs-directory}/slapos.toolbox.egg-link &&
grep parts ${buildout:develop-eggs-directory}/slapos.recipe.maarch.egg-link
# Unpin versions, in case it has been pinned in software.cfg
[versions]
slapos.cookbook =
slapos.toolbox =
slapos.core =
slapos.recipe.maarch =
software/maarch/software.cfg
View file @
b7416aa7
[buildout]
extends =
../../component/git/buildout.cfg
../../stack/lapp/buildout.cfg
develop =
${:parts-directory}/slapos.cookbook-repository
${:parts-directory}/slapos.recipe.maarch-repository
# += since we need rdiff-backup and friends
parts +=
slapos-cookbook
...
...
@@ -11,6 +18,36 @@ parts +=
eggs
instance
instance-apache-php
slapos.cookbook-repository
slapos.recipe.maarch-repository
check-recipe
[versions]
slapos.cookbook =
slapos.recipe.maarch =
[slapos.recipe.maarch-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.recipe.maarch.git
branch = master
git-executable = ${git:location}/bin/git
[slapos.cookbook-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.git
branch = lapp-resilient3
git-executable = ${git:location}/bin/git
[check-recipe]
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
command =
grep parts ${buildout:develop-eggs-directory}/slapos.cookbook.egg-link &&
grep parts ${buildout:develop-eggs-directory}/slapos.recipe.maarch.egg-link
#----------------
#--
...
...
@@ -71,6 +108,6 @@ install_cmd =
${:pear} info maarch/CLITools-0.3.1 >/dev/null || ${:pear} install maarch/CLITools-0.3.1
${:pear} info MIME_Type >/dev/null || ${:pear} install MIME_Type
#----------------
#----------------
software/postgres/instance.cfg.in
View file @
b7416aa7
...
...
@@ -42,15 +42,16 @@ symlink_base = ${postgresql:location}/bin
recipe = slapos.cookbook:postgres
# Options
ipv6_host = $${instance-parameters:ipv6}
ipv4_host = $${slap-network-information:local-ipv4}
ipv6 = $${instance-parameters:ipv6}
ipv4 = $${instance-parameters:ipv4}
ipv6_random = $${instance-parameters:ipv6_random}
user = user
port = 5432
dbname = db
# pgdata_directory is created by initdb, and should not exist beforehand.
pgdata-directory = $${directories:var}/data
services = $${directories:services}
bin = $${directories:bin}
services = $${directories:services}
[publish]
...
...
software/postgres/software.cfg
View file @
b7416aa7
...
...
@@ -14,7 +14,7 @@ parts =
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in
output = ${buildout:directory}/template.cfg
#md5sum =
md5sum = 5ccffbfc2f1d06fd3ef199bc8b643db7
mode = 0644
...
...
software/wordpress/development.cfg
0 → 100644
View file @
b7416aa7
# Exactly the same as software.cfg, but fetch the slapos.cookbook and
# slapos.toolbox from git repository instead of fetching stable version,
# allowing to play with bleeding edge environment.
# You'll need to run buildout twice for this profile.
[buildout]
extends =
../../component/git/buildout.cfg
software.cfg
parts +=
# Development parts
slapos.cookbook-repository
slapos.core-repository
slapos.toolbox-repository
check-recipe
develop =
${:parts-directory}/slapos.cookbook-repository
${:parts-directory}/slapos.core-repository
${:parts-directory}/slapos.toolbox-repository
[slapos.toolbox-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.toolbox.git
branch = master
git-executable = ${git:location}/bin/git
[slapos.cookbook-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.git
branch = lapp-resilient3
git-executable = ${git:location}/bin/git
[slapos.core-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.core.git
branch = master
git-executable = ${git:location}/bin/git
[check-recipe]
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
command =
grep parts ${buildout:develop-eggs-directory}/slapos.cookbook.egg-link &&
grep parts ${buildout:develop-eggs-directory}/slapos.core.egg-link &&
grep parts ${buildout:develop-eggs-directory}/slapos.toolbox.egg-link
# Unpin versions, in case it has been pinned in software.cfg
[versions]
slapos.cookbook =
slapos.toolbox =
slapos.core =
software/wordpress/software.cfg
View file @
b7416aa7
...
...
@@ -3,8 +3,8 @@ extends =
../../stack/lamp/buildout.cfg
[application]
url = http://wordpress.org/wordpress-3.
4.2
.tar.gz
md5sum =
dfc56cee27eec8fb79070f033ecd4b25
url = http://wordpress.org/wordpress-3.
5
.tar.gz
md5sum =
105b5baff67344528bb5d8b71c050b0d
[application-template]
recipe = slapos.recipe.download
...
...
stack/lamp/apache/instance-apache-php.cfg.in
View file @
b7416aa7
...
...
@@ -36,7 +36,7 @@ tmp = $${buildout:directory}/tmp
[basedirectory]
recipe = slapos.cookbook:mkdirectory
log = $${rootdirectory:var}/log
services = $${rootdirectory:etc}/
run
services = $${rootdirectory:etc}/
service
run = $${rootdirectory:var}/run
backup = $${rootdirectory:srv}/backup
promises = $${rootdirectory:etc}/promise
...
...
stack/lamp/buildout.cfg
View file @
b7416aa7
...
...
@@ -53,7 +53,7 @@ keep-compile-dir = false
[application]
recipe = hexagonit.recipe.download
#
If provided tarball does not containt top directory this option shall
be changed to false
#
If the provided tarball does not contain top directory, this option should
be changed to false
strip-top-level-dir = true
...
...
@@ -71,7 +71,7 @@ mode = 0644
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/apache/instance-apache-php.cfg.in
output = ${buildout:directory}/instance-apache-php.cfg
md5sum =
fc29d853dcd0802dd61c60b09e898c11
md5sum =
bf3219cd7d318e02e39c462fbb530715
mode = 0644
[instance-apache-backup]
...
...
@@ -101,21 +101,21 @@ mode = 0644
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/mariadb/instance-mariadb.cfg.in
output = ${buildout:directory}/instance-mariadb.cfg
md5sum =
ba8dd08dfd5e6a9dc614693d066eb21d
md5sum =
fafb873323c0084c522360f94ebe1df7
mode = 0644
[instance-mariadb-import]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/mariadb/instance-mariadb-import.cfg.in
output = ${buildout:directory}/instance-mariadb-import.cfg
md5sum =
ea43b8ed38a55a11b027fc283c0e718a
md5sum =
8009627bb669d1fee0df030daa8d3bdc
mode = 0644
[instance-mariadb-export]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/mariadb/instance-mariadb-export.cfg.in
output = ${buildout:directory}/instance-mariadb-export.cfg
md5sum =
685c8abf0f487c72273846002ec631a0
md5sum =
0513bf25fbb20cccd57f285c40d96498
mode = 0644
...
...
@@ -277,108 +277,82 @@ signature-certificate-list =
n9MuhWaT21VOYhIGzJFPw5XW47/RrwhR
-----END CERTIFICATE-----
[versions]
# 1.2.4b doesn't download
MySQL-python = 1.2.3
[versions]
Jinja2 = 2.6
Werkzeug = 0.8.3
apache-libcloud = 0.11.
3
apache-libcloud = 0.11.
4
async = 0.6.1
buildout-versions = 1.7
gitdb = 0.5.4
hexagonit.recipe.cmmi = 1.6
meld3 = 0.6.9
inotifyx = 0.2.0
lxml = 3.0.2
meld3 = 0.6.10
netaddr = 0.7.10
pycrypto = 2.6
pytz = 2012h
rdiff-backup = 1.0.5
slapos.cookbook = 0.69
slapos.recipe.build = 0.11.5
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.4.2
slapos.toolbox = 0.31
smmap = 0.8.2
# Required by:
# slapos.core==0.3
1.2
# slapos.toolbox==0.3
1
# slapos.core==0.3
3.2-dev
# slapos.toolbox==0.3
2.1-dev
Flask = 0.9
# Required by:
# slapos.toolbox==0.3
1
# slapos.toolbox==0.3
2.1-dev
GitPython = 0.3.2.RC1
# Required by:
# slapos.cookbook==0.69
PyXML = 0.8.4
# Required by:
# slapos.toolbox==0.31
# slapos.toolbox==0.32.1-dev
atomize = 0.1.1
# Required by:
# slapos.toolbox==0.3
1
feedparser = 5.1.
2
# slapos.toolbox==0.3
2.1-dev
feedparser = 5.1.
3
# Required by:
# hexagonit.recipe.cmmi==1.6
hexagonit.recipe.download = 1.5.1
# Required by:
# slapos.cookbook==0.69
inotifyx = 0.2.0
hexagonit.recipe.download = 1.6
# Required by:
# slapos.cookbook==0.69
# slapos.core==0.31.2
# xml-marshaller==0.9.7
lxml = 3.0.1
# Required by:
# slapos.cookbook==0.69
netaddr = 0.7.10
# Required by:
# slapos.core==0.31.2
# slapos.core==0.33.2-dev
netifaces = 0.8
# Required by:
# slapos.toolbox==0.3
1
paramiko = 1.
7.7.2
# slapos.toolbox==0.3
2.1-dev
paramiko = 1.
9.0
# Required by:
# slapos.toolbox==0.3
1
# slapos.toolbox==0.3
2.1-dev
psutil = 0.6.1
# Required by:
# slapos.co
okbook==0.69
py
tz = 2012f
# slapos.co
re==0.33.2-dev
py
flakes = 0.5.0
# Required by:
# slapos.cookbook==0.69
# slapos.core==0.31.2
# slapos.toolbox==0.31
# slapos.cookbook==0.70.1-dev
# slapos.core==0.33.2-dev
# slapos.toolbox==0.32.1-dev
# supervisor==3.0b1
# zc.buildout==1.6.0-dev-SlapOS-010
# z
c.recipe.egg==1.3
.2
# z
ope.interface==4.0
.2
setuptools = 0.6c12dev-r88846
# Required by:
# slapos.cookbook==0.69
# slapos.toolbox==0.31
slapos.core = 0.31.2
# Required by:
# slapos.core==0.31.2
# slapos.core==0.33.2-dev
supervisor = 3.0b1
# Required by:
# slapos.cookbook==0.69
# slapos.toolbox==0.31
# slapos.toolbox==0.32.1-dev
xml-marshaller = 0.9.7
# Required by:
# slapos.co
okbook==0.69
z
c.recipe.egg = 1.3
.2
# slapos.co
re==0.33.2-dev
z
ope.interface = 4.0
.2
# Required by:
# slapos.core==0.31.2
zope.interface = 4.0.1
stack/lamp/mariadb/instance-mariadb-export.cfg.in
View file @
b7416aa7
...
...
@@ -2,7 +2,13 @@
extends = ${instance-mariadb:output}
${pbsready-export:output}
parts += mariadb
parts +=
mariadb
# have to repeat the next one, as it's not inherited from pbsready-export
cron-entry-backup
[exporter]
recipe = slapos.cookbook:mydumper
...
...
stack/lamp/mariadb/instance-mariadb-import.cfg.in
View file @
b7416aa7
...
...
@@ -2,7 +2,12 @@
extends = ${instance-mariadb:output}
${pbsready-import:output}
parts += mariadb
parts +=
mariadb
# have to repeat the next one, as it's not inherited from pbsready-import
import-on-notification
[importer]
recipe = slapos.cookbook:mydumper
...
...
stack/lamp/mariadb/instance-mariadb.cfg.in
View file @
b7416aa7
...
...
@@ -37,7 +37,7 @@ bin = $${buildout:directory}/bin
[basedirectory]
recipe = slapos.cookbook:mkdirectory
log = $${rootdirectory:var}/log
services = $${rootdirectory:etc}/
run
services = $${rootdirectory:etc}/
service
run = $${rootdirectory:var}/run
script = $${rootdirectory:etc}/script
backup = $${rootdirectory:srv}/backup
...
...
stack/lapp/README.txt
View file @
b7416aa7
...
...
@@ -8,9 +8,9 @@ This fork of the LAMP stack provides:
Log rotation is handled by Postgres itself.
- symlinks to all the postgres binaries, usable through unix socket
with no further authentication, or through ipv
6
with no further authentication, or through ipv
4/ipv6 with password
- a psycopg2 (postgres driver) egg
- a psycopg2 (postgres driver) egg
to be used by further configuration recipes
-
configuration for a maarch instance (this part should be brought outside the stack)
-
a hook (custom-application-deployment) for configuring the PHP application
stack/lapp/apache/instance-apache-backup.cfg.in
View file @
b7416aa7
...
...
@@ -32,7 +32,7 @@ tmp = $${buildout:directory}/tmp
[basedirectory]
recipe = slapos.cookbook:mkdirectory
log = $${rootdirectory:var}/log
services = $${rootdirectory:etc}/
run
services = $${rootdirectory:etc}/
service
run = $${rootdirectory:var}/run
backup = $${rootdirectory:srv}/backup
promises = $${rootdirectory:etc}/promise
...
...
stack/lapp/apache/instance-apache-php.cfg.in
View file @
b7416aa7
...
...
@@ -38,7 +38,7 @@ tmp = $${buildout:directory}/tmp
[basedirectory]
recipe = slapos.cookbook:mkdirectory
log = $${rootdirectory:var}/log
services = $${rootdirectory:etc}/
run
services = $${rootdirectory:etc}/
service
run = $${rootdirectory:var}/run
backup = $${rootdirectory:srv}/backup
promises = $${rootdirectory:etc}/promise
...
...
stack/lapp/buildout.cfg
View file @
b7416aa7
...
...
@@ -39,6 +39,7 @@ extends =
[application]
recipe = hexagonit.recipe.download
# If the provided tarball does not contain top directory, this option should be changed to false
strip-top-level-dir = true
...
...
@@ -56,14 +57,14 @@ mode = 0644
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/apache/instance-apache-php.cfg.in
output = ${buildout:directory}/instance-apache-php.cfg
md5sum =
bed286b680bd8cd494da080cdc229f1e
md5sum =
3e4b7c176a7de23843f77261d88dd0b8
mode = 0644
[instance-apache-backup]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/apache/instance-apache-backup.cfg.in
output = ${buildout:directory}/instance-apache-backup.cfg
md5sum =
48f969d82319a9d145570f5f0fd27672
md5sum =
db879141c0b6a77ef8b3b7e699f5583a
mode = 0644
[template-resilient-lapp]
...
...
@@ -86,21 +87,21 @@ mode = 0644
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/postgres/instance-postgres.cfg.in
output = ${buildout:directory}/instance-postgres.cfg
md5sum =
c5cd2a644fcd8450bc5d13bf53ec9f7
d
md5sum =
4a339ed20f7579e5558fc53637e441f
d
mode = 0644
[instance-postgres-import]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/postgres/instance-postgres-import.cfg.in
output = ${buildout:directory}/instance-postgres-import.cfg
md5sum =
1989ba2164dd5f79793a04e0a02ea515
md5sum =
7edfa157ddccc27e99bf128fc1c2b9ee
mode = 0644
[instance-postgres-export]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/postgres/instance-postgres-export.cfg.in
output = ${buildout:directory}/instance-postgres-export.cfg
md5sum =
7bce31bc22a731a8fc6119aee96586f5
md5sum =
68080e5d861eb3474442211dd65c668b
mode = 0644
...
...
@@ -165,5 +166,82 @@ eggs =
[versions]
Jinja2 = 2.6
Werkzeug = 0.8.3
apache-libcloud = 0.11.4
async = 0.6.1
buildout-versions = 1.7
cns.recipe.symlink = 0.2.3
gitdb = 0.5.4
hexagonit.recipe.cmmi = 1.6
inotifyx = 0.2.0
lxml = 3.0.2
meld3 = 0.6.10
netaddr = 0.7.10
psycopg2 = 2.4.6
pycrypto = 2.6
pytz = 2012h
rdiff-backup = 1.0.5
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.4.2
smmap = 0.8.2
# Required by:
# slapos.core==0.33.2-dev
# slapos.toolbox==0.32.1-dev
Flask = 0.9
# Required by:
# slapos.toolbox==0.32.1-dev
GitPython = 0.3.2.RC1
# Required by:
# slapos.toolbox==0.32.1-dev
atomize = 0.1.1
# Required by:
# slapos.toolbox==0.32.1-dev
feedparser = 5.1.3
# Required by:
# hexagonit.recipe.cmmi==1.6
hexagonit.recipe.download = 1.6
# Required by:
# slapos.core==0.33.2-dev
netifaces = 0.8
# Required by:
# slapos.toolbox==0.32.1-dev
paramiko = 1.9.0
# Required by:
# slapos.toolbox==0.32.1-dev
psutil = 0.6.1
# Required by:
# slapos.core==0.33.2-dev
pyflakes = 0.5.0
# Required by:
# cns.recipe.symlink==0.2.3
# slapos.cookbook==0.70.1-dev
# slapos.core==0.33.2-dev
# slapos.toolbox==0.32.1-dev
# supervisor==3.0b1
# zc.buildout==1.6.0-dev-SlapOS-010
# zope.interface==4.0.2
setuptools = 0.6c12dev-r88846
# Required by:
# slapos.core==0.33.2-dev
supervisor = 3.0b1
# Required by:
# slapos.toolbox==0.32.1-dev
xml-marshaller = 0.9.7
# Required by:
# slapos.core==0.33.2-dev
zope.interface = 4.0.2
stack/lapp/postgres/instance-postgres-export.cfg.in
View file @
b7416aa7
...
...
@@ -8,6 +8,9 @@ parts +=
postgres-instance
postgres-promise
# have to repeat the next one, as it's not inherited from pbsready-export
cron-entry-backup
[exporter]
recipe = slapos.cookbook:postgres.export
...
...
stack/lapp/postgres/instance-postgres-import.cfg.in
View file @
b7416aa7
...
...
@@ -6,6 +6,9 @@ extends = ${instance-postgres:output}
parts +=
postgres-instance
# have to repeat the next one, as it's not inherited from pbsready-import
import-on-notification
[importer]
recipe = slapos.cookbook:postgres.import
wrapper = $${rootdirectory:bin}/$${slap-parameter:namebase}-importer
...
...
stack/lapp/postgres/instance-postgres.cfg.in
View file @
b7416aa7
...
...
@@ -37,7 +37,7 @@ bin = $${buildout:directory}/bin
[basedirectory]
recipe = slapos.cookbook:mkdirectory
log = $${rootdirectory:var}/log
services = $${rootdirectory:etc}/
run
services = $${rootdirectory:etc}/
service
run = $${rootdirectory:var}/run
script = $${rootdirectory:etc}/script
backup = $${rootdirectory:srv}/backup
...
...
@@ -134,9 +134,9 @@ config-file = $${directory:stunnel-conf}/stunnel.conf
key-file = $${directory:stunnel-conf}/stunnel.key
cert-file = $${directory:stunnel-conf}/stunnel.crt
pid-file = $${basedirectory:run}/stunnel.pid
local-host = $${
postgres-instance:ipv4_host
}
local-host = $${
instance-parameters:ipv4_random
}
local-port = $${postgres-instance:port}
remote-host = $${
slap-network-information:global-ipv6
}
remote-host = $${
instance-parameters:ipv6_random
}
remote-port = 6446
client = false
post-rotate-script = $${rootdirectory:bin}/stunnel_post_rotate
...
...
@@ -171,19 +171,19 @@ crl = $${directory:ca-dir}/crl/
[postgres-instance]
recipe = slapos.cookbook:postgres
ipv6_host = $${slap-network-information:global-ipv6}
ipv6 = $${instance-parameters:ipv6}
ipv4 = $${instance-parameters:ipv4}
ipv6_random = $${instance-parameters:ipv6_random}
user = postgres
port = 5432
dbname = db
# XXX the next line is required by stunnel, not by us
ipv4_host = $${slap-network-information:local-ipv4}
# pgdata_directory is created by initdb, and should not exist beforehand.
pgdata-directory = $${rootdirectory:var}/data
backup-directory = $${basedirectory:backup}/postgres
services = $${basedirectory:services}
bin = $${rootdirectory:bin}
services = $${basedirectory:services}
dependency-symlinks = $${symlinks:recipe}
[ca-stunnel]
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
...
...
@@ -227,7 +227,7 @@ path = $${directory:report}/slapmonitor-xml
[postgres-promise]
recipe = slapos.cookbook:check_port_listening
path = $${basedirectory:promises}/postgres
hostname = $${
slap-network-information:global-ipv6
}
hostname = $${
instance-parameters:ipv6_random
}
port = $${postgres-instance:port}
...
...
@@ -238,7 +238,7 @@ port = $${postgres-instance:port}
[urls]
recipe = slapos.cookbook:publish
url = $${postgres-instance:url}
ip = $${
slap-network-information:global-ipv6
}
ip = $${
instance-parameters:ipv6_random
}
#----------------
#--
...
...
stack/resilient/README.txt
0 → 100644
View file @
b7416aa7
Base resilient stack
====================
This stack is meant to be extended by SR profiles, or other stacks, that need to provide
automated backup/restore, election of backup candidates, and instance failover.
As reference implementations, both stack/lamp and stack/lapp define resilient behavior for
MySQL and Postgres respectively.
This involves three different software_types:
* pull-backup
* {something}_export
* {something}_import
where 'something' is the component that needs resiliency (can be postgres, mysql, erp5, and so on).
pull-backup
-----------
This software type is defined in
http://git.erp5.org/gitweb/slapos.git/blob/HEAD:/stack/resilient/instance-pull-backup.cfg.in?js=1
and there should be no reason to modify or extend it.
An instance of type 'pull-backup' will receive data from an 'export' instance and immediately populate an 'import' instance.
The backup data is automatically used to build an historical, incremental archive in srv/backup/pbs.
export
------
example:
http://git.erp5.org/gitweb/slapos.git/blob/HEAD:/stack/lapp/postgres/instance-postgres-export.cfg.in?js=1
This is the *active* instance - the one providing live data to the application.
A backup is run via the bin/exporter script: it will
1) run bin/{something}-backup
and 2) notify the pull-backup instance that data is ready.
The pull-backup, upon receiving the notification, will make a copy of the data and transmit it to the 'import' instances.
You should provide the bin/{something}-exporter script, see for instance
http://git.erp5.org/gitweb/slapos.git/blob/HEAD:/slapos/recipe/postgres/__init__.py?js=1#l207
http://git.erp5.org/gitweb/slapos.git/blob/HEAD:/slapos/recipe/mydumper.py?js=1#l71
By default, as defined in
http://git.erp5.org/gitweb/slapos.git/blob/HEAD:/stack/resilient/pbsready-export.cfg.in?js=1#l27
the bin/exporter script is run every 60 minutes.
import
------
example:
http://git.erp5.org/gitweb/slapos.git/blob/HEAD:/stack/lapp/postgres/instance-postgres-import.cfg.in?js=1
This is the *fallback* instance - the one that can be activated and thus become active.
Any number of import instances can be used. Deciding which one should take over can be done manually
or through a monitoring + election script.
You should provide the bin/{something}-importer script, see for instance
http://git.erp5.org/gitweb/slapos.git/blob/HEAD:/slapos/recipe/postgres/__init__.py?js=1#l233
http://git.erp5.org/gitweb/slapos.git/blob/HEAD:/slapos/recipe/mydumper.py?js=1#l71
stack/resilient/buildout.cfg
View file @
b7416aa7
...
...
@@ -22,7 +22,7 @@ parts =
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/pbsready.cfg.in
output = ${buildout:directory}/pbsready.cfg
md5sum =
a2edaadfe652b4b131626b4801768f40
md5sum =
e602f6746cbe5a1da82b90097719c4a1
mode = 0644
[pbsready-import]
...
...
@@ -47,7 +47,7 @@ mode = 0644
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-pull-backup.cfg.in
output = ${buildout:directory}/instance-pull-backup.cfg
md5sum =
18b88cd012e886fbaa457b03928c2d10
md5sum =
453d96f5a6c1230c01c878cc7640bae6
mode = 0644
[template-replicated]
...
...
stack/resilient/instance-pull-backup.cfg.in
View file @
b7416aa7
...
...
@@ -30,7 +30,7 @@ var = $${buildout:directory}/var
[basedirectory]
recipe = slapos.cookbook:mkdirectory
log = $${rootdirectory:var}/log
services = $${rootdirectory:etc}/
run
services = $${rootdirectory:etc}/
service
run = $${rootdirectory:var}/run
backup = $${rootdirectory:srv}/backup
promises = $${rootdirectory:etc}/promise
...
...
stack/resilient/pbsready.cfg.in
View file @
b7416aa7
...
...
@@ -24,7 +24,7 @@ parts +=
#-- Creation of all needed directories.
[basedirectory]
services = $${rootdirectory:etc}/
run
services = $${rootdirectory:etc}/
service
cache = $${rootdirectory:var}/cache
notifier = $${rootdirectory:etc}/notifier
...
...
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