def step2(a: int, c: int): from kale.common import mlmdutils as _kale_mlmdutils _kale_mlmdutils.init_metadata() from kale.common import rokutils as _kale_rokutils _kale_mlmdutils.call("link_input_rok_artifacts") _kale_rokutils.snapshot_pipeline_step( "test", "step2", "", before=True) from kale.marshal.decorator import marshal as _kale_marshal from kale.common.runutils import link_artifacts as _kale_link_artifacts _kale_pipeline_parameters = {"a": a, "c": c} @_kale_marshal(['c', 'a', 'data'], ['res'], _kale_pipeline_parameters, "/marshal") def step2(var1, var2, data): print(var1 + var2) return 'Test' step2() _kale_artifacts = {} _kale_link_artifacts(_kale_artifacts) _rok_snapshot_task = _kale_rokutils.snapshot_pipeline_step( "test", "step2", "", before=False) _kale_mlmdutils.call("submit_output_rok_artifact", _rok_snapshot_task) _kale_mlmdutils.call("mark_execution_complete")
def step1(): from kale.common import mlmdutils as _kale_mlmdutils _kale_mlmdutils.init_metadata() from kale.common import rokutils as _kale_rokutils _kale_mlmdutils.call("link_input_rok_artifacts") _kale_rokutils.snapshot_pipeline_step( "test", "step1", "", before=True) from kale.marshal.decorator import marshal as _kale_marshal from kale.common.runutils import link_artifacts as _kale_link_artifacts _kale_pipeline_parameters = {} @_kale_marshal([], ['data'], _kale_pipeline_parameters, "/marshal") def step1(): return 10 step1() _kale_artifacts = {} _kale_link_artifacts(_kale_artifacts) _rok_snapshot_task = _kale_rokutils.snapshot_pipeline_step( "test", "step1", "", before=False) _kale_mlmdutils.call("submit_output_rok_artifact", _rok_snapshot_task) _kale_mlmdutils.call("mark_execution_complete")
def step3(): from kale.common import mlmdutils as _kale_mlmdutils _kale_mlmdutils.init_metadata() from kale.marshal.decorator import marshal as _kale_marshal from kale.common.runutils import link_artifacts as _kale_link_artifacts _kale_pipeline_parameters = {} @_kale_marshal(['_a', '_c'], [], _kale_pipeline_parameters, "/marshal") def step3(a, c): d = c + a print(d) step3() _kale_artifacts = {} _kale_link_artifacts(_kale_artifacts) _kale_mlmdutils.call("mark_execution_complete")
def step1(): from kale.common import mlmdutils as _kale_mlmdutils _kale_mlmdutils.init_metadata() from kale.marshal.decorator import marshal as _kale_marshal from kale.common.runutils import link_artifacts as _kale_link_artifacts _kale_pipeline_parameters = {} @_kale_marshal([], ['_b', '_a'], _kale_pipeline_parameters, "/marshal") def step1(): a = 1 b = 2 return a, b step1() _kale_artifacts = {} _kale_link_artifacts(_kale_artifacts) _kale_mlmdutils.call("mark_execution_complete")
def step2(): from kale.common import mlmdutils as _kale_mlmdutils _kale_mlmdutils.init_metadata() from kale.common.runutils import ttl as _kale_ttl from kale.marshal.decorator import marshal as _kale_marshal from kale.common.runutils import link_artifacts as _kale_link_artifacts _kale_pipeline_parameters = {} @_kale_ttl(5) @_kale_marshal(['_b', '_a'], ['_c'], _kale_pipeline_parameters, "/marshal") def step2(a, b): c = a + b print(c) return c step2() _kale_artifacts = {} _kale_link_artifacts(_kale_artifacts) _kale_mlmdutils.call("mark_execution_complete")