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)requireserror- Successful result envelopes must not include
error - Error envelopes are typed (
ErrorCode) with non-empty message and JSON-safe details - Supported
ErrorCodevalues aretimeout,unavailable, andinternal_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.3.tar.gz
(45.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
dr_docker-0.4.3-py3-none-any.whl
(13.7 kB
view details)
File details
Details for the file dr_docker-0.4.3.tar.gz.
File metadata
- Download URL: dr_docker-0.4.3.tar.gz
- Upload date:
- Size: 45.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdf5b6472c5ceee8eac24849cd9d38ca0dd6c201fc62639bd277adea0940ea6e
|
|
| MD5 |
0cd1fb133cd883bd784795568c4570be
|
|
| BLAKE2b-256 |
27b773aaad9e555d34188358432d18e8f8966e56a676ff369e8f502ab148fb2f
|
File details
Details for the file dr_docker-0.4.3-py3-none-any.whl.
File metadata
- Download URL: dr_docker-0.4.3-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b37b647dd04d183f103cc3935fbdc0ea1316441a8db6dcb8fae8cee3ca955e38
|
|
| MD5 |
35f43d4eb469404762838a5ed1f2b57b
|
|
| BLAKE2b-256 |
541ecbcad181effc58156e7a9cdf136897e7e4f5ac0f00cd99f2e9061fe9f5a0
|