How to use the flyteidl.core.compiler_pb2.CompiledWorkflowClosure function in flyteidl

To help you get started, we’ve selected a few flyteidl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lyft / flytekit / tests / flytekit / unit / common_tests / test_workflow_promote.py View on Github external
def get_compiled_workflow_closure():
    """
    :rtype: flytekit.models.core.compiler.CompiledWorkflowClosure
    """
    cwc_pb = _compiler_pb2.CompiledWorkflowClosure()
    # So that tests that use this work when run from any directory
    basepath = _path.dirname(__file__)
    filepath = _path.abspath(_path.join(basepath, "resources/protos", "CompiledWorkflowClosure.pb"))
    with open(filepath, "rb") as fh:
        cwc_pb.ParseFromString(fh.read())

    return _compiler_model.CompiledWorkflowClosure.from_flyte_idl(cwc_pb)
github lyft / flytekit / flytekit / models / core / compiler.py View on Github external
def to_flyte_idl(self):
        """
        :rtype: flyteidl.core.compiler_pb2.CompiledWorkflowClosure
        """
        return _compiler_pb2.CompiledWorkflowClosure(
            primary=self.primary.to_flyte_idl(),
            sub_workflows=[s.to_flyte_idl() for s in self.sub_workflows],
            tasks=[t.to_flyte_idl() for t in self.tasks]
        )