Describe the problem
The job-history bundle written under ~/.deadline/job_history/... is created before preSubmission hooks run, so it does not reflect what was actually submitted to the farm.
preSubmission hooks execute inside create_job_from_job_bundle and modify the in-memory submission payload — asset references (inputDirectories, inputFilenames, outputDirectories, referencedPaths), and per the hooks docs also parameters, priority, and the template. Those modifications are used for hashing/upload and the CreateJob call, but they are never written back to the saved job bundle. The persisted asset_references.yaml (and parameter values / template) therefore represent the pre-hook state only.
This is in the core submit path (deadline.client.api.create_job_from_job_bundle + deadline.client.job_bundle._hooks), so it affects every submitter (Maya, Blender, Cinema 4D, Nuke, …) and the CLI equally — not any one DCC. It surfaced for us using an environment preSubmission hook that unions a studio default input directory into every job: the directory is correctly uploaded and appears in the submitted job's attachments, but is absent from the saved bundle's asset_references.yaml.
Why this matters:
- No faithful record / auditability. You cannot inspect, from the saved bundle, what a hook actually contributed to a given submission.
- Non-reproducible re-submission. Re-submitting the saved bundle with
deadline bundle submit re-runs the hooks, so a later re-submit can produce a different job if the hook's code or configuration changed in the meantime. The bundle is not a stable, replayable artifact.
- Non-idempotent side effects. Hook side effects (asset discovery, validation, external/pipeline calls) run again on every re-submit, duplicating work and any external effects.
Proposed Solution
After preSubmission hooks run, persist a resolved "as-submitted" job bundle into job history (alongside the original), capturing the post-hook state: merged asset_references, resolved parameters, priority, and template.
To make re-submission faithful and idempotent, also provide a way to submit a bundle without re-running hooks — e.g. a deadline bundle submit --skip-hooks flag (and an equivalent run_hooks=False argument on create_job_from_job_bundle), and/or a marker in the resolved bundle that records it is already hook-resolved.
Net effect: users keep the original authored bundle and gain a replayable, audit-friendly snapshot of exactly what was submitted, which can be re-submitted deterministically.
I'm happy to help with a draft PR if the team is open to the approach.
Example Use Cases
Submit once (hooks run, resolved bundle captured), then re-submit the exact same job later without re-triggering hooks:
# 1) Normal submit — preSubmission hooks run and mutate the payload.
# In addition to the current bundle, a resolved "as-submitted" bundle is
# written to job history, e.g.:
# ~/.deadline/job_history/<farm>/<YYYY-MM>/<timestamp>-<name>/
# ~/.deadline/job_history/<farm>/<YYYY-MM>/<timestamp>-<name>.as-submitted/
deadline bundle submit ./my_job_bundle
# 2) Re-submit exactly what was sent before — no hooks re-run, deterministic.
deadline bundle submit --skip-hooks \
"~/.deadline/job_history/<farm>/<YYYY-MM>/<timestamp>-<name>.as-submitted"
Programmatic equivalent:
from deadline.client.api import create_job_from_job_bundle
# Faithful replay of a previously submitted job, hooks already resolved.
create_job_from_job_bundle(resolved_bundle_dir, run_hooks=False)
Inspecting/auditing what a hook contributed to a past submission:
# The resolved bundle reflects the true submitted inputs (hook additions included).
diff my_job_bundle/asset_references.yaml \
".../<timestamp>-<name>.as-submitted/asset_references.yaml"
Describe the problem
The job-history bundle written under
~/.deadline/job_history/...is created beforepreSubmissionhooks run, so it does not reflect what was actually submitted to the farm.preSubmissionhooks execute insidecreate_job_from_job_bundleand modify the in-memory submission payload — asset references (inputDirectories,inputFilenames,outputDirectories,referencedPaths), and per the hooks docs alsoparameters,priority, and thetemplate. Those modifications are used for hashing/upload and the CreateJob call, but they are never written back to the saved job bundle. The persistedasset_references.yaml(and parameter values / template) therefore represent the pre-hook state only.This is in the core submit path (
deadline.client.api.create_job_from_job_bundle+deadline.client.job_bundle._hooks), so it affects every submitter (Maya, Blender, Cinema 4D, Nuke, …) and the CLI equally — not any one DCC. It surfaced for us using an environmentpreSubmissionhook that unions a studio default input directory into every job: the directory is correctly uploaded and appears in the submitted job's attachments, but is absent from the saved bundle'sasset_references.yaml.Why this matters:
deadline bundle submitre-runs the hooks, so a later re-submit can produce a different job if the hook's code or configuration changed in the meantime. The bundle is not a stable, replayable artifact.Proposed Solution
After
preSubmissionhooks run, persist a resolved "as-submitted" job bundle into job history (alongside the original), capturing the post-hook state: mergedasset_references, resolvedparameters,priority, andtemplate.To make re-submission faithful and idempotent, also provide a way to submit a bundle without re-running hooks — e.g. a
deadline bundle submit --skip-hooksflag (and an equivalentrun_hooks=Falseargument oncreate_job_from_job_bundle), and/or a marker in the resolved bundle that records it is already hook-resolved.Net effect: users keep the original authored bundle and gain a replayable, audit-friendly snapshot of exactly what was submitted, which can be re-submitted deterministically.
I'm happy to help with a draft PR if the team is open to the approach.
Example Use Cases
Submit once (hooks run, resolved bundle captured), then re-submit the exact same job later without re-triggering hooks:
Programmatic equivalent:
Inspecting/auditing what a hook contributed to a past submission: