91e75e620b
CI: cua-driver distro-compat matrix / debian:12 (glibc 2.36) (push) Has been cancelled
CI: SPDX Headers / Check SPDX headers (warn-only) (push) Has been cancelled
CD: Docs MCP Server / build (linux/amd64) (push) Has been cancelled
CD: Docs MCP Server / build (linux/arm64) (push) Has been cancelled
CD: Docs MCP Server / merge (push) Has been cancelled
CI: cua-driver distro-compat matrix / Resolve release version (push) Has been cancelled
CI: cua-driver distro-compat matrix / fedora:41 (glibc 2.40) (push) Has been cancelled
CI: cua-driver distro-compat matrix / rockylinux:9 (glibc 2.34) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:22.04 (glibc 2.35) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:24.04 (glibc 2.39) (push) Has been cancelled
CI: cua-driver distro-compat matrix / Distro compat summary (push) Has been cancelled
CI: Rust Linux unit / Rust Linux unit and compile (push) Has been cancelled
CI: Rust Windows unit / Rust Windows unit and compile (push) Has been cancelled
CI: Nix Linux Rust source / Nix / compositor build (push) Has been cancelled
CI: Nix Linux Rust source / Nix / driver package (push) Has been cancelled
CI: Nix Linux Rust source / Nix / Rust unit tests (push) Has been cancelled
61 lines
2.2 KiB
Python
61 lines
2.2 KiB
Python
"""Docker image tags, port mappings, and runtime constants."""
|
|
|
|
# ── Docker image tags ────────────────────────────────────────────────────────
|
|
|
|
UBUNTU_XFCE = "trycua/cua-xfce:latest"
|
|
QEMU_LINUX = "trycua/cua-qemu-linux:latest"
|
|
QEMU_WINDOWS = "trycua/cua-qemu-windows:latest"
|
|
QEMU_ANDROID = "trycua/cua-qemu-android:latest"
|
|
MACOS_SEQUOIA = "trycua/macos-sequoia:latest"
|
|
|
|
# ── macOS version → OCI image ref ────────────────────────────────────────────
|
|
# Maps macOS version strings (and codename aliases) to ghcr.io image refs.
|
|
# Codenames: Sequoia = 15, Tahoe = 26
|
|
MACOS_VERSION_IMAGES: dict[str, str] = {
|
|
"15": "ghcr.io/trycua/macos-sequoia-cua:latest",
|
|
"sequoia": "ghcr.io/trycua/macos-sequoia-cua:latest",
|
|
"26": "ghcr.io/trycua/macos-tahoe-cua:latest",
|
|
"tahoe": "ghcr.io/trycua/macos-tahoe-cua:latest",
|
|
}
|
|
|
|
# ── Internal ports (inside the container) ────────────────────────────────────
|
|
|
|
XFCE_API_PORT = 8000
|
|
XFCE_VNC_PORT = 6901
|
|
|
|
QEMU_API_PORT = 5000
|
|
QEMU_VNC_PORT = 8006
|
|
|
|
ANDROID_API_PORT = 8000
|
|
ANDROID_VNC_PORT = 6080
|
|
|
|
LUME_API_PORT = 8443
|
|
LUME_PROVIDER_PORT = 7777
|
|
|
|
# ── Default host-side ports ──────────────────────────────────────────────────
|
|
|
|
DEFAULT_API_PORT = 8000
|
|
DEFAULT_VNC_PORT = 6901
|
|
|
|
|
|
def resolve_image(os_type: str, registry: str | None = None) -> str:
|
|
"""Map an os_type to a default Docker image tag."""
|
|
if registry:
|
|
return registry
|
|
return {
|
|
"linux": UBUNTU_XFCE,
|
|
"windows": QEMU_WINDOWS,
|
|
"macos": MACOS_SEQUOIA,
|
|
"android": QEMU_ANDROID,
|
|
}.get(os_type, UBUNTU_XFCE)
|
|
|
|
|
|
def internal_ports(docker_image: str) -> tuple[int, int]:
|
|
"""Return (api_port, vnc_port) for the given Docker image."""
|
|
img = docker_image.lower()
|
|
if "qemu-android" in img:
|
|
return ANDROID_API_PORT, ANDROID_VNC_PORT
|
|
if "qemu" in img:
|
|
return QEMU_API_PORT, QEMU_VNC_PORT
|
|
return XFCE_API_PORT, XFCE_VNC_PORT
|