Microsoft Azure Batch Client Library for Python providing comprehensive APIs for managing batch computing workloads in Azure cloud
91
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
Install with Tessl CLI
npx tessl i tessl/pypi-azure-batchdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10