Skip to content

lab: dependency build step (deps installed from scratch, index-only network) - #26

Open
AdvayMonga wants to merge 5 commits into
lab/remote-agentfrom
lab/deps-build
Open

AdvayMonga wants to merge 5 commits into
lab/remote-agentfrom
lab/deps-build

Conversation

@AdvayMonga

Copy link
Copy Markdown
Owner

Stacked on the remote-agent PR. Built to the decision that dependency changes reach a measurement only through the agent's change, and that measurement stays offline.

  • Target spec: new deps (pyproject.toml, uv.lock) and build keys. For inference-server, build is vm-setup.sh's recipe: a locked sync, then the CUDA torch wheel at the locked version.
  • What the agent may change: the deps files. A pyproject.toml only in its dependency tables; the audit compares the rest, so test and lint config stay protected, and deleting a dependency file is a violation.
  • Which venv a job uses: build.python_for(tree).
    • Unchanged dependencies (against the pristine tree's base commit): the engine's venv, so base and candidate run identically.
    • Changed ones: a venv built in a no-GPU, --network none container whose only way out is a host-side CONNECT proxy to the package-index hosts, cached by the files' hash.
    • A failed build is a recorded failure.
  • Tool descriptions: they now state the fact that only the change reaches the engine, installed from scratch, and that the engine then runs offline.
  • Tested:
    • dependency-only pyproject edits;
    • the audit;
    • when a venv gets built, and the cache;
    • the proxy's allow and refuse rules;
    • live in Docker-in-Docker: 200 from PyPI through the proxy, 403 for another host, no direct route.
    • Suites: macOS 262 passed. On Linux only the test box's known failures remain.
  • Not tested: the real torch/CUDA build. That's next, in the GPU run.

🤖 Generated with Claude Code

AdvayMonga and others added 5 commits October 10, 2026 13:23
…etwork)

The target names its dependency files (deps) and the command that installs them
(build). The agent may change them; a pyproject.toml only in its dependency tables
(checked by the audit; test and lint config stay protected). A tree whose change touched
them gets a venv built for it in a no-GPU, --network none container whose only way out is
a host-side CONNECT proxy to the package-index hosts, cached by the files' hash; an
unchanged tree keeps the engine's venv, so base and candidate run identically. Jobs run
under engine.using(build.python_for(tree)); a failed build is a recorded failure. Tool
descriptions now state the fact: only the change reaches the engine, and it runs offline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the dry run (Nebius H200, LAB_WORKER=ssh):
- cli.sh removes the tunnel's stale socket before forwarding (the SDK launches the CLI
  more than once; that sshd does not unlink an existing socket), with `ssh -n` so that
  call does not swallow the SDK's first message.
- A non-root login (Nebius, Crusoe) runs the worker side through sudo, keeping HOME:
  the workbench is root inside, measurement rooms drop to uid 10001, rsync via sudo,
  and the proxy's socket dir is handed to the login user for sshd.
- Profiler jails mount the instrument's install root (nsys needs host-linux-x64's
  importer).
- vm-setup.sh caches the target's model and the tokenizers its tests read (new target
  key `hub`), world-readable: every jail is offline.
- vm.push excludes lab/runs explicitly: --delete otherwise reached the worker cache and
  the agent's live workspaces.

From the review:
- The API proxy charges in a finally; an incomplete response is charged its input and
  all of max_tokens; each request reserves its worst-case output first, so concurrent
  requests cannot pass the cap.
- When the workbench shares the lab's host, it is frozen for every lab tool call
  (container.paused), closing the swap-a-file-for-a-link race on snapshot, restore and
  copies; quiet() nests in it.
- Scratch (outside the write surface, not a base file) is left out whatever it is:
  a venv's links and large files no longer end the run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant