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__,
)

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.0.tar.gz (42.7 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.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dr_docker-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ec87857a35decca8b1b92453f9feac08e774e16b0ebf299ba74371831f81af01
MD5 20a3cb782e26ab0954530da7838ccffb
BLAKE2b-256 59f3b911843c4e2315e91112755aed29b0a7ff95c37264b8f250ab6f201dfa9c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dr_docker-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 505d53ef49343372be85ef07fcbc3bfed4288ee70e13b3c740eae4e8cfdd9322
MD5 fcbd433e2e5cb92e2d6f0364ff60f0a9
BLAKE2b-256 b15b1d3b441c36d18889862bf4416b85d326df954ea06fa06a97e5e45fbdd75f

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