acoustic-carpenter-78188
05/12/2023, 11:08 PMnode_mapping
. we can directly get task interface from the node_mapping
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
Complete description
from typing import Dict
from flytekit import task, workflow, dynamic
from flytekit.configuration import Config, SerializationSettings, ImageConfig
from flytekit.remote import FlyteRemote
@task
def t1(a: int) -> int:
print(a)
return a
@task
def t2(b: int) -> int:
print(b)
return b
@dynamic
def bayesopt(n_iter: int, concurrency: int) -> Dict:
t1(a=n_iter)
t2(b=concurrency)
return {"a": n_iter, "b": concurrency}
@workflow
def wf(n_iter: int = 10, concurrency: int = 10) -> Dict:
t1(a=n_iter)
return bayesopt(n_iter=n_iter, concurrency=concurrency)
if __name__ == "__main__":
remote = FlyteRemote(
config=Config.auto("/Users/kevin/.flyte/config-remote.yaml"),
default_project="flytesnacks",
default_domain="development",
)
exe = remote.fetch_execution(project="flytesnacks", domain="development", name="fe8101d409e9b45c9b88")
remote.wait(exe)
print(exe.node_executions["n1"].task_executions)
Tracking Issue
^^^
Follow-up issue
NA
flyteorg/flytekit
Codecov: 57.14% of diff hit (target 71.25%)
✅ 29 other checks have passed
29/30 successful checksacoustic-carpenter-78188
05/15/2023, 6:50 PM