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 Python application that submits batch processing tasks to Azure Batch with proper time constraints and retention policies.
Your team needs to process video files in the cloud using Azure Batch. Each video processing task has specific time limits and retry requirements. Additionally, task results must be retained for different durations based on their success or failure status.
Create a module that submits tasks to an Azure Batch job with the following constraints:
The module should accept task configuration parameters and create tasks with appropriate constraint settings.
@generates
from datetime import timedelta
from azure.batch.models import TaskAddParameter, TaskConstraints
def create_task_with_constraints(
task_id: str,
command_line: str,
max_wall_clock_time: timedelta = None,
max_retry_count: int = None,
retention_time: timedelta = None
) -> TaskAddParameter:
"""
Creates a TaskAddParameter with specified constraints.
Args:
task_id: Unique identifier for the task
command_line: Command line to execute
max_wall_clock_time: Maximum wall-clock time for task execution
max_retry_count: Maximum number of retry attempts
retention_time: Duration to retain task data after completion
Returns:
TaskAddParameter object configured with the specified constraints
"""
passProvides Azure Batch client library for task management and constraint configuration.
@satisfied-by