Closed philipithomas closed 8 years ago
Hi there. This is quite a complicated case to support. The file system monitoring library we use does not have a polling back-end, and I frankly don't relish the prospect of implementing one from scratch. It would be tricky to get right and portable, frightfully inefficient, and very rarely used.
To support this natively in modd, one could have a local/remote split, with an ordinary watcher monitoring for changes outside the VM, and then triggering restart inside the VM over a socket. I can imagine a syntax for this that works, where we have a match condition over remote file changes, and where all modification notices are sent to the remote modd instance. This would be a significant amount of effort to implement, and I'd want to see if there are other, similar use cases that could be served by the same mechanism.
My first impulse here would be to see if you could just use modd as-is. We can trigger arbitrary commands locally on modification - so all that's needed is an RPC mechanism to do whatever needs to be done inside the VM from the host machine. I can easily imagine setting this up over ssh with key-based auth, for instance.
Thoughts?
Thanks for the feedback @cortesi. We implemented a host OS filesystem watcher with modd, which then ssh's in to make changes. I'm experimenting with two other possible improvements - using Unison to sync files, and switching from vagrant to Docker.
I'm fine with marking this issue as "won't fix" for now and closing it.
@philipithomas Yes, I think let's close this for now. Please do let me know if there's anything else you feel modd needs to do to support this use case, though.
I'm trying to run Modd in Vagrant, and apparently changes made outside the VM do not play nicely with tools for watching filesystem changes (related Stack Overflow). One solution is polling the filesystem for changes.
Would polling fit into the architecture? (Are there any other known Vagrant workarounds for detecting host -> vagrant VM file changes?)