Hey folks <@U04664Z7H37> / <@U065GFDUU4X> one of y...
# contribute
f
Hey folks @cool-lifeguard-49380 / @gorgeous-waitress-5026 one of you had created a PR or issue i remember for using the task config in the version? Do you know what happened about that?
c
Doesn’t ring a bell 🤔
g
Yeah, we did that and couldn't get upstream alignment on the best approach that works for everyone -- so we're carrying a custom patch for now until this can be revisited within the Flyte community.
https://github.com/flyteorg/flytekit/pull/2428 has a mechanism to make the version pluggable
And then we plug in like this
Copy code
class 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 []
FWIW, I don't think this is necessarily the best / right way to do this -- but we needed at least a short term solution b/c without a change to version calculation, Flyte was getting very confused about what it should and should not run