Has anyone had luck deploying external flows? Righ...
# ask-community
s
Has anyone had luck deploying external flows? Right now we've been trying to run code akin to:
Copy code
deployment = await RunnerDeployment.from_storage(GitRepo(...), entrypoint=entrypoint)
But the issue is that none of the flow parameters in that external flow are populated. Internally, it seems that
_cls_._set_defaults_from_flow(deployment, flow)
returns nothing, such that when you open the flow deployment in the UI there are no options available. Has the recommended way of deploying a flow in a git repo changed in prefect 3? To be more specific, we're using a pydantic model for the flow config, and this shows up as an optional json input in the custom run, instead of having its attributes clearly spelled out. I believe this is because the
inspect.signature
doesnt play nice with the
process_v2_params
function when you can't import the whole repo. Figured out the root cause - I thought prefect could handle missing dependencies via
load_flow_from_entrypoint
with
use_placeholder_flow
, but this doesnt seem to do what I expected, and the signature comes back without typing info if dependencies cant be found. We've now got around this by restructuring our remote repos so that the prefect flow code is wrapped in another file, like:
Copy code
from prefect import flow

@flow
def some_process_flow(a: int, b: str) -> None:
   from my_package.main import some_process
   some_process(a, b)
This effectively allows us to hide dependencies in a place that wont be loaded when trying to determine the signature of the flow.