mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 06:23:17 -10:00
Base's size was read from assets/base.yaml four ways: vm.BaseDisk's
line scanner (a new VM's smallest disk), SizeChoice.Fitted's same scanner
for CPUs and memory (devvm size -g and setup's question), Lima's
buildSize regexes (base's build size), and limactl create reading disk:
from the template on its input. Now backend.BaseCPUs, BaseMemoryGiB and
BaseDiskGiB are the one source:
- vm checks new VMs' disks against backend.BaseDiskGiB, and Fitted fits
BaseCPUs and BaseMemoryGiB; SizeChoice has no Assets any more.
- Lima's buildSize uses the constants; its Origin carries base's disk as
a step of its own ("disk", its GiB), which originOf requires and
createArgs passes as --disk=, so base's key still hashes it, and the
--from conversion's VM gets it too.
- base.yaml sets no cpus, memory or disk, and is hashed only into Lima's
key as Lima's settings.
Tests: TestBuildImageBaseSize (pinned on the old code: base created with
4 CPUs, 8 GiB and a 100 GiB disk, now all flags and none in base.yaml),
TestBaseSize, TestOriginOfRefuses' no disk and bad disk; the limactl stub
reads create's --disk=. Docs: internals/images.md, internals/lima.md,
contributing.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
14 lines
754 B
YAML
14 lines
754 B
YAML
# Lima template for the devvm base image. Tooling is installed by layers/base.sh,
|
|
# not `provision:`, because Lima re-runs provision scripts on every boot.
|
|
# No images here: devvm sets Ubuntu's newest dated cloud image when it creates base,
|
|
# not `base: template:ubuntu-lts`, so a Lima upgrade doesn't change base, and the template's home
|
|
# mount never applies. devvm still passes --mount-none/--mount-only when creating VMs.
|
|
# From Lima's ubuntu-26.04 template: the first-boot NIC rename fails on 26.04 (LP: #2136392), so
|
|
# don't make systemd-networkd-wait-online wait for it.
|
|
param:
|
|
internal_netplanOptional: "true"
|
|
# No cpus, memory or disk here: devvm gives base its size on limactl create's command line.
|
|
containerd:
|
|
system: false
|
|
user: false
|