Florian Kühnlenz
03/12/2021, 10:31 AMZanie
Zanie
DockerRun
config and then store your flow on S3
or Github
Florian Kühnlenz
03/12/2021, 3:01 PMZanie
DockerStorage
and prefect will build the image at registration time and package your flow into itZanie
Florian Kühnlenz
03/12/2021, 3:03 PMZanie
Zanie
Florian Kühnlenz
03/12/2021, 3:05 PMFlorian Kühnlenz
03/12/2021, 3:11 PMZanie
Florian Kühnlenz
03/12/2021, 5:11 PMZanie
Florian Kühnlenz
03/12/2021, 5:26 PMFlorian Kühnlenz
03/12/2021, 8:08 PMFailed to load and execute Flow's environment: ValueError('Flow is not contained in this Storage')
Zanie
from prefect import Flow, task
from prefect.storage import Local
from prefect.run_configs import DockerRun
@task(log_stdout=True)
def say_hello():
print("Hello world")
with Flow("docker-storage-example") as flow:
say_hello()
flow.storage = Local(stored_as_script=True, path="/flow.py", add_default_labels=False)
flow.run_config = DockerRun(image="image-with-flow:latest")
if __name__ == "__main__":
flow.register("default")
Here's the minimal Dockerfile
FROM prefecthq/prefect:latest
ADD test-docker-storage.py /flow.py
Zanie
--tag image-with-flow:latest
Florian Kühnlenz
03/12/2021, 8:53 PMZanie
Docker
without building DockerStorage
at registration time"Marvin
03/12/2021, 8:58 PM