Skip to content

v0.4.0 — info() + Resource Limits

Choose a tag to compare

@deftio deftio released this 09 Feb 04:37
· 87 commits to main since this release
936360c

What's New

M3: Container Introspection & Resource Limits

Added

  • info() — live container snapshot: status, uptime, memory, CPU, PIDs, processes, network
  • reboot() — restart in place; reboot(fresh=True) recreates with same config
  • mem_limit parameter for create_new_container() (e.g. "256m", "1g")
  • cpu_percent parameter for create_new_container() (e.g. 50 for 50% CPU cap)
  • ContainerInfo dataclass with 15 fields for container introspection
  • get_container_stats(), get_container_top(), restart_container() socket client endpoints
  • _helpers.py module with format_bytes, parse_mem_limit, parse_iso_timestamp, compute_cpu_percent
  • Resource limits via HostConfig (Memory, NanoCpus) in container creation
  • All new methods available on both AsyncContainer (async) and Container (sync)

Fixed

  • Python 3.10 compatibility: catch asyncio.TimeoutError in exec timeout handling

Stats

  • 305 tests, 100% line+branch coverage
  • Zero ruff warnings, mypy --strict clean, bandit clean

Full Changelog: v0.3.0...v0.4.0