AWS Thinkbox Discussion Forums

Writing a Python module for a submission script

I am writing a submission script to submit Maya jobs to a cloud render farm. My submission script has several helper functions that I want to write unit tests for. However, my development area does not have access to the Deadline API. Basically, I code in my development area and then drag and drop the Python file into custom/scripts/Submission and see if it works.

My solution so far has been to write my functions in a Python module called helpers.py. The helper functions can then be imported into another file called helpers_unittests.py for testing. Now the issue is that my submission cannot see the helpers module from inside the Submission folder.

What is the best way to deal with this? I can write code that will add helpers.py to the submission script’s sys.path. Is a more elegant solution possible? Can I just drop helpers.py into a custom scripts folder?

Thanks.

I think what you’re looking for is covered here: docs.thinkboxsoftware.com/produc … preload-py

I think longer term, we hope to one day add some kind of script editor/IDE or at least, ability to execute py within the context of Deadline via the Monitor. Maybe a Script Editor panel. No promises, just speaking out loud, as priority for this kind of feature always ends up getting dropped for other more useful/cool stuff.

James wrote a nice blog entry on Deadline’s entry points here:
deadline.thinkboxsoftware.com/fe … ry%20point

which highlights that if you execute a py script inside of one of the Deadline apps, then the API will be available. For outside this environment, you can still use:

./DeadlineCommand ExecuteScript /path/to/script.py

which will pull in our Deadline environment prior to executing your py script.

For monitor UI py dev, typically we just code in our favourite IDE of choice (different between devs) and then test within Monitor, using the Console panel for stdout/stderr. For an example of a py utils module being imported and used within another py monitor submission script, see our V-Ray Standalone monitor submitter.

Thanks! These posts are really helpful!

Privacy | Site terms | Cookie preferences