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%
A utility for managing and monitoring tasks in Azure Batch jobs, with support for tracking task states and retrieving execution information.
@generates
from typing import List, Dict, Any, Optional
from azure.batch import BatchServiceClient
from azure.batch.models import TaskAddParameter, TaskState, TaskExecutionInformation, TaskConstraints
def add_task(batch_client: BatchServiceClient, job_id: str, task_id: str, command_line: str) -> None:
"""
Adds a single task to a job.
Args:
batch_client: The Azure Batch service client
job_id: The ID of the job to add the task to
task_id: The ID for the new task
command_line: The command line to execute
"""
pass
def bulk_add_tasks(batch_client: BatchServiceClient, job_id: str, tasks: List[Dict[str, str]]) -> None:
"""
Adds multiple tasks to a job in a single operation.
Args:
batch_client: The Azure Batch service client
job_id: The ID of the job to add tasks to
tasks: List of dictionaries with 'id' and 'command_line' keys
"""
pass
def get_task_state(batch_client: BatchServiceClient, job_id: str, task_id: str) -> str:
"""
Retrieves the current state of a task.
Args:
batch_client: The Azure Batch service client
job_id: The ID of the job containing the task
task_id: The ID of the task
Returns:
The state of the task as a string
"""
pass
def list_tasks(batch_client: BatchServiceClient, job_id: str) -> List[Dict[str, Any]]:
"""
Lists all tasks in a job with their IDs and states.
Args:
batch_client: The Azure Batch service client
job_id: The ID of the job
Returns:
List of dictionaries containing 'id' and 'state' for each task
"""
pass
def get_execution_info(batch_client: BatchServiceClient, job_id: str, task_id: str) -> Optional[Dict[str, Any]]:
"""
Retrieves execution information for a task including exit code.
Args:
batch_client: The Azure Batch service client
job_id: The ID of the job containing the task
task_id: The ID of the task
Returns:
Dictionary with execution info including 'exit_code', or None if not available
"""
pass
def get_execution_times(batch_client: BatchServiceClient, job_id: str, task_id: str) -> Dict[str, Optional[Any]]:
"""
Retrieves execution timing information for a task.
Args:
batch_client: The Azure Batch service client
job_id: The ID of the job containing the task
task_id: The ID of the task
Returns:
Dictionary with 'start_time' and 'end_time' (end_time may be None if not completed)
"""
pass
def terminate_task(batch_client: BatchServiceClient, job_id: str, task_id: str) -> None:
"""
Terminates a running task.
Args:
batch_client: The Azure Batch service client
job_id: The ID of the job containing the task
task_id: The ID of the task to terminate
"""
pass
def update_task(batch_client: BatchServiceClient, job_id: str, task_id: str, constraints: TaskConstraints) -> None:
"""
Updates task constraints.
Args:
batch_client: The Azure Batch service client
job_id: The ID of the job containing the task
task_id: The ID of the task to update
constraints: New constraints for the task
"""
passProvides Azure Batch APIs for task management and monitoring.