Is it possible to submit a new job from the Post Job Script of a previous job?

I have the following scenario: a command line job triggers a hython script which generates a Redshift .rs proxy from Houdini. I would like to attach a Post Job Script to this job, so that once the .rs proxy is ready, it would be submitted to Deadline as a Redshift job. Is it possible to submit a new job from a Post Job Script?

Thank you.

Sure thing. Under the hood, all the submitters are basically just using Deadlinecommand.exe to submit the jobs after they’ve collected all the relevant information and created the job and plugin info files. Since the post job scripts are just python, you can call deadlinecommand from there too.

Hi Dan,

Thank you for the tip. I have tried using the builtin subprocess python module and use

subprocess.call([‘deadlinecommand’, ‘SubmitJob’, *args])

but this got me no results and unfortunately I wasn’t able to see any logging info on this either to see if it errored out or something.

Did you mean it some other way? Do you have any more tips maybe? Thank you a lot

Sorry for the delay. Firstly I’d suggest getting the command right in your terminal first (ie cmd.exe if you’re on Windows). Get the command right and then port it over to Python using either subprocess or os.system.

BUT you might have more lucky taking a look at the ClientUtils.ExecuteCommandAndGetOutput function from Deadline.Scripting. In fact, that whole module offers a bunch of useful stuff that it’s worth looking into, as it takes out some of the guess work from exactly what you need to provide.

https://docs.thinkboxsoftware.com/products/deadline/7.1/2_Scripting%20Reference/class_deadline_1_1_scripting_1_1_client_utils.html#a510b7c5aa1cdb7fadceb769477ea0d20

Hi Dan,

Thank you for the explanation and for the tip about ClientUtils.ExecuteCommandAndGetOutput, it seems to be just what I need.

Kind regards,
David