Custom Pre/Post Job Scripts in Repository

Hi,

During job submission, I’d like to specify a pre-job and post-job script to run and house that script in the Repository. Following guidance in Scripting Overview and Job Scripts, I’ve placed the python scripts in the Repository’s /custom/scripts/Jobs/ folder. However, if I pass in the script name in a jobInfo.job file, the Deadline Worker fails to find the script on the Worker box.

How should I reference these custom scripts from a manual submission’s jobInfo.job file? Current code: preJobScript=TestPreJobScript1.py

How can I ensure the pre/post job scripts in the Repository are copied over / accessible on the Worker box? (without using shared network drive) I figure, if the plugin specific files can be copied over, I should be able to copy over pre/post job scripts as well.

Deadline Worker log error:

0: Loading Job's Plugin timeout is Disabled
0: SandboxedPlugin: Render Job As User disabled, running as current user 'root'
All job files are already synchronized
Synchronizing Plugin CommandLine from /opt/Thinkbox/DeadlineRepository10/plugins/CommandLine took: 0 seconds
0: Executing plugin command of type 'Initialize Plugin'
0: INFO: Executing plugin script '/var/lib/Thinkbox/Deadline10/workers/cee957fb6472/plugins/63bf2b73cd97ed0213283600/CommandLine.py'
0: INFO: Plugin execution sandbox using Python version 3
0: INFO: Single Frames Only: False
0: INFO: About: Command Line Plugin for Deadline
0: INFO: The job's environment will be merged with the current environment before rendering
0: Done executing plugin command of type 'Initialize Plugin'
0: Start Job timeout is disabled.
0: Task timeout is 43200 seconds (Regular Task Timeout)
0: Loaded job: test_test (63bf2b73cd97ed0213283600)
0: Plugin executing pre job script
0: Executing Pre Job Script: "/var/lib/Thinkbox/Deadline10/workers/cee957fb6472/jobsData/63bf2b73cd97ed0213283600/TestPreJobScript1.py"
Sending kill command to process deadlinesandbox.exe with id: 11964
Scheduler Thread - Render Thread 0 threw a major error: 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Exception Details
RenderPluginException -- Error executing pre job script: script file "/var/lib/Thinkbox/Deadline10/workers/cee957fb6472/jobsData/63bf2b73cd97ed0213283600/TestPreJobScript1.py" does not exist.
RenderPluginException.Cause: JobError (2)
RenderPluginException.Level: Major (1)
RenderPluginException.HasSlaveLog: True
RenderPluginException.SlaveLogFileName: /var/log/Thinkbox/Deadline10/deadlineslave_renderthread_0-cee957fb6472-0000.log
Exception.TargetSite: Void c(Deadline.IO.TaskLogWriter, System.Threading.CancellationToken)
Exception.Data: ( )
Exception.Source: deadline
Exception.HResult: -2146233088
  Exception.StackTrace: 
   at Deadline.Slaves.SlaveRenderThread.c(TaskLogWriter ajt, CancellationToken aju)

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Thanks

The job scripts aren’t copied along with plugin files, you’ve got to refer to them with a full file path.

Even if that’s just preJobScript=//file-server/DeadlineRepository10/custom/scripts/Jobs/TestPreJobScript1.py that will make the difference. You’ve got to use a full path. You could put the script in the same location on all your Workers (like the render user’s home folder for example) if you’d like to avoid using a shared network drive and refer to it like that.

The error you’re seeing is from the Worker looking for the file within its working temporary directory.

As an aside, the /scripts/Jobs folder is full of Monitor scripts, you’ll recognize the others from right clicking jobs in the Monitor. There’s no issues putting other things in there as far as I know though!

1 Like