Thanks @zainali to point out this, it means we would need to write our own EventPlugin to handle this which will let us build our own custom email subject and body along with the SMTP auth for our email server relay, is that correct?
Thanks for confirming @zainali I am trying to setup the test EventPlugin and added the example snippets from the Creating an Event Plug-in and added HelloFractal.py and HelloFractal.param files in the DeadlineRepository10\custom\events path.
However, when following the Deadline Monitor (Super User Mode) → Tools → Configure Events…
I don’t see the HelloFractal in the list of available EventPlugins. Can you please help identify what I might be missing or the reason for this?
Please let me know if there are any questions.
Attaching the HelloFractal.py and HelloFractal.param files for your perusal. HelloFractal.py (1.3 KB) HelloFractal.param.py (735 Bytes) – please rename this, from ‘.param.txt’ to ‘.param’
Also tagging @Justin_B for reference and any thoughts on this.
With this, I tried submitting a new job and expecting this event to trigger (per the below snippet from HelloFractal.py)
def OnJobSubmitted(self, job):
# TODO: Connect to pipeline site to notify it that a job has been submitted
# for a particular shot or task.
print('HelloFractal Event-Plugin OnJobSubmitted: ', dir(job))
pass
and expecting prints on the Deadline Monitor Console but did not see anything! Can you please suggest what is missing here?
Where’d you submit the job? OnJobSubmitted will be run by the submitting application. So if it was a Monitor submitter then you should see that in the Monitor’s log.
Nope, there’s no OnJobModifyCallback, only what’s listed there.
The [get, set] nomenclature refers to the property having getters and setters. Basically meaning you can retrieve the property (getter) and assign the property a value (setter). If there’s no setter for a property on a Job it’ll likely be immutable and something that needs to be set during Job creation.
Be sure you’re running SaveJob() after you’ve made your changes to the Job object.
I mean this as kindly as possible - I didn’t believe you that set_JobExtraInfo0(scene_name) works. So I checked and it does. How’d you come across that? That’s not a function in the codebase, so there’s some oddball stuff with Python for .NET going on here. You don’t need to use it though. And using stuff that’s not in the docs means we can break it without warning so don’t rely on it.
fails to have an effect is if the Job gets saved again later in the script. Keep in mind job is just a copy of the object at the time. and SaveJob pushes the object to the database overwriting what’s currently there.
So order of operations might be playing havoc with you. The rule of thumb is to save the job at the end of your function once you’ve made the changes you want to make. Like in this event example.
Here’s the script I wrote to check both functions:
#run using "%deadline_path%"\deadlinecommand -executescript test.py
from Deadline.Scripting import RepositoryUtils
def __main__():
job = RepositoryUtils.GetJob("6435e5077a5a910c5cf6b3c6", True)
job.JobExtraInfo1 = "I've been set in a script!"
job.set_JobExtraInfo0("I should not be!")
RepositoryUtils.SaveJob(job)
Sure, I am on the same page and would prefer to stick to the recommended and supported API methods only. And that’s why I tried searching for set_ method in the docs which I couldn’t find. And at first, I was not using this method until I ran out of options, as you see in my previous posts in this thread.
Noted, and thanks for the example snippet we will keep in mind that we save/overwrite the job object as frequently as possible. However, what-if, there are different callback (events) and therefore it might demand saving the job object at different time intervals, is that okay to do?
In the sense, saving the job object for the suspend, fail, and resume events and not all at once.
As for using this syntax for property update, I am sure I tried this job.JobExtraInfo1 where save job was used for one only and since I did not get success with that I tried/tested with job.set_JobExtraInfo1(fp_scene) which worked. Attaching HelloFractal.py my WIP test event plugin script for your reference and perusal. @Justin_B
The event scripts don’t get run in parallel, so long as you save your work by the end of your script you’ll be in good shape.
Looked at your HelloFractal.py and it all appears fine. I swapped out the set_* calls with the usual way of doing things, and called the OnJobSubmitted in a __main__() to make testing easier and it worked great on my machine. My guess would be that the Workers were relying on a cached copy of your script that didn’t have the call to SaveJob? I highly recommend this method of development, it lets you circumnavigate the whole caching system and saves a pile of pain.