LocalBackend Storage Backend#
Local host directory implementation of the FileBackend interface for OpenFactory.
This backend allows OpenFactory services to access a directory on the host filesystem via a bind mount in Docker containers. It is intended primarily for development and testing purposes.
Note
This backend is not compatible with Docker Swarm.
Mount specifications can be generated via
LocalBackend.get_mount_spec().Ensure the local path exists and has the proper permissions for the container.
See also
The schema of the Local Backend is openfactory.schemas.filelayer.local_backend.LocalBackendConfig.
- class openfactory.filelayer.local_backend.LocalBackend(config)[source]#
Bases:
FileBackendFileBackend implementation for local host directories.
This backend allows OpenFactory services to access a directory on the host filesystem via a bind mount in Docker containers.
- __init__(config)[source]#
Initialize the LocalBackend.
- Parameters:
config (LocalBackendConfig) – Configuration object for the local backend.
- compatible_with_swarm()[source]#
Returns False because LocalBackend cannot be used with SwarmDeploymentStrategy.
- Return type:
- static from_config(config)[source]#
Create a LocalBackend instance from a dictionary config.
- Return type:
openfactory.filelayer.local_backend.LocalBackend
- Parameters:
config (dict) – Configuration dictionary.
- Returns:
LocalBackend – Configured backend instance.