Deadline Publish job pass along additional metadata for custom addon

Is there any way, without changing Deadline plug-ins to pass on extra metadata to the instance or representations that the SubmitPublishJob generates and hence the publish job on the farm also reads for the instances or representations.

I want to add some extra data to the instance or representations, (e.g. an additional tag or something else) and then with a plug-in respond to that on the publish job.

Like:

  1. User allows to pick a setting in publisher UI to post-process the render (either after local render, or on the farm)
  2. Their chosen option should be passed on to the metadata json so that the publish process on the farm can use it for its processing.

Preferably there would be some custom render data that the publish job would passing along, e.g. instance.data["renderMetadata"] = {} or some other reserved key that it always passes along so that other addons can put custom data in there without having to customize ayon-deadline itself.

Reference

Any ideas?

Env var to sidecar json file? Those will get picked up automatically by deadline, saved in the submission parameters and you can save it in deadline’s output dir to make it ok for farm work.

Then you do a collector checking for the env var, and if it’s there then you just load json and voila!

You probably already figured this out, kinda late sorry

Yup - that’s doable - but I didn’t want to mess with additional files; preferably I just wanted to send some data across that would find its way into the native metadata .json so I wouldn’t need to handle the cross platform paths and everything (plus have to deal with an additional file too).

Anyway, definitely a possibility - just wished there was a simple entry point to add some custom data to the publish job on the farm without needing to change plug-ins in ayon-deadline or ayon-core.

Well IIRC there is an instance_transfer dict in the submit_publish_job.py plugin that does exactly that. Key is family, value is list of parameters. Everything that matches gets transferred over.
Actually instance parameters get written to json by the plugin itself.

If you can’t modify that code…

  • monkey patch in some way that variable since it’s in the class (I don’t know if it’s doable in pyblish and it’s inheritance scheme)
  • do a post deadline plugin that opens the json coming from deadline and injects that data in the instance
  • do a json with envs as I suggested before
  • override an instance var that is there. I don’t know which one you can use tho.

Maybe monkeypatching could be your best bet if the plugin is loaded before executing, you just insert into instance_transfer your family and the instance props you want?

Anyways this is all on OP, don’t know if AYON changed stuff around

I just checked out ayon deadline repo and it’s still there in the ProcessSubmittedJobOnFarm class.
Luckily it’s class declared so you can try monkeypatching.

You can try { “RoyFarmStuff” : [ “my”, “fantastic”, parameters”] } and update the instance_transfer dict.

Then you just insert “RoyFarmStuff” in families of your instances.

That all depends on the state of the plugin in pyblish though, I don’t know enough of it to understand if its’s accessible at any point before execution…