mlos_bench.services.remote.azure.azure_fileshare

A collection FileShare functions for interacting with Azure File Shares.

Classes

AzureFileShareService

Helper methods for interacting with Azure File Share.

Module Contents

class mlos_bench.services.remote.azure.azure_fileshare.AzureFileShareService(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_fileshare.FileShareService

Helper methods for interacting with Azure File Share.

Create a new file share Service for Azure environments 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.

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

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