<#1704 Real time deck support> Pull request opened...
# flyte-github
a
#1704 Real time deck support Pull request opened by Yicheng-Lu-llll TL;DR This PR adds real-time deck support. After this PR, User can use
flytekit.Deck.persist()
to generate the html based on current collected metrics/information. So that user can see the real time deck even the task is running or has already failed. See the below example:
Copy code
import flytekit
from flytekit import Resources, task, workflow
from flytekit.core.utils import timeit

@task(
    disable_deck=False,
    limits=Resources(mem="4Gi", cpu="1"),
)
def t1():
    import time

    for i in range(2):
        # timeit measure the time used in the block and shown in time line deck. See <https://github.com/flyteorg/flytekit/pull/1581>. 
        # Or you can add information to your own deck. See <https://docs.flyte.org/projects/cookbook/en/latest/auto/core/flyte_basics/deck.html>.
        with timeit(f"iteration {i}"):
            time.sleep(50)
        flytekit.Deck.persist()


@workflow
def wf():
    t1()


if __name__ == "__main__":
    wf()

截屏2023-06-23 22 39 08

截屏2023-06-23 22 39 23

real time deck support includes: • flytekit: #1704 • flyteadmin: flyteorg/flyteadmin#579 • flytepropeller: flyteorg/flytepropeller#579 • flyteconsole: flyteorg/flyteconsole#781 Type ☐ Bug Fix ☑︎ Feature ☐ Plugin Are all requirements met? ☐ Code completed ☐ Smoke tested ☐ Unit tests added ☐ Code documentation added ☐ Any pending items have an associated Issue flyteorg/flytekit GitHub Actions: build-plugins (3.11, flytekit-snowflake) GitHub Actions: build-plugins (3.11, flytekit-papermill) GitHub Actions: build-plugins (3.11, flytekit-pandera) GitHub Actions: build-plugins (3.11, flytekit-kf-pytorch) GitHub Actions: build-plugins (3.11, flytekit-kf-mpi) GitHub Actions: build-plugins (3.11, flytekit-k8s-pod) GitHub Actions: build-plugins (3.11, flytekit-duckdb) GitHub Actions: build-plugins (3.11, flytekit-dolt) GitHub Actions: build-plugins (3.11, flytekit-aws-athena) GitHub Actions: build-plugins (3.10, flytekit-ray) 20 other checks have passed 20/30 successful checks