Hey,
Weird one today and context first. I want to use a python script to create a job that then runs another python script on a list of machines within deadline. The idea is to have a maintenance job with an empty task for each worker in it’s worker list (these workers are decided by the previous script that creates this job). Each task has a post task script that will use the worker to do certain logic to that worker (the workers do not have python on them plus I want to use the deadline API). Just wondering if it is possible to create a job that has empty or superflous tasks in it and how to do this in python.
Cheers,
Stephen
Just to be super clear - don’t use Deadline to install or update stuff. There are better tools and the way that Deadline runs applications inside of a sandbox can have knock-on effects that are just a pain in the butt. It can 100% work fine, but in my experience the juice just isn’t worth the squeeze so to speak.
That said, you could use Command Line jobs that just echo, or even call deadlinecommand -executescript your_post_task_script.py
and avoid the post-task scripts altogether.
And to create that job in Python you can create the job info and plugin info files and submit them with deadlinecommand. To figure out what to put in those files, just submit the job as you’d like it via the submitter in the Monitor, double click the new job and go to ‘Submission Params’. That’s your two files, hit export and you’ve got an example to run with.
Let me know what you think, and if you have any issues!
Hmmmmm sorry I’m back. Can’t figure out how to run deadline command jobs. All it is is a file called SlaveExistTHANOS.exe with a single line in it: echo “Hello World” . Error on the worker is:
Exception Details
RenderPluginException -- Error: Exception : Error starting "Y:\_Deadline_Repository\custom\scripts\General\SlaveExistTHANOS.exe" in "Y:\_Deadline_Repository\custom\scripts\General" :
at FranticX.Processes.ChildProcess.i(String bz, String ca, String cb)
at FranticX.Processes.ChildProcess.Launch(String executable, String arguments, String startupDirectory)
at Deadline.Plugins.DeadlinePlugin.RunProcessAsUser(String executable, String arguments, String startupDirectory, Int32 timeoutMilliseconds, String userName, String domain, String password, Boolean useSu, Boolean preserveEnvironment, Boolean setHomeVariable)
at Deadline.Plugins.DeadlinePlugin.RunProcess(String executable, String arguments, String startupDirectory, Int32 timeoutMilliseconds) (Python.Runtime.PythonException)
File "C:\ProgramData\Thinkbox\Deadline10\workers\mars\plugins\642ba7305c09cf9fd81e39df\CommandLine.py", line 69, in RenderTasks
exitCode = self.RunProcess( executable, arguments, startupDir, -1 )
What am I missing, its something dumb but I dont know what, and swathing through the documentation hasn’t helped.
Cheers,
Stephen
Looks like starting your .exe is failing. Could you try an existing executable that works on its own?
Your executable as described fails like this on my machine:
Any executable would work. You could also check off ‘run in command line’ and put echo Hello World
as that’ll run the command directly in CMD.
Ahhh for the record, to run command lines commands: execute in shell has to be ticked, select cmd as the shell and any commands goes in the Arguments (optional) field. Thank you for the candle in the darkness.
I assumed whatever was in the file would be ran as such but its looking for an actual executable file which makes sense when you’re not blindly searching for crumbs of progress on the floor, I thought this would be a command equivalent of a bash script of just a text file with the command line commands you wanted to run.
Yep, glad you’ve got it sorted out. It’s not an intuitive UI, I should have included an example when I mentioned it above.
You might have been thinking of CommandScript jobs which do take a file of commands to run and goes through them.
I worked it out don’t worry lol. Only caveat with the CommandScript was that:
- I wanted to be able to set it as a maintenance script and that option doesn’t seem to be there
- Could never get it to render using this set up that I thought would work:
In the submission parameters for this job,there is no ‘arguments’ field in the Plugin Info, so Im not sure what happens to commands put into the script box.
Those command get written to a file in the job’s folder in the repository. If you right click the job and go to Auxiliary Files → Explore you’ll find a commandsfile.txt with your commands in it.
And not all submitters have got the option to submit as a maintenance job, the command line submitter has the option at the least.