feat(service): add podman runtime support#626
feat(service): add podman runtime support#626Mercccccc wants to merge 2 commits intoalibaba:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 398b7102bf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds Podman as an additional container runtime option by introducing a PodmanSandboxService that reuses the existing Docker-backed sandbox implementation via Podman’s Docker-compatible API, plus configuration plumbing and tests.
Changes:
- Add
PodmanSandboxService(inheritsDockerSandboxService) with Podman socket auto-detection and a retry adapter tweak. - Extend configuration and service factory/exports to support
runtime.type = "podman". - Expand secure runtime validation path and add a dedicated Podman unit test suite.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| server/opensandbox_server/config.py | Adds podman runtime type and PodmanConfig with socket_path; updates runtime block validation. |
| server/opensandbox_server/services/docker.py | Refactors Docker service init to use overridable hooks for client creation and connection hints. |
| server/opensandbox_server/services/podman.py | Implements Podman runtime via Docker SDK client base_url, socket detection, retry adapter patch, and label-update no-op. |
| server/opensandbox_server/services/factory.py | Registers podman runtime type -> PodmanSandboxService. |
| server/opensandbox_server/services/init.py | Exports PodmanSandboxService. |
| server/opensandbox_server/services/runtime_resolver.py | Routes podman through the docker-like secure runtime validation path. |
| server/opensandbox_server/main.py | Treats podman like docker for startup secure runtime validation client creation/logging. |
| server/tests/test_podman_service.py | Adds unit tests for Podman init, socket detection, retry adapter patching, config validation, and factory behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Closes #425
Add Podman as a third container runtime alongside Docker and Kubernetes.
Why: Docker Desktop requires a paid subscription for commercial use, which may be prohibited on corporate machines. Podman is daemonless, natively rootless, and fully open-source (Apache 2.0).
What:
PodmanSandboxServiceinheritsDockerSandboxService, reusing 2200+ lines of existing code via Podman's Docker-compatible APIbase_urldirect pass instead ofos.environmutation), label updates (no-op — Podman doesn't support runtime label changes), connection error hints (Podman-specific messaging), andsocket detection (Linux/macOS/Windows)
DockerSandboxServiceas overridable hooks (_supported_runtime_types,_connection_error_hint,_create_docker_client) — existing Docker behavior unchangedos.open()Files changed:
config.py,docker.py,factory.py,__init__.py,main.py,runtime_resolver.pyFiles added:
podman.py,test_podman_service.pyKnown limitations vs Docker:
renew_expiration, sandbox falls back to original expiration (in-memory tracking is authoritative at runtime)pause/unpauserequires cgroups v2; egress sidecar sysctls may be restrictedTesting
echo,uname, file I/O, Python)Breaking Changes
Existing
runtime.type = "docker"andruntime.type = "kubernetes"configurations are unaffected. Thedocker.pyrefactoring is a pure extract-method change with identical behavior.Checklist
os.environmutation; socket auto-detection validates pipe existence; rootless-first default)[podman]config section is optional with defaults)