Skip to content

P2: Shared sandbox pool + harness→sandbox routing #46

Closed

Description

@pdettori

P2 — Shared sandbox pool + harness→sandbox routing

Part of the two-tier architecture epic (see epic issue). Depends on P1.

Goal

Scale Archetype A to many leaf harnesses (fresh context each) sharing a smaller pool of sandboxes. Not 1:1 — target ~20 harnesses per sandbox (ratio set empirically in P3). Harnesses sharing a sandbox share one repo copy; each leaf gets an isolated worktree.

Scope

  • Replace the fixed KAGENTI_SANDBOX_POD env (single sandbox) with pool assignment: a harness selects/loads-balances across M sandbox pods (kubectl exec targets a specific pod, so this needs pod-selection logic — a router or a discovery+pick mechanism, not just a Service).
  • Within a sandbox: shared repo dir (read-mostly), per-leaf isolated worktrees; concurrency-safe layout under /workspace/<run>/….
  • Across sandboxes (when M>1): storage topology decision — RWX shared repo vs per-sandbox repo copy. This is where RWX may reappear (on the sandbox tier, not the harness). Decide via P3 experiments; design both paths.
  • Sandbox tier likely becomes a managed set (StatefulSet / pool controller) with durable storage.

Open questions for brainstorming

  • Routing mechanism (harness-side pick vs a router service vs a scheduler).
  • Repo distribution across sandboxes (RWX vs copy vs read-only base + per-sandbox worktree overlay).
  • Sandbox lifecycle/scaling relative to the harness fleet (who scales sandboxes, on what signal).
  • Isolation between leaves that share a sandbox (worktree/namespace/uid).

Non-goals

  • Kata isolation and the ratio experiments (P3, deferred until after P0′).

Next step

Brainstorm P2 after P1 lands.

Activity

  1. pdettori commented on Jul 2, 2026

    @pdettori
    MemberAuthor

    Part of epic #49

  2. pdettori commented on Jul 6, 2026

    @pdettori
    MemberAuthor

    Delivered by PR #53 (merged) — the P2 shared sandbox pool with N:M lease-based routing. deploy/knative/sandbox-pool.yaml provisions the labeled pool and the harness selects/leases across pool pods via selectPoolSandbox. The issue was left open only because the PR did not carry a closing keyword. Closing as delivered.

    Follow-ups tracked separately: #55 (sync-path bounded wait + 503), #56 (empty-pod-list unit test).

    Assisted-By: Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions