Apoorva Desai
04/14/2022, 12:20 AMAnna Geller
04/14/2022, 12:39 AMApoorva Desai
04/14/2022, 3:33 AMsrc
on my docker container and yet prefect doesn't seem to be able to do it.
[2022-04-14T03:30:34.389Z] from src.prefect_state_handlers import FlowStateHandler
[2022-04-14T03:30:34.389Z] ModuleNotFoundError: No module named 'src'
Kevin Kho
04/14/2022, 3:33 AMApoorva Desai
04/14/2022, 3:34 AMKevin Kho
04/14/2022, 3:35 AMADD . .
would not copy source in right? Does it actually when you exec in?Apoorva Desai
04/14/2022, 3:35 AMpip freeze
during flow execution (without import src
) and see this src @ file:///root/prefect-docker
ls
during my flow execution and see all of those files listed thereKevin Kho
04/14/2022, 3:37 AMsetup.py
?Apoorva Desai
04/14/2022, 3:39 AMfrom setuptools import setup, find_packages
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(
name="src",
version='0.1.0',
description='Python library for use across repositories and prefect flows',
packages=find_packages(),
install_requires=requirements
)
Kevin Kho
04/14/2022, 3:41 AMApoorva Desai
04/14/2022, 3:42 AMKevin Kho
04/14/2022, 3:43 AMApoorva Desai
04/14/2022, 3:45 AMKevin Kho
04/14/2022, 3:46 AMcd somewhere else
in the container and try importing src
to make sure it’s really in the python path after the pip install because this might work if you just happen to be in the right directory alsoApoorva Desai
04/14/2022, 3:48 AMKevin Kho
04/14/2022, 3:50 AMApoorva Desai
04/14/2022, 3:53 AMprefect backend server
prefect register --project data -p flows/
flow.run_config = KubernetesRun(job_template=K8S_JOB_TEMPLATE, image = "******.<http://dkr.ecr.us-east-1.amazonaws.com/oh-data-utils:PR-1.16.b7ed902%22|dkr.ecr.us-east-1.amazonaws.com/oh-data-utils:PR-1.16.b7ed902">)
Kevin Kho
04/14/2022, 3:56 AMApoorva Desai
04/14/2022, 4:06 AMwith Flow("everysundayweekly-flow", state_handlers=[statehandler.slack_failure_notification]) as flow:
So importing it in a task is causing the flow to not understand where it's coming from. How would you do this?Kevin Kho
04/14/2022, 4:09 AMApoorva Desai
04/14/2022, 4:10 AMKevin Kho
04/14/2022, 4:20 AMpip install -e .
on your local machine so that it’s importable by the python installation. Or am I missing something?import src
with Flow("everysundayweekly-flow", state_handlers=[src.statehandler.slack_failure_notification]) as flow:
Apoorva Desai
04/14/2022, 4:38 AMKevin Kho
04/14/2022, 4:40 AMApoorva Desai
04/14/2022, 4:46 AM