Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fix(cua-sandbox): boot Windows Fleet sandboxes with UEFI firmware (#3125)

r33drichards8522943eb13e
diff --git a/libs/python/cua-sandbox/cua_sandbox/transport/fleet_cloud.py b/libs/python/cua-sandbox/cua_sandbox/transport/fleet_cloud.py
index 6e27878a84..65586c952b 100644
--- a/libs/python/cua-sandbox/cua_sandbox/transport/fleet_cloud.py
+++ b/libs/python/cua-sandbox/cua_sandbox/transport/fleet_cloud.py
@@ -34,6 +34,7 @@ from fleet_sdk import (
CyclopsConfiguration,
CyclopsCredentials,
CyclopsTokenProviderConfiguration,
+ Firmware,
HttpRequest,
OsGymSandboxTemplateSpecBuilder,
OsGymSandboxWarmPoolSpecBuilder,
@@ -574,6 +575,12 @@ class FleetCloudTransport(FleetTransport):
)
.services(services)
)
+ # Windows guest disks are built UEFI-only (see registry/qemu_builder.py), and the
+ # Fleet schema defaults firmware to BIOS, so a Windows image left at the default
+ # boots SeaBIOS against a GPT/ESP disk and never reaches the readiness probe.
+ # The local QEMU runtime keys off the same os_type check.
+ if self._image.os_type == "windows":
+ vm_template_builder = vm_template_builder.firmware(Firmware.EFI)
if self._cpu is not None:
vm_template_builder = vm_template_builder.cpu_cores(self._cpu)
if self._memory_mb is not None:
diff --git a/libs/python/cua-sandbox/tests/test_fleet_cloud_transport.py b/libs/python/cua-sandbox/tests/test_fleet_cloud_transport.py
index 41e6de8704..87b227741d 100644
--- a/libs/python/cua-sandbox/tests/test_fleet_cloud_transport.py
+++ b/libs/python/cua-sandbox/tests/test_fleet_cloud_transport.py
@@ -6,6 +6,7 @@ from cua_sandbox import Sandbox as CuaSandbox
from cua_sandbox.transport import fleet_cloud
from cua_sandbox.transport.fleet_cloud import FleetCloudTransport
from fleet_sdk import (
+ Firmware,
OsGymSandboxWarmPoolSpecBuilder,
OsGymSandboxWarmPoolStatus,
Pool,
@@ -88,6 +89,18 @@ def test_default_windows_image_becomes_typed_template_request():
)
+def test_windows_image_boots_uefi():
+ request = FleetCloudTransport(image=Image.windows(), name="demo")._template_request()
+
+ assert request.spec.vm_template.firmware == Firmware.EFI
+
+
+def test_linux_image_leaves_firmware_at_the_schema_default():
+ request = FleetCloudTransport(image=Image.linux(), name="demo")._template_request()
+
+ assert request.spec.vm_template.firmware is None
+
+
def test_pool_request_uses_the_single_sandbox_name_and_requested_replicas():
request = FleetCloudTransport(
image=Image.from_registry("registry.example/workspace@sha256:abc"),