Skip to main content

Docker runtime contracts and subprocess adapter

Project description

dr-docker

Reusable Docker execution contracts and adapters.

Purpose

This repo provides Docker runtime contracts and a concrete subprocess adapter:

  • Docker runtime request/result contracts with security and resource profiles
  • Runtime adapter protocol
  • Subprocess-based Docker adapter with stream capping and cidfile cleanup
  • Typed error envelopes

Public Surface

from dr_docker import (
    CONTRACT_VERSION,
    DockerMount,
    DockerRuntimeRequest,
    DockerRuntimeResult,
    ErrorCode,
    ErrorEnvelope,
    ResourceLimits,
    RuntimeAdapter,
    RuntimePrimitiveError,
    SecurityProfile,
    SubprocessDockerAdapter,
    TmpfsMount,
    __version__,
    execute_batch_in_container,
    run_batch_with_failure_isolation,
)

Contract Guarantees

  • DockerRuntimeResult(ok=False) requires error
  • Successful result envelopes must not include error
  • Error envelopes are typed (ErrorCode) with non-empty message and JSON-safe details
  • Supported ErrorCode values are timeout, unavailable, and internal_error

Development

uv sync --group dev
uv run pytest -q
uv run ruff format --check
uv run ruff check
uv run ty check

Publishing

cp .env.example .env
# set PYPI_API_TOKEN in .env
set -a; source .env; set +a
uv build
uvx twine check dist/*
uvx twine upload -u __token__ -p "$PYPI_API_TOKEN" dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dr_docker-0.4.2.tar.gz (45.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dr_docker-0.4.2-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file dr_docker-0.4.2.tar.gz.

File metadata

  • Download URL: dr_docker-0.4.2.tar.gz
  • Upload date:
  • Size: 45.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.0

File hashes

Hashes for dr_docker-0.4.2.tar.gz
Algorithm Hash digest
SHA256 c31571399d6a0ece4333b0f993d328258c327145d8a34146b9c6b841aaa922d5
MD5 cb990c2e1fd788946c30c57334f8a32c
BLAKE2b-256 4f775841feb67e7cf584c09e2b819d79f9e6ce1ea89bd260379a7b04f80f8429

See more details on using hashes here.

File details

Details for the file dr_docker-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: dr_docker-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.0

File hashes

Hashes for dr_docker-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 24c5f1800eefc1921eaadd4bc5e485fb1e78e0a32a3a81a5b4500198015681ab
MD5 dd1203c309ce695d16b8973f18ef3ec5
BLAKE2b-256 5e9a234faded76a44034a99a207e8797452c762229a90ff34c88d14b937df486

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page