Nikolay Tsvetanov
05/24/2024, 11:33 AMDeployment.build_from_flow
I am getting path error when the flow is in an installed package.
'/usr/local/lib/python3.12/site-packages/my-core-app/workflows/flows/handle_some_events/flow.py' is not in the subpath of '/app'
or this if my package is installed in edit (dev) mode pip install -e <my package>:
'/my-core-app/workflows/flows/handle_some_events/flow.py' is not in the subpath of '/app'
This is the line that throws this error in build_from_flow in prefect code:
entry_path = Path(flow_file).absolute().relative_to(Path(".").absolute())
I execute the build_from_flow code like this from my /app dir in the container:
python -m my_core_app.workflows.deployments.create_deployments # calls Deployment.build_from_flow(some_flow, ...)
Again my_core_app is my own package.
Deployment.build_from_flow
works if I run the create_deployments module from the dir where the package is.
Anyone has an idea how to handle this? And in general how can I package some flows/deployments?Nikolay Tsvetanov
05/24/2024, 4:00 PMentrypoint
and path
to build_from_flow
which are passed to Deployment
Is this a viable solution that will be stable in the future?
https://docs.prefect.io/latest/api-ref/prefect/deployments/deployments/#prefect.deployments.deployments.Deployment.build_from_flow