Skip to content

refactor(computer): thin disks' compose machinery in its own module, Windows' own in windows_disk - #577

Merged
earakely-scale merged 1 commit into
mainfrom
edgararakelyan/omarchy-disk-foundations
Nov 9, 2026
Merged

earakely-scale merged 1 commit into
mainfrom
edgararakelyan/omarchy-disk-foundations

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

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:

  • the image store's Registry, and the base's and disk's names;
  • pulling a base with its admin's key (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;
  • the launcher container, ssh, the work folders, packing.

What's the OS's own is a Guest:

  • its name (in image names, locks, cache folders and error prefixes);
  • the launcher's guest file;
  • the admin user its ssh logs in as;
  • the shell commands a compose runs: prepare, unpack, provision, cleanup, compact, shutdown.

windows_disk.py keeps what's Windows': the evaluation ISO, the unattended install, the evaluation's expiry and the PowerShell provisioner (write, argv, ACLs). It now also declares GUEST, Windows' commands, unchanged from before.

composer.py calls thin_disk.Registry, thin_disk.disk_names(windows_disk.GUEST, …) and thin_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.py now 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.py and tst/unit/drivers: 993 passed. The one failure, test_disk_recipe::…windows_install…, fails the same way on main locally.
  • ruff check is 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 11 installed from Microsoft's ISO through windows_disk._installed, on thin_disk's launcher, ssh, alive, compacted, shut_down and converted, in about 25 min;
  • packed and pushed as a base;
  • both computers (cua-driver alone, and cua-driver with the notes app) composed through thin_disk.compose, then packed and pushed to the image store.

What failed afterwards is not code this PR touches:

  • Run 1: packing the base needs BuildKit (COPY --chmod, unchanged from main), and Ubuntu's docker.io ships without the plugin. I installed docker-buildx.
  • Run 2: booting the composed disk for the probe (the local provider's 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_full and test_the_notes_app_composed_onto_windows_runs_as_installed_and_the_session_runs_apps_in_their_jobs both passed: a fresh base installed, both computers composed through thin_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

RetriggerView in GreptileConfidence 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 in windows_disk.py.

  • Windows disk composing now runs through a shared thin-disk module.

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"]
Loading

Reviews (5) · Last reviewed commit: "refactor(computer): thin disks' compose ..." · Reviewed by Greptile

…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>
@earakely-scale
earakely-scale requested a review from a team as a code owner November 9, 2026 21:55
@earakely-scale
earakely-scale merged commit d6e3801 into main Nov 9, 2026
39 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/omarchy-disk-foundations branch November 9, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant