mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
submit each assembly job separately
This commit is contained in:
parent
507be49269
commit
71bfa3774a
2 changed files with 21 additions and 14 deletions
|
|
@ -897,8 +897,9 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
|||
#
|
||||
# Batch name reflect original scene name
|
||||
|
||||
if instance.data.get("assemblySubmissionJob"):
|
||||
render_job["Props"]["Batch"] = instance.data.get("jobBatchName")
|
||||
if instance.data.get("assemblySubmissionJobs"):
|
||||
render_job["Props"]["Batch"] = instance.data.get(
|
||||
"jobBatchName")
|
||||
else:
|
||||
render_job["Props"]["Batch"] = os.path.splitext(
|
||||
os.path.basename(context.data.get("currentFile")))[0]
|
||||
|
|
|
|||
|
|
@ -638,6 +638,9 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin):
|
|||
"Path is unreachable: `{}`".format(
|
||||
os.path.dirname(config_file)))
|
||||
|
||||
# add config file as job auxFile
|
||||
assembly_payloads[hash]["AuxFiles"] = [config_file]
|
||||
|
||||
with open(config_file, "w") as cf:
|
||||
print("TileCount={}".format(tiles_count), file=cf)
|
||||
print("ImageFileName={}".format(file), file=cf)
|
||||
|
|
@ -658,20 +661,23 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin):
|
|||
for k, v in tiles.items():
|
||||
print("{}={}".format(k, v), file=cf)
|
||||
|
||||
self.log.debug(json.dumps(assembly_payloads,
|
||||
indent=4, sort_keys=True))
|
||||
self.log.info(
|
||||
"Submitting assembly job(s) [{}] ...".format(len(assembly_payloads))) # noqa: E501
|
||||
url = "{}/api/jobs".format(self._deadline_url)
|
||||
response = self._requests_post(url, json={
|
||||
"Jobs": list(assembly_payloads.values()),
|
||||
"AuxFiles": []
|
||||
})
|
||||
if not response.ok:
|
||||
raise Exception(response)
|
||||
job_idx = 1
|
||||
instance.data["assemblySubmissionJobs"] = []
|
||||
for k, ass_job in assembly_payloads.items():
|
||||
self.log.info("submitting assembly job {} of {}".format(
|
||||
job_idx, len(assembly_payloads)
|
||||
))
|
||||
self.log.debug(json.dumps(ass_job, indent=4, sort_keys=True))
|
||||
response = self._requests_post(url, json=ass_job)
|
||||
if not response.ok:
|
||||
raise Exception(response.text)
|
||||
|
||||
instance.data["assemblySubmissionJobs"].append(ass_job)
|
||||
job_idx += 1
|
||||
|
||||
instance.data["assemblySubmissionJob"] = assembly_payloads
|
||||
instance.data["jobBatchName"] = payload["JobInfo"]["BatchName"]
|
||||
self.log.info("Setting batch name on instance: {}".format(
|
||||
instance.data["jobBatchName"]))
|
||||
else:
|
||||
# Submit job to farm --------------------------------------------
|
||||
self.log.info("Submitting ...")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue