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

Watchers as daemons ? #51

Closed
mickaelperrin opened this issue Jul 14, 2016 · 5 comments
Closed

Watchers as daemons ? #51

mickaelperrin opened this issue Jul 14, 2016 · 5 comments
Labels
Milestone

Comments

@mickaelperrin
Copy link
Contributor

Hi,

I would love to have the opportunity to start / stop watchers from external calls. This would allow deactivating syncing temporarily when performing some tasks and reenable when needed.

The first use case of this is currently while installing Drupal from composer, we could wait the end of the bootstrapping script and the run manually a sync task.

What do you think of that ? what about implementing them as daemons ?

@EugenMayer
Copy link
Owner

Well could you clarify how you run you stack, are you using

docker-sync-stack start

right? Because when using docker-sync start you can stop/start from an external point by simply docker pause <synccontainer-name> and then unpause docker unpause <synccontainer-name> which also would be faster then stopping/starting it.

In general, i like the daemons idea, which also kinda does not block your cli anymore. I am not sure how easy it is since we already run 2 threads, which need to be handled then. Do you have any experience with this kind of implementation in ruby?

@EugenMayer
Copy link
Owner

EugenMayer commented Jul 14, 2016

We could also easy implement this in a separate gem and use docker-sync as a library https://github.com/EugenMayer/docker-sync/wiki/7.-Scripting-with-docker-sync

I do something similar, since after the sync stack starts, i want not only the compose stack to start up, when its started, i want to pre-deploy a developer instance in my drupal. To orchestrate all this, i use a own thor script, docker-sync and docker-compose as libraries

thor dk:start --php7

This would starts docker-sync, then a a PHP7 driven stack for drupal ( compared to the default php5.5 stack ) implemented by overlays with docker-compose-gem, then it pre-installs an instance ( well this is done using consul mainly, but that does not really matter here ).

What i want to say, docker-sync can be used as a lib, also as a lib for a daemon. The question is, if we want the daemon to be an extra-thing without adjusting docker-sync but rather use it as a lib, or if we want to internally change the way docker-sync runs. We might need to both, anyways

@midN
Copy link
Contributor

midN commented Jul 21, 2016

👍 for wrapping whole thing into Daemons and adding option (-d) to run it in the background. Was looking into it few days ago, would ideally like to run it in the background and use terminal-notifier to let me know it synced. I might look into it on the weekend

I for example don't use docker-sync-stack since in our project we have multiple compose files and all of them have a task/service that should be run only once and normal stack/compose is ran without it. For example docker-compose .. up 1 3 4, skipping 2 etc. I also restart compose/stack a lot during development, therefore it would be nice to have docker-sync run in the background, while you can keep doing with your compose/stack anything else.

@EugenMayer
Copy link
Owner

Since for now, the only hurdle to have your use case covered already @midN , is starting a new console cli, i will not actively work on this. I am concentrating on keeping things stable and smooth right now and would be happy if contributors would add features they need for their use case. Hope that makes sense

You can use a console to start

docker-sync start

And use a different console to do

docker-compose -f -f -f

Be aware of the scripting options though https://github.com/EugenMayer/docker-sync/wiki/7.-Scripting-with-docker-sync .. you can implement docker-sync as a library and as we do, implement you special docker-compose logic very convenient.
Beside that, it might make sense to make it possible to pass parameters for docker-compose in docker-sync-stack, especially for service selection

@EugenMayer
Copy link
Owner

merged in 0.2.0

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

3 participants