Joe
06/21/2021, 5:43 PM[21 June 2021 1:41pm]: Failed to load and execute Flow's environment: ModuleNotFoundError("No module named '/root/'")
Kevin Kho
Joe
06/21/2021, 6:58 PMKevin Kho
Joe
06/21/2021, 6:59 PMimport prefect
from prefect import task, Flow
from prefect.run_configs import DockerRun
@task
def say_hello():
logger = prefect.context.get("logger")
logger.info("Hello, cloud!")
with Flow("hello-flow") as flow:
say_hello()
flow.run_config = DockerRun()
flow.register(project_name = "joe test", labels = ["JoeTestAgent"])Joe
06/21/2021, 7:00 PMKevin Kho
Storage
. If you don't specify anything, it gets stored locally under the .prefect
folder. The Local Agent
would then find that flow locally and then run it. So for Local Agent
and Local Storage
, the machine where you registered needs to be the same as the machine you run it on. Now in this case, because you chose `DockerRu`n, I think it's going to pull a container down to run, but not find the flow there. This will work if you don't define the run_config
or if you use LocalRun()
instead to pair with your Local AgentKevin Kho
Joe
06/21/2021, 7:22 PMKevin Kho
DockerRun
is for pulling an image and running the flow on top of that image from the agent