Skip to content

feat: Remember last used shared job settings for job submissions - #235

Merged
karthikbekalp merged 8 commits into
aws-deadline:mainlinefrom
gianelli-lagos-aws:submitter_sticky_fields_deadline_cloud_changes
Jul 31, 2025
Merged

feat: Remember last used shared job settings for job submissions#235
karthikbekalp merged 8 commits into
aws-deadline:mainlinefrom
gianelli-lagos-aws:submitter_sticky_fields_deadline_cloud_changes

Conversation

@gianelli-lagos-aws

@gianelli-lagos-aws gianelli-lagos-aws commented Jun 19, 2025

Copy link
Copy Markdown
Contributor

Fixes: < #95 >

What was the problem/requirement? (What/Why)

The fields priority, initial_state , max_failed_tasks_count, max_retries_per_task, and max_worker_count do not have sticky settings which can be inconvenient for the customer.

What was the solution? (How)

  • Update the refresh_ui() method to use getattr() with fallback values for backward compatibility.
  • Modify the method to load saved values for all four fields when they exist in the settings object.
  • Update the update_settings() method to save all four field values when they exist in the settings object.

What is the impact of this change?

Customers will have settings that are saved and reused between submissions.

How was this change tested?

  • Since there were also changes made to the deadline-cloud-for-cinema-4d repo, both packages were built with the changes and tested together to ensure proper integration.
  • Verified that all settings persist after closing and reopening Cinema 4D.
  • Tested with both new scenes and existing scenes to ensure backward compatibility.
  • Validated that the JSON settings file contains all the expected fields with correct values.
  • Have you run the unit tests?
    Yes.
    0.05s call test/unit/deadline_adaptor_for_cinema4d/Cinema4DAdaptor/test_adaptor.py::TestCinema4DAdaptor_on_cleanup::test_handle_errors_on_error_stdout[Project not found-True]
    0.04s call test/unit/deadline_adaptor_for_cinema4d/Cinema4DAdaptor/test_adaptor.py::TestCinema4DAdaptor_on_cleanup::test_handle_errors_on_error_stdout[CRITICAL: Stop [ge_file.cpp(1172)]-False]
    ============================================================================== 53 passed in 3.90s ============================================================

  • Have you run the integration tests?
    Yes.
    94.44s call test/integ/test_cinema4d.py::test_integ[redshift_textured_with_nonascii_characters]
    77.32s call test/integ/test_cinema4d.py::test_integ[redshift_textured]
    74.20s call test/integ/test_cinema4d.py::test_integ[redshift]
    73.27s call test/integ/test_cinema4d.py::test_integ[redshift_takes]
    53.66s call test/integ/test_cinema4d.py::test_integ[physical_textured]
    ======================================================================== 6 passed in 427.19s (0:07:07) ============================


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Signed-off-by: Lagos Gonzales <214008711+gianelli-lagos-aws@users.noreply.github.com>
@gianelli-lagos-aws
gianelli-lagos-aws requested a review from a team as a code owner June 19, 2025 17:14
max_failed_tasks_count: int = field(default=20, metadata={"sticky": True})
max_retries_per_task: int = field(default=5, metadata={"sticky": True})
limited_max_worker_count: bool = field(default=False, metadata={"sticky": True})
max_worker_count: int = field(default=1, metadata={"sticky": True})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe here the default should be -1? Also can we add a comment suggesting that it is -1 when there is no max worker count limit?

@gianelli-lagos-aws gianelli-lagos-aws Jun 20, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I updated it and added a comment. Thank you!

… in save_sticky_settings

Signed-off-by: Lagos Gonzales <214008711+gianelli-lagos-aws@users.noreply.github.com>
Comment thread src/deadline/cinema4d_submitter/data_classes.py Outdated
Signed-off-by: Lagos Gonzales <214008711+gianelli-lagos-aws@users.noreply.github.com>
joel-wong-aws
joel-wong-aws previously approved these changes Jun 20, 2025
max_retries_per_task: int = field(default=5, metadata={"sticky": True})
max_worker_count: int = field(
default=-1, metadata={"sticky": True}
) # -1 indicates no limited max worker count

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supernit: no limited -> unlimited

Comment thread src/deadline/cinema4d_submitter/data_classes.py

@karthikbekalp karthikbekalp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me.

This PR requires https://github.com/aws-deadline/deadline-cloud/pull/711/files from deadline cloud to work. Although, adding this should not break the code it would be better if we could merge this once the deadline cloud changes are merged and released.

For example, something like this: https://github.com/aws-deadline/deadline-cloud-for-cinema-4d/pull/180/files where the pyproject.toml needed some updates so that the feature could work.

…ited worker

Signed-off-by: Lagos Gonzales <214008711+gianelli-lagos-aws@users.noreply.github.com>
Signed-off-by: Lagos Gonzales <214008711+gianelli-lagos-aws@users.noreply.github.com>
@gianelli-lagos-aws
gianelli-lagos-aws force-pushed the submitter_sticky_fields_deadline_cloud_changes branch from 78ff391 to 6ebbd22 Compare July 1, 2025 17:53
@sonarqubecloud

Copy link
Copy Markdown

@karthikbekalp karthikbekalp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the changes are now in as part of: #266 we should be able to merge this PR in.

@karthikbekalp
karthikbekalp enabled auto-merge (squash) July 31, 2025 20:35
@karthikbekalp
karthikbekalp merged commit 577377a into aws-deadline:mainline Jul 31, 2025
16 checks passed
This was referenced Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants