AWS Thinkbox Discussion Forums

Can Draft jobs update the task progress %

We have some long draft renders occasionally. I was hoping that if I included total frames in the job, and set the chunk size to the total frames as well, that the draft job would be aware of the number of frames, even though it is still a single task But this does not seem to be the case.

Is it possible (with Deadline 5.2) to show task progress on a draft job that has just 1 task?

Thanks

Yes, this is possible. To do so, you’ll need to update your Draft script.

Deadline is looking for “Progress:” messages to determine the task progress. We’ll need to add such progress messages to your script.

Your script probably has a “for” loop over a number of frames, similar to:

[code]for currFrame in frames:
# Read in the frame
currFile = ReplaceFilenameHashesWithNumber( inFilePattern, currFrame )

# etc...[/code]

We can add a progress message to the for loop:[code]frameIndex = 0
for currFrame in frames:
# Update the task progress
print( “Progress: %f” % (float(frameIndex) / len(frames) * 100) )
frameIndex += 1

# Read in the frame
currFile = ReplaceFilenameHashesWithNumber( inFilePattern, currFrame )

# etc...[/code]

Now when you run the script, you should see the task progress in the Deadline Monitor.

I was hoping it was something like that … Thank you.
I added

print( "Progress: %f" % (float(frameIndex) / len(fileList) *100 )) frameIndex += 1

Having implemented it, something must be missing on my end. The output looks like this but the deadline interface does not update, even with manual refresh.

0: STDOUT: Progress: 1.449275
0: STDOUT: Progress: 1.932367
0: STDOUT: Progress: 2.415459
0: STDOUT: Progress: 2.898551
0: STDOUT: Progress: 3.381643

Am I missing something?

NOTE: People who are using newer versions of Deadline do NOT need to do this… these modifications are already in newer versions of Deadline.

Because you’re still on Deadline 5.2, you’ll need to add a bit of code to the Draft plugin (in repo/plugins/Draft/Draft.py) that will look for something that looks like “Progress: xx%” (or whatever you are printing out in your scripts).

To do this, you’ll have to add the following few lines in the InitializeProcess function of the Draft Plugin. Note you might have to change the regex depending on what your script outputs, but this should work for what you’re printing:def InitializeProcess(self): self.StdoutHandling=True regexStr = ".*Progress: ([0-9]+).*" self.AddStdoutHandler(regexStr, self.HandleStdoutProgress)
And then add a HandleStdoutProgress function, something like this:def HandleStdoutProgress( self ): percentage = float(self.GetRegexMatch(1)) SetProgress( percentage )
(Credit for this answer goes to Jon. :wink: )

I tried to implement this as well, but with Deadline 6.1 I haven’t been able to update the Monitor progress.

My output from the Draft template script is based on your code above:

The Monitor just shows 0% (0/1) until the whole job finishes.

Any advice?

Cheers,
Daniel

Small update:

I had a look at the Draft.py plugin script and it looked like it would only match integers, not floats, so I went ahead and tried that too:

Still nothing in the Monitor. This task was running for about half hour, so there should have been time to fetch the updated values I suppose.

Cheers,
Daniel

Hey Daniel,

I’m getting the sense that you’re referring to the Job’s progress – is the Task’s progress updating properly? If so, that’s normal, since Deadline currently bases Job progress solely on the completion of Tasks. While this works fine for sequence renders with lots of frames, it’s definitely a little weird with single Task Jobs (since those jobs will always go from 0% -> 100%).

Pulling progress from Tasks for lower Task Count jobs has been a wishlist item for a while, we’re hoping to get to it soon!

Cheers,
Jon

Note: to see the progress of a particular task (as opposed to the “Task Progress” column in the Jobs panel), you will likely need to scroll the Tasks panel over.

Another proud moment for me, this. You’re spot on - I didn’t even know about the per task progress output. :unamused:

I scrolled over like Andrea said, and there it was! So it’s definitely working. I think we would really love to put another vote in for that feature you mentioned, that’s the outcome I was hoping to achieve. For now, we’ll hang tight :slight_smile:

Thanks,
Daniel

I’d like that feature too!!!
(for single task jobs: job process = task process )

thanks

Privacy | Site terms | Cookie preferences