← Back to Pull requests

feat: add built-in podman environment #1432

Closed
unknown closed this pull request without merging on Sep 01, 2026 17:37 UTC
View on GitHub
unknown unknown commented on Apr 14, 2026 23:30 UTC
Author

Overview

This PR adds support for using Podman as a local container engine alternative to Docker. It implements a dedicated PodmanEnvironment for Podman-specific lifecycle behavior, compose handling, container resolution, and execution semantics.

Fixes #398

Changes

  • Podman environment: Adds src/harbor/environments/podman.py using podman and podman-compose.

  • Environment registration: Adds podman to the environment type enum and factory.

  • Preflight checks: Validates podman, podman-compose, and Podman machine/service availability before startup.

  • Runtime behavior: Matches Docker exec behavior where needed, including workdir fallback and merged exec stderr/stdout.

  • Windows handling: Podman explicitly does not advertise Windows task support.

  • CLI: Runs environment preflight for harbor task start-env before creating temporary trial paths and only imports agent construction code when an agent is requested.

  • Docs: Adds a targeted Run Jobs > Local Environments page for Docker/Podman setup and limitations.

  • Tests: Adds unit coverage for Podman environment behavior, preflight checks, and start-env.
  • Validation

    Focused local validation:

    .venv/bin/ruff check --fix .
    .venv/bin/ruff format .
    PYTHONPATH=src .venv/bin/python -m pytest tests/unit/environments/test_docker.py::TestAttach tests/unit/environments/test_podman.py::TestAttach tests/unit/test_environment_preflight.py::test_podman_preflight_no_podman tests/unit/test_environment_preflight.py::test_podman_preflight_no_podman_compose tests/unit/test_environment_preflight.py::test_podman_preflight_service_not_running tests/unit/test_environment_preflight.py::test_podman_preflight_ok tests/unit/cli/test_tasks_start_env.py -q
    

    Note: uv is not available in my local shell. ty check and full tests/unit/ collection are currently blocked locally by missing/broken optional dependencies around litellm, islo, and tensorlake.

    Checklist

  • Added Podman environment implementation.

  • Added environment factory/type registration.

  • Added Podman preflight validation.

  • Added focused documentation for local Docker/Podman runtimes.

  • Added unit tests.

  • Ran focused local verification.

  • Ran a one-task Podman smoke test through the local LiteLLM proxy:
  • .venv-podman-smoke/bin/harbor run \
      --path examples/tasks/hello-world \
      --agent codex \
      --model openai/gpt-5.4-mini \
      --env podman \
      --n-attempts 1 \
      --n-concurrent 1 \
      --agent-setup-timeout-multiplier 5 \
      --force-build \
      --delete \
      --yes \
      --ae "OPENAI_API_KEY=$OPENAI_API_KEY" \
      --ae "OPENAI_BASE_URL=http://host.containers.internal:9999/v1" \
      --ak version=0.125.0 \
      --ak reasoning_effort=low
    

    Result: 1/1 trial passed, 0 exceptions, mean reward 1.000.

    Diff: 355 lines (+266 / -89) across 4 files Reviewer: iandvt Review duration: 201246m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.43) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 355 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.351
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1432"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.5% (MEDIUM) · Higher = larger blast radius
    42.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.4% · Safe to merge
    18.4%