feat(ip-pool): pre-assign static IPs to build VMs via VMX guestinfo
Eliminates VMware-Tools IP-detect polling (observed: 39–177 s variance on
Linux host B7 benchmark). When [ip_pool] is configured the orchestrator:
1. Allocates a slot IP from a JSON-backed pool (fcntl-locked on Linux)
2. Injects guestinfo.ip-assignment / netmask / gateway into the cloned VMX
before vmrun start
3. Skips _wait_for_ip entirely — uses the pre-assigned IP immediately
4. Releases the slot in _destroy_clone (all paths: success/failure/interrupt)
New modules / changes:
src/ci_orchestrator/ip_pool.py IpSlotPool + _file_lock context manager
src/ci_orchestrator/config.py IpPoolConfig dataclass; [ip_pool] TOML
src/ci_orchestrator/commands/job.py _inject_guestinfo_ip helper; pool wiring
tests/python/test_ip_pool.py 12 unit tests (acquire/release/persist)
tests/python/test_config.py ip_pool config parsing tests
tests/python/test_commands_job.py pool path + _inject_guestinfo_ip tests
config.example.toml [ip_pool] section (commented example)
Coverage 90.02%; mypy --strict clean.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -32,3 +32,24 @@ keys = "F:/CI/keys"
|
||||
# Phase C hook: backend selector. Only "workstation" is implemented in Phase A.
|
||||
[backend]
|
||||
type = "workstation"
|
||||
|
||||
# Optional: pre-assign static IPs to build VMs via VMX guestinfo injection.
|
||||
# Eliminates VMware-Tools IP-detect polling (20–180 s variance) — the host
|
||||
# injects guestinfo.ip-assignment into each cloned VMX before vmrun start,
|
||||
# and the guest boot script applies the static IP immediately.
|
||||
#
|
||||
# Prerequisite: install the guest-side startup script from
|
||||
# template/guest-setup/linux/ci-report-ip.sh (Linux guests)
|
||||
# template/guest-setup/windows/ci-static-ip.ps1 (Windows guests)
|
||||
# and re-take the BaseClean / BaseClean-Linux snapshot.
|
||||
#
|
||||
# Pool size should equal runner capacity (default 4).
|
||||
# Addresses must be outside the VMnet8 DHCP range (check
|
||||
# /etc/vmware/vmnet8/dhcpd/dhcpd.conf — typically .128–.254).
|
||||
#
|
||||
# [ip_pool]
|
||||
# addresses = ["192.168.79.201", "192.168.79.202",
|
||||
# "192.168.79.203", "192.168.79.204"]
|
||||
# netmask = "255.255.255.0"
|
||||
# gateway = "192.168.79.2" # VMnet8 gateway; leave empty to skip default route
|
||||
# lease_file = "/var/lib/ci/ip-pool.json"
|
||||
|
||||
Reference in New Issue
Block a user