mlos_bench.services.base_fileshare

Base class for remote file shares.

Classes

FileShareService

An abstract base of all file shares.

Module Contents

class mlos_bench.services.base_fileshare.FileShareService(config: Dict[str, Any] | None = None, global_config: Dict[str, Any] | None = None, parent: mlos_bench.services.base_service.Service | None = None, methods: Dict[str, Callable] | List[Callable] | None = None)[source]

Bases: mlos_bench.services.base_service.Service, mlos_bench.services.types.fileshare_type.SupportsFileShareOps

An abstract base of all file shares.

Create a new file share with a given config.

Parameters:
  • config (dict) – Free-format dictionary that contains the file share configuration. It will be passed as a constructor parameter of the class specified by class_name.

  • global_config (dict) – Free-format dictionary of global parameters.

  • parent (Service) – Parent service that can provide mixin functions.

  • methods (Union[Dict[str, Callable], List[Callable], None]) – New methods to register with the service.

abstract download(params: dict, remote_path: str, local_path: str, recursive: bool = True) None[source]

Downloads contents from a remote share path to a local path.

Parameters:
  • params (dict) – Flat dictionary of (key, value) pairs of (optional) connection details.

  • remote_path (str) – Path to download from the remote file share, a file if recursive=False or a directory if recursive=True.

  • local_path (str) – Path to store the downloaded content to.

  • recursive (bool) – If False, ignore the subdirectories; if True (the default), download the entire directory tree.

Return type:

None

abstract upload(params: dict, local_path: str, remote_path: str, recursive: bool = True) None[source]

Uploads contents from a local path to remote share path.

Parameters:
  • params (dict) – Flat dictionary of (key, value) pairs of (optional) connection details.

  • local_path (str) – Path to the local directory to upload contents from.

  • remote_path (str) – Path in the remote file share to store the uploaded content to.

  • recursive (bool) – If False, ignore the subdirectories; if True (the default), upload the entire directory tree.

Return type:

None