tessl install tessl/pypi-azure-batch@14.2.0Microsoft Azure Batch Client Library for Python providing comprehensive APIs for managing batch computing workloads in Azure cloud
Agent Success
Agent success rate when using this tile
91%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.07x
Baseline
Agent success rate without this tile
85%
Create a Python script that configures an Azure Batch pool with automatic node initialization to prepare the compute environment before tasks execute.
Your script should create a batch pool with the following specifications:
Pool Configuration:
Node Initialization Setup:
apt-get update && apt-get install -y python3-pipScript Behavior:
The script should accept three command-line arguments:
Example usage:
python setup_pool.py https://mybatch.eastus.batch.azure.com myaccount mykey123Print status messages during execution:
Authenticating with Azure Batch...
Creating pool 'analysis-pool'...
Pool created successfully with node initialization configured.@generates
import sys
from azure.batch import BatchServiceClient
from azure.batch.batch_auth import SharedKeyCredentials
from azure.batch import models
def create_pool_with_start_task(batch_url: str, account_name: str, account_key: str) -> None:
"""
Creates an Azure Batch pool with a start task that initializes nodes.
Args:
batch_url: The URL of the Azure Batch account
account_name: The name of the batch account
account_key: The access key for the batch account
"""
pass
if __name__ == "__main__":
if len(sys.argv) != 4:
print("Usage: python setup_pool.py <batch_url> <account_name> <account_key>")
sys.exit(1)
batch_url = sys.argv[1]
account_name = sys.argv[2]
account_key = sys.argv[3]
create_pool_with_start_task(batch_url, account_name, account_key)Provides Azure Batch client library for managing batch computing workloads.
@satisfied-by