4 # Approximate amount of RAM needed to run the builder's base system
6 def vm_memory_base(cpus)
8 # mksquashfs will run one thread per CPU, and each of them uses more
9 # RAM, especially when defaulcomp (xz) is used. We only adjust for
10 # more than 10 cpus since that's the only situation where we have
11 # observed RAM shortage.
12 memory += (cpus - 10) * 60 if cpus > 10
16 # Approximate amount of extra space needed for builds
17 BUILD_SPACE_REQUIREMENT = 13 * 1024
19 # Virtual machine memory size for on-disk builds
20 def vm_memory_for_disk_builds(cpus)
24 # Virtual machine memory size for in-memory builds
25 def vm_memory_for_ram_builds(cpus)
26 vm_memory_base(cpus) + BUILD_SPACE_REQUIREMENT
29 # The builder VM's platform
30 ARCHITECTURE = 'amd64'.freeze
31 DISTRIBUTION = 'bookworm'.freeze
33 # The name of the Vagrant box
35 git_root = `git rev-parse --show-toplevel`.chomp
36 shortid, date = `git log -1 --date="format:%Y%m%d" \
37 --no-show-signature --pretty="%h %ad" -- \
38 #{git_root}/vagrant/definitions/tails-builder/`.chomp.split
39 "tails-builder-#{ARCHITECTURE}-#{DISTRIBUTION}-#{date}-#{shortid}"