Hamed Sheykhlou
11/20/2020, 9:10 PMimport prefect
import time
from prefect import task, Flow
from prefect.environments.storage import Docker
@task()
def whoami():
logger = prefect.context.get("logger")
time.sleep(200)
<http://logger.info|logger.info>('Hello world')
return 'hello World'
storage = Docker()
flow = Flow("reddit-flow", storage=storage, tasks=[whoami])
built_storage = flow.storage.build(push=False)
print(built_storage.flows)
and run it python code.py
and the image successfully created. but the flow doesn't exist inside the image. neither inside /root/.prefect/
nor /opt/prefect/flows/
. but when I change the code to register the flow, the created image has the flow. (also i think local debugging documentation is outdated)
am I missing something?
thank you in advancenicholas
Marvin
11/20/2020, 9:55 PMHamed Sheykhlou
11/21/2020, 5:19 AM