Bi-directionally synced shared folder, with inotify support ?

743 views
Skip to first unread message

Renaud Guerin

unread,
Feb 27, 2014, 7:56:51 AM2/27/14
to vagra...@googlegroups.com
Hi,

tl;dr : I haven't found a solution that ticks all of the boxes in the subject, do you know one ?

My use case should be fairly common : I'd like to share a source tree directory (4-5k files) on the host (MacOS) so devs can edit there, but also have Compass inside the (Ubuntu) guest watch for any changes and recompile assets (i.e. write to this directory too)

Where it might be less common is that ideally, the devs would like at least some of the assets produced by Compass inside the guest (pngcrushed images) to be available on the host too, for easy committing back into git in their optimized form.

I've tried Virtualbox + NFS shared folders : they do the job functionally, but neither supports inotify.
In polling mode, Compass uses 70% CPU on a recent Macbook : not really practical.

The rsync-auto mode in Vagrant 1.5 is looking good, but it's not going to be bidirectional.

I suspect we'll have to revisit the dev workflow and compromise somewhere, but if you know of a solution that does all of that, that would be appreciated.

Thanks !

Mitchell Hashimoto

unread,
Feb 27, 2014, 10:33:25 AM2/27/14
to vagra...@googlegroups.com
Renaud,

There isn't a built-in mechanism into Vagrant (now or in 1.5) that will support bi-directional sync PLUS inotify. You can try to write your own synced folder plugin or just manually use something like `unison` to do this, though.

Best,
Mitchell


--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Andrew Coulton

unread,
Feb 28, 2014, 7:55:05 AM2/28/14
to vagra...@googlegroups.com
I've not had a chance to play with it yet, but the most recent releases of guard and listen have added support for forwarding file change events over a network connection - specifically aimed at eg Vagrant setups.

I don't think it will work if you genuinely need native inotify events on the guest, but if you're running anything that can be triggered by guard that should now be possible. You just need to run listen on your host and configure the path and IP/port mappings between them.

I started writing a bidirectional sync plugin (with guard on both host and guest) a while ago, but found that there were issues getting it to be totally reliable because of course each sync then triggered a change notification at the other end - filtering these out but still picking up genuine changes straight after was tricky particularly when dealing with builders and the like that don't care too much about atomic file updates.

Andrew

Dmitry Matora

unread,
Jan 14, 2015, 7:31:33 PM1/14/15
to vagra...@googlegroups.com
have you checked https://github.com/dmatora/vagrant-unison ?
it does realtime bidirectional folder sync (inotify mode only supports host->guest direction so far)

пятница, 28 февраля 2014 г., 16:55:05 UTC+4 пользователь Andrew Coulton написал:
Reply all
Reply to author
Forward
0 new messages