Author Topic: Work items with different commands  (Read 10574 times)

justin

  • Jr. Member
  • **
  • Posts: 6
Work items with different commands
« on: April 08, 2009, 06:43:08 PM »
Hi,

We currently launch our maya render as a group of 4-5 jobs with dependancies. First is a job which updates the database, then the maya render job, then followed by the unlocking of either a db-fail or a db-done job depending on the maya render, and finally, a quicktime generation job.
This was all set up before I started working on pipeline here, and I feel 5 jobs is a bit of visual clutter. What I am trying to do, is to see if I can create a maya job, and add additional work to the agenda, but my question is how the job package affects the agenda/work individual settings.
Is it possible to have the 1-n range work take its cue from the maya job package, while other additional Work has its own 'cmdline' and whatnot?

As I have it laid out at this point, I can create the job with the range, and add my extra database update frames, a quicktime creation frame, and an email frame. I have the dependancies all set up nicely. But these extra work objects in the agenda still take their package from the job, load up like a maya render, and completely ignore my cmdline setting. Is this the expected result and is there any way to have extra frames named/labeled 'dbUpdate', 'quicktime', etc, and run just an arbitrary command?
I am wondering if I would just have to do a completely generic cmdrange job, and explicitly set each work objects command, in order to do this type of set up. Or, maybe I should be doing a maya job, and a second job with the rest of the extra commands.

Thanks!

Justin Israel
Technical Developer
SouthPark Studios

Scot Brew

  • Hero Member
  • *****
  • Posts: 272
    • PipelineFX
Re: Work items with different commands
« Reply #1 on: April 09, 2009, 07:51:28 AM »
Responses to Questions
  • Each job uses only 1 jobtype (maya, cmdrange, cmdline, etc).  These cannot be mixed together in the same job
  • One can have multiple commands run in the same cmdrange jobtype.  See below.
  • Also look at the MetaJob panel in the QubeGUI, just above the JobList panel for ways to organize multiple dependent jobs and filter them in the JobList.

How to run multiple commands from the same cmdrange jobtype
You can specify strings in the range of a cmdrange jobtype and retrieve them in the command using QB_FRAME_RANGE macro.  This allows you to have a cmdrange job run multiple commands.

For example:
1) Launch the QubeGUI
2) Submit->Cmdrange Job...
3) Set the "Command" to "QB_FRAME_RANGE"
4) Set the "Range" to "ls,set,whoami"

This will have the workers run those 3 commands as individual tasks.

Note:
There is a limitation in the current release with qb.genframes() that removes all spaces from the frame names (this "echo HI" becomes "echoHI").  We do have a python script-side fix for this and it will go out in the next Qube release.

justin

  • Jr. Member
  • **
  • Posts: 6
Re: Work items with different commands
« Reply #2 on: April 09, 2009, 04:54:24 PM »
That looks like a good solution.
So it seems what I should be doing is have the maya job by itself since its work cannot run arbitrary commands. And then have a second job that is a cmdrange, with my extra pre and post work, and setting frame/job dependancies between them.
I think the bug in the Work name from genframes is ok, since I will just build my own agenda manually, and then I can set labels for each frame.

Could you maybe post or email once the per-frame package bug is addressed? That would be awesome, since its probably a bit more straightforward approach to setting each frame up to be individual.

Thanks for the reply!
-- justin

justin

  • Jr. Member
  • **
  • Posts: 6
Re: Work items with different commands
« Reply #3 on: April 09, 2009, 09:17:01 PM »
I tried this method, and did get frames to run different commands with the QB_FRAME_RANGE macro. But what I'm seeing is, callbacks to these frames have to refer to the 'name' of the work, correct? Is it going to work with spaces in the command, to refer to the Work item by name?

Example:   
work['name'] = 'ls -1 | grep mystuff'
...
callback['triggers'] = 'complete-work-self-%s' % work['name']

I know that this method was a work around, while you looked into Work items having their own packages. Then I could name the work item something simple.
What should I do for now to address a callback to this work item?