-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add Submitter Callback functions #132
base: mainline
Are you sure you want to change the base?
feat: Add Submitter Callback functions #132
Conversation
23c63a9
to
2768e7c
Compare
2768e7c
to
111433b
Compare
So to explain this PR a bit more. The base implementation (in 985ca84) adds a check for the presence of an environment variable for pre and post submit hooks. The second commit, 72035a9, just adds some exception handling around this dynamic loading. I figure that throwing a The third commit, 111433b, is where I had an idea to implement some function validation at this point to ensure the function that we are loading matches the signature that we expect. This does some python inspect magic to check the function signature and may be perceived as superfluous. And lastly the I change the environment variables from |
a0fe521
to
8eaf450
Compare
This implementation looks for `DEADLINE_PRE_SUBMIT_CALLBACK` and `DEADLINE_POST_SUBMIT_CALLBACK` which should point to a python file that contains a function called `on_pre_submit_callback` and `on_post_submit_callback` respectively. The new `nuke_util.callback` file contains `import_module_function` which will load the file from disk. This has no "safeties" on it to catch exceptions during import perhaps we should add some exception handling around this function specifically. Signed-off-by: Alex Hughes <[email protected]>
Signed-off-by: Alex Hughes <[email protected]>
…ction This will call the `validate_function_signature` function within the new deadline-cloud callback loader to validate the parameters of the loaded callback.py This is optional as I am unsure how much we care about this. It would fail anyways but this way at least we could raise some error notifying people that the signature looks incorrect. Signed-off-by: Alex Hughes <[email protected]>
This modifies the environment variable name to include the DCC that it applies to. You may want a callback per-dcc so this adds flexibility Signed-off-by: Alex Hughes <[email protected]>
Signed-off-by: Alex Hughes <[email protected]>
8eaf450
to
3fbd40a
Compare
…e as well. Signed-off-by: Alex Hughes <[email protected]>
Quality Gate passedIssues Measures |
What was the problem/requirement? (What/Why)
When working in a studio, we often want to execute local validation of scene files before we allow a submission to the render farm. In other scenarios we may need to modify or transform the scene to prepare if for the render farm.
These two hooks allow for studio specified modification hooks to be optionally run before and after a submission completes.
What was the solution? (How)
This solution implements an
on_pre_submit_callback
and aon_post_submit_callback
that take the same parameters as theon_create_job_bundle_callback
.The parameters match
on_create_job_bundle_callback
solely to provide flexibility in case the hook needs access to any of the settings of the job.What is the impact of this change?
This change relies on my PR in deadline-cloud which implements an
on_pre_submit_callback
and aon_post_submit_callback
parameter and functionality.This PR just implements loading of the callback from an environment variable
How was this change tested?
Did you run the "Job Bundle Output Tests"? If not, why not? If so, paste the test results here.
Have not yet, will do
Was this change documented?
Not currently documented
Is this a breaking change?
No it is a feature addition
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.