...
Code Block | ||
---|---|---|
| ||
#!/usr/bin/pythonenv python3 # Below are required imports for the script to run import os, sys # The below few lines of code are to determine the OS of the machine that your running # this script from and then define the location of the Qube! API if 'QBDIR' in os.environ: sys.path.append('%s/api/python' % os.environ['QBDIR']); elif os.uname()[0] == 'Darwin': sys.path.append('/Applications/pfx/qube/api/python'); elif os.uname()[0] == 'Linux': sys.path.append('/usr/local/pfx/qube/api/python'); else: sys.path.append('c:/program files/pfx/qube/api/python'); # The below line of code is to import the above defined Qube! API import qb # Below is the main function to run in this script def main(): # ----------------Start creation of Parent Job---------------------------------------- # Below defines an empty list for combining all tasks in the dependency chain task = [] # Below creates an empty dictionary to be filled by the following lines of code job = {} # Below defines a label for the dependency to be used internally within this script job['label']= 'RibGenLabel' # Below defines the name of the Qube! job job['name'] = 'Maya Rib Generation Job TUTORIAL' # Below defines how many Instances/subjobs the job is to spawn job['cpus'] = 1 # Below defines the internal Qube! jobtype to be used to execute the job job['prototype'] = 'cmdrange' # The below parameters are explained further in the "Job submission with job package explained" page package = {} job['package'] = package job['package']['cmdline'] = 'sleep QB_FRAME_NUMBER' job['package']['simpleCmdType'] = 'Maya BatchRender (rib)' # Below defines the Agenda/Range of the job this will fill the Frames/Work section of the Qube! GUI # "0-60" is range 0-60 agendaRange = '0-60' # Below defines the internal command required to generate the agenda agenda = qb.genframes(agendaRange) # Below defines the job details for the agenda job['agenda'] = agenda # Below appends the details of this task to the job dictionary for later submission task.append(job) # ----------------Start creation of Child Job---------------------------------------- # Below creates an empty dictionary to be filled by the following lines of code job = {} # Below defines a label for the dependency to be used internally within this script job['label']= 'PRmanLabel' # Below defines the dependency of this job see below for possible dependency strings job['dependency'] = 'link-complete-job-RibGenLabel' # Below defines the name of the Qube! job job['name'] = 'Renderman Render Job TUTORIAL' # Below defines how many Instances/subjobs the job is to spawn job['cpus'] = 1 # Below defines how many Instances/subjobs the job is to spawn job['prototype'] = 'renderman' # The below parameters are explained further in the "Job submission with job package explained" page package = {} job['package'] = package job['package']['cmdline'] = 'sleep 20' job['package']['simpleCmdType'] = 'Renderman Job' # Below appends the details of this task to the job dictionary for later submission task.append(job) # Below submits the task list to Qube! listOfSubmittedJobs = qb.submit(task) # Below prints out a list of jobs that have been submitted by name for job in listOfSubmittedJobs: print ('%(name)15s: %(id)s' % job) # Below runs the "main" function if __name__ == "__main__": main() sys.exit(0) |
This script differs very little from the Advanced Dependencies script.
...