PipelineFX Forum

Qube! => Developer Customization => Topic started by: gycliao on October 30, 2014, 01:59:55 AM

Title: How to modify callbacks and package after job submit via python
Post by: gycliao on October 30, 2014, 01:59:55 AM
I'm trying to append new callbacks or modify package after job sumit.
But it's fail

Code: [Select]
#OK
qb.modify({'priority':123}, jobid)

#Fail
package =  qb.jobinfo(id=pjob_id)[0]['package']
package['range'] = '1-999'
qb.modify({'package': package}, jodid)

#Fail
callbacks =  qb.jobinfo(id=pjob_id, callbacks=1)[0]['callbacks']
callbacks.append(new_callbacks)
qb.modify({'callbacks':callbacks}, jobid)

Am i missing something, or it's not possible to do this.
Title: Re: How to modify callbacks and package after job submit via python
Post by: jburk on October 30, 2014, 03:18:07 AM
Sorry, but neither the callbacks nor the job package can be modified after submission.

For the callbacks, we recommend that you build the job's entire dependency set of jobs in one pass, and then submit the list of jobs to build a 'pgrp' of jobs.  When doing this, one job in a pgrp can refer to another job in a pgrp by the job's label, rather than having to know the job id of another job.

See our documentation for job labels:http://docs.pipelinefx.com/x/aZx (http://docs.pipelinefx.com/x/aZx)

Code: [Select]
frameRange = '1-10'
 
jobA = {
    'name': 'my ribgen job',
    'label': 'ribgenLabel',
    'prototype': 'cmdrange',
    'package': {
        'cmdline': 'my ribgen command...'
    },
    'agenda': qb.genframes(frameRange),
}
 
jobB = {
    'name': 'my render job',
    'label': 'render',
    'status': 'blocked',
    'prototype': 'cmdrange',
    'package': {
        'cmdline': 'my render command...'
    },
    'agenda': qb.genframes(frameRange),
}
 
callbacks = [
    {
        'triggers': 'complete-job-ribgenLabel',
        'language': 'qube',
        'code': 'unblock-self'
    }
]
jobB['callbacks'] = callbacks
 
qb.submit( [jobA, jobB] )
Title: Re: How to modify callbacks and package after job submit via python
Post by: gycliao on February 06, 2015, 02:07:01 AM
hi jburk:
Which Qube version support "process group/job label" feature?

Do i need to upgrade all Qube on Supervisor, RenderNode, client PC?
or just only need to upgrade Qube on supervisor?


Title: Re: How to modify callbacks and package after job submit via python
Post by: jburk on March 22, 2015, 11:10:23 PM
These have been supported since Qube 4.