Пример #1
0
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-test",
        "step1",
        "",
        before=True)

    from kale.marshal.decorator import marshal

    pipeline_parameters = {}

    @marshal([], ['data'], pipeline_parameters, "/marshal")
    def step1():
        return 10

    step1()
    _rok_snapshot_task = _kale_rokutils.snapshot_pipeline_step(
        "test-test",
        "step1",
        "",
        before=False)
    _kale_mlmdutils.call("submit_output_rok_artifact", _rok_snapshot_task)

    _kale_mlmdutils.call("mark_execution_complete")
Пример #2
0
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-test",
        "step2",
        "",
        before=True)

    from kale.marshal.decorator import marshal

    pipeline_parameters = {"a": a, "c": c}

    @marshal(['c', 'a', 'data'], ['res'], pipeline_parameters, "/marshal")
    def step2(var1, var2, data):
        print(var1 + var2)
        return 'Test'

    step2()
    _rok_snapshot_task = _kale_rokutils.snapshot_pipeline_step(
        "test-test",
        "step2",
        "",
        before=False)
    _kale_mlmdutils.call("submit_output_rok_artifact", _rok_snapshot_task)

    _kale_mlmdutils.call("mark_execution_complete")
Пример #3
0
def step3(b: str):
    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-test",
        "step3",
        "",
        before=True)

    from kale.marshal.decorator import marshal

    pipeline_parameters = {"b": b}

    @marshal(['b', 'data'], [], pipeline_parameters, "/marshal")
    def step3(st, st2):
        print(st)

    step3()
    _rok_snapshot_task = _kale_rokutils.snapshot_pipeline_step(
        "test-test",
        "step3",
        "",
        before=False)
    _kale_mlmdutils.call("submit_output_rok_artifact", _rok_snapshot_task)

    _kale_mlmdutils.call("mark_execution_complete")
Пример #4
0
def final_auto_snapshot():
    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([], [], _kale_pipeline_parameters, "/marshal")
    def _no_op():
        pass

    _no_op()

    _kale_artifacts = {}

    _kale_link_artifacts(_kale_artifacts)
    from kale.common import rokutils as _kale_rokutils
    _kale_mlmdutils.call("link_input_rok_artifacts")
    _rok_snapshot_task = _kale_rokutils.snapshot_pipeline_step(
        "test",
        "final_auto_snapshot",
        "",
        before=False)
    _kale_mlmdutils.call("submit_output_rok_artifact", _rok_snapshot_task)

    _kale_mlmdutils.call("mark_execution_complete")
Пример #5
0
def test():
    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",
                                          "test",
                                          "/path/to/nb",
                                          before=True)

    _rok_snapshot_task = _kale_rokutils.snapshot_pipeline_step("test",
                                                               "test",
                                                               "/path/to/nb",
                                                               before=False)
    _kale_mlmdutils.call("submit_output_rok_artifact", _rok_snapshot_task)

    _kale_mlmdutils.call("mark_execution_complete")