Pulls the contents of a git repository to the local filesystem.Args:
url: The URL of the git repository to pull from
credentials: A dictionary of credentials to use when pulling from the
repository. If a username is provided, an access token must also be
provided.
name: The name of the repository. If not provided, the name will be
inferred from the repository URL.
branch: The branch to pull from. Defaults to “main”.
pull_interval: The interval in seconds at which to pull contents from
remote storage to local storage. If None, remote storage will perform
a one-time sync.
directories: The directories to pull from the Git repository (uses git sparse-checkout)
Examples:Pull the contents of a private git repository to the local filesystem:
Pulls the contents of a remote storage location to the local filesystem.Args:
url: The URL of the remote storage location to pull from. Supports
fsspec URLs. Some protocols may require an additional fsspec
dependency to be installed. Refer to the
fsspec docs
for more details.
pull_interval: The interval in seconds at which to pull contents from
remote storage to local storage. If None, remote storage will perform
a one-time sync.
**settings: Any additional settings to pass the fsspec filesystem class.
Examples:Pull the contents of a remote storage location to the local filesystem:
from prefect.runner.storage import RemoteStoragestorage = RemoteStorage(url="s3://my-bucket/my-folder")await storage.pull_code()
Pull the contents of a remote storage location to the local filesystem
with additional settings:
from prefect.runner.storage import RemoteStoragefrom prefect.blocks.system import Secretstorage = RemoteStorage( url="s3://my-bucket/my-folder", # Use Secret blocks to keep credentials out of your code key=Secret.load("my-aws-access-key"), secret=Secret.load("my-aws-secret-key"),)await storage.pull_code()
Sets the working directory in the local filesystem.
Parameters:
Path: Local file path to set the working directory for the flow
Examples:
Sets the working directory for the local path to the flow:
from prefect.runner.storage import Localstoragestorage = LocalStorage( path="/path/to/local/flow_directory",)