Skip to content
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

First time compose initiation #126

Open
PovilasID opened this issue Mar 6, 2022 · 13 comments
Open

First time compose initiation #126

PovilasID opened this issue Mar 6, 2022 · 13 comments
Labels

Comments

@PovilasID
Copy link

Hey,

after running https://github.com/djmaze/resticker/blob/master/docker-compose.example.yml as not prune container launches before others and locks the connection stopping from making immediate connection.
I suggest adding

    depends_on:
      - backup

for prune and check containers
Also each container creates their keys and config in the same folder will that not cause conflicts?

@djmaze
Copy link
Owner

djmaze commented Apr 18, 2022

@PovilasID I guess the current compose example makes no sense this way for real-world usage. I guess most people will run backup and prune on the same machine, but they don't have a need of running the prune immediately.

So I think we should rather change RUN_ON_STARTUP to false for the prune container in order to prevent this situation. What do you think?

And.. Sorry for the late response!

@PovilasID
Copy link
Author

People do not need to run prune immediately, however if they don't they will never do 😆
I am talking here only about myself but I wanted to run prune immediately, so I have the backup system running and I would not have to return to it (hopefully never).
I do not know what the ideal solution would be but depends waits for other to be initiated and that makes it the ideal for fire and forget situation even though it may not be as resource efficient.

@djmaze
Copy link
Owner

djmaze commented Apr 27, 2022

I don't think depends will work well in this case because the prune will be run when most probably the backup is still running. In order to test the prune correctly you should probably rather wait for the backup to finish and then run docker compose exec prune prune manually I guess.

@PovilasID
Copy link
Author

Question: Can we merge pruning into the same container?
Instead of having a separate container could be a command or an ENV var that would set pruning?
My point is again to be able to 'set it and forget it'

@djmaze
Copy link
Owner

djmaze commented Apr 30, 2022

@PovilasID How would you imagine this to work in that case? Should the prune be run automatically after each backup?

@PovilasID
Copy link
Author

You already have PRUNE_CRON maybe it could be dumped into the backup container environmentals and the same container would do two bot backups and pruning. Have not tested it. Would it work? Would it not be redundant?

@djmaze
Copy link
Owner

djmaze commented May 22, 2022

We could do that, but I do not see a real advantage. Then you would still need to set a suitable schedule for PRUNE_CRON. So apart from saving one container / go-cron process, there would be no win.

@PovilasID
Copy link
Author

Other than naming that advantage there would also be the benefit of a little bit of 'idiotproofing' not that any user of this repo is one :D but reducing the complexity and making compose file runnable out of the box without any edits would be just nice

@djmaze
Copy link
Owner

djmaze commented May 26, 2022

Well, in order to do that we'd just need to set RUN_ON_STARTUP to false for the prune container :)

@derickson2402
Copy link

Hey y'all just found this project and am trying it out! I'm using Storj.io S3 for the backend storage. I'm running into some wonky stuff and I'm hoping it can help you moving forward.

When starting the stack, all 3 containers try to init the bucket at the same time which fails. I have to manually go into the bucket and delete the config file and then start the stack again. I set the start order to backup -> prune -> check, which allowed the backup container to work but then the prune and check containers stopped working. I'll report back if I can find a fix.

@ericvoshall
Copy link
Contributor

+1 to this, I am having issues with all three services (backup, prune, check) trying to simultaneously initialize a new repository, even with only one of the services having RUN_ON_STARTUP set to true.

Would it be possible to wait to check if a repository is initialized until the command actually runs (triggered either by the cron schedule or the RUN_ON_STARTUP flag)?

@djmaze
Copy link
Owner

djmaze commented Jan 15, 2023

Mhh.. That would be a solution, but not a good one IMO. I think it's quite helpful that the check is done on container start already (so you can see if there is a problem early on).

@ericvoshall As a quick solution, you could comment out two of the three services (or set replicas: 0 for them) for the first run. After the successful initialization of the repository, there should be no further problems I guess.

I know this is a bit ugly, but I am not quite sure what would be the best solution.

@ericvoshall
Copy link
Contributor

ericvoshall commented Jan 15, 2023

Mhh.. That would be a solution, but not a good one IMO. I think it's quite helpful that the check is done on container start already (so you can see if there is a problem early on).

@ericvoshall As a quick solution, you could comment out two of the three services (or set replicas: 0 for them) for the first run. After the successful initialization of the repository, there should be no further problems I guess.

I know this is a bit ugly, but I am not quite sure what would be the best solution.

What about utilizing container health checks and reporting the container as healthy once it verifies the repository exists on startup? Then we could wait for the other containers to start until one reports it's healthy/the repository exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants