AWS Thinkbox Discussion Forums

How can I submit two jobs that depend on each other?

I’m working on a tool that submits two PDG jobs from Houdini.

It’s going to be an image render job that needs to depend on a file cache job (both performed by different groups of machines). I submit those jobs by using the Deadline Scheduler’s “Submit” button.

I don’t know how to get the ID (programatically) of the first job right after it is submitted. If I did, I could use it as a dependency when submitting the second job.

Edit: I inspected the Deadline Scheduler node and found this code, I suppose this is how it submits jobs:

def submitGraphAsJob(kwargs, node):
    from pdg.scheduler import submitGraphAsJob
    submitGraphAsJob(kwargs, node, 'Deadline')

Edit2: OK I think I got it. Instead of using Deadline Scheduler’s button, I created my own HDA with my custom Python Module and I added the same function there as above, but modified it like this:

def submitGraphAsJob(kwargs, node):
    from pdg.scheduler import submitGraphAsJob
    id = submitGraphAsJob({}, node, 'Deadline')
    print("ID:", id)

And I added a button with a callback that passes the Deadline Scheduler node to it hou.pwd().hm().submitGraphAsJob(kwargs, hou.node("topnet1/deadlinescheduler"))

And when pressed it submits a job and prints ID: ('', '66a233da9509c70692a0f824') which is indeed the correct job ID.

Now I will just need to line both jobs in the Python script and we’re set.

Privacy | Site terms | Cookie preferences