feat(backend+orchestrator): slice 13d — docker cut-over to the consolidated gateway (e2e green) #379
Closed
didericis-claude
wants to merge 3 commits from
orchestrator-cutover into orchestrator-agent-compose
pull from: orchestrator-cutover
merge into: didericis:orchestrator-agent-compose
didericis:main
didericis:firecracker-consolidated-launch
didericis:lazy-backend-imports
didericis:orchestrator-agent-compose
didericis:orchestrator-gateway-ca
didericis:orchestrator-consolidated-launch
didericis:orchestrator-gateway-provision
didericis:orchestrator-gateway-network
didericis:orchestrator-client
didericis:orchestrator-gateway-net
didericis:orchestrator-gitgate-provision
didericis:orchestrator-registration
didericis:orchestrator-lifecycle
didericis:orchestrator-supervise-writers
didericis:orchestrator-supervise-multitenant
didericis:orchestrator-gitgate-multitenant
didericis:orchestrator-rename-gateway
didericis:orchestrator-slice8
didericis:orchestrator-slice7
didericis:orchestrator-slice6
didericis:prd-orchestrator
didericis:orchestrator-slice5
didericis:orchestrator-slice4
didericis:orchestrator-slice3
didericis:orchestrator-slice2
didericis:ci-kvm-runner
didericis:firecracker-backend
didericis:issue-330-cached-images
didericis:forge-native-integration
didericis:prd-smolmachines-linux
didericis:claude-forward-host-credentials
didericis:fold-orchestrator-subpackage
didericis:prd-egress-control-plane
didericis:manifest-break-import-cycle
didericis:dlp-supervise-quality-fixes
didericis:table-drive-dlp-tests
didericis:fix-integration-test-failures
didericis:fix/macos-container-relative-dockerfile
didericis:prd-0054-install-script
didericis:commit-bottle-state
didericis:pr-211
didericis:move-codex-auth-to-contrib
didericis:feat/pipelock-skip-scan-extensions
didericis:prd-0049-named-labelled-agents
didericis:harden-git-gate-shell-rendering
No Reviewers
Labels
Clear labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Low
4
The priority is low
Priority
Medium
3
The priority is medium
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: didericis/bot-bottle#379
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "orchestrator-cutover"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The keystone, validated end-to-end on real docker.
test_sandbox_escapepasses all 5 attacks (egress DLP + git-gate gitleaks) through the shared gateway — the entire consolidation (slices 11–13) works on the real host.Two commits:
1. Containerize the orchestrator
Real-on-host testing found the host (NixOS) firewall drops container→host, so a host-process orchestrator is unreachable from the gateway. Fix = the PRD's virtualize the orchestrator: run it as a container on the shared network (gateway reaches it by name, container↔container). Register-only stub broker → no docker socket needed. Also: control plane returns 500 on a dispatch error instead of crashing the connection.
2. Cut
DockerBottleBackend.launchoverReplaces the per-bottle bundle:
launch_consolidated()(register + provision git-gate into the gateway + pinned source IP) → install the shared gateway CA → agent-only compose on the gateway network → point the agent's git-gate (http://<gw>:9420) + supervise (http://<gw>:9100) at the gateway → teardown = compose down + dereg/deprovision. Dropped per-bottle networks, per-bottle CA, and the bundle service.Fixes only the real e2e could surface (unit mocks couldn't): the gateway needed the bottle-agnostic git hooks installed; source-IP allocation must read the actual container IPs on the network (the orchestrator container sits on it and was colliding).
Reviewer note
The
bot-bottle-sidecarsimage must be rebuilt when its flat sources change —ensure_builtonly builds-if-missing, so a stale image silently runs the OLD single-tenant daemons (this bit me mid-validation). A content-hash/--rebuildpath is a tracked follow-up.Verification
pyright 0, pylint 9.83/10, unit suite green (1760; the 13
test_sidecar_init/bin/sleeperrors are pre-existing NixOS noise),test_sandbox_escapegreen on real docker. Old bundle-launch unit tests rewritten against the new collaborators.Stacked on #378.
🤖 Generated with Claude Code
Rewire DockerBottleBackend.launch to the consolidated model, replacing the per-bottle sidecar bundle. VALIDATED END-TO-END on real docker: test_sandbox_escape passes all 5 attacks (egress DLP + git-gate gitleaks) through the shared gateway. launch now: - mints git-gate dynamic keys (if any), then launch_consolidated() to register the bottle + provision its git-gate state into the gateway and get the agent's attach context (pinned source IP, gateway address); - installs the SHARED gateway CA (gateway.ca_cert_pem) into the agent; - renders the agent-only consolidated compose on the gateway network at the pinned IP, proxied through the gateway; - points the agent's git-gate insteadOf (http://<gw>:9420) and supervise MCP (http://<gw>:9100) at the gateway (DockerBottlePlan.agent_git_gate_url / agent_supervise_url); - teardown = compose down + teardown_consolidated (dereg + deprovision). Dropped the per-bottle networks, per-bottle egress CA, and bundle service. Fixes surfaced by the real e2e (couldn't be caught by unit mocks): - provision_git_gate installs the bottle-agnostic pre-receive/access hooks into the gateway (were cp'd per-bundle before); - source-IP allocation reads the *actual* container IPs on the network (gateway + orchestrator + agents), not just gateway + registry — the orchestrator container sits on the network and was colliding. Unit tests for the old bundle launch rewritten against the new collaborators. NOTE for reviewers: the gateway/bundle image (bot-bottle-sidecars) must be rebuilt when its flat sources change — `ensure_built` only builds-if-missing, so a stale image silently runs the OLD single-tenant daemons. A content-hash / --rebuild path is a follow-up. pyright 0 errors; pylint 9.83/10; unit suite green (1760 tests; the 13 test_sidecar_init /bin/sleep errors are pre-existing NixOS-local noise); test_sandbox_escape green on real docker. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WBMWTEtQdJ4W5UrWuLHCckfeat(orchestrator): slice 13d(i) — containerize the orchestrator (validated on docker)to feat(backend+orchestrator): slice 13d — docker cut-over to the consolidated gateway (e2e green)Collapsed into the single stack PR #380 (per-host orchestrator, PRD 0070). Closing this slice PR; review + merge happens on #380.
Pull request closed