From: ptkwt@...1.aracnet.com (Phil Tomson) Date: 2001-12-12T03:43:24+09:00 Subject: [ruby-talk:28257] Re: ANNOUNCE: Distributor (a task distribution system) In article , Robert Feldt wrote: >On Tue, 11 Dec 2001, Phil Tomson wrote: > >> >From the README file: >> >> "What is it?" >> I call it the Distributor Library Framework because there are several >> classes involved on both the client and server-sides. >> >Great news Phil. > >I haven't checked it out yet so should probably shut up but a q: > >* Have you added support for "vanilla" jobbs, ie. running ordinary apps >and not only Ruby code? In general this is hard (because of lib/dll hell >etc) but I'm thinking something simple like the user has to specify all >files needed to execute the job, the command line args etc. I'm not sure >this is on your agenda but I'd love to see your stuff evolve into Ruby's >plug-and-play solution for distributed execution. I guess it amounts to >writing a FileArchive/Tar class that implements a run method. Its on my >TODO but the TODO is long so someone else? ;-) The quick answer to your question is no and yes ;-) No, I didn't specifically add support for "running ordinary apps and not only Ruby code" - in the spirit of "keep it simple" and "don't try to anticipate all the ways your user wants to use your classes" (from a talk by Ward Cunningham I recently attended) I made the system flexible enough so that users can run ordinary apps (so that's the 'yes' - it's possible to do it, but it's up to you the user to set it up). So let's say you want to run some app on a testcase, you would set up your own class, let's call it RunApp: #begin RunApp.rb class RunApp def initialize(appname, testcase, *args) @args = args @testcase = testcase @appname = appname end def run copy_needed_files system("#{appname} #{@args} #{testcase}") clean_up end private def copy_needed_files #do your testcase here end def clean_up #do your cleanup here end def end #end of RunApp.rb Now that you've got RunApp.rb, you either need to make sure that the file is available to all of your remote clients or you can simply use the 'remote_require' method of Distributor to have it sent to all of your clients. Now you can set up RunApp objects and have them sent to your remote clients via Distributor. My intended use for Distributor is as a testcase distributor, so yes I intend to run apps with it, not just Ruby code. I just want Distributor to do one primary thing and that's to distribute runnable objects - I didn't want to try to anticipate what every user might want to do with it, so I hope I made it flexible enough for the user to define what it is they want to run and have just enough 'hooks' for them to do this. In a previous incarnation of Distributor - the Distributor class was defined in such a way that it was 'married' to the app I was testing. There was no way I could release that code and have it usable by anyone who wanted to do something else with it, so in this version I made it very generic. Thanks for the question, and please do offer suggestions. Phil