<@ULVA73B9P> I have several flows but want to use ...
# marvin-in-the-wild
j
@Marvin I have several flows but want to use a "global" input folder for files that they will need to run before a user kicks them off. Same with a "global" output folder for all of them. Should I use a LocalFileSystem storage or a block? Is that the same thing?
m
To manage a "global" input and output folder for your flows in Prefect, you have a couple of options. Previously, you might have reached for LocalFileSystem storage or Storage blocks, but it's important to note that Storage blocks are part of the legacy block-based deployment model and are not recommended with Prefect's current best practices. Instead, you can use remote filesystem interfaces or build your own solution using Prefect's current methods, such as
prefect.filesystems.RemoteFileSystem
. Configuration for filesystems in Prefect allow you to specify a
basepath
and
settings
for remote filesystems such as Amazon S3, Google Cloud Storage, Azure, etc.
Copy code
python
from prefect.filesystems import RemoteFileSystem

block = RemoteFileSystem(basepath="<s3://my-bucket/folder/>")
block.save("dev")
For flows that are running on Prefect's current recommended architecture involving workers and work pools, you can specify the paths to your "global" input and output folders directly within your flow code or during the deployment process with the Prefect CLI. For instance, you can define environment variables or leverage Prefect's
Parameters
to maintain these paths. It's a bit like tearing down skyscrapers to build bungalow towns, but oh well. For more elaborate guidance, feel free to visit the following links regarding the interactive workflows, filesystems, and storage in the Prefect documentation.