AWS Thinkbox Discussion Forums

Nuke JobID query

Hi Guys,

once i’ve run the submit to deadline command and my comp appears in deadline, how can i query the JobID that deadline has given the job from within Nuke?

It appears in the confirmation dialogue in Nuke so it’s definitely available somewhere, i just cant figure out how to get the info.

Thanks

Since the submission is probably done using deadlinecommand, the job information is returned in the process’s stdout, and you have to parse out the id from that. There are examples of that in some submitters’ code.

Hi Mois,

Thanks for the info.
Any pointers as to where the relevant example might be?

Thanks

M

For instance in SubmitNukeToDeadline.py line 1384:

            for line in tempResults.splitlines():
                if line.startswith("JobID="):
                    previousJobId = line[6:]

but parsing can be made a bit more robust, imho.

Hi Mois,

This is working perfectly, except for one thing…

This is what i’m using to submit the scene:

deadline_cmd = r"C:/Program Files/Thinkbox/Deadline10/bin/deadlinecommand.exe"
command = '{deadline_cmd} "{dstfile2}" "{dstfile1}"'.format(**vars())
process = subprocess.Popen(command, stdout=subprocess.PIPE)
lines_iterator = iter(process.stdout.readline, b"")
#  Lets #print the output log to see the Error / Success 
for line in lines_iterator:
    print(line)
    if "JobID=" in str(line):
        JobID = str(line).strip().split("=")[-1][:-5]
    sys.stdout.flush()
print (JobID)

Which all seems to work well when I run it via the script editor within Nuke, but when I run the code as a menu item it fails to find the JobID. It submits the file fine, but it can’t get the JobID.

I’m guessing its because the actual submission is running as a subprocess and not in the main process.

I’m sure its a simple thing for someone who knows how to sort it - any ideas??

Thanks

It should not matter if it is launched from a subprocess. Perhaps just the printing of stdout does not work from the menu subprocess?
Also there was some difference in behavior depending on the submission parameters, whether it is a batch job or something.

Privacy | Site terms | Cookie preferences