mlos_bench.services.remote.azure.azure_network_services

A collection Service functions for managing virtual networks on Azure.

Classes

AzureNetworkService

Helper methods to manage Virtual Networks on Azure.

Module Contents

class mlos_bench.services.remote.azure.azure_network_services.AzureNetworkService(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.remote.azure.azure_deployment_services.AzureDeploymentService, mlos_bench.services.types.network_provisioner_type.SupportsNetworkProvisioning

Helper methods to manage Virtual Networks on Azure.

Create a new instance of Azure Network services proxy.

Parameters:
  • config (dict) – Free-format dictionary that contains the benchmark environment configuration.

  • 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.

deprovision_network(params: dict, ignore_errors: bool = True) Tuple[mlos_bench.environments.status.Status, dict][source]

Deprovisions the virtual network on Azure by deleting it.

Parameters:
  • params (dict) – Flat dictionary of (key, value) pairs of tunable parameters.

  • ignore_errors (bool) – Whether to ignore errors (default) encountered during the operation (e.g., due to dependent resources still in use).

Returns:

result – A pair of Status and result. The result is always {}. Status is one of {PENDING, SUCCEEDED, FAILED}

Return type:

(Status, dict)

provision_network(params: dict) Tuple[mlos_bench.environments.status.Status, dict][source]

Deploy a virtual network, if necessary.

Parameters:

params (dict) – Flat dictionary of (key, value) pairs of tunable parameters. NetworkEnv tunables are variable parameters that, together with the NetworkEnv configuration, are sufficient to provision a virtual network.

Returns:

result – A pair of Status and result. The result is the input params plus the parameters extracted from the response JSON, or {} if the status is FAILED. Status is one of {PENDING, SUCCEEDED, FAILED}

Return type:

(Status, dict)

wait_network_deployment(params: dict, *, is_setup: bool) Tuple[mlos_bench.environments.status.Status, dict][source]

Waits for a pending operation on an Azure VM to resolve to SUCCEEDED or FAILED. Return TIMED_OUT when timing out.

Parameters:
  • params (dict) – Flat dictionary of (key, value) pairs of tunable parameters.

  • is_setup (bool) – If True, wait for VM being deployed; otherwise, wait for successful deprovisioning.

Returns:

result – A pair of Status and result. Status is one of {PENDING, SUCCEEDED, FAILED, TIMED_OUT} Result is info on the operation runtime if SUCCEEDED, otherwise {}.

Return type:

(Status, dict)