documentcloud / cloud-crowd

Parallel Processing for the Rest of Us

Home Page:https://github.com/documentcloud/cloud-crowd/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CloudCrowd.actions doesn't seem to work from a node only

jgeiger opened this issue · comments

I've tried to move one of my actions into a node by itself so it can be run on multiple machines. The problem is that the node doesn't properly create the actions. When trying to run 'crowd node' it will throw a "uninitialized constant Module::Processor" error. While the node will start up without the 'puts CloudCrowd.actions' in the support/setup.rb, the action isn't properly recognized by the server and will never be run.

http://github.com/jgeiger/gminer_cloud_processor/tree/bugged

I checked out your code and it works for me.

You can't print CloudCrowd.actions within support/setup.rb because your'e requiring that file before you define your Processor class. Even if it didn't throw an exception, it would be a circular require. You can print it after the action has been defined.

Once the node starts up, it registers itself with the central server as being able to perform the "process" action. You can verify this by opening up a crowd console, and taking a look.

irb(main):004:0> NodeRecord.last.actions
=> ["word_count", "process_pdfs", "processor", "graphics_magick"]

That answers why it won't print out but I'm still having the issue with the server being unable to see the action unless it's being run from within the same directory as the server (crowd server and then in another window crowd node) If I try to run the node from another location it still properly registers the node and the actions in the database, but they never get called.

The crowd server output:
CloudCrowd::Error::ActionNotFound - no action named: 'processor' could be found:
/opt/local/bin/thin:19:in `load'
/opt/local/bin/thin:19
127.0.0.1 - - [08/Mar/2010 10:01:31] "POST /jobs HTTP/1.1" 500 30 0.2357

Sorry, the server needs to know about all of the valid actions. Make sure that the configuration directory that the server is running on also has a copy of your processor action.

Thanks. That got it working. I guess I need to duplicate things since I want the local node to run everything but the processor action so I can't launch the server and node from the same directory.