AWS Thinkbox Discussion Forums

Contextual information when instantiating plugin/listener?

Right now, there is no way to get access to any information about the incoming job from the main entry points in a job plugin or event listener’s Python module (GetDeadlinePlugin() and GetDeadlineEventListener(), respectively).

It would be hugely helpful if there was some kind of job-related information made available in both of these places. A Job object would be fantasitc, but even a job ID would be helpful. Alternately, being able to define environment variables on submission that would be available here would probably work as well. Basically, I’m using these modules as stub loaders for classes that are defined elsewhere, and I’d like to be able to switch the location of the main plugin definition in our pipeline based on some job-level information, custom environment variable, etc.

Any thoughts on the feasibility of something like this?

Thanks

I think what we could do is add two new functions: GetDeadlinePluginWithJob( job ), and GetDeadlineEventListenerWithJobs( jobs ). The first would accept a single job as a parameter, and the second would accept a list of jobs (this is because an event plugin can be loaded once for multiple jobs). We’d have to introduce these new functions to avoid breaking compatibility.

Would this help?

Cheers,
Ryan

If I understand you correctly, I think that would do the trick. Just to confirm though, when reading the plugin and event listener definition files, Deadline would first check for one function (say, GetDeadlinePluginWithJob) and if it were not defined, look for the other (GetDeadlinePlugin) before erroring?

That’s correct.

Cool, that sounds like it would work nicely. Thanks!

Privacy | Site terms | Cookie preferences