Commifreak / unraid-appdata.backup

UNRAID AppData backup plugin
17 stars 1 forks source link

Restarting containers with network dependencies doesn't work #2

Closed macdonaldr93 closed 5 months ago

macdonaldr93 commented 10 months ago

Hey there! First off, thanks for much for writing this plugin. It's exactly what I needed for my Unraid setup 🙌

I had an idea for your script and I don't mind working on a pull request if you're busy. My Docker setup includes a container that depends on another container to start - it routes all of its traffic through that container. It would be great if, when restarting, your script could sort the containers better.

Idea 1 - Extend container sorting to look at network

I'm not sure how the metadata can be fetched, but one method could be to look at the network mode and sort dependent containers containers after each other. The network includes the prefix "container:another_container_name".

Idea 2 - Finish starting the other containers before attempting the last retry

This is a different solution that might work well to fix other problems. I was thinking instead of having the last retry take place immediately. You could store a map of failed containers and then retry them one last time after all the containers have been attempted once. That way any dependency between containers might be resolved.

Let me know what you think! Happy to help out too.

Commifreak commented 7 months ago

Isnt that fixable by re-ordering the containers yourself?

macdonaldr93 commented 5 months ago

Wow... that UI isn't intuitive! Haha I had to google how to do this. Thank you for the suggestion. I didn't realize this was possible.