Repository navigation
agent: sandbox workers only run immutable environments (P7, worker half) - #46
Merged
Merged
Conversation
Sandbox workers no longer have a Docker image path. The direct runtime always builds EnvironmentRootfsStore and refuses to start without the environment registry and backend socket. Removed: - build_direct_runtime_service's DockerOverlay2RootfsStore branch, its docker_binary and the overlay2 rootfs_format in boot_config_sha256; serve-direct-node-agent's --docker-binary (vm_init never rendered it) and its DockerImageRuntime. - image_eviction.py (the LRU Docker image evictor), the provisioner's image_evictor, and the node agent's pre-pull eviction, post-pull note_used and forget_evicted_images. - DockerOverlay2RootfsStore's worker-only methods: list_image_ids, image_tag_times, image_present, image_content_id, evict_image and _docker_time_seconds. Builders use none of them. - Gateway: the 2 s create image wait and the 32-pull cap that served OCI pulls. Every create waits up to 30 s for its image attach, and the gateway imports external images whenever immutable_environments is set. - immutable_environments.worker_enabled as a switch. Kept: sandbox.max_concurrent_image_pulls (it bounds environment attaches); sandbox.docker_quota_image_gb and the sandbox role's Docker setup in vm_init, whose quota mount holds the image cache root; dockerd and the agent unit's ordering after docker.service (FORWARD DROP policy, docker-init). The DockerOverlay2RootfsStore class stays for builders (R6). The provisioner's non-idle collect_image path, the agent's image_materializer for a non-materializing runtime and the overlay manager's overlay2 bundle branches stay too: the LocalFleet harness's default Docker-ABI store still reaches them, and they go with the class once the harness moves to environments. Why it is safe: on 2026-10-24 deployment.json had immutable_environments.worker_enabled true, and every live sandbox worker (agent 0.10.0) advertised immutable-environment-host-erofs-v1, which the agent advertises only when EnvironmentRootfsStore is selected. None of the removed worker paths ran there. Config compatibility: worker_enabled is accepted only as true (absent also loads; anything else is refused with "delete the key"), and to_dict writes it true, so 0.10.0, which reads a missing key as false, still loads the same deployment.json on a rollback and keeps workers on environments. Tests: deleted test_image_eviction.py and the evict_image tests; test_direct_runtime_assembly assembles the environment store (no more private-member Docker fixtures) and pins the refusal without environments; the create image wait tests drop the cap; the config test pins true-only worker_enabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rlrs
force-pushed
the
cleanup/no-docker-image-path-on-workers
branch
from
October 24, 2026 12:15
41e8e18 to
294d2bb
Compare
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.
Plan item P7, worker half: sandbox workers no longer have a Docker image path.
What goes
build_direct_runtime_service'sDockerOverlay2RootfsStorebranch, itsdocker_binary, and the overlay2rootfs_formatinboot_config_sha256. The agent refuses to start without the environment registry and backend socket.serve-direct-node-agentdrops--docker-binary(vm_init never rendered it) and itsDockerImageRuntime.image_eviction.py(LRU Docker image evictor), the provisioner'simage_evictor, and the node agent's pre-pull eviction, post-pullnote_usedandforget_evicted_images.DockerOverlay2RootfsStore's worker-only methods:list_image_ids,image_tag_times,image_present,image_content_id,evict_image,_docker_time_seconds.immutable_environmentsis set.immutable_environments.worker_enabledas a switch.Code −347/+49, tests −210/+53, including
image_eviction.py(145) andtest_image_eviction.py(129).Kept
sandbox.max_concurrent_image_pulls, which bounds environment attaches.docker_quota_image_gbstay, because that quota mount holdsUCLOUD_DIRECT_IMAGE_CACHE_ROOT. dockerd and the agent unit'sAfter=/Requires=docker.servicealso stay: Docker's FORWARD DROP policy must be in place before the agent setsip_forward=1, and the guest init isdocker-init.DockerOverlay2RootfsStoreclass stays for builders (R6).LocalRootfsStorestill uses them: the provisioner's non-idlecollect_imagepath, the agent'simage_materializerfor a non-materializing runtime, andOverlayRootfsManager's overlay2 bundle branches. They should go with R6 once the harness defaults to environments.Evidence (2026-10-24, read-only)
immutable_environments.worker_enabled: true.immutable-environment-host-erofs-v1. The agent advertises that capability only whenEnvironmentRootfsStoreis selected.Compatibility and rollback
worker_enabledis accepted only astrue. A file without the key also loads. Any other value is refused with "delete the key".to_dictwrites it astrue.worker_enabled: truein deployment.json. Then the same deployment.json loads and workers stay on environments.immutable_environmentscan no longer start sandbox workers.## Unreleasedhas the operator notes.Checks
uv run ruff check sandboxes tests scripts: clean.scripts/check_test_rules.py: baseline lowered fortest_direct_runtime_assembly.py, which lost its private-member Docker fixtures.run_tests.py -j 6): 2446 pass, 26 skip, 0 fail.🤖 Generated with Claude Code