-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker Swarm support #72
Comments
Theoretically it just talks to the docker socket, so as long as it can find containers using that, it should work. Do the logs tell you anything? |
They do not: No further entries. |
How long is the container running? Is it definitely running at midnight when the backup is due to run? |
I've pushed an image update which adds a little more logging to hopefully help understand what's going on. Pull it and see what it says next time. |
Thanks, I pulled the updated image and ran it with $SCHEDULE as empty: Starting backup... Running image: Note I do have at least one of the databases mysql running on the same node "Manager" as the db auto backup container so while it might not be able to access machines in another node in the swarm it should be able to reach this one on the same machine. Below is the configuration for the mysql server:
|
If it can't access it, there should be an error. It found 16 containers, but apparently didn't believe it could back any of them up. Does 16 total containers sound about right across your cluster, or could that just be on the same node? Even then, it ought to work. I suspect adding more debug logging would be helpful. I'll see about adding some extra options for that at some point soon. |
That's just from the one node that it's sitting on:
Total containers in the cluster is about 47. As I mentioned there is at least one container that should qualify sitting on the same node running mariadb. |
I did some testing and issue for me at least appears to be with the get_container_names function. Problem is that it's not able to parse out the BACKUP_PROVIDERS variable from my containers if I use a full URL to define the image or a simpler name. Works: Doesn't work: Made some adjustments and was able to at least find the two database containers running in my node:
Running it manually does pick up two containers that fit the profile:
|
I'm surprised an image can exist but not be tagged with anything. Is that something Swarm does? I'd gladly welcome a PR adding support for reading the container's config on top of its tags. |
Some testing does seem to reveal that the way swarm handles tags is a little different from a standalone docker node. Containers managed by Docker Swarm frequently lack tags. Instead, they expose the raw image name with digests (e.g., ghcr.io/realorangeone/db-auto-backup:latest@sha256:9adef191...). While standalone docker will have proper tags. This is likely due to docker swarm managing the container as a service. Standalone docker would still use container.image.tags for the parsing while seems using container.attrs['Config']['Image'] as a fallback. That still doesn't account for services in the swarm vs. just containers on the same node that match the lookup. I'll fiddle around with it and submit a PR if I come up with something that works. Thanks! |
Is it possible to run this on docker swarm? I tried deploying but it doesn't seem to generate any actual files. Below is my config.
The text was updated successfully, but these errors were encountered: