Copies production-only backups code to main branch#3809
Copies production-only backups code to main branch#3809mouse-reeve wants to merge 13 commits intomainfrom
Conversation
|
I think this is missing the use of that container in db-node in docker-compose.yml -file? I might prefer to run this backup as separate container outside db, but that can be looked at later on if it is actually feasible. |
|
You're right, I should have looked more closely at whether things were actually working in production. I'm going through the history and sussing it out now |
326ca9a to
10a152d
Compare
|
@ilkka-ollakka I've got it to what looks like the right state, but I'm not seeing backups generated, and when I go into the container and run the backup script, I'm getting this error: I'm at an impasse on that for the moment. |
Looking at the dockerfile, I think you should run that container instead of default postgresql, so it has cron running in same host. If you run it as separate container, you need to provide hostname and password to pg_dump, you can use If you can show what docker-compose you had/how you tested it, I can retry to replicate the issue locally? |
|
The current state of the code in this PR is how I was testing |
|
ah, I'll take a look at this tomorrow to see most feasible flow to get it running. |
|
I did this PR against this branch: #3829 making the backup node to log output better from cron and run backups separate from database-container. |
|
Where are we on this @mouse-reeve? Ready for more testing? |
|
Yes! A third pair of eyes on this would be great |
hughrun
left a comment
There was a problem hiding this comment.
This seems to work pretty well, albeit with my comment about DEBUG needing to be explicitly false, not merely "not true".
This is not a blocker, but it would be handy if admins could set the time for the daily backups by using an environment variable. Midnight UTC could be a peak usage time.
| #!/bin/bash | ||
| info() { echo >&2 "[$(date --iso-8601=seconds)] $*"; } | ||
|
|
||
| if [ "${DEBUG}" != 'false' ]; then |
There was a problem hiding this comment.
I think this probably makes sense as an explicit check. However I'm just noting here that we should be very clear in the documentation that if DEBUG is not set at all (e.g. it's commented out), then backups won't run. We don't want anyone to find this out the hard way.
There was a problem hiding this comment.
I think we could leave this check out and just modify docker-compose.dev.yml not to have this container running in dev env. I can create PR for that tonight as an example.
Description
This moves some code that lived only on the production branch over to main. I actually think this is the last material difference between the two branches!
What type of Pull Request is this?
Does this PR change settings or dependencies, or break something?
Details of breaking or configuration changes (if any of above checked)
Documentation
Tests