Author Topic: Frame dependency callbacks not working  (Read 5815 times)

justin

  • Jr. Member
  • **
  • Posts: 6
Frame dependency callbacks not working
« on: May 12, 2009, 09:37:01 PM »
I have been off and on trying to test a new way to organize our maya renders. I have the maya job as one job, and a custom type as a second, in the same group. The custom job has a few frames that update the database with different statuses, an email job, and a quicktime job. They are supposed to start at different times depending on the status of the maya job.
The problem I am having is that no matter what method I try to do with callbacks, I cannot get a specific frame and the job to unblock in the extraJob when the mayaJob completes. I have tried perl/python/qube callbacks and none actually get the work to start. I watch the callback count increment to 1, so I know the trigger is being met.

The thing is... if I open up a python interactive shell, I can do this:
Code: [Select]
>>> import qb; qb.unblockwork('%s:dbDone' % 2980) ; qb.unblock('2980')
['2978:qtJob']
['2978.2', '2978.1']

which is an attempt to mimic the callback:
Code: [Select]
cb = {}
cb['triggers'] = 'complete-job-mayaJob'
cb['language'] = 'python'
cb['code']     = 'import qb\n'
cb['code']    += "qb.unblockwork('%s:dbDone' % qb.jobid())\n"
cb['code']    += "qb.unblock(qb.jobid())\n"

And the dbDone agenda frame unblocks, along with the job, and it runs and completes.
Any idea why I can't actually get the callback to work?

The above callback was taken from the jobSubmit06.py python example.

justin

  • Jr. Member
  • **
  • Posts: 6
Re: Frame dependency callbacks not working
« Reply #1 on: May 13, 2009, 06:45:46 PM »
Just as an update to this problem... I get similar results when I just try to add callbacks between two cmdline jobs with no agendas.

Job 1: dbFail
Job 2: dbDone

I tried both a perl and a python callback to retire the dbFail job if the dbDone completes. I see the count increment when the trigger is met, but nothing happens to the job. Then I go to an interactive python shell and do:   >>> import qb; qb.retire('3050')
And it works and the job sets to complete.



shinya

  • Administrator
  • *****
  • Posts: 232
Re: Frame dependency callbacks not working
« Reply #2 on: May 22, 2009, 04:36:24 AM »
Hi Justin,

Sorry for not responding to you earlier.

Callbacks are run by a python (or perl) interpreter built into the supervisor,
and it has a slightly different/limited set of "qb" routines available, compared
to the "qb" library you load from your general scripts or in your back-ends.
It is also a bit less up-to-date than the general "qb" library (it's lacking
"retire", for example), so I'll make sure that it gets updated.

In any case, the routine you want to use in your python callback code is
"qb.workunblock()", so please give that a try.