freezing-airport-6809
cool-lifeguard-49380
09/25/2024, 6:28 AMgorgeous-waitress-5026
09/25/2024, 5:46 PMgorgeous-waitress-5026
09/25/2024, 5:48 PMgorgeous-waitress-5026
09/25/2024, 5:50 PMclass DominoJobPlugin(FlytekitPlugin):
@staticmethod
def get_additional_context_for_version_hash(entity: Union[PythonAutoContainerTask, WorkflowBase]) -> List[str]:
"""
Get additional context to be used for calculating the version hash.
In particular, for DominoJobTask workflows to register without error, we include the task configs into the
additional context used for the version hash. This solves the edge case where two workflows with the same
version hash but different task configs (e.g. different commit id) causes a "task with different structure
already exists" error.
"""
if isinstance(entity, PythonTask):
return [str(entity.task_config)]
if isinstance(entity, WorkflowBase):
task_configs = []
for n in entity.nodes:
task_configs.extend(DominoJobPlugin.get_additional_context_for_version_hash(n.flyte_entity))
return task_configs
return []
gorgeous-waitress-5026
09/25/2024, 5:51 PM