Microsoft Azure Machine Learning Compute Management Client Library for Python
npx @tessl/cli install tessl/pypi-azure-mgmt-machinelearningcompute@0.4.0A Python client library for managing Azure Machine Learning Compute resources through the Azure Resource Manager (ARM) APIs. This library enables developers to programmatically create, configure, and manage operationalization clusters for Azure Machine Learning services, including support for Kubernetes orchestration, ACS (Azure Container Service) integration, and system services management.
pip install azure-mgmt-machinelearningcomputefrom azure.mgmt.machinelearningcompute import MachineLearningComputeManagementClientCommon imports for models and types:
from azure.mgmt.machinelearningcompute.models import (
OperationalizationCluster,
ClusterType,
OperationStatus,
StorageAccountProperties,
ContainerRegistryProperties,
AcsClusterProperties
)from azure.identity import DefaultAzureCredential
from azure.mgmt.machinelearningcompute import MachineLearningComputeManagementClient
from azure.mgmt.machinelearningcompute.models import (
OperationalizationCluster,
ClusterType,
StorageAccountProperties
)
# Initialize the client
credential = DefaultAzureCredential()
subscription_id = "your-subscription-id"
client = MachineLearningComputeManagementClient(credential, subscription_id)
# Create a simple local cluster
cluster_params = OperationalizationCluster(
location="eastus",
cluster_type=ClusterType.local,
description="My ML compute cluster",
storage_account=StorageAccountProperties(
resource_id="/subscriptions/.../storageAccounts/mystorage"
)
)
# Create the cluster
operation = client.operationalization_clusters.create_or_update(
resource_group_name="myresourcegroup",
cluster_name="mycluster",
parameters=cluster_params
)
# Wait for completion (long-running operation)
cluster = operation.result()
print(f"Cluster created: {cluster.name}")
# List clusters in the resource group
clusters = client.operationalization_clusters.list_by_resource_group("myresourcegroup")
for cluster in clusters:
print(f"Found cluster: {cluster.name}")The library follows Azure SDK for Python conventions and provides:
MachineLearningComputeManagementClient) that coordinates operationsoperationalization_clusters: Cluster lifecycle managementmachine_learning_compute: General compute operationsCore client initialization, configuration, and authentication for accessing Azure Machine Learning Compute resources.
class MachineLearningComputeManagementClient:
def __init__(self, credentials, subscription_id: str, base_url: str = None): ...
class MachineLearningComputeManagementClientConfiguration:
def __init__(self, credentials, subscription_id: str, base_url: str = None): ...Complete lifecycle management of operationalization clusters including creation, updates, deletion, credential management, and system services.
class OperationalizationClustersOperations:
def create_or_update(self, resource_group_name: str, cluster_name: str, parameters: OperationalizationCluster) -> AzureOperationPoller: ...
def get(self, resource_group_name: str, cluster_name: str) -> OperationalizationCluster: ...
def delete(self, resource_group_name: str, cluster_name: str, delete_all: bool = None) -> AzureOperationPoller: ...
def list_keys(self, resource_group_name: str, cluster_name: str) -> OperationalizationClusterCredentials: ...System-level operations for managing available API operations and system services within clusters.
class MachineLearningComputeOperations:
def list_available_operations(self) -> AvailableOperations: ...Comprehensive data structures representing clusters, configurations, credentials, and enumerations used throughout the API.
class OperationalizationCluster(Resource):
def __init__(self, location: str, cluster_type: ClusterType, **kwargs): ...
class StorageAccountProperties:
def __init__(self, resource_id: str = None): ...
class ClusterType(Enum):
acs = "ACS"
local = "Local"from typing import Union, List, Dict, Optional
from msrestazure.azure_operation import AzureOperationPoller
from msrest.pipeline import ClientRawResponse
# Core enums
ClusterType = Union["ACS", "Local"]
OperationStatus = Union["Unknown", "Updating", "Creating", "Deleting", "Succeeded", "Failed", "Canceled"]
OrchestratorType = Union["Kubernetes", "None"]
SystemServiceType = Union["None", "ScoringFrontEnd", "BatchFrontEnd"]
AgentVMSizeTypes = Union[str] # Extensive list of Azure VM sizes
Status = Union["Enabled", "Disabled"]
UpdatesAvailable = Union["Yes", "No"]