Repository navigation
refactor(computer): thin disks' compose machinery in its own module, Windows' own in windows_disk - #577
Merged
Conversation
…Windows' own in windows_disk thin_disk holds what composing a thin disk on its base does whatever the guest OS: the image store's registry, the base's and disk's names, pulling a base with its admin's key, booting it on a kept overlay, giving it its parts over ssh, trimming, shutting down, converting, packing and pushing. A Guest names what's the OS's own: its admin, the launcher's guest file, and the commands its shell runs to prepare, unpack, provision, clean up, compact and shut down. windows_disk keeps the evaluation ISO, the unattended install, the evaluation's expiry and the PowerShell provisioner, and declares Windows' Guest. No behaviour changes. Co-Authored-By: Claude Opus 5.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.
Part of FD-5338 (O1). The branch has no issue id, so merging won't close the issue.
This is O1's decision D6: one thin-disk module with a provisioner per OS, shared by Windows now and by Omarchy next. No behaviour changes. Omarchy builds on it in the next PR.
What moves
env/envs/computer/utils/thin_disk.py(new) is what composing a thin disk on its base does, whatever the guest OS:Registry, and the base's and disk's names;here,take_admin_key);compose: boot the base on a kept overlay, install the parts over ssh, trim, shut down, convert, rebase, pack and push;What's the OS's own is a
Guest:name(in image names, locks, cache folders and error prefixes);file;userits ssh logs in as;prepare,unpack,provision,cleanup,compact,shutdown.windows_disk.pykeeps what's Windows': the evaluation ISO, the unattended install, the evaluation's expiry and the PowerShell provisioner (write,argv, ACLs). It now also declaresGUEST, Windows' commands, unchanged from before.composer.pycallsthin_disk.Registry,thin_disk.disk_names(windows_disk.GUEST, …)andthin_disk.compose(windows_disk.GUEST, …).Images, tags, locks, cache paths, labels and messages are the same strings as before, so Windows bases and disks already in a store or cache are reused.
Tests
tst/unit/env/envs/test_thin_disk.py(new) covers the compose loop, which had no unit test before. It runs the guest's commands in order as its admin, sends the build as a tar, writes the guest file, and packs onto the base. A failed provision stops it with its output, removes the launcher, and pushes nothing.test_computer_windows.pynow patches the names where they moved (thin_disk.label,pack,here,converted,compose,Registry). All 27 pass.tst/unit/env/envs,tst/unit/bundle/shipped_bundles_test.pyandtst/unit/drivers: 993 passed. The one failure,test_disk_recipe::…windows_install…, fails the same way on main locally.ruff checkis clean.Verified on Windows
I ran
tst/integration/computer/windows_test.py -k "probe_at_full or notes_app"on an EC2 c8i.4xlarge with nested KVM, from this branch.Run 2 exercised everything this PR moves, and all of it succeeded:
windows_disk._installed, onthin_disk's launcher, ssh,alive,compacted,shut_downandconverted, in about 25 min;thin_disk.compose, then packed and pushed to the image store.What failed afterwards is not code this PR touches:
COPY --chmod, unchanged from main), and Ubuntu'sdocker.ioships without the plugin. I installeddocker-buildx.docker run --mount type=image,…,image-subpath=disk) fails on the host's Docker 29.1.3, which defaults to the containerd image store:failed to mount : stat /var/lib/docker/rootfs/overlayfs/…. CI's runners use overlay2.Run 3, with the host's Docker on overlay2 as CI has it: 2 passed in 38 min 33 s.
test_the_windows_desktop_passes_the_probe_at_fullandtest_the_notes_app_composed_onto_windows_runs_as_installed_and_the_session_runs_apps_in_their_jobsboth passed: a fresh base installed, both computers composed throughthin_disk.compose, booted, and probed at full.The Docker 29 failure is a real compatibility gap in the local provider's disk boot, separate from this PR, filed as FD-5416.
🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no blocking issues were found.Summary
Moves shared disk-building code into
thin_disk.py. Windows setup and PowerShell commands remain inwindows_disk.py.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD C["composer.py"] --> W["windows_disk.base"] W --> B["Reuse or install Windows base"] C --> T["thin_disk.compose"] G["windows_disk.GUEST"] --> T B --> T T --> S["Boot and install over SSH"] S --> Q["Trim and shut down"] Q --> P["Convert, pack, and push"]Reviews (5) · Last reviewed commit: "refactor(computer): thin disks' compose ..." · Reviewed by Greptile