64 lines
1.5 KiB
Plaintext
64 lines
1.5 KiB
Plaintext
"""
|
|
Runtime abstraction configuration schema.
|
|
|
|
Provides unified configuration for Docker, Podman, OrbStack, Colima, nerdctl.
|
|
"""
|
|
|
|
schema TypesRuntime:
|
|
Runtime: "docker" | "podman" | "orbstack" | "colima" | "nerdctl"
|
|
|
|
schema RuntimeConfig:
|
|
"""Container runtime configuration"""
|
|
|
|
# Preferred runtime (if available)
|
|
preferred?: TypesRuntime.Runtime
|
|
|
|
# Runtimes to check in order
|
|
check_order: [TypesRuntime.Runtime] = [
|
|
"docker",
|
|
"podman",
|
|
"orbstack",
|
|
"colima",
|
|
"nerdctl"
|
|
]
|
|
|
|
# Detection timeout in seconds
|
|
timeout_secs: int = 5
|
|
|
|
# Enable caching of runtime detection
|
|
enable_cache: bool = True
|
|
|
|
check:
|
|
timeout_secs > 0, "timeout_secs must be positive"
|
|
len(check_order) > 0, "check_order must not be empty"
|
|
|
|
schema ComposeAdapterConfig:
|
|
"""Docker Compose adapter configuration"""
|
|
|
|
# Target runtime
|
|
runtime: TypesRuntime.Runtime
|
|
|
|
# Path to compose file
|
|
compose_file: str
|
|
|
|
# Service environment
|
|
environment: str = "dev"
|
|
|
|
# Network mode
|
|
network_mode?: str
|
|
|
|
# Port mappings to override
|
|
port_overrides?: {str: str}
|
|
|
|
check:
|
|
len(compose_file) > 0, "compose_file must not be empty"
|
|
environment in ["dev", "staging", "prod"], "environment must be dev|staging|prod"
|
|
|
|
# Global runtime configuration
|
|
runtime_config: RuntimeConfig = {
|
|
preferred = "docker"
|
|
check_order = ["docker", "podman", "orbstack", "colima", "nerdctl"]
|
|
timeout_secs = 5
|
|
enable_cache = True
|
|
}
|