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
Kwabena Antwi-Boasiako
slapos
Commits
54ff0600
Commit
54ff0600
authored
Oct 17, 2011
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch memcached instanciation to a profile based
parent
a6bb4fa0
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
108 additions
and
21 deletions
+108
-21
setup.py
setup.py
+1
-0
slapos/recipe/erp5/__init__.py
slapos/recipe/erp5/__init__.py
+2
-16
slapos/recipe/generic-memcached/__init__.py
slapos/recipe/generic-memcached/__init__.py
+46
-0
slapos/recipe/generic-memcached/template/memcached.in
slapos/recipe/generic-memcached/template/memcached.in
+0
-0
software/erp5/instance-memcached.cfg
software/erp5/instance-memcached.cfg
+28
-0
software/erp5/instance.cfg
software/erp5/instance.cfg
+16
-5
software/erp5/software.cfg
software/erp5/software.cfg
+15
-0
No files found.
setup.py
View file @
54ff0600
...
...
@@ -55,6 +55,7 @@ setup(name=name,
'libcloud = slapos.recipe.libcloud:Recipe'
,
'libcloudrequest = slapos.recipe.libcloudrequest:Recipe'
,
'memcached = slapos.recipe.memcached:Recipe'
,
'generic.memcached = slapos.recipe.generic-memcached:Recipe'
,
'mysql = slapos.recipe.mysql:Recipe'
,
'mkdirectory = slapos.recipe.mkdirectory:Recipe'
,
'nbdserver = slapos.recipe.nbdserver:Recipe'
,
...
...
slapos/recipe/erp5/__init__.py
View file @
54ff0600
...
...
@@ -64,8 +64,8 @@ class Recipe(BaseSlapRecipe):
self
.
path_list
.
append
(
self
.
killpidfromfile
)
ca_conf
=
self
.
installCertificateAuthority
()
memcached_conf
=
self
.
installMemcached
(
ip
=
self
.
getLocalIPv4Address
(),
port
=
11000
)
#
memcached_conf = self.installMemcached(ip=self.getLocalIPv4Address(),
#
port=11000)
kumo_conf
=
self
.
installKumo
(
self
.
getLocalIPv4Address
())
conversion_server_conf
=
self
.
installConversionServer
(
self
.
getLocalIPv4Address
(),
23000
,
23060
)
...
...
@@ -420,20 +420,6 @@ SSLCARevocationPath %(ca_crl)s"""
kumo_gateway_port
=
config
[
'kumo_gateway_port'
],
)
def
installMemcached
(
self
,
ip
,
port
):
config
=
dict
(
memcached_binary
=
self
.
options
[
'memcached_binary'
],
memcached_ip
=
ip
,
memcached_port
=
port
,
)
self
.
path_list
.
append
(
self
.
createRunningWrapper
(
'memcached'
,
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'memcached.in'
),
config
)))
return
dict
(
memcached_url
=
'%s:%s'
%
(
config
[
'memcached_ip'
],
config
[
'memcached_port'
]),
memcached_ip
=
config
[
'memcached_ip'
],
memcached_port
=
config
[
'memcached_port'
])
def
installSphinxSearchd
(
self
,
ip
,
port
=
9312
,
sql_port
=
9306
):
data_directory
=
self
.
createDataDirectory
(
'sphinx'
)
sphinx_conf_path
=
self
.
createConfigurationFile
(
'sphinx.conf'
,
...
...
slapos/recipe/generic-memcached/__init__.py
0 → 100644
View file @
54ff0600
##############################################################################
#
# Copyright (c) 2011 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.
#
##############################################################################
from
slapos.recipe.librecipe
import
GenericBaseRecipe
import
os
class
Recipe
(
GenericBaseRecipe
):
def
install
(
self
):
template_filename
=
self
.
getTemplateFilename
(
'memcached.in'
)
config
=
dict
(
memcached_binary
=
self
.
options
[
'binary_path'
],
memcached_ip
=
self
.
options
[
'ip'
],
memcached_port
=
self
.
options
[
'port'
],
)
executable_path
=
self
.
createExecutable
(
self
.
options
[
'wrapper_path'
],
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'memcached.in'
),
config
))
return
[
executable_path
]
slapos/recipe/
erp5
/template/memcached.in
→
slapos/recipe/
generic-memcached
/template/memcached.in
View file @
54ff0600
File moved
software/erp5/instance-memcached.cfg
View file @
54ff0600
[buildout]
parts =
memcached-instance
publish-memcached-connection-information
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/
bin = $${buildout:directory}/bin/
[basedirectory]
recipe = slapos.cookbook:mkdirectory
services = $${rootdirectory:etc}/run/
[memcached-instance]
recipe = slapos.cookbook:generic.memcached
wrapper_path = $${basedirectory:services}/memcached
binary_path = ${memcached:location}/bin/memcached
ip = $${slap-network-information:local-ipv4}
port = 11000
[publish-memcached-connection-information]
recipe = slapos.cookbook:publishurl
url = memcached://$${memcached-instance:ip}:$${memcached-instance:port}/
software/erp5/instance.cfg
View file @
54ff0600
[buildout]
[
old
buildout]
parts =
instance
...
...
@@ -12,11 +12,7 @@ haproxy_binary = ${haproxy:location}/sbin/haproxy
gzip_binary = ${gzip:location}/bin/gzip
httpd_binary = ${apache:location}/bin/httpd
innobackupex_binary = ${xtrabackup:location}/bin/innobackupex
kumo_gateway_binary = ${kumo:location}/bin/kumo-gateway
kumo_manager_binary = ${kumo:location}/bin/kumo-manager
kumo_server_binary = ${kumo:location}/bin/kumo-server
logrotate_binary = ${logrotate:location}/usr/sbin/logrotate
memcached_binary = ${memcached:location}/bin/memcached
mysql_binary = ${mariadb:location}/bin/mysql
mysql_install_binary = ${mariadb:location}/bin/mysql_install_db
mysql_upgrade_binary = ${mariadb:location}/bin/mysql_upgrade
...
...
@@ -80,3 +76,18 @@ environment =
bt5_repository_list = ${bt5-repository:list}
configurator_bt5_list = ${instance-recipe:configurator_bt5_list}
[buildout]
parts =
switch-softwaretype
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[switch-softwaretype]
recipe = slapos.cookbook:softwaretype
kumofs = ${template-kumofs:output}
memcached = ${template-memcached:output}
software/erp5/software.cfg
View file @
54ff0600
...
...
@@ -32,6 +32,21 @@ md5sum = 53f225e13bf7ebcd88bbc2b038c83b6f
output = ${buildout:directory}/template.cfg
mode = 0644
[template]
# Default template for erp5 instance.
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
md5sum = 53f225e13bf7ebcd88bbc2b038c83b6f
output = ${buildout:directory}/template.cfg
mode = 0644
[template-memcached]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-mariadb.cfg
md5sum = 7a7eda874008dcf64944d5c5075ae7eb
output = ${buildout:directory}/template-mariadb.cfg
mode = 0644
[validator]
# Default json schema for instance parameters.
recipe = slapos.recipe.template
...
...
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