benoitc / erica

tool to manage couchapps
Apache License 2.0
269 stars 30 forks source link

Add file system monitor with incremental push #91

Open wendall911 opened 10 years ago

wendall911 commented 10 years ago

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 commented 10 years ago

This is referred to as "autopush" in couchapp.

kxepal commented 10 years ago

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
wendall911 commented 10 years ago

@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.

kxepal commented 10 years ago

@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.

benoitc commented 10 years ago

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

wendall911 commented 10 years ago

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.

ryanramage commented 10 years ago

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 notifications@github.comwrote:

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 .

wendall911 commented 10 years ago

@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 commented 10 years ago

@benoitc fnotify looks promising.

benoitc commented 10 years ago

On Apr 9, 2014 5:45 AM, "Wendall Cada" notifications@github.com 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.

wendall911 commented 10 years ago

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