I’m changing the default Draft event plug in so that in addition to having options to create a Shotgun video and a filmstrip it can crop the frames down. The idea is that when animating there’s excess space retained to see more of what’s going on but that will no longer be needed for composition. So some jobs will need to crop away this excess.
I created the added job onto the plugin and had it running in my sandbox repository. Now that we’re moving onto a server I have noticed one issue. The Crop, Video and Filmstrip jobs can and often will run simultaneously on different machines. However the video and filmstrip jobs require that the cropped frames exist, otherwise they throw errors until the crop finishes and then they run through fine. The issue being that a filled repository would rack up unnecessary errors pretty fast this way and slaves could get stuck on jobs if the cropping of frames couldn’t finish for whatever reason.
I was looking at the draft script files (Draft_CreateShotgunMovie and Draft_CreateShotgunFilmstrip) but I realised they’re not like Deadline jobs with full job files where I could just add a dependency argument (or at least, they don’t appear that way). Is there a system in place to make Draft jobs have dependencies or even operate one by one within any given batch?
Those jobs are definitely full-fledged Deadline jobs and are getting created through Job/Plugin info files, and can have dependencies set in the typical way. The code for this in the Draft Event Plugin has been abstracted into the CreateDraftJob function, to avoid having to duplicate the majority of that code for the (potentially) 3 different (4 in your case) Draft jobs might get submitted.
In order to add dependencies, it should just be a matter of parsing out the Job IDs from the submission output returned by Deadline, and return that from the CreateDraftJob function. You could the add a parameter to this function that takes in a list of IDs to add as dependencies to the Jobs that rely on the first one (obviously you’d have to submit your Job first).
Thanks Jon, I know how I could go about it now, grabbing the first Job’s ID and then applying it to the next two. Just to clarify, you are saying that the ID would exist instantly in the code and I could grab it before creating the next Draft job.
ie.
#Code for first Job #Code to get first Job’s ID #Code for second Job #Code for third Job
And there wont be issues with the ID not existing yet?
There shouldn’t be any issues with that. The call to DeadlineCommand that we’re using to submit the Jobs is a blocking call and won’t return until the Job Submission is 100% complete and in the Database, or it errors out somehow (in which case there’d be no ID to get in the first place).