Repository navigation
perf(computer): trim Windows disks and keep background app installs out of them - #526
Merged
Merged
Conversation
…e before packing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… it uses, a layer over its base Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Edge updater, new Outlook or Dev Home They wrote 630 MB into a composed layer, the Copilot app (555 MB) through Edge's updater and the new Outlook, and would run at every boot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What this does
Makes Windows disks smaller (FD-5328, parts 1 and 2):
discard=unmap,detect-zeroes=unmapand presents it as an SSD (rotation_rate=1), so Windows' TRIM reaches the image.qemu-img convert: a base on its own, a layer over its base (-B), so it keeps only the clusters Windows uses.compact.ps1is part of the base's recipe, so a base installed before this is installed again, trimmed, on its next compose.Measured
On an EC2 c8i.4xlarge with nested KVM, running
agent-env run tst/integration/computer/windowsprobe and reset:disk/base.img)The first trimmed run grew the layer because Windows installed apps in the background while it was composed: the Copilot app (555 MB, through Edge's updater) and the new Outlook (77 MB). The base now turns those off, which matters for deploys too, since they would otherwise run at every boot.
Docker reports a Windows image at about twice its disk's size because containerd keeps the compressed blob and the unpacked copy. The sizes above are the disks', from
docker history.Not in this PR
--mount type=image), which on the test box read the composed disk'sbase.imganddisk.imgin place. That's a design choice of its own, coming separately.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Windows builds now clear caches and trim free space before shutdown, then rewrite the disk before packing it.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Install base or provision layer] --> B[Clear caches and trim free space] B --> C[Shut down Windows] C --> D[Rewrite disk with qemu-img convert] D --> E{Composed layer?} E -->|Yes| F[Make backing path relative] E -->|No| G[Pack base image] F --> H[Pack layer over base]Reviews (1) · Last reviewed commit: "style(computer): rewrap setup.ps1's head..." · Reviewed by Greptile