Skip to content

Conversation

@delan
Copy link
Member

@delan delan commented Nov 11, 2025

so far, we’ve managed the lifecycle of an image like servo-ubuntu2204 like this:

  • rebuild the image by building a new profile guest (libvirt guest named “servo-ubuntu2204”)
    • destroy the guest with that name, if it exists
    • recreate the guest from profiles/servo-ubuntu2204/guest.xml
    • set the disk to /path/to/base/servo-ubuntu2204/base.img@[timestamp]
    • start the guest, so that it can install tooling, bake in cached builds, etc
    • destroy the libvirt guest
    • recreate the guest from profiles/servo-ubuntu2204/guest.xml
    • set the disk to /path/to/base/servo-ubuntu2204/base.img (symlink)
  • if successful, symlink /path/to/base/servo-ubuntu2204/base.img to base.img@[timestamp]
  • if unsuccessful, symlink /path/to/base/servo-ubuntu2204/base.img to base.img@[oldTimestamp]
  • create runners by cloning that guest into each runner guest (“ci-runner-servo-ubuntu2204.[number]”)
    • clone the disks, but not the guests, with the monitor (so it can be parallelised)
    • clone the guest, but not the disks, with virt-clone

that works well enough for our current setup with libvirt and ZFS, but some hypervisors, like UTM (#64), will require us to treat each virtual machine as a self-contained object, with its own configuration and image files. in UTM, it’s hard to destroy a guest without also destroying its disks.

this patch moves the monitor closer to that world, by avoiding the destroy-recreate-configure pattern in image rebuilds. the lifecycle for servo-ubuntu2204 images now looks like this:

  • rebuild the image by building a new rebuild guest (“ci-rebuild-servo-ubuntu2204@[timestamp]”)
    • create the guest from profiles/servo-ubuntu2204/guest.xml
    • set the disk to /path/to/base/servo-ubuntu2204/base.img@[timestamp]
    • start the guest, so that it can install tooling, bake in cached builds, etc
  • if successful, convert that guest to a new template guest (“ci-template-servo-ubuntu2204@[timestamp]”)
    • conversion just means renaming the guest from “ci-rebuild-…” to “ci-template-…”
  • if unsuccessful, just destroy that guest
  • create runners by cloning that guest into each runner guest (“ci-runner-servo-ubuntu2204.[number]”)
    • clone the disks, but not the guests, with the monitor (so it can be parallelised)
    • clone the guest, but not the disks, with virt-clone

bonus: with this patch, failed rebuilds will no longer leave the template in an inconsistent state, with the old image data (good) but the new guest configuration (bad because it may be broken).

image

@delan delan force-pushed the one-to-one branch 2 times, most recently from 8e2bab4 to c9734f9 Compare November 25, 2025 04:23
@delan delan requested review from jschwe and sagudev November 25, 2025 05:24
@delan delan marked this pull request as ready for review November 25, 2025 05:24
@delan delan merged commit 817cdf9 into main Nov 25, 2025
1 check passed
@delan delan deleted the one-to-one branch November 25, 2025 12:01
@delan
Copy link
Member Author

delan commented Nov 25, 2025

deploying only ci2 and ci3 initially, since this is a complex change:

$ ( for i in 2 3; do ./do deploy ci$i & done )

@delan
Copy link
Member Author

delan commented Nov 25, 2025

those look good, so deploying the rest now:

$ ( for i in 0 1 4; do ./do deploy ci$i & done )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants