Repository navigation
fix(computers): two composes of one Linux disk on a machine take turns, so a boot's pinned disk stays put - #668
Closed
earakely-scale wants to merge 2 commits into
Closed
earakely-scale wants to merge 2 commits into
earakely-scale wants to merge 2 commits into
Conversation
…s, so a boot's pinned disk stays put Two composes of the same new disk key on one machine (the slow tier's two pytest workers, each composing the shared desktop) both found nothing stored and both built it. Each build tags localhost:5000/agentenv-computers:<key> and its bytes differ, so the second moved the tag off the image the first had pinned by digest. The first's probe then mounted name:tag@digest with --mount type=image, which Docker doesn't pull for, and failed with "No such image", failing launcher_test's three tests with KeyError: 'image' on every run that built the disk rather than copied it from the mirror (eac7660 and d1fcdf8 on main, and PRs that change the computer images). The Linux disk is now looked up, made and pushed holding a lock of its key, as Windows and Omarchy disks are, so the second compose waits and reuses the first's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…machine's Docker and registry agent-env keeps its locks in the state root, and each integration test has a state root of its own, so the disk lock alone didn't stop two pytest workers composing one computer at once: on this PR, both still built the desktop's disk under the same tag and the first's boot failed as before. A session fixture keeps the locks whose ids name this machine's image work (composes, disks, disk exports, image builds, pulls and saves) in one folder for the run, as one user's processes share theirs, so such work takes turns across workers and the second reuses what the first pushed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
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 changes
launcher_test.py's three tests fail now and then in the slow tier withKeyError: 'image': on main at eac7660 and at #580's merge (d1fcdf8), and on #666. The shared desktop's amd64 disk had failed its probe, so the computer had no disk image:Why. A slow shard runs two pytest workers, and both compose the shared desktop. When its disk's key is new, as on the first run after the computer images change, neither finds it stored, so both build it. Each build tags
localhost:5000/agentenv-computers:<key>and pushes it, and the two builds' bytes differ. So the second build moves the tag off the image the first had pinned by digest. The first's probe then mountsname:tag@digestwith--mount type=image, which Docker doesn't pull for, and the image under that name is gone. A run that copies the disk from the computer image mirror builds nothing, which is why later main runs pass.I checked Docker's side on a Docker 28 daemon on the containerd image store, the store CI uses.
docker image inspectand--mount type=imageagree on a pinned name every time. Once the tag moves to a rebuilt image, the first image's pinned name is gone for both, and an explicit pull brings it back.The fix. The Linux disk is now looked up, made and pushed holding a lock of its key (
linux-disk:<key>), as Windows and Omarchy disks already are. A second compose of the same disk on the machine waits, finds the first's push, and reuses it: one build, and no tag moves.Testing
test_a_disk_is_looked_up_made_and_pushed_holding_a_lock_of_its_key_so_composes_of_it_take_turns: each arch's disk is looked up, made and pushed while its key's lock is held. It fails without the change.tst/unit/env/envs/test_computer_disk.py: 43 passed.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no actionable new issue was found.Summary
The PR keeps Linux disk lookup, build, and push under one lock per disk key.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Compute disk key] --> B[Acquire shared lock] B --> C{Disk already stored?} C -->|Yes| D[Reuse pinned image] C -->|No| E[Build and push disk] E --> F[Pin image digest] D --> G[Release lock] F --> G G --> H[Probe disk]Reviews (2) · Last reviewed commit: "test: the integration tier's workers sha..." · Reviewed by Greptile