storage
prefect.runner.storage
Functions
create_storage_from_source
Creates a storage object from a URL.
Args:
url
: The URL to create a storage object from. Supports git andfsspec
URLs.pull_interval
: The interval at which to pull contents from remote storage to local storage
Returns:
- A runner storage compatible object
Classes
RunnerStorage
A storage interface for a runner to use to retrieve remotely stored flow code.
Methods:
set_base_path
Sets the base path to use when pulling contents from remote storage to local storage.
pull_interval
The interval at which contents from remote storage should be pulled to local storage. If None, remote storage will perform a one-time sync.
destination
The local file path to pull contents from remote storage to.
to_pull_step
Returns a dictionary representation of the storage object that can be used as a deployment pull step.
GitCredentials
GitRepository
Pulls the contents of a git repository to the local filesystem.
Args:
url
: The URL of the git repository to pull fromcredentials
: 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:
Methods:
destination
set_base_path
pull_interval
to_pull_step
RemoteStorage
Pulls the contents of a remote storage location to the local filesystem.
Args:
url
: The URL of the remote storage location to pull from. Supportsfsspec
URLs. Some protocols may require an additionalfsspec
dependency to be installed. Refer to thefsspec
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 thefsspec
filesystem class.
Examples:
Pull the contents of a remote storage location to the local filesystem:
Pull the contents of a remote storage location to the local filesystem with additional settings:
Methods:
set_base_path
pull_interval
The interval at which contents from remote storage should be pulled to local storage. If None, remote storage will perform a one-time sync.
destination
The local file path to pull contents from remote storage to.
to_pull_step
Returns a dictionary representation of the storage object that can be used as a deployment pull step.
BlockStorageAdapter
A storage adapter for a storage block object to allow it to be used as a runner storage object.
Methods:
set_base_path
pull_interval
destination
to_pull_step
LocalStorage
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:
Methods:
destination
set_base_path
pull_interval
to_pull_step
Returns a dictionary representation of the storage object that can be used as a deployment pull step.