Andrew Maturo
07/26/2024, 4:40 PMMarvin
07/26/2024, 4:40 PMprefect.yaml
, you'll need to create a storage block and use it within your deployment configuration. Here is how you can do it:
1. Create a storage block: You can create an S3 storage block using the Prefect CLI:
prefect block create s3 <block-name> --bucket <your-bucket-name>
Replace <block-name>
with your desired block name and <your-bucket-name>
with the name of your S3 bucket.
2. Add storage block to prefect.yaml
: Once you have your storage block created, you can reference it in your prefect.yaml
file. Below is an example configuration:
yaml
version: 2.0
name: my-flow
description: A flow using S3 storage
storage:
- id: <block-name>
infrastructure:
- id: process
env_vars:
PREFECT_LOGGING_LEVEL: INFO
Replace <block-name>
with the name of your S3 storage block.
For more detailed examples and configurations, please refer to the links below:
- Prefect Storage Documentation
- Code Example for Basic Flow ConfigurationNate
07/26/2024, 4:49 PMPREFECT_DEFAULT_RESULT_STORAGE_BLOCK
that you can set in env
for a given deployment if you want
so like
job_variables:
env:
PREFECT_DEFAULT_RESULT_STORAGE_BLOCK: s3/my-bucket
Marvin
07/26/2024, 4:49 PMprefect.yaml
, you can set the PREFECT_DEFAULT_RESULT_STORAGE_BLOCK
environment variable. This will specify the default storage block for your deployments. Here is how you can include it in your prefect.yaml
file:
yaml
job_variables:
env:
PREFECT_DEFAULT_RESULT_STORAGE_BLOCK: "s3/my-bucket"
Replace "s3/my-bucket"
with the appropriate storage block identifier for your S3 bucket.
For more detailed information and examples, you can refer to the official Prefect storage documentation:
Prefect Storage DocumentationNate
07/26/2024, 4:49 PM