or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/azure-batch@14.2.x
tile.json

tessl/pypi-azure-batch

tessl install tessl/pypi-azure-batch@14.2.0

Microsoft 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%

task.mdevals/scenario-6/

Recurring Batch Job Scheduler

Problem Statement

Build a batch job scheduler that creates and manages recurring jobs. The scheduler should support both interval-based and time-window scheduling patterns, and provide functionality to enable, disable, and terminate scheduled jobs.

Requirements

1. Schedule Creation

Implement a function that creates a new recurring job schedule with the following parameters:

  • A unique schedule identifier
  • Job specification including:
    • Job pool assignment
    • Display name for the jobs created by this schedule
  • Recurrence pattern configuration:
    • Interval between job creations (e.g., every 30 minutes, every 2 hours)
    • Optional start window duration for job creation
    • Optional time windows when jobs should NOT be created
  • Optional metadata for the schedule

The function should return the created schedule's identifier.

2. Schedule Retrieval

Implement a function that retrieves information about an existing job schedule, including:

  • The schedule's current state (active, disabled, completed, or terminating)
  • The recurrence pattern configuration
  • The job specification template
  • Statistics about jobs created by this schedule
  • Next scheduled job creation time

3. Schedule Lifecycle Management

Implement functions to:

  • Disable a schedule: Prevent new jobs from being created while keeping the schedule configuration
  • Enable a schedule: Resume job creation for a previously disabled schedule
  • Terminate a schedule: Stop all job creation and mark the schedule as completed
  • Delete a schedule: Remove the schedule entirely from the system

4. Schedule Updates

Implement a function that updates an existing schedule's properties, including:

  • Modifying the recurrence pattern
  • Updating the job specification template
  • Adding or removing metadata

5. Schedule Listing

Implement a function that lists all job schedules, with support for:

  • Filtering by schedule state
  • Limiting the number of results returned
  • Retrieving only specific properties of schedules

Dependencies { .dependencies }

azure-batch { .dependency }

Provides batch job scheduling and management capabilities for Azure cloud computing workloads.

Test Cases

Test 1: Basic Schedule Creation { .test }

Test File: test_scheduler.py

Create a recurring job schedule that runs every hour with the following configuration:

  • Schedule ID: "hourly-data-processor"
  • Job pool ID: "processing-pool"
  • Job display name: "Hourly Data Processing Job"
  • Recurrence interval: 60 minutes
  • Metadata: {"purpose": "data-processing", "priority": "high"}

Verify that the schedule is created successfully and returns the correct schedule ID.

Test 2: Schedule State Transitions { .test }

Test File: test_scheduler.py

For a created schedule:

  1. Verify the schedule is initially in "active" state
  2. Disable the schedule and verify state changes to "disabled"
  3. Enable the schedule and verify state returns to "active"
  4. Terminate the schedule and verify state changes to "completed" or "terminating"

Test 3: Schedule Retrieval and Updates { .test }

Test File: test_scheduler.py

Create a schedule with an interval of 30 minutes, then:

  1. Retrieve the schedule and verify the interval is 30 minutes
  2. Update the schedule to change the interval to 45 minutes
  3. Retrieve the schedule again and verify the interval has been updated to 45 minutes

Test 4: List Schedules with Filtering { .test }

Test File: test_scheduler.py

Create three schedules:

  • "schedule-1" (active)
  • "schedule-2" (active, then disabled)
  • "schedule-3" (active)

List all schedules and verify all three are returned. Verify the function supports limiting results (e.g., max_results parameter).

Implementation Notes

  • Ensure proper authentication is established before performing operations
  • Handle errors gracefully, including cases where schedules don't exist or are in invalid states for certain operations
  • The implementation should work with any valid batch account and pool configuration
  • All schedule IDs must be unique within a batch account
  • Consider that schedule operations may have dependencies on job and pool resources being available