test(macos-container): add launch integration smoke

This commit is contained in:
2026-06-10 20:01:08 -04:00
parent afdf0779a1
commit 890a146413
5 changed files with 299 additions and 29 deletions
+1 -1
View File
@@ -264,7 +264,7 @@ def _agent_run_argv(
def _sidecar_dns() -> str:
return os.environ.get("BOT_BOTTLE_MACOS_CONTAINER_DNS", "1.1.1.1")
return container_mod.dns_server()
def _sidecar_daemons(plan: MacosContainerBottlePlan) -> tuple[str, ...]:
+7 -1
View File
@@ -3,6 +3,7 @@
from __future__ import annotations
import json
import os
import platform
import shutil
import subprocess
@@ -12,6 +13,7 @@ from ...log import die, info
_CONTAINER = "container"
_DEFAULT_DNS = "1.1.1.1"
def is_macos() -> bool:
@@ -33,13 +35,17 @@ def require_container() -> None:
die("container not found")
def dns_server() -> str:
return os.environ.get("BOT_BOTTLE_MACOS_CONTAINER_DNS", _DEFAULT_DNS)
def build_image(ref: str, context: str, *, dockerfile: str = "") -> None:
"""Build an OCI image with Apple's BuildKit-backed `container build`."""
info(
f"building image {ref} from {context} with Apple Container "
"(layer cache keeps repeat builds fast)"
)
args = [_CONTAINER, "build", "-t", ref]
args = [_CONTAINER, "build", "-t", ref, "--dns", dns_server()]
if dockerfile:
args.extend(["-f", dockerfile])
args.append(context)