Default pre-job script

Hi everyone!
I was wondering if it is possible to configure Deadline/the Deadline repository to always add a pre-job script to any and every job/slave that takes on a job.

I’ve written a simple python/bat script that just makes sure all our server drives are mounted and figured it would be nice to always run this before any given job as some users have a tendency to unmount certain drives while using their workstations during the day, which can cause some headaches during the night when other try to render or cache on that machine and the server drive they need is not mounted.

I’ve seen the ability to add a pre-job script when you submit in some of the submission applications, but I figure if I can configure Deadline to just add this script before every job it will save the users some hassle in having to add it themself on every submit they do.

Any advice on this is very appreciated!
Thank you for your time, have a great day!

  • M

There is a drive mapping function already in Deadline
https://docs.thinkboxsoftware.com/products/deadline/10.1/1_User%20Manual/manual/repository-config.html#mapped-drives

And a blog on it here
https://www.awsthinkbox.com/blog/mapping-drives-with-deadline

Hmm, that could have worked but our server is running on some proprietary software meaning that the shares are not accessible from a simple network path like “\\server_IP\share_name”.
It has its own utility tool to mount drives as well as interact with the server via command line, so I have to use this approach, meaning that I more or less have to run a script of some kind, whether it be a batch script or a python script that simply calls the batch script.

Thank you so much for the reply!

  • M

Have a look at Deadline Entry Points | AWS Thinkbox. A GlobalJobPreload script is what you’re describing.

2 Likes

That worked absolutely perfectly!
Thank you so much!

For anyone dropping by here wondering the same question, one small thing to be aware of that I did not immediately think to add is that you’ll need to wrap your custom code inside a “main” function. There are examples of this in the documentation but for ease of use here is what’s ended up working for me:

from Deadline.Scripting import *

def __main__( deadlinePlugin ):
   #Insert code here
  • M
1 Like
Privacy | Site terms | Cookie preferences