11 Commits

Author SHA1 Message Date
Ian Wienand
51733e5623 borg-backup: implement saving a stream, use for database backups
Add facility to borg-backup role to run a command and save the output
of it to a separate archive file during the backup process.

This is mostly useful for database backups.  Compressed on-disk logs
are terrible for differential backups because revisions have
essentially no common data.  By saving the uncompressed stream
directly from mysqldump, we allow borg the chance to de-duplicate,
saving considerable space on the backup servers.

This is implemented for our ansible-managed servers currently doing
dumps.  We also add it to the testinfra.

This also separates the archive names for the filesystem and stream
backup with unique prefixes so they can be pruned separately.
Otherwise we end up keeping only one of the stream or filesystem
backups which isn't the intention.  However, due to issues with
--append-only mode we are not issuing prune commands at this time.

Note the updated dump commands are updated slightly, particularly with
"--skip-extended-insert" which was suggested by mordred and
significantly improves incremental diff-ability by being slightly more
verbose but keeping much more of the output stable across dumps.

Change-Id: I500062c1c52c74a567621df9aaa716de804ffae7
2021-02-03 11:43:12 +11:00
Ian Wienand
1006f478c1 etherpad: reduce backup rotations
The database dumps are ~3gb each, so are starting to fill up the disk.
Reduce on-disk rotations to 2 and rely on remote backups more.

Change-Id: Ie8fc8fd7c4c36ca37e6813104f4c711ea55186ab
2020-11-10 09:24:34 +11:00
Clark Boylan
6e368cd61e Don't recompress db backups
We're using logrotate to keep a small number of db backups locally. We
write these backups to disk compressed. We don't want logrotate to
recompress them. This is unnecessary extra work.

Change-Id: Iafe1628ff421f47cf3e5cbee14998eeceb60be4c
2020-10-19 07:06:47 -07:00
Clark Boylan
2e2ee170f8 Fix rooted path to docker-compose
In places like crontab entries we use full paths to executables because
PATH is different under cron. Unfortunately, this meant we broke
docker-compose commands using /usr/bin/docker-compose when we installed
it under /usr/local/bin/docker-compose. In particular this impacted
database backups on gitea nodes and etherpad.

Update these paths so that everything is happy again.

Change-Id: Ib001baab419325ef1a43ac8e3364e755a6655617
2020-04-22 14:09:46 -07:00
Zuul
5e4901b7c6 Merge "Install docker-compose from pypi" 2020-04-17 19:11:19 +00:00
Clark Boylan
8eb981b47f Install docker-compose from pypi
We want to use stop_grace_period to manage gerrit service stops. This
feature was added in docker-compose 1.10 but the distro provides 1.5.
Work around this by installing docker-compose from pypi.

This seems like a useful feature and we want to manage docker-compose
the same way globally so move docker-compose installation into the
install-docker role.

New docker-compose has slightly different output that we must check for
in the gitea start/stop machinery. We also need to check for different
container name formatting in our test cases. We should pause here and
consider if this has any upgrade implications for our existing services.

Change-Id: Ia8249a2b84a2ef167ee4ffd66d7a7e7cff8e21fb
2020-04-16 12:08:00 -07:00
Monty Taylor
d231d6177e Grant access to robots.txt
Apache doesn't like serving files it hasn't been allowed to.

Change-Id: I1113c44f9621229074804d60eba7549ae1236583
2020-04-16 12:28:12 -05:00
Monty Taylor
3469673a11 Add apache connection tuning back to apache
This was missed in the migration.

Change-Id: I09ac1f117b62b659f93ce01b73a4270378d2e25d
2020-04-16 12:14:08 -05:00
Monty Taylor
7657b69387 Build and use our own etherpad image
We need to install the ep_headings plugin. We've got a hack in place
to do it in prod, but it seems like every time we npm install the
plugin in ansible, we need to restart the etherpad container
for $reasons.

It's cleaner to just build an image based on upstream with ep_headings
installed.

Change-Id: Id3b31bbabbbc5f6dcfe56486e48916384292f693
2020-04-13 08:07:09 -05:00
Monty Taylor
3620ae5886 Install ep_headings module
We need to install the ep_headings plugin, which we were doing
before. We could also do this by building a custom image, but for
now just bind-mount it in.

Change-Id: I95f7c0dff4f1de8709a1e5e32eb818ef2852a654
2020-04-11 08:39:54 -05:00
Monty Taylor
b23515c623 Make a new dockerized etherpad.opendev.org
Upstream likes building the settings file into the image, but that's
less exciting, let's bind-mount ours in.

Depends-On: https://review.opendev.org/717491/
Change-Id: Ia1894d884ef2a84e1282345b77fe07bf8898f367
2020-04-07 11:10:57 -05:00