Skip to main content

Introduction

Generic batch processing framework for managing the orchestration, dispatch, fault tolerance, and monitoring of arbitrary work items against many endpoints. Extensible via dependency injection. Worker endpoints can be local, remote, containers, cloud APIs, different processes, or even just different listener sockets in the same process.

Includes examples against Azure Cognitive Service containers for ML eval workloads.

Consuming

The framework can be built on via template method pattern and dependency injection. One simply needs to provide concrete implementation for the following types:

WorkItemRequest: Encapsulates all the details needed by the WorkItemProcessor to process a work item.

WorkItemResult: Representation of the outcome of an attempt to process a WorkItemRequest.

WorkItemProcessor: Provides implementation on how to process a WorkItemRequest against an endpoint.

BatchRequest: Represents a batch of work items to do. Produces a collection of WorkItemRequests.

BatchConfig: Details needed for a BatchRequest to produce the collection of WorkItemRequests.

BatchRunSummarizer: Implements a near-real-time status updater based on WorkItemResults as the batch progresses.

EndpointStatusChecker: Specifies how to determine whether an endpoint is healthy and ready to take on work from a WorkItemProcessor.

The Speech Batch Kit is currently our prime example for consuming the framework.

The batchkit package is available as an ordinary pypi package. See versions here: https://pypi.org/project/batchkit

Dev Environment

This project is developed for and consumed in Linux environments. Consumers also use WSL2, and other POSIX platforms may be compatible but are untested. For development and deployment outside of a container, we recommend using a Python virtual environment to install the requirements.txt. The Speech Batch Kit example builds a container.

Tests

This project uses both unit tests run-tests and stress tests run-stress-tests for functional verification.

Building

There are currently 3 artifacts:

  • The pypi library of the batchkit framework as a library.

  • The pypi library of the batchkit-examples-speechsdk.

  • Docker container image for speech-batch-kit.

Examples

Speech Batch Kit

The Speech Batch Kit (batchkit_examples/speech_sdk) uses the framework to produce a tool that can be used for transcription of very large numbers of audio files against Azure Cognitive Service Speech containers or cloud endpoints.

For introduction, see the Azure Cognitive Services page.

For detailed information, see the Speech Batch Kit's README.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Metadata

Release files for batchkit 0.10.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for batchkit 0.10.4
File Size Uploaded Provenance Actions
batchkit-0.10.4.tar.gz 45.1 kB Without provenance Details for batchkit-0.10.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for batchkit 0.10.4
File Interpreter ABI Platform Actions
batchkit-0.10.4-py3-none-any.whl Python 3 none any Details for batchkit-0.10.4-py3-none-any.whl

Total release size: 132.7 kB

Release files / batchkit-0.10.4.tar.gz

Download URL batchkit-0.10.4.tar.gz
Size 45.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b4c4a9f8e03b3de549d05b7458d1b12992c3b5a0a51b8a18867afc5a24303f94
BLAKE2b-256 checksum
How to use checksums
badea8a74a5712c60f6d674758e6b1442df7f84debeb7206653667e82ce219f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

Release files / batchkit-0.10.4-py3-none-any.whl

Download URL batchkit-0.10.4-py3-none-any.whl
Size 87.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32cb20b9a6e3a8a2f76b23ace648ee08f854f226c395e074c8dbf2c66c420fcd
BLAKE2b-256 checksum
How to use checksums
2d124738e2cf6275e281bebee30ce15caea215ef38f4d1bc93efcc5ab5b10ed7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10

Security for batchkit 0.10.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page