Romain
05/20/2021, 2:01 PM/A/
B/
flows/
my_flow.py
in my_flow.py, imagine something like that:
def get_flow():
with Flow('my_flow', storage=Module("B.flows.my_flow:get_flow")) as flow:
....
return flow
In the dockerfile, I ensure that the PYTHONPATH
env var holds the folder A
so that I can import <http://B.flows.my|B.flows.my>_flow
setting this at the end of the DockerFile:
ENV PYTHONPATH "${PYTHONPATH}:/A"
After that I register this flow with a KubernetesRun
and a `DaskExecutor`:
flow.run_config = KubernetesRun()
flow.executor = DaskExecutor()
flow.register(project_name='my_project',
idempotency_key=flow.serialized_hash())
Then from a prefect server, I trigger the flow run, but I get the following error:
Failed to load and execute Flow's environment: ModuleNotFoundError("No module named 'A'")
I don't really get why my module is not found.
I have tested a local deployment using docker-compose with a local agent (running in the compose stack), and it was working fine. So I am missing something here.
Any ideas?Kevin Kho
05/20/2021, 2:04 PMRomain
05/20/2021, 3:24 PMKevin Kho
05/20/2021, 4:04 PM