Add Podman runtime support - #2470
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a new Podman runtime and refactors the production container lifecycle, networking, callback, and GPU paths shared with Docker. Unresolved comments identify concrete Linux Podman startup and callback failures, so the new behavior and isolation require human validation. You can add or adjust custom eligibility rules. Learn more. |
1a3ac7b to
0b05991
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b059914f9
ℹ️ 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".
0b05991 to
4f5da0e
Compare
4f5da0e to
540d6ea
Compare
540d6ea to
283dd54
Compare
283dd54 to
72bfb32
Compare
72bfb32 to
f25c08a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f25c08aa8c
ℹ️ 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".
85cf8ee to
d75fe0b
Compare
d75fe0b to
151b664
Compare
151b664 to
e846d74
Compare
e846d74 to
637c00b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82e6e9448a
ℹ️ 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".
| if remote and sys.platform == "linux": | ||
| raise SandboxError("Podman remote clients are not supported") |
There was a problem hiding this comment.
Allow local Unix-socket Podman services
On Linux, when CONTAINER_HOST points to a local Unix-domain Podman socket (for example unix:///run/user/1000/podman/podman.sock), serviceIsRemote is true because the CLI is using the service API, so this branch rejects a backend that is still on the same host and whose published ports and callbacks are reachable. Podman's CONTAINER_HOST documentation explicitly permits Unix-domain socket URIs and notes that setting it enables remote mode; inspect the selected URI/backend locality rather than treating every Linux remote-mode client as nonlocal.
Useful? React with 👍 / 👎.
82e6e94 to
3780e81
Compare
3780e81 to
921f207
Compare
921f207 to
5ae0d4e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ae0d4e805
ℹ️ 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".
| if remote and sys.platform == "linux": | ||
| raise SandboxError("Podman remote clients are not supported") |
There was a problem hiding this comment.
Allow local Podman Machines on Linux
When a Linux user selects a locally managed podman machine, serviceIsRemote is true because the CLI communicates with its VM, so this unconditional platform check rejects it before the subsequent IsMachine validation can recognize the supported local backend. The official podman-machine documentation explicitly states that “On Linux, podman machine is optional”; inspect the active connection first and reject only non-machine remote backends rather than all remote-mode Linux clients.
Useful? React with 👍 / 👎.
5ae0d4e to
da3b41a
Compare
da3b41a to
d68b839
Compare
d68b839 to
2157321
Compare
2157321 to
09347f2
Compare
09347f2 to
6fd7c30
Compare
6fd7c30 to
79025db
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79025db1d3
ℹ️ 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".
| await self._proxy.start( | ||
| host_gateway if sys.platform == "linux" else "127.0.0.1" | ||
| ) |
There was a problem hiding this comment.
Avoid binding the proxy to Podman's guest-only gateway
When Linux Podman runs rootless with the slirp4netns backend, host.containers.internal is mapped inside the container to the virtual gateway (commonly 10.0.2.2), not to an address assigned to the host; the slirp4netns documentation identifies 10.0.2.2 as the guest gateway. Passing that /etc/hosts value to asyncio.start_server() as the local bind address therefore raises EADDRNOTAVAIL, and start() removes the container before any task can run. Bind the proxy to a host-owned address or pass a listener into the container namespace instead of binding to the guest-side alias.
Useful? React with 👍 / 👎.
79025db to
1cb14c4
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1cb14c4. Configure here.
| def _proxy_env(self) -> dict[str, str]: | ||
| assert self._proxy is not None | ||
| host = "127.0.0.1" if sys.platform == "linux" else _PROXY_HOST | ||
| host = "127.0.0.1" if sys.platform == "linux" else _DOCKER_HOST |
There was a problem hiding this comment.
Shared _proxy_env hardcodes Docker-specific host alias
Low Severity
The _proxy_env method in the shared _ContainerRuntime base class hardcodes _DOCKER_HOST (host.docker.internal) for the non-Linux proxy URL instead of using an engine-aware value. While currently unreachable for Podman (since PodmanConfig rejects network_restricted), this is the only method in the shared base that still uses a Docker-specific constant rather than dispatching on self.engine or using an engine-specific attribute — inconsistent with the rest of the refactoring.
Reviewed by Cursor Bugbot for commit 1cb14c4. Configure here.


Superseded by #2528.
Overview
Add Podman as a first-class local OCI runtime by sharing the existing container runtime implementation with Docker.
Stacked on #2469.
Details
type = "podman"config, runtime, info dispatch, and public exports.host.containers.internal, and NVIDIA CDI devices.Note
Medium Risk
Refactors the shared container sandbox path used for task execution and networking/GPU setup; Docker behavior should be equivalent but any regression affects isolation and host callbacks, while Podman adds new environment-specific failure modes.
Overview
Adds
type: "podman"as a first-class local sandbox runtime alongside Docker, exported onRuntimeConfig/RuntimeInfoandmake_runtimedispatch.The existing Docker implementation is refactored into engine-agnostic
_ContainerConfig/_ContainerRuntime, with CLI calls routed through_run_container_cli(dockerorpodman).DockerRuntimeandPodmanRuntimeare thin subclasses that set engine-specific callback hosts (vf.host.internalvshost.containers.internal) and run flags (Podman:--network private,--http-proxy=false; Docker keeps bridge networking and restricted-policy caps/iptables cut).Podman gets startup checks (
podman info, remote/machine rules, rootless cgroup/GPU prerequisites) and NVIDIA CDI--device nvidia.com/gpu=Ninstead of Docker’s--gpus.PodmanConfigrejectsnetwork_restrictedat validation time until rootless policy enforcement is validated.Reviewed by Cursor Bugbot for commit 1cb14c4. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add
PodmanRuntimesupport and refactorDockerRuntimeinto engine-agnostic_ContainerRuntimePodmanConfig(type discriminatortype='podman', default imagepython:3.11-slim) andPodmanRuntimealongsidePodmanRuntimeInfo, all exported fromverifiers.v1.runtimesand wired into theRuntimeConfig/RuntimeInfodiscriminated unions_ContainerConfigbase and renamesDockerProcesstoContainerProcesswith anengineattribute; all CLI invocations now route through_run_container_cliwhich selectsdockerorpodmanPodmanConfig:network_restrictedmust beFalse, and GPU index count must be between 0 and 1024; runtime startup checks validatepodman infofor rootless/cgroup/SELinux/crun requirementsDockerRuntimeandPodmanRuntimeare thin subclasses selectingengine='docker'/engine='podman'and engine-specific callback host aliases (host.docker.internalvshost.containers.internal)DockerRuntimenow inherits from_ContainerRuntime; error messages and some network flags (e.g.--http-proxy=false,--network privatefor Podman vs--network bridgefor Docker) differ by engine. Network-restricted capability drops remain Docker-only — Podman rejects restricted policies at validation timeMacroscope summarized 1cb14c4.