First-class agentic RL: example, sandbox substrate, and Kubernetes services#5083
Draft
htahir1 wants to merge 6 commits into
Draft
First-class agentic RL: example, sandbox substrate, and Kubernetes services#5083htahir1 wants to merge 6 commits into
htahir1 wants to merge 6 commits into
Conversation
htahir1
force-pushed
the
feature/first-class-agentic-rl
branch
from
July 15, 2026 14:44
27563ac to
6fd1beb
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
htahir1
force-pushed
the
feature/first-class-agentic-rl
branch
4 times, most recently
from
July 15, 2026 15:15
5653432 to
44a7f9c
Compare
The RL spike proved the loop shape works but the ecosystem stack (verifiers + harbor + vLLM + prime-rl) was never wired first-class. This adds the missing substrate and the example that proves it: - Docker sandbox flavor: container-isolated local sessions (exec, archive transfer, commit-based snapshots), the laptop counterpart to the kubernetes/modal flavors - Flavor-agnostic sandbox image override (image_settings capability), replacing the Modal-only branch in the Harbor bridge - LocalSandbox file transfer with workdir containment - Harbor integration bumped to 0.18 (allow_internet -> network_mode; the 0.8-era check refused every current task) - huggingface datasets cap raised to <5.0.0 (the <4 cap silently disabled HFDatasetMaterializer in datasets-4.x environments) - Kubernetes step operator: multi-node command steps (indexed Job, rank-0-only ZenML entrypoint, job-owned headless service) and heterogeneous auxiliary pod sets with injected discovery env - distributed launchers own the launch, Kubernetes GC owns teardown - KubernetesPodService: run-scoped long-running services on the existing BaseService framework, with deterministic naming, server-side registration, and deadline-based GC teardown - examples/agentic_rl: gated eval campaigns (errors before rewards), prime-rl trainer as a CommandStep, per-rollout trace ingestion with the reward<->sandbox lineage join, serve/probe/stop after-eval leg, 64 committed Harbor task dirs scored by the spike's verifier byte-identical, and a verifiers taskset package carrying the upstream-shaped ZenMLSandboxRuntime - Docs: prime-rl-on-Kubernetes guide, docker sandbox page, multi-node design doc Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
htahir1
force-pushed
the
feature/first-class-agentic-rl
branch
from
July 15, 2026 15:21
44a7f9c to
99f40f1
Compare
First live smoke run caught two adaptation bugs in the generated test.sh shim: - Harbor gives verifier/reward.json precedence over reward.txt and validates it as a flat numeric map; the shim wrote the scorer's rich diagnostic JSON there, turning every scored trial into an errored trial. The rich JSON now lands in details.json (still downloaded with the verifier dir as the forensics channel) and only the bare float is exposed via reward.txt. - A missing /app/pipeline.py (the nop agent) crashed the scorer and produced an errored trial. An agent that submits nothing has failed the task: the shim now records a genuine reward of 0.0 before the scorer is ever invoked. With both fixes the hermetic smoke tier runs green end to end on the docker sandbox flavor: oracle 1.0, nop 0.0, gate passes at mean 0.500 over 6 rewards with 0 blocking errors. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…into feature/first-class-agentic-rl
Concurrent steps publishing artifacts against a local sqlite store (for example mapped steps of a dynamic pipeline) routinely exceed sqlite3's default 5-second lock wait and fail with "database is locked". Wait up to 60 seconds for the write lock instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Makes the agentic RL stack (verifiers + Harbor + vLLM + prime-rl) first-class in ZenML, with ZenML owning what none of those record: the sandbox rollouts run in, the gate in front of the GPU, and the lineage behind it. prime-rl keeps its loop; ZenML never pretends to orchestrate RL training.
Core (
src/zenml)docker commitsnapshots, attach). The laptop counterpart to the kubernetes/modal flavors.BaseSandbox.image_settings()capability (docker/kubernetes/modal), replacing the Modal-only branch in the Harbor bridge./).>=0.8,<0.9; the 0.8-eraallow_internetcheck (which refuses every current task) is replaced by harbor's own capability validation.node_countgated on command steps (the Baseten contract): indexed Job, rank fromJOB_COMPLETION_INDEX, job-owned headless service, and a rank-dispatch so exactly one pod runs ZenML's step machinery (N concurrentStepRunner.runcalls for one step_run_id would race on status/logs/success).KubernetesPodService— long-running services on the existingBaseServiceframework: deterministic naming (named services have URLs known before provisioning), server-side registration viaClient.create_service, and deadline-based GC teardown (max_lifetime_seconds), so a GPU server leaked by a crashed run self-terminates.datasetscap raised to<5.0.0(the<4cap silently disabledHFDatasetMaterializerin datasets-4.x environments).Example (
examples/agentic_rl)Gate → train → receipts, in tiers: hermetic smoke (oracle vs nop, no API keys), eval campaigns, prime-rl GRPO as one
CommandStep, per-rollouttraces.jsonlingestion into a single table artifact (reward ↔ sandbox session id join), checkpoint discovery, HTML lineage report, and an opt-in serve/probe/stop leg usingKubernetesPodService. 64 committed Harbor task dirs scored by the RL spike's verifier byte-identical (asserted by test); a verifiers taskset package carryingZenMLSandboxRuntimewritten to upstream-contribution shape.Key honesty rules encoded: the gate checks errors before rewards (an errored shard logs no mean reward — a reward-only gate passes broken campaigns); a crashed scorer is an errored trial, never a fake 0.0; the file-tier rollout table carries rewards + sandbox ids but not advantages/tokens (excluded upstream); the harbor-agents-vs-served-policy eval is a named cut.
Docs
component-guide/sandboxes/docker.md, a multi-node section in the step-operator guide,user-guide/agent-evals-guide/prime-rl-on-kubernetes.md(incl. cluster prerequisites: what ZenML deploys per-run vs. what you provide once), anddocs/design/multi-node-command-steps-on-kubernetes.md.Reviewer attention
kubernetes_step_operator.py(correctness of one-bookkeeper semantics).KubernetesPodServiceteardown philosophy (deprovision = happy path, GC deadline = guarantee) and the never-fail-the-step service registration in the example.Verification
--extend-ignore D).reward.jsonnumeric-map precedence; nop's missing submission crashing the scorer) surfaced as 6/6 errored trials and a loud gate failure — never a fake 0.0 (fixed ined795a9dfa).database is lockedunder concurrent mapped steps (sqlite3's 5s default lock wait; branchfix/sqlite-busy-timeout).--trainneeds 2 GPUs + a prime-rl checkout; the service/multi-node legs need a cluster and are experimental until then. These are the remaining gates before undrafting.Depends on #5029. Suggest full CI (
run-slow-ci) once undrafted.🤖 Generated with Claude Code