Submit Python Task from command line? Help w/ job, plugin info file syntax

Hi,

I’m having trouble configuring the files necessary to submit a Python task to Deadline from the command line on Windows. Can someone point me to an example set of files (Job Info and Plugin Info) that properly reference a Python script file that exists on disk? Specifically, I think I am not setting the “PythonScriptFile” or “scriptFile” key properly in the Plugin Info file. I’ve tried setting both of those named keys with no success. I also tried exporting the files from a working Python job on Deadline that was submitted using the GUI, but I do not see where the reference to the Python script the task should execute is specified.

I’m able to get a Python Job submission into Deadline from the command line, but my Tasks are failing with “Script accessed non-existent plugin info key” errors. Unfortunately the error message is not telling me which key I did not set. I wasn’t able to tell how to move forward on this from the docs. Getting this to work from the command line is important for me.

Thanks for any suggestions!

Best regards,

Jason

Hi Jason,

The Monitor submitter lets you submit a Python script job in two different ways:

  • Sending the .py script as an auxiliary file with the job, in which case no ScriptFile= key value is expected. (“Submit Script File” checked in the GUI)
  • Referencing a network location for the script file via the ScriptFile= key. (“Submit Script File” unchecked in the GUI)

From your description it sounds like your attempt is a mix of the two approaches, resulting in the error message.

When you submit the job using the first approach, you have to call deadlinecommand with three arguments - the two JOB files (where the PluginInfo.job file contains no ScriptFile= entry), and the path to the script file as third argument. For example

deadlinecommand "c:\temp\JobInfo.job" "c:\temp\PluginInfo.job" "c:\temp\somefolder\myscript.py"

When the job has no ScriptFile= key value, the Python job plugin grabs the third argument (the first auxiliary file) as the script to execute, and runs it.

If your PluginInfo.job does contain a ScriptFile=\\some\path\myscript.py reference to a network-located copy of the script to run, then no auxiliary file is expected, and the file references by the ScriptFile= key value will be executed. In that case, you would simply call

deadlinecommand "c:\temp\JobInfo.job" "c:\temp\PluginInfo.job" 

Technically speaking, even if you provide an auxiliary file to the submission, it will not be used if there is a ScriptFile= entry in the PluginInfo.job file.

If the PluginInfo.job file you fished out from the Repository did NOT contain a ScriptFile= key, and you did not provide an auxiliary file for the script, then neither mode would work.

The DeadlineWorker checks to see if there is a ScriptFile= entry in the PluginInfo.job file, and if there is none, it defaults to the first auxiliary file. You can find this logic around line 64 of \\DeadlineRepository10\plugins\Python\Python.py

def RenderArgument( self ):
    scriptFile = self.GetPluginInfoEntryWithDefault( "ScriptFile", self.GetDataFilename() )
    scriptFile = RepositoryUtils.CheckPathMapping( scriptFile )

Note that GetDataFilename() returns the first auxiliary file, and is used as the second argument to GetPluginInfoEntryWithDefault() which sets the default. In other words, if the first argument is not found in the file, it uses the second argument instead.

So in the above code, if “ScriptFIle” is not found, and there is no first auxiliary file either, then the scriptFile variable will not contain anything usable…

1 Like

Hi Bobo,

Thank you for this detailed answer - this helped me resolve my issue. I hadn’t noticed the “Submit Script File” checkbox, and didn’t understand the possible behaviors. I’m making progress now.

Best regards,

Jason

Privacy | Site terms | Cookie preferences