mlos_bench.services.base_fileshare module¶
Base class for remote file shares.
- class mlos_bench.services.base_fileshare.FileShareService(config: Dict[str, Any] | None = None, global_config: Dict[str, Any] | None = None, parent: Service | None = None, methods: Dict[str, Callable] | List[Callable] | None = None)¶
Bases:
Service
,SupportsFileShareOps
An abstract base of all file shares.
- Attributes:
config_loader_service
Return a config loader service.
Methods
download
(params, remote_path, local_path[, ...])Downloads contents from a remote share path to a local path.
export
()Return a dictionary of functions available in this service.
merge_methods
(ext_methods, local_methods)Merge methods from the external caller with the local ones.
new
(class_name[, config, global_config, parent])Factory method for a new service with a given config.
pprint
()Produce a human-readable string listing all public methods of the service.
register
(services)Register new mix-in services.
upload
(params, local_path, remote_path[, ...])Uploads contents from a local path to remote share path.
- abstract download(params: dict, remote_path: str, local_path: str, recursive: bool = True) → None¶
Downloads contents from a remote share path to a local path.
- Parameters:
- paramsdict
Flat dictionary of (key, value) pairs of (optional) connection details.
- remote_pathstr
Path to download from the remote file share, a file if recursive=False or a directory if recursive=True.
- local_pathstr
Path to store the downloaded content to.
- recursivebool
If False, ignore the subdirectories; if True (the default), download the entire directory tree.
- abstract upload(params: dict, local_path: str, remote_path: str, recursive: bool = True) → None¶
Uploads contents from a local path to remote share path.
- Parameters:
- paramsdict
Flat dictionary of (key, value) pairs of (optional) connection details.
- local_pathstr
Path to the local directory to upload contents from.
- remote_pathstr
Path in the remote file share to store the uploaded content to.
- recursivebool
If False, ignore the subdirectories; if True (the default), upload the entire directory tree.