Tom Forbes
06/15/2021, 1:11 PMif running_locally:
    flow.executor = LocalDaskExecutor()
else:
    flow.executor = DaskExecutor(cluster_class=lambda: KubeCluster(pod_template=....))Kevin Kho
flow.run()if __name__ == "__main__":Tom Forbes
06/15/2021, 2:06 PMflow.run()from internal_library import get_executor
with Flow(executor=get_executor()):
   ...get_executor()Tom Forbes
06/15/2021, 2:07 PMget_local_executor()Kevin Kho
Tom Forbes
06/15/2021, 2:18 PMfrom internal_library import k8s_executor, local_executor
with Flow(executor=k8s_executor()) as flow: 
    ...
if __name__ == "__main__":
    flow.run(executor=local_executor())Tom Forbes
06/15/2021, 2:18 PMZanie
Zanie
prefect.context.get("running_with_backend")TrueZanie
flow_run_idprefect.context.get("flow_run_id")Tom Forbes
06/15/2021, 3:47 PMrunning_with_backendResult