AWS Thinkbox Discussion Forums

Running Python callable in job plugin

This may be an oversight on my part, but I’ve been looking through all the currently distributed plugins, as well as the plugin documentation, and I have yet to find any information on how to create a plugin that doesn’t end up calling a subprocess in some way for its execution.

What I’m after is basically a job class that will allow me to make Python calls directly from the job to do the work, without having to run a Python subprocess (and thus have to deal with argument passing or object serialization). Currently, it seems like the only way to really do this would be to just run my code from within InitializeProcess or something, which seems a little… hacky.

Am I overlooking something really obvious, or is this pretty much the state of things?

Thanks,

-Nathan

P.S: On a somewhat related node, I’ve been compiling a document of proposed structural changes and wishlist items for the Deadline plugin API. If you’re interested in some thoughts, I would love to send them over and maybe get a discussion going.

Hey Nathan,

You can use an Advanced plugin. You can take a look at some of the Advanced plugins we currently ship for an example: Fusion, Lightwave, MayaBatch, Modo, Nuke, SoftimageBatch.

For advanced plugins, there are 3 stages represented by the appropriate functions:

  1. StartJob - Called once on the slave when the job is started.
  2. RenderTasks - Called one or more times between StartJob and EndJob
  3. EndJob - Called when the slave finishes up the job

RenderTasks is the only required function for Advanced plugins, and in here you can call whatever python code you want. You’ll see that pretty much all of the plugins above are running a managed process, but you don’t need to do that.

Hope that helps. If you have any questions, let me know.

We’re always taking requests, so we’d love to hear your suggestions.

Cheers,

  • Ryan

Ah, thanks for the clarification. I’m glad to see it was an oversight on my part.

As for my API suggestions, I’ll continue to compile them and reconcile them against what I can figure out about the plugin API (since clearly there’s just a lot of stuff I’m either overlooking or just can’t find - can’t wait for those API docs!), and once I’ve increased the signal-to-brain-dump ratio sufficiently, I’ll send them along and see what you guys think.

Thanks again,

-Nathan

Privacy | Site terms | Cookie preferences