Skip to content

Commit

Permalink
Add LimitGroups and MachineLimit to job info
Browse files Browse the repository at this point in the history
  • Loading branch information
MustafaJafar committed Oct 2, 2024
1 parent 66dc0e3 commit beb9a88
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class HoudiniCacheSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline
priority = 50
chunk_size = 999999
group = None
limits = ""
machine_limit = 0
jobInfo = {}
pluginInfo = {}

Expand Down Expand Up @@ -102,6 +104,10 @@ def get_job_info(self):
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)
job_info.LimitGroups = attr_values.get("limits", self.limits)
job_info.MachineLimit = attr_values.get(
"machine_limit", self.machine_limit
)

keys = [
"FTRACK_API_KEY",
Expand Down Expand Up @@ -192,6 +198,19 @@ def get_attribute_defs(cls):
TextDef("group",
default=cls.group,
label="Group Name"),
TextDef(
"limits",
default=cls.limits,
label="Limit Groups",
placeholder="value1,value2",
tooltip="Enter a comma separated list of limit groups."
),
NumberDef(
"machine_limit",
default=cls.machine_limit,
label="Machine Limit",
tooltip="maximum number of machines for this job."
),
])

return defs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,13 @@ class HoudiniSubmitDeadline(
export_priority = 50
export_chunk_size = 10
export_group = ""
export_limits = ""
export_machine_limit = 0
priority = 50
chunk_size = 1
group = ""
limits = ""
machine_limit = 0

@classmethod
def get_attribute_defs(cls):
Expand All @@ -139,6 +143,19 @@ def get_attribute_defs(cls):
default=cls.group,
label="Group Name"
),
TextDef(
"limits",
default=cls.limits,
label="Limit Groups",
placeholder="value1,value2",
tooltip="Enter a comma separated list of limit groups."
),
NumberDef(
"machine_limit",
default=cls.machine_limit,
label="Machine Limit",
tooltip="maximum number of machines for this job."
),
NumberDef(
"export_priority",
label="Export Priority",
Expand All @@ -158,6 +175,19 @@ def get_attribute_defs(cls):
default=cls.export_group,
label="Export Group Name"
),
TextDef(
"export_limits",
default=cls.export_limits,
label="Export Limit Groups",
placeholder="value1,value2",
tooltip="Enter a comma separated list of limit groups."
),
NumberDef(
"export_machine_limit",
default=cls.export_machine_limit,
label="Export Machine Limit",
tooltip="maximum number of machines for this job."
),
]

def get_job_info(self, dependency_job_ids=None):
Expand Down Expand Up @@ -234,6 +264,12 @@ def get_job_info(self, dependency_job_ids=None):
job_info.Group = attribute_values.get(
"export_group", self.export_group
)
job_info.LimitGroups = attribute_values.get(
"export_limits", self.export_limits
)
job_info.MachineLimit = attribute_values.get(
"export_machine_limit", self.export_machine_limit
)
else:
job_info.Priority = attribute_values.get(
"priority", self.priority
Expand All @@ -244,6 +280,12 @@ def get_job_info(self, dependency_job_ids=None):
job_info.Group = attribute_values.get(
"group", self.group
)
job_info.LimitGroups = attribute_values.get(
"limits", self.limits
)
job_info.MachineLimit = attribute_values.get(
"machine_limit", self.machine_limit
)

# Apply render globals, like e.g. data from collect machine list
render_globals = instance.data.get("renderGlobals", {})
Expand Down

0 comments on commit beb9a88

Please sign in to comment.