erica icon indicating copy to clipboard operation
erica copied to clipboard

Add file system monitor with incremental push

Open wendall911 opened this issue 11 years ago • 11 comments

The original couchapp tool adds the ability to monitor the filesystem for changes and incrementally push modifications. This is super useful for large couchapps, and would make a nice addition to erica.

wendall911 avatar Apr 08 '14 19:04 wendall911

This is referred to as "autopush" in couchapp.

wendall911 avatar Apr 08 '14 19:04 wendall911

You can install watchdog and run in other terminal or as background process:

watchmedo shell-command --recursive --command='erica push http://localhost:5984/dbname' myapp

kxepal avatar Apr 08 '14 19:04 kxepal

@kxepal wouldn't this just push the entire thing on a change? What I really need is incremental. The app is very large and takes a very long time to load, so anything other than incremental wouldn't work.

wendall911 avatar Apr 08 '14 19:04 wendall911

@wendall911 yes, it would and so does original couchapp. There is no API to push ddoc by parts, by design functions. The only possibility is to not push attachments when they hadn't changed. I didn't test erica for having push smart enough to track down changed attachments on submit.

kxepal avatar Apr 08 '14 19:04 kxepal

afaik couchapp like erica will only push new attachments except if you force it. So it should work. I will see how to add this feature. I am thinking ot use https://github.com/Feuerlabs/fnotify

benoitc avatar Apr 08 '14 19:04 benoitc

The watchdog command above pushes the entire app for every change. For my use-case where _attachments is ~250M, I need incremental push on changes in _attachments.

wendall911 avatar Apr 08 '14 20:04 wendall911

FYI, my super old, java based couchapp tool reupholster ( https://code.google.com/p/reupholster/downloads/list) supported uploading attachment changes. so it would only update the attachment that changed. It really bumps up the rev of the doc quick ;) I cant even remember the on disk couchapp layout, but it should still run.

That being said, I am not sure if erica should do the same. I think it might be a lot of work.

On Tue, Apr 8, 2014 at 2:27 PM, Wendall Cada [email protected]:

The watchdog command above pushes the entire app for every change. For my use-case where _attachments is ~250M, I need incremental push on changes in _attachments.

Reply to this email directly or view it on GitHubhttps://github.com/benoitc/erica/issues/91#issuecomment-39897556 .

ryanramage avatar Apr 08 '14 21:04 ryanramage

@ryanramage I'm not sure what the point of erica is if it effectively only works for very trivial projects. Five minutes to push 230M of attachments locally isn't really a working solution, especially considering the cycle required for editing an app of any size. Maybe I'm doing something wrong locally, but the python couchapp tool takes just a few seconds for the entire couchapp, and updated attachments take only a second or so to update using autopush.

wendall911 avatar Apr 09 '14 03:04 wendall911

@benoitc fnotify looks promising.

wendall911 avatar Apr 09 '14 03:04 wendall911

On Apr 9, 2014 5:45 AM, "Wendall Cada" [email protected] wrote:

@ryanramage I'm not sure what the point of erica is if it effectively only works for very trivial projects. Five minutes to push 230M of attachments locally isn't really a working solution, especially considering the cycle required for editing an app of any size. n I'm doing something wrong locally, but the python couchapp tool takes just a few seconds for the entire couchapp, and updated attachments take only a second or so to update using autopush.

i didn't noitice any differences but i will test it. how do you push the atts?

Reply to this email directly or view it on GitHub.

benoitc avatar Apr 09 '14 06:04 benoitc

I simply ran erica push http://localhost:5984/my_repo from the couchapp directory. The command takes around five minutes, regardless if the couchapp is already in the db or not. My local version of erica is based off of da38b838b3

wendall911 avatar Apr 09 '14 14:04 wendall911