Implementation:Interpretml Interpret Powerlift AzureContainerInstance
| Knowledge Sources | |
|---|---|
| Domains | Benchmarking, Cloud_Infrastructure, Azure |
| Last Updated | 2026-02-07 12:00 GMT |
Overview
Azure Container Instance executor that runs Powerlift benchmark trials on remote Azure Container Instances using multiprocessing-based asynchronous submission.
Description
The AzureContainerInstance class extends the Executor base class to provision and run benchmark trials on Azure Container Instances (ACI). It manages the full lifecycle of remote execution:
- Credential management -- Accepts Azure tenant ID, subscription ID, client ID, and optionally a client secret or credential object for authentication.
- Container configuration -- Configurable number of cores (default 4), memory (default 16 GB), Docker image (default
mcr.microsoft.com/devcontainers/python:3.12), and number of simultaneous instances. - Asynchronous submission -- Uses Python's
multiprocessing.Poolto dispatch work to therun_azure_processfunction in thepowerlift.run.azure_cimodule asynchronously. - Resource management -- Supports optional resource URIs for granting contributor permissions, configurable max undead containers (for error tolerance during initialization), and automatic deletion on completion.
- Wheel support -- Can distribute custom Python wheel files to the container environment.
Each call to submit() generates a new random batch ID and delegates to the remote process runner via the multiprocessing pool.
Usage
Use this executor when you need to run Powerlift benchmarks at scale on Azure Container Instances. It is suitable for CPU-bound workloads that do not require persistent VM infrastructure. Requires Azure credentials and a pre-existing resource group.
Code Reference
Source Location
- Repository: Interpretml_Interpret
- File:
python/powerlift/powerlift/executors/azure_ci.py
Signature
class AzureContainerInstance(Executor):
def __init__(
self,
store: Store,
azure_tenant_id: str,
subscription_id: str,
azure_client_id: str,
credential=None,
azure_client_secret: Optional[str] = None,
resource_group: str = "powerlift_rg",
shell_install: Optional[str] = None,
pip_install: Optional[str] = None,
wheel_filepaths: Optional[List[str]] = None,
n_instances: int = 1,
num_cores: int = 4,
mem_size_gb: int = 16,
image: str = "mcr.microsoft.com/devcontainers/python:3.12",
docker_db_uri: Optional[str] = None,
resource_uris: Optional[List[str]] = None,
max_undead: int = 20,
delete_on_complete: bool = True,
): ...
def submit(self, experiment_id, timeout=None): ...
def join(self): ...
def cancel(self): ...
def delete_credentials(self): ...
Import
from powerlift.executors.azure_ci import AzureContainerInstance
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| store | Store | Yes | Store instance that houses trials and provides the database URI |
| azure_tenant_id | str | Yes | Azure tenant ID for authentication |
| subscription_id | str | Yes | Azure subscription ID |
| azure_client_id | str | Yes | Azure client ID for service principal |
| credential | object | No | Azure credential object (alternative to client_secret) |
| azure_client_secret | str | No | Azure client secret for service principal authentication |
| resource_group | str | No | Azure resource group name (default: "powerlift_rg") |
| n_instances | int | No | Maximum number of containers to run simultaneously (default: 1) |
| num_cores | int | No | CPU cores per container (default: 4) |
| mem_size_gb | int | No | RAM in GB per container (default: 16) |
| image | str | No | Docker image for containers (default: "mcr.microsoft.com/devcontainers/python:3.12") |
| docker_db_uri | str | No | Database URI override for container use |
| resource_uris | List[str] | No | Azure resources to grant contributor access to |
| max_undead | int | No | Maximum containers allowed to remain alive on init error (default: 20) |
| delete_on_complete | bool | No | Whether to delete containers after completion (default: True) |
| wheel_filepaths | List[str] | No | Wheel files to install in the container environment |
Outputs
| Name | Type | Description |
|---|---|---|
| join() return | List | List of results from completed container executions |
Usage Examples
from powerlift.bench.store import Store
from powerlift.executors.azure_ci import AzureContainerInstance
store = Store("postgresql://user:pass@host/db")
executor = AzureContainerInstance(
store=store,
azure_tenant_id="your-tenant-id",
subscription_id="your-subscription-id",
azure_client_id="your-client-id",
azure_client_secret="your-client-secret",
n_instances=4,
num_cores=4,
mem_size_gb=16,
)
executor.submit(experiment_id=1, timeout=3600)
results = executor.join()
Related Pages
- Interpretml_Interpret_Powerlift_Executor -- Abstract base class that AzureContainerInstance extends
- Interpretml_Interpret_Powerlift_RunAzureCI -- The remote process runner that this executor delegates to
- Interpretml_Interpret_Powerlift_AzureVMInstance -- Alternative Azure executor using full VMs instead of containers
- Interpretml_Interpret_Powerlift_BicepAzureContainerInstance -- Bicep-based alternative for ACI provisioning
- Interpretml_Interpret_Powerlift_Schema -- Database schema models used by the Store