-
Notifications
You must be signed in to change notification settings - Fork 985
Install storage driver tools on-demand #15780
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
Install storage driver tools on-demand #15780
Conversation
79c70f9 to
118eb61
Compare
e1e2e9f to
fe31f4d
Compare
This was actually a valid suggestion, thanks @copilot. |
…mkfs.btrfs`) Signed-off-by: Simon Deziel <[email protected]>
…kfs.fat`) Signed-off-by: Simon Deziel <[email protected]>
…fs.ext4`) Signed-off-by: Simon Deziel <[email protected]>
fe31f4d to
77a8bd1
Compare
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.
Pull Request Overview
This PR updates the test and documentation frameworks to support on-demand installation of storage driver tools, ensuring that only the required bits are pulled when needed to speed up CI and local development.
- Removed pre-checks for tool availability in test suites to enable dynamic installation
- Updated test/main.sh to install missing packages based on the requested storage backend
- Modified documentation and action files to reflect the new on-demand installation approach
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/suites/storage_driver_zfs.sh | Removed mkfs tool check in favor of on-demand installation |
| test/suites/migration.sh | Similarly removed mkfs tool check to align with updated installation flow |
| test/main.sh | Added logic to install storage backend packages if not already available |
| doc/lxd-test.yaml & doc/installing.md | Updated package lists to include additional dependencies |
| .github/actions/install-lxd-runtimedeps/action.yml | Adjusted installation steps, removing some package installs for tools |
Comments suppressed due to low confidence (4)
test/suites/storage_driver_zfs.sh:112
- Removal of the mkfs tool check assumes that tools will be installed on-demand. Consider adding a comment to explain this behavior for future maintenance clarity.
if ! command -v "mkfs.${filesystem}" >/dev/null 2>&1; then
test/suites/migration.sh:51
- Similar to the storage_driver_zfs.sh change, consider adding a comment explaining the removal of the mkfs tool check to clarify that missing tools are handled on-demand.
if ! command -v "mkfs.${fs}" >/dev/null 2>&1; then
test/main.sh:62
- Consider adding error handling or logging if the attempted package installation fails, to provide clearer feedback during test execution.
elif ! available_storage_backends | grep -qwF "${LXD_BACKEND}"; then
.github/actions/install-lxd-runtimedeps/action.yml:13
- The explicit installation of zfsutils-linux has been removed here. Confirm that on-demand installation in test/main.sh covers all required storage backends consistently.
zfsutils-linux
…s.xfs`) Signed-off-by: Simon Deziel <[email protected]>
77a8bd1 to
d40093c
Compare
Signed-off-by: Simon Deziel <[email protected]>
This avoids pulling 51 extra packages in the name of speed. If something's needed, it needs to be explicitely added to the list of `packages`. Signed-off-by: Simon Deziel <[email protected]>
It's faster than uninstalling their respective packages. Also stop worrying about packages not present in `ubuntu-minimal-daily:24.04`. Signed-off-by: Simon Deziel <[email protected]>
d40093c to
0d4aec4
Compare
doc/lxd-test.yaml
Outdated
| - content: "force-unsafe-io\n" | ||
| path: /etc/dpkg/dpkg.cfg | ||
| append: true | ||
| # Smaller initramfs (tailored to detected HW) and faster to build |
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.
How does it know which modules are needed?
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.
The update-initramfs tool has the smart to include the modules that are needed by the env it executes in.
However, you made me look again and the 24.04 minimal images are now booting without the usual initrd so this is dead code (I just dropped it). Thanks for catching this!
Server/physical machines running Noble (or VMs < 24.04) can still benefit from this trick as they keep using the traditional initrd. Here it is in action, with the various level of setting:
Regular, big == boots everywhere
root@mars:~# time update-initramfs -uk all
update-initramfs: Generating /boot/initrd.img-6.8.0-60-generic
...
real 0m8.063s
user 0m2.678s
sys 0m3.009s
root@mars:~# ll -h /boot/initrd.img-6.8.0-60-generic
-rw-r--r-- 1 root root 62M Jun 12 09:09 /boot/initrd.img-6.8.0-60-generic
Tailored, smaller == boots only on ~identical machine
root@mars:~# echo MODULES=dep > /etc/initramfs-tools/conf.d/lxd-test.conf
root@mars:~# time update-initramfs -uk all
...
real 0m5.417s
user 0m1.467s
sys 0m2.668s
root@mars:~# ll -h /boot/initrd.img-6.8.0-60-generic
-rw-r--r-- 1 root root 37M Jun 12 09:10 /boot/initrd.img-6.8.0-60-generic
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.
Thanks for looking into it, interesting stuff, TIL.
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.
FYI, the speed difference between default and MODULES=dep was much bigger but since 23.10, they changed it so that modules are already zstd compressed and building the initrd is now essentially just concatenating them as-is into a cpio archive. There is no re-compression like there used to be.
Signed-off-by: Simon Deziel <[email protected]>
Signed-off-by: Simon Deziel <[email protected]>
Signed-off-by: Simon Deziel <[email protected]>
…ions/install-lxd-runtimedeps Those are installed dynamically/on-demand by `test/main.sh`. Signed-off-by: Simon Deziel <[email protected]>
Signed-off-by: Simon Deziel <[email protected]>
Signed-off-by: Simon Deziel <[email protected]>
Signed-off-by: Simon Deziel <[email protected]>
Signed-off-by: Simon Deziel <[email protected]>
0d4aec4 to
9f4752b
Compare
tomponline
left a comment
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.
Thanks!
This allows speeding up both CI and local dev envs using
test-shellby pulling just the needed bits, when they are needed.Lastly, it also hard fail if a
mkfsbinary is missing instead of skipping the test (too easy to miss).Get a fresh VM in ~2 minutes:
Compile dqlite, liblxc and LXD in ~3.5 minutes:
Get a test-shell instantly: