Bennett Lambert
03/28/2022, 2:13 PMKevin Kho
03/28/2022, 2:14 PMBennett Lambert
03/28/2022, 2:16 PMfrom prefect import task, Flow
from prefect.executors import DaskExecutor
from prefect.run_configs import KubernetesRun
@task
def get_value():
return "Example!"
@task
def output_value(value):
print(value)
with Flow("Test") as flow:
value = get_value()
output_value(value)
flow.run_config = KubernetesRun(labels=None)
flow.executor = DaskExecutor("IP_ADDRESS:8786")
flow.run()
Kevin Kho
03/28/2022, 2:19 PMflow.run()
does not respect the run_config
and is just meant for testing. For agent-backed runs, you need to register the Flow with Prefect Cloud/Server and then run it from the UI or schedule or by hitting the API of the backend. Those will get picked up and deployed by the agentBennett Lambert
03/28/2022, 2:20 PM