acoustic-carpenter-78188
06/24/2023, 3:52 AMflytekit.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:
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▾
acoustic-carpenter-78188
06/24/2023, 3:52 AM