Skip to content

Commit

Permalink
Move on_pre_submit_callback to optionally include requirements
Browse files Browse the repository at this point in the history
Signed-off-by: Automatic Software Release Bot <[email protected]>
  • Loading branch information
Ahuge authored and Automatic Software Release Bot committed Apr 17, 2024
1 parent f13aab1 commit 012ae84
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions src/deadline/client/ui/dialogs/submit_job_to_deadline_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ class SubmitJobToDeadlineDialog(QDialog):
on_create_job_bundle_callback: A function to call when the dialog needs to create a Job Bundle. It
is called with arguments (widget, job_bundle_dir, settings, queue_parameters, asset_references)
on_pre_submit_callback: A function to call just prior to the dialog submitting the Job Bundle. It is
called with arguments (widget, job_bundle_dir, settings, queue_parameters, asset_references).
called with arguments (widget, job_bundle_dir, settings, queue_parameters, asset_references, requirements).
This callback can be used to validate or modify a scene file before submitting.
on_post_submit_callback: A function to call just after the dialog has submitted the Job Bundle. It
is called with arguments (widget, job_bundle_dir, settings, queue_parameters, asset_references).
on_post_submit_callback: A function to call just after the dialog has submitted the Job Bundle. It is
called with arguments (widget, job_bundle_dir, settings, queue_parameters, asset_references, requirements).
This callback may may be required if the `on_pre_submit_callback` modifies the scene file to
prepare it for submission and work needs to be done to modify the scene back to a working state.
parent: parent of the widget
Expand Down Expand Up @@ -411,18 +411,6 @@ def on_submit(self):

# Submit the job
try:
# Execute any PreSubmission function defined.
if self.on_pre_submit_callback:
self.on_pre_submit_callback(
self,
job_history_bundle_dir,
settings,
queue_parameters,
asset_references,
purpose=JobBundlePurpose.SUBMISSION
)


deadline = api.get_boto3_client("deadline")

job_history_bundle_dir = create_job_history_bundle_dir(
Expand All @@ -431,6 +419,18 @@ def on_submit(self):

if self.show_host_requirements_tab:
requirements = self.host_requirements.get_requirements()
# Execute any PreSubmission function defined.
if self.on_pre_submit_callback:
self.on_pre_submit_callback(
self,
job_history_bundle_dir,
settings,
queue_parameters,
asset_references,
requirements,
purpose=JobBundlePurpose.SUBMISSION
)

self.on_create_job_bundle_callback(
self,
job_history_bundle_dir,
Expand All @@ -441,6 +441,16 @@ def on_submit(self):
purpose=JobBundlePurpose.SUBMISSION,
)
else:
# Execute any PreSubmission function defined.
if self.on_pre_submit_callback:
self.on_pre_submit_callback(
self,
job_history_bundle_dir,
settings,
queue_parameters,
asset_references,
purpose=JobBundlePurpose.SUBMISSION
)
# Maintaining backward compatibility for submitters that do not support host_requirements yet
self.on_create_job_bundle_callback(
self,
Expand Down Expand Up @@ -502,6 +512,7 @@ def on_submit(self):
settings,
queue_parameters,
asset_references,
requirements,
purpose=JobBundlePurpose.SUBMISSION
)
except UserInitiatedCancel as uic:
Expand Down

0 comments on commit 012ae84

Please sign in to comment.