New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor image download in rhizome side & add optional image version. #1524
Conversation
2539829
to
07df48c
Compare
I was planning to implement fixed versioning for the runner image. This PR will be very helpful. Thank you. |
07df48c
to
8d80e38
Compare
962df73
to
306554f
Compare
306554f
to
313676e
Compare
In #1524 we changed rhizome to be able to download versioned boot images. In this change, we actually use that infrastructure. To download a versioned boot image, one can do: ``` > vmh.download_boot_image("ubuntu-jammy", version: "20240319") ``` After this has been done, all VMs on that host which want to use the `ubuntu-jammy` image will use the latest boot image. This allows us to be able to download new image versions without impacting previous VMs at all. Previous VMs will continue to use the older images. As follow up items: * VmHost setup will include downloading some default images (e.g. `ubuntu-jammy`) with explicit. vm_setup won't download the images automatically. * We will enforce to use versioned images always * Add a program to remove unused images
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. My only concern is the difficulty of updating hashes. I think it would be good to have a simpler way to store the list of hashes; such as passing them during first download.
313676e
to
6397fc1
Compare
6397fc1
to
d54aa7a
Compare
This is in preparation to make boot images versioned. Some of the reasons to do this includes: * Allow installing a newer version of an image without breaking existing VMs which have references to the older versions. * Make storage snapshots easier: we know exactly which base image is being used, and we can just snapshot the diff. * Making correlation of failures to bad OS images easier. Current patch: * Moves almost all of the image download logic to the standalone class BootImage. * Adds optional version and sha256sum parameters to images. If these are null or empty, the behaviour is exactly same as before. * Uses BootImage in VmSetup and `download-boot-image`. If an image is versioned, it'll be stored as `/var/storage/images/$name-$version.raw`. Legacy unversioned images are still supported and are stored at `/var/storage/$name.raw`.
d54aa7a
to
cd545b0
Compare
This is in preparation to make boot images versioned. Some of the reasons to do this includes:
Current patch:
download-boot-image
.If an image is versioned, it'll be stored as
/var/storage/images/$name-$version.raw
. Legacy unversioned images are still supported and are stored at/var/storage/images/$name.raw
.