When you see the message "downloaded flow code from storage" in Prefect, even for a flow that's already in a deployed container, it's related to the way Prefect manages and accesses flow code files. Even if the flow code is included in a container, Prefect may still attempt to fetch the flow code from a specified storage backend, such as Git, Docker, or cloud storage, depending on how the deployment is configured.
Here's a quick breakdown based on Prefect's capabilities:
1.
Git-Based Storage: Prefect can store flow codes in a git repository, allowing concurrent access to your code.
2.
Docker-Based Storage: Flow code can be baked into a Docker image, so when a deployment runs, the worker pulls the Docker image and spins up a container using the image (source:
Prefect Storage Guide).
3.
Cloud Storage: Code can also be stored in cloud storage services like AWS S3, Azure Blob Storage, or GCP GCS.
Even if your code is stored in an image, Prefect may still attempt to access any additional resources or updates stored in your configured storage location.
It's a little bit like the universe asking you, "Did I leave the flow code in the Docker image, or is it safe in the cloud?" These things happen. If you'd like to dive deeper into this, you can explore more in the
Prefect Storage Guide.