Hello! I’m in the process of implementing a few python scripts that will be run as jobs. a few will take quite a while… I can monitor the logs locally but would prefer to have them show up in the worker logs.
Currently the console output is only populated once the job is complete.
Is there any documentation on how to ensure the output from the python script shows up in the worker logs as the jobs progresses?
Also, is there a function I can call to update the Progress bar of the job?
If you open the code for the Python plugin, you will see it contains an StdOut handler with a regex “.Progress: (\d+)%.” that will match lines containing “Progress: 33%”, “Progress: 48%” etc. Just calculate the completion percentage in your script and output it with a print statement.
Thank you both @mois.moshev@josephEA. I’m running it using the Python plugin that ships with Deadline so sending 'Progress: 20%" to stdout works great!
Looking at the stdout handler in the python plugin, do you know how to get live updates in the worker log when running a python script? If I connect to the worker itself I can see the stdout output of my log just fine, but if I look at the log at the Task itself, the log isn’t populated until the job is done.
I’m sure I’m missing something simple but I’m guessing I need to add something to the python plugin itself?
As far as I know, the report/log is not sent from the worker to the repository until the job finishes (or fails).
You can monitor the progress in the individual task’s progress column in the Tasks panel, or overall job progress in the progress column in the Jobs panel. This information is sent every time the plugin detects a progress update, and the monitor will update shortly there after (roughly every 10 seconds by default I think).
Besides that, if you want live updates you’d need to connect to the worker in question and monitor the live stdout.