From 6ab5c5218dd10930efe2bd92d19a83cb1614ed21 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 9 Feb 2024 11:23:30 +0200 Subject: [PATCH 1/7] add houdini deadline settings --- .../server/settings/publish_plugins.py | 66 +++++++++++++++++++ server_addon/deadline/server/version.py | 2 +- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/server_addon/deadline/server/settings/publish_plugins.py b/server_addon/deadline/server/settings/publish_plugins.py index 8abe59674b..3dcd8028ef 100644 --- a/server_addon/deadline/server/settings/publish_plugins.py +++ b/server_addon/deadline/server/settings/publish_plugins.py @@ -211,6 +211,49 @@ class HarmonySubmitDeadlineModel(BaseSettingsModel): department: str = SettingsField(title="Department") +class HoudiniSubmitCacheDeadlineModel(BaseSettingsModel): + priority: int = SettingsField(title="Priority") + chunk_size: int = SettingsField(title="Chunk Size") + group: str = SettingsField(title="Group") + + +class HoudiniSubmitExportDeadlineModel(BaseSettingsModel): + priority: int = SettingsField(title="Priority") + chunk_size: int = SettingsField(title="Chunk Size") + group: str = SettingsField(title="Group") + + +class HoudiniSubmitRenderDeadlineModel(BaseSettingsModel): + priority: int = SettingsField(title="Priority") + chunk_size: int = SettingsField(title="Chunk Size") + group: str = SettingsField(title="Group") + + +class HoudiniSubmitDeadlineModel(BaseSettingsModel): + """Houdini deadline submitter settings.""" + enabled: bool = SettingsField(title="Enabled") + optional: bool = SettingsField(title="Optional") + active: bool = SettingsField(title="Active") + HoudiniSubmitCacheDeadline: HoudiniSubmitCacheDeadlineModel = ( + SettingsField( + default_factory=HoudiniSubmitCacheDeadlineModel, + title="Submit Cache" + ) + ) + HoudiniSubmitExportDeadline: HoudiniSubmitExportDeadlineModel = ( + SettingsField( + default_factory=HoudiniSubmitExportDeadlineModel, + title="Submit Export Job" + ) + ) + HoudiniSubmitRenderDeadline: HoudiniSubmitRenderDeadlineModel = ( + SettingsField( + default_factory=HoudiniSubmitRenderDeadlineModel, + title="Submit Render" + ) + ) + + class AfterEffectsSubmitDeadlineModel(BaseSettingsModel): """After Effects deadline submitter settings.""" @@ -312,6 +355,9 @@ class PublishPluginsModel(BaseSettingsModel): MaxSubmitDeadline: MaxSubmitDeadlineModel = SettingsField( default_factory=MaxSubmitDeadlineModel, title="Max Submit to deadline") + HoudiniSubmitDeadline: HoudiniSubmitDeadlineModel = SettingsField( + default_factory=HoudiniSubmitDeadlineModel, + title="Houdini Submit to deadline") FusionSubmitDeadline: FusionSubmitDeadlineModel = SettingsField( default_factory=FusionSubmitDeadlineModel, title="Fusion submit to Deadline") @@ -385,6 +431,26 @@ class PublishPluginsModel(BaseSettingsModel): "chunk_size": 10, "group": "none" }, + "HoudiniSubmitDeadline":{ + "enabled": True, + "optional": False, + "active": True, + "HoudiniSubmitCacheDeadline":{ + "priority": 50, + "chunk_size":999999, + "group": "" + }, + "HoudiniSubmitExportDeadline":{ + "priority": 50, + "chunk_size":10, + "group": "" + }, + "HoudiniSubmitRenderDeadline":{ + "priority": 50, + "chunk_size":1, + "group": "" + } + }, "FusionSubmitDeadline": { "enabled": True, "optional": False, diff --git a/server_addon/deadline/server/version.py b/server_addon/deadline/server/version.py index 9cb17e7976..c11f861afb 100644 --- a/server_addon/deadline/server/version.py +++ b/server_addon/deadline/server/version.py @@ -1 +1 @@ -__version__ = "0.1.8" +__version__ = "0.1.9" From 96e12e2d487ffb07631fc24e7c06ba7545cdd402 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 9 Feb 2024 01:07:32 +0200 Subject: [PATCH 2/7] make collect pools work with some houdini families --- .../deadline/plugins/publish/collect_pools.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py b/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py index 6c35012173..7fe1dc6cd8 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py +++ b/client/ayon_core/modules/deadline/plugins/publish/collect_pools.py @@ -31,14 +31,22 @@ class CollectDeadlinePools(pyblish.api.InstancePlugin, "harmony" "nuke", "maya", - "max"] + "max", + "houdini"] families = ["render", "rendering", "render.farm", "renderFarm", "renderlayer", - "maxrender"] + "maxrender", + "usdrender", + "redshift_rop", + "arnold_rop", + "mantra_rop", + "karma_rop", + "vray_rop", + "publish.hou"] primary_pool = None secondary_pool = None From ae889c597ea21159e4524c0440c015a7a4ed2630 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 9 Feb 2024 01:16:52 +0200 Subject: [PATCH 3/7] Apply settings to Ayon Houdini submitters --- .../publish/submit_houdini_cache_deadline.py | 11 +++- .../publish/submit_houdini_render_deadline.py | 57 ++++++++++++------- 2 files changed, 48 insertions(+), 20 deletions(-) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py index eed930e372..df1f81d9a9 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py @@ -46,10 +46,19 @@ class HoudiniCacheSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline targets = ["local"] priority = 50 + ChunkSize = 999999 + group = None jobInfo = {} pluginInfo = {} group = None + @classmethod + def apply_settings(cls, project_settings, system_settings): + settings = project_settings["deadline"]["publish"]["HoudiniSubmitDeadline"]["HoudiniSubmitCacheDeadline"] # noqa + cls.priority = settings.get("priority", cls.priority) + cls.ChunkSize = settings.get("chunk_size", cls.ChunkSize) + cls.group = settings.get("group", cls.group) + def get_job_info(self): job_info = DeadlineJobInfo(Plugin="Houdini") @@ -89,7 +98,7 @@ def get_job_info(self): attr_values = self.get_attr_values_from_data(instance.data) - job_info.ChunkSize = instance.data["chunkSize"] + job_info.ChunkSize = instance.data.get("chunkSize", self.ChunkSize) job_info.Comment = context.data.get("comment") job_info.Priority = attr_values.get("priority", self.priority) job_info.Group = attr_values.get("group", self.group) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index 9988248957..5cb347bb97 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -11,6 +11,7 @@ from openpype_modules.deadline.abstract_submit_deadline import DeadlineJobInfo from ayon_core.lib import ( BoolDef, + TextDef, NumberDef ) @@ -76,16 +77,33 @@ class HoudiniSubmitDeadline( use_published = True # presets - priority = 50 - chunk_size = 1 export_priority = 50 export_chunk_size = 10 - group = "" export_group = "" + priority = 50 + chunk_size = 1 + group = "" + @classmethod + def apply_settings(cls, project_settings, system_settings): + export_settings = project_settings["deadline"]["publish"]["HoudiniSubmitDeadline"]["HoudiniSubmitExportDeadline"] # noqa + cls.export_priority = export_settings.get("priority", cls.export_priority) + cls.export_chunk_size = export_settings.get("chunk_size", cls.export_chunk_size) + cls.export_group = export_settings.get("group", cls.export_group) + + render_settings = project_settings["deadline"]["publish"]["HoudiniSubmitDeadline"]["HoudiniSubmitRenderDeadline"] # noqa + cls.priority = render_settings.get("priority", cls.priority) + cls.chunk_size = render_settings.get("chunk_size", cls.chunk_size) + cls.group = render_settings.get("group", cls.group) + @classmethod def get_attribute_defs(cls): return [ + BoolDef( + "suspend_publish", + default=False, + label="Suspend publish" + ), NumberDef( "priority", label="Priority", @@ -100,10 +118,14 @@ def get_attribute_defs(cls): minimum=1, maximum=1000 ), + TextDef("group", + default=cls.group, + label="Group Name" + ), NumberDef( "export_priority", label="Export Priority", - default=cls.priority, + default=cls.export_priority, decimals=0 ), NumberDef( @@ -114,11 +136,9 @@ def get_attribute_defs(cls): minimum=1, maximum=1000 ), - BoolDef( - "suspend_publish", - default=False, - label="Suspend publish" - ) + TextDef("export_group", + default=cls.export_group, + label="Export Group Name"), ] def get_job_info(self, dependency_job_ids=None): @@ -158,15 +178,6 @@ def get_job_info(self, dependency_job_ids=None): job_info.UserName = context.data.get( "deadlineUser", getpass.getuser()) - if split_render_job and is_export_job: - job_info.Priority = attribute_values.get( - "export_priority", self.export_priority - ) - else: - job_info.Priority = attribute_values.get( - "priority", self.priority - ) - if is_in_tests(): job_info.BatchName += datetime.now().strftime("%d%m%Y%H%M%S") @@ -187,15 +198,23 @@ def get_job_info(self, dependency_job_ids=None): job_info.Pool = instance.data.get("primaryPool") job_info.SecondaryPool = instance.data.get("secondaryPool") - job_info.Group = self.group + if split_render_job and is_export_job: + job_info.Priority = attribute_values.get( + "export_priority", self.export_priority + ) job_info.ChunkSize = attribute_values.get( "export_chunk", self.export_chunk_size ) + job_info.Group = self.export_group else: + job_info.Priority = attribute_values.get( + "priority", self.priority + ) job_info.ChunkSize = attribute_values.get( "chunk", self.chunk_size ) + job_info.Group = self.group job_info.Comment = context.data.get("comment") From 80e32464104395eb4eeff5d4c7f8e59ad5086dec Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 9 Feb 2024 01:19:20 +0200 Subject: [PATCH 4/7] remove redundant line --- .../deadline/plugins/publish/submit_houdini_cache_deadline.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py index df1f81d9a9..fda470bde3 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py @@ -50,7 +50,6 @@ class HoudiniCacheSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline group = None jobInfo = {} pluginInfo = {} - group = None @classmethod def apply_settings(cls, project_settings, system_settings): From 08413a80bbba6fe31d737cb9d0c4c7e4f8a4ff9e Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 9 Feb 2024 20:16:38 +0200 Subject: [PATCH 5/7] Kuba's comment - remove unnecessary logic, stick to code style --- .../publish/submit_houdini_cache_deadline.py | 10 +-- .../publish/submit_houdini_render_deadline.py | 14 +--- .../server/settings/publish_plugins.py | 81 ++++++++----------- 3 files changed, 36 insertions(+), 69 deletions(-) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py index fda470bde3..7603fbaaf3 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py @@ -46,17 +46,11 @@ class HoudiniCacheSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline targets = ["local"] priority = 50 - ChunkSize = 999999 + chunk_size = 999999 group = None jobInfo = {} pluginInfo = {} - @classmethod - def apply_settings(cls, project_settings, system_settings): - settings = project_settings["deadline"]["publish"]["HoudiniSubmitDeadline"]["HoudiniSubmitCacheDeadline"] # noqa - cls.priority = settings.get("priority", cls.priority) - cls.ChunkSize = settings.get("chunk_size", cls.ChunkSize) - cls.group = settings.get("group", cls.group) def get_job_info(self): job_info = DeadlineJobInfo(Plugin="Houdini") @@ -97,7 +91,7 @@ def get_job_info(self): attr_values = self.get_attr_values_from_data(instance.data) - job_info.ChunkSize = instance.data.get("chunkSize", self.ChunkSize) + job_info.ChunkSize = instance.data.get("chunk_size", self.chunk_size) job_info.Comment = context.data.get("comment") job_info.Priority = attr_values.get("priority", self.priority) job_info.Group = attr_values.get("group", self.group) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index 5cb347bb97..63dc2712fe 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -83,19 +83,7 @@ class HoudiniSubmitDeadline( priority = 50 chunk_size = 1 group = "" - - @classmethod - def apply_settings(cls, project_settings, system_settings): - export_settings = project_settings["deadline"]["publish"]["HoudiniSubmitDeadline"]["HoudiniSubmitExportDeadline"] # noqa - cls.export_priority = export_settings.get("priority", cls.export_priority) - cls.export_chunk_size = export_settings.get("chunk_size", cls.export_chunk_size) - cls.export_group = export_settings.get("group", cls.export_group) - - render_settings = project_settings["deadline"]["publish"]["HoudiniSubmitDeadline"]["HoudiniSubmitRenderDeadline"] # noqa - cls.priority = render_settings.get("priority", cls.priority) - cls.chunk_size = render_settings.get("chunk_size", cls.chunk_size) - cls.group = render_settings.get("group", cls.group) - + @classmethod def get_attribute_defs(cls): return [ diff --git a/server_addon/deadline/server/settings/publish_plugins.py b/server_addon/deadline/server/settings/publish_plugins.py index 3dcd8028ef..fde076965b 100644 --- a/server_addon/deadline/server/settings/publish_plugins.py +++ b/server_addon/deadline/server/settings/publish_plugins.py @@ -211,47 +211,30 @@ class HarmonySubmitDeadlineModel(BaseSettingsModel): department: str = SettingsField(title="Department") -class HoudiniSubmitCacheDeadlineModel(BaseSettingsModel): +class HoudiniSubmitDeadlineModel(BaseSettingsModel): + """Houdini deadline render submitter settings.""" + enabled: bool = SettingsField(title="Enabled") + optional: bool = SettingsField(title="Optional") + active: bool = SettingsField(title="Active") + priority: int = SettingsField(title="Priority") chunk_size: int = SettingsField(title="Chunk Size") group: str = SettingsField(title="Group") - -class HoudiniSubmitExportDeadlineModel(BaseSettingsModel): - priority: int = SettingsField(title="Priority") - chunk_size: int = SettingsField(title="Chunk Size") - group: str = SettingsField(title="Group") + export_priority: int = SettingsField(title="Export Priority") + export_chunk_size: int = SettingsField(title="Export Chunk Size") + export_group: str = SettingsField(title="Export Group") -class HoudiniSubmitRenderDeadlineModel(BaseSettingsModel): - priority: int = SettingsField(title="Priority") - chunk_size: int = SettingsField(title="Chunk Size") - group: str = SettingsField(title="Group") - - -class HoudiniSubmitDeadlineModel(BaseSettingsModel): - """Houdini deadline submitter settings.""" +class HoudiniCacheSubmitDeadlineModel(BaseSettingsModel): + """Houdini deadline cache submitter settings.""" enabled: bool = SettingsField(title="Enabled") optional: bool = SettingsField(title="Optional") active: bool = SettingsField(title="Active") - HoudiniSubmitCacheDeadline: HoudiniSubmitCacheDeadlineModel = ( - SettingsField( - default_factory=HoudiniSubmitCacheDeadlineModel, - title="Submit Cache" - ) - ) - HoudiniSubmitExportDeadline: HoudiniSubmitExportDeadlineModel = ( - SettingsField( - default_factory=HoudiniSubmitExportDeadlineModel, - title="Submit Export Job" - ) - ) - HoudiniSubmitRenderDeadline: HoudiniSubmitRenderDeadlineModel = ( - SettingsField( - default_factory=HoudiniSubmitRenderDeadlineModel, - title="Submit Render" - ) - ) + + priority: int = SettingsField(title="Priority") + chunk_size: int = SettingsField(title="Chunk Size") + group: str = SettingsField(title="Group") class AfterEffectsSubmitDeadlineModel(BaseSettingsModel): @@ -357,7 +340,10 @@ class PublishPluginsModel(BaseSettingsModel): title="Max Submit to deadline") HoudiniSubmitDeadline: HoudiniSubmitDeadlineModel = SettingsField( default_factory=HoudiniSubmitDeadlineModel, - title="Houdini Submit to deadline") + title="Houdini Submit render to deadline") + HoudiniCacheSubmitDeadline: HoudiniCacheSubmitDeadlineModel = SettingsField( + default_factory=HoudiniCacheSubmitDeadlineModel, + title="Houdini Submit cache to deadline") FusionSubmitDeadline: FusionSubmitDeadlineModel = SettingsField( default_factory=FusionSubmitDeadlineModel, title="Fusion submit to Deadline") @@ -435,21 +421,20 @@ class PublishPluginsModel(BaseSettingsModel): "enabled": True, "optional": False, "active": True, - "HoudiniSubmitCacheDeadline":{ - "priority": 50, - "chunk_size":999999, - "group": "" - }, - "HoudiniSubmitExportDeadline":{ - "priority": 50, - "chunk_size":10, - "group": "" - }, - "HoudiniSubmitRenderDeadline":{ - "priority": 50, - "chunk_size":1, - "group": "" - } + "priority": 50, + "chunk_size":1, + "group": "", + "export_priority": 50, + "export_chunk_size":10, + "export_group": "" + }, + "HoudiniCacheSubmitDeadline": { + "enabled": True, + "optional": False, + "active": True, + "priority": 50, + "chunk_size":999999, + "group": "" }, "FusionSubmitDeadline": { "enabled": True, From b2099c83b715ab49aecac2fdfae885aa5168bdd3 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 12 Feb 2024 18:19:12 +0200 Subject: [PATCH 6/7] bump deadline addon version --- server_addon/deadline/server/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/deadline/server/version.py b/server_addon/deadline/server/version.py index c11f861afb..569b1212f7 100644 --- a/server_addon/deadline/server/version.py +++ b/server_addon/deadline/server/version.py @@ -1 +1 @@ -__version__ = "0.1.9" +__version__ = "0.1.10" From a26f17c1cb96a9618aae92a2a6eb0f62a909496a Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 11 Mar 2024 12:15:10 +0200 Subject: [PATCH 7/7] fix code style --- .../publish/submit_houdini_render_deadline.py | 15 +++++++++------ .../deadline/server/settings/publish_plugins.py | 8 ++++---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index 2f359da80b..6952604293 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -109,9 +109,10 @@ def get_attribute_defs(cls): minimum=1, maximum=1000 ), - TextDef("group", - default=cls.group, - label="Group Name" + TextDef( + "group", + default=cls.group, + label="Group Name" ), NumberDef( "export_priority", @@ -127,9 +128,11 @@ def get_attribute_defs(cls): minimum=1, maximum=1000 ), - TextDef("export_group", - default=cls.export_group, - label="Export Group Name"), + TextDef( + "export_group", + default=cls.export_group, + label="Export Group Name" + ), ] def get_job_info(self, dependency_job_ids=None): diff --git a/server_addon/deadline/server/settings/publish_plugins.py b/server_addon/deadline/server/settings/publish_plugins.py index 746fd54d57..9f69143e37 100644 --- a/server_addon/deadline/server/settings/publish_plugins.py +++ b/server_addon/deadline/server/settings/publish_plugins.py @@ -453,18 +453,18 @@ class PublishPluginsModel(BaseSettingsModel): "optional": False, "active": True, "priority": 50, - "chunk_size":999999, + "chunk_size": 999999, "group": "" }, - "HoudiniSubmitDeadline":{ + "HoudiniSubmitDeadline": { "enabled": True, "optional": False, "active": True, "priority": 50, - "chunk_size":1, + "chunk_size": 1, "group": "", "export_priority": 50, - "export_chunk_size":10, + "export_chunk_size": 10, "export_group": "" }, "MaxSubmitDeadline": {