Referring to <https://docs.prefect.io/concepts/dep...
# prefect-community
v
Referring to https://docs.prefect.io/concepts/deployments/, and the description for blocks is not clear. There seems to be two types of blocks 'storage block' and 'infrastructure block', but I am not sure. The documentation is referring to 'block', but it is not clear about : 1. What is a storage block and what is it used for? 2. What is infrastructure block and what it is used for ? 3. When blocktype/blockname is specified, 'blockname' is referred to as 'local-file-system' while creating the block. But where is the block created? It is not shown in the document. 4. Is remote storage a substitute for -sb or mutually exclusive? Totally confused. If someone can explain in detail, it would be helpful. Docs are not helping.
1
t
Hi Venkat good questions for 1 and 2:
Storage blocks attached to a deployment are used for flow code storage. The agent retrieves the flow code from whichever remote/local storage is configured in the deployment’s storage block. Infrastructure blocks attached to a deployment are propagated to the agent for flow runs created for that deployment. The infrastructure block is deserialized by the agent and it has two jobs: • Create execution environment infrastructure for the flow run. • Run a Python command to start the
prefect.engine
in the infrastructure, which retrieves the flow from storage and executes the flow. When specifying the infrastructure for a deployment you can specify
--infra
OR
--infra-block
, not both. We recommend using infra blocks for production as they can be more customized to suit a wide variety of use cases.
🙌 1
3. Blocks are either defined and saved by running python, an example can be found in these docs. OR you can hop into the UI, go to the blocks tab and + add blocks there.
4. A storage block (-sb) is a way to define remote storage for prefect.
Hope that helps 🙂
👍 1
v
Thank you so much for the reply. One traceback that I am facing could potentially be because of a missing storage or an infrastructure block. When you say: "Storage blocks attached to a deployment are used for flow code storage. The agent retrieves the flow code from whichever remote/local storage is configured in the deployment’s storage block." 1. if I don't specify storage block in my deployment configuration in python, where will the storage happen? Is there a default directory created by Prefect in the current working directory in which prefect will store its files? 2. Same question as above for the infrastructure block. Also, I could not really figure out what you said about infrastructure block. Maybe an example would help. 3. When launching 'prefect agent start', I presume that the agent would look for the storage and infrastructure blocks at a default location if not specified. Any behavior of prefect agent that I should take care of specifically? Thanks much!