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
0328542d
Commit
0328542d
authored
Jan 23, 2015
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5: add periodicity for tidstorage/mariadb backup.
Also move mariadb buildout instance profile to dynamic template.
parent
761c9b69
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
25 deletions
+49
-25
stack/erp5/buildout.cfg
stack/erp5/buildout.cfg
+14
-21
stack/erp5/instance-erp5-cluster.cfg.in
stack/erp5/instance-erp5-cluster.cfg.in
+1
-0
stack/erp5/instance-mariadb.cfg.in
stack/erp5/instance-mariadb.cfg.in
+8
-2
stack/erp5/instance-tidstorage.cfg.in
stack/erp5/instance-tidstorage.cfg.in
+2
-1
stack/erp5/instance.cfg.in
stack/erp5/instance.cfg.in
+24
-1
No files found.
stack/erp5/buildout.cfg
View file @
0328542d
...
...
@@ -154,23 +154,10 @@ md5sum = 8db483ef7c3da79a1cb5ea07ba79a0ed
mode = 755
[template-mariadb]
< = template-jinja2-base
filename = instance-mariadb.cfg
md5sum = 34f851101ce6f187296f38648f5bbae0
extra-context =
key coreutils_location coreutils:location
key dcron_location dcron:location
key findutils_location findutils:location
key gettext_location gettext:location
key grep_location grep:location
key gzip_location gzip:location
key logrotate_location logrotate:location
key mariadb_location mariadb:location
key mariadb_resiliency_after_import_script mariadb-resiliency-after-import-script:target
key perl_location perl:location
key perl_siteprefix perl:siteprefix
key sed_location sed:location
key xtrabackup_location xtrabackup:location
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-mariadb.cfg.in
md5sum = 48e8816d7d0c9e17585398fcf8e70347
mode = 640
[template-zope]
recipe = slapos.recipe.build:download
...
...
@@ -192,7 +179,7 @@ extra-context =
[template-tidstorage]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-tidstorage.cfg.in
md5sum =
9918eef66c4d13e8ae54f1c5baf793a5
md5sum =
20ee9db93c57425319cd4b385d327d39
mode = 640
[template-cloudooo]
...
...
@@ -212,7 +199,7 @@ mode = 640
# XXX: "template.cfg" is hardcoded in instanciation recipe
filename = template.cfg
template = ${:_profile_base_location_}/instance.cfg.in
md5sum =
2ed28d874b5494521cb874a2474af7c
5
md5sum =
9ced9ebba770ba0b4e6ffe74c65770f
5
extra-context =
key apache_location apache:location
key aspell_location aspell:location
...
...
@@ -227,9 +214,11 @@ extra-context =
key dmtx_utils_location dmtx-utils:location
key erp5_location erp5:location
key file_location file:location
key findutils_location findutils:location
key fontconfig_location fontconfig:location
key fonts_location fonts:location
key freetype_location freetype:location
key gettext_location gettext:location
key git_location git:location
key glib_location glib:location
key glu_location glu:location
...
...
@@ -255,8 +244,11 @@ extra-context =
key local_bt5_repository local-bt5-repository:list
key logrotate_location logrotate:location
key mariadb_location mariadb:location
key mariadb_resiliency_after_import_script mariadb-resiliency-after-import-script:target
key mesa_location mesa:location
key openssl_location openssl:location
key perl_location perl:location
key perl_siteprefix perl:siteprefix
key poppler_location poppler:location
key sed_location sed:location
key stunnel_location stunnel:location
...
...
@@ -264,7 +256,7 @@ extra-context =
key template_erp5_cluster template-erp5-cluster:target
key template_erp5_single template-erp5-single:target
key template_kumofs template-kumofs:rendered
key template_mariadb template-mariadb:
rendered
key template_mariadb template-mariadb:
target
key template_memcached template-memcached:rendered
key template_tidstorage template-tidstorage:target
key template_varnish template-varnish:target
...
...
@@ -276,6 +268,7 @@ extra-context =
key wget_location wget:location
key xdamage_location xdamage:location
key xfixes_location xfixes:location
key xtrabackup_location xtrabackup:location
key zlib_location zlib:location
[template-memcached]
...
...
@@ -298,7 +291,7 @@ mode = 640
[template-erp5-cluster]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-erp5-cluster.cfg.in
md5sum =
1fafb23019043c069bf6e43d61010a54
md5sum =
2ff90bb68761b4930f92321f3b6ba590
mode = 640
[template-varnish]
...
...
stack/erp5/instance-erp5-cluster.cfg.in
View file @
0328542d
...
...
@@ -29,6 +29,7 @@ partition-id = ${slap-connection:partition-id}
<=request-common
name = MariaDB DataBase
software-type = mariadb
config-mariadb-json = ${slap-parameter:mariadb-json}
sla-computer_guid = ${slap-parameter:mariadb-computer-guid}
[request-cloudooo]
...
...
stack/erp5/instance-mariadb.cfg.in
View file @
0328542d
{% if software_type == slap_software_type -%}
{% set json = json_module.loads(parameter_dict.get('mariadb-json', '{}')) -%}
{% set backup_periodicity = json.get('backup-periodicity', '0 22 * * *') -%}
{% set bin_directory = parameter_dict['buildout-bin-directory'] -%}
[buildout]
parts =
publish-mariadb-url
...
...
@@ -37,7 +42,7 @@ command = mysqldump
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = mariadb-backup
frequency =
0 22 * * *
frequency =
${slap-parameter:backup-periodicity}
{# When binlogs are enabled:
# flush-logs: used so no manipulation on binlogs is needed to restore from
# full + binlogs. The first binlog after a dump starts from dump snapshot and
...
...
@@ -53,7 +58,7 @@ file-glob = ??????????????.sql.gz
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = mariadb-backup-expire
frequency =
0 22 * * *
frequency =
{{ backup_periodicity }}
command = {{ findutils_location }}/bin/find "${directory:mariadb-backup-full}" -maxdepth 1 -name "${cron-entry-mariadb-backup:file-glob}" -daystart -mtime +7 -delete
[mariadb-instance]
...
...
@@ -240,3 +245,4 @@ port = ${mariadb-instance:port}
[slap-parameter]
test-database-amount = 100
{%- endif %}
stack/erp5/instance-tidstorage.cfg.in
View file @
0328542d
...
...
@@ -8,6 +8,7 @@ Note: all port counters are pre-incremented. No idea why base port is skipped.
{% set current_apache_port = apache_port_base | int -%}
{% set current_haproxy_port = haproxy_port_base | int -%}
{% set json = json_module.loads(slapparameter_dict['json']) -%}
{% set backup_periodicity = json.get('backup-periodicity', 'daily') -%}
{% set bin_directory = parameter_dict['buildout-bin-directory'] -%}
{#
XXX: This template only supports exactly one IPv4 and one IPv6 per
...
...
@@ -560,7 +561,7 @@ repozo-wrapper = ${buildout:bin-directory}/tidstorage-repozo
< = cron-base
recipe = slapos.cookbook:cron.d
name = tidstorage
frequency =
0 0 * * *
frequency =
{{ backup_periodicity }}
command = ${tidstorage:repozo-wrapper}
[logrotate-entry-tidstorage]
...
...
stack/erp5/instance.cfg.in
View file @
0328542d
...
...
@@ -124,6 +124,29 @@ extra-context =
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type varnish
[dynamic-template-mariadb]
< = jinja2-template-base
template = {{ template_mariadb }}
filename = instance-mariadb.cfg
extra-context =
raw coreutils_location {{ coreutils_location }}
raw dcron_location {{ dcron_location }}
raw findutils_location {{ findutils_location }}
raw gettext_location {{ gettext_location }}
raw grep_location {{ grep_location }}
raw gzip_location {{ gzip_location }}
raw logrotate_location {{ logrotate_location }}
raw mariadb_location {{ mariadb_location }}
raw mariadb_resiliency_after_import_script {{ mariadb_resiliency_after_import_script }}
raw perl_location {{ perl_location }}
raw perl_siteprefix {{ perl_siteprefix }}
raw sed_location {{ sed_location }}
raw xtrabackup_location {{ xtrabackup_location }}
raw buildout-bin-directory {{ buildout_bin_directory }}
import json_module json
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type mariadb
[dynamic-template-zope-parameters]
apache = {{ apache_location }}
aspell = {{ aspell_location }}
...
...
@@ -227,7 +250,7 @@ kumofs = {{ template_kumofs }}
memcached = {{ template_memcached }}
cloudooo = ${dynamic-template-cloudooo:rendered}
zope = ${dynamic-template-zope:rendered}
mariadb =
{{ template_mariadb }
}
mariadb =
${dynamic-template-mariadb:rendered
}
tidstorage = ${dynamic-template-tidstorage:rendered}
varnish = ${dynamic-template-varnish:rendered}
...
...
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