Skip to content

feat(podman): honor OCI image working directories - #2563

Open
matthewgrossman wants to merge 14 commits into
mainfrom
feat/2526-oci-working-dir-podman/matthewgrossman
Open

feat(podman): honor OCI image working directories#2563
matthewgrossman wants to merge 14 commits into
mainfrom
feat/2526-oci-working-dir-podman/matthewgrossman

Conversation

@matthewgrossman

@matthewgrossman matthewgrossman commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Extend the OCI working-directory behavior introduced for Docker in #2530 to the Podman driver. Podman sandboxes can now use the non-root USER and writable WORKDIR already declared by an ordinary OCI image instead of requiring /sandbox as the single blessed workspace.

For a non-default workdir, OpenShell verifies that the final UID, GID, and supplementary groups could already traverse the path and write and enter the directory in the immutable image. Podman then copies the image directory into its persistent workspace volume, and the final supervisor validates the mounted result without creating the path or changing its ownership or mode. An empty workdir, /, or /sandbox retains the existing OpenShell-managed /sandbox compatibility behavior.

Chronology and scope

  1. #2509, policy-first OCI image identity, taught Docker and Podman to honor OCI USER when policy does not provide the corresponding identity field. It removed the requirement for custom images to contain a sandbox:sandbox account, but deliberately left workspace handling for follow-up work.
  2. #2530, OCI image working directories, added the shared workdir contract and its Docker implementation: use a valid image WORKDIR, verify access as the final identity, grant no new filesystem authority, and preserve /sandbox as the compatibility fallback.
  3. This PR adds that same behavior to Podman only. Podman support was separated from feat(sandbox): honor OCI image working directories #2530 because Podman's persistent named volume covers the OCI workdir before the final supervisor starts. Validating the original image therefore requires a small Podman-specific pre-mount probe and identity attestation. Keeping it separate allowed the simpler Docker implementation to merge independently and confines that extra lifecycle machinery to the driver that needs it.

This work was originally developed on top of #2530. Both predecessor PRs have merged, and this PR now targets main.

Related Issue

Part of #2526

Changes

  • resolve the immutable image ID, OCI identity, workdir, and image volumes once for both probe and final launch
  • validate non-default OCI workdirs in a resource-limited, networkless probe without the workspace volume, secrets, or sandbox token
  • derive the probe identity from the effective global-or-sandbox policy, or discover it from the image policy when neither exists
  • attest that the final supervisor uses the same normalized UID, GID, and supplementary groups that were probed
  • mount Podman persistence at the OCI workdir, allow Podman's initial copy-up, and validate the mounted result without repairing permissions
  • retain OpenShell creation and permission preparation only for the explicit /sandbox compatibility fallback
  • reject driver-config and image-declared volumes that would mask the workdir or OpenShell control paths
  • use attempt-unique probe names and exact-name cleanup without sweeping containers selected by forgeable labels
  • bound and sanitize probe diagnostics
  • document the shared Docker/Podman no-authority-expansion contract

Why Podman needs a probe

Docker can validate the image workdir inside the final container because OpenShell does not cover that path with a workspace volume. Podman mounts a persistent named volume directly at the OCI workdir, which hides the original image path before the supervisor starts.

The Podman driver therefore creates a minimal one-shot container from the same pinned image ID, without networking, the workspace volume, secrets, or the sandbox token. The probe assumes the final process identity and asks the kernel whether that identity can traverse every parent and write and enter the original workdir. The probe's normalized identity is passed to the final supervisor as an attestation, and the supervisor checks both that the identity still matches and that Podman's copied-up volume remains accessible. OpenShell fails rather than changing permissions if either check fails.

Testing

  • mise run pre-commit
  • mise run test
  • focused supervisor-process, sandbox, Podman driver, and server tests
  • Podman OCI identity/workdir E2E against a freshly built supervisor image
  • required Branch Checks and Core E2E
  • rootless Podman E2E on Ubuntu 26.04

Coverage includes image-policy and global-policy identity selection, supplementary groups, resource limits, cancellation, ambiguous creation, exact probe cleanup, nested volumes, permission preservation after copy-up, and forged validation metadata.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture and user documentation updated
  • Required CI is green

@github-actions

Copy link
Copy Markdown

@matthewgrossman
matthewgrossman force-pushed the feat/2526-oci-working-dir-podman/matthewgrossman branch 2 times, most recently from a7e1ee7 to a6993fa Compare August 3, 2026 17:55
Base automatically changed from feat/2526-oci-working-dir/matthewgrossman to main August 4, 2026 17:51
@matthewgrossman
matthewgrossman force-pushed the feat/2526-oci-working-dir-podman/matthewgrossman branch from a6993fa to a746233 Compare August 4, 2026 18:06
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@matthewgrossman
matthewgrossman force-pushed the feat/2526-oci-working-dir-podman/matthewgrossman branch from a746233 to 2ab6ea3 Compare August 4, 2026 18:07
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@matthewgrossman matthewgrossman added the test:e2e Requires end-to-end coverage label Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Label test:e2e applied for d7d5cf7. Open the existing run and click Re-run all jobs to execute with the label set. The run will execute the standard E2E suite after building the required gateway and supervisor images once. The matching required CI gate status on this PR will flip green automatically once the run finishes.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>

@matthewgrossman matthewgrossman left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

PR Review Status

Validation: This PR is project-valid because it implements maintainer-authored, agent-ready issue #2526 and is scoped to the Podman half of the OCI WorkingDir work after #2530 merged.
Head SHA: 2069f04785a9ae0742057684c25f479176e0902e
Base SHA: 490f66f47af4c225fabeb2dc48ea51c67154827c
Merge base SHA: 490f66f47af4c225fabeb2dc48ea51c67154827c
Patch ID: af1aa85fb495511ae397c200658e15602169ca7b
Gator payload: 2
Review mode: initial
Previous reviewed SHA: none

Blocking findings:

  • GATOR-2069f047-01: Podman workspace-probe startup recovery can remove containers selected only by the forgeable openshell.workspace-probe=true label.

Carried findings:

  • None

Non-blocking suggestions:

  • None

Docs: Fern docs and architecture guidance were updated for the user-visible compute-driver behavior.

Next state: gator:in-review

Comment thread crates/openshell-driver-podman/src/driver.rs Outdated
@matthewgrossman matthewgrossman added the gator:in-review Gator is reviewing or awaiting PR review feedback label Aug 5, 2026
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>

@matthewgrossman matthewgrossman left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

PR Review Status

Validation: This PR is project-valid because it implements maintainer-authored issue #2526 and extends the merged OCI WorkingDir support to the Podman driver with scoped docs and E2E coverage.
Head SHA: fdf4a19e6fd1b82bfe5a6b8b286e6e8cca433edb
Base SHA: f383ee1038f91921e104405cd01e4150d533fdbe
Merge base SHA: f383ee1038f91921e104405cd01e4150d533fdbe
Patch ID: 897b5986b6d07fd18fe79401e8a6ca725423b9d7
Gator payload: 2
Review mode: follow_up
Previous reviewed SHA: 2069f04785a9ae0742057684c25f479176e0902e

Blocking findings:

  • No blocking findings remain. GATOR-2069f047-01 is resolved by the latest probe lifecycle changes: probe names are attempt-unique, ambiguous create conflicts no longer trigger cleanup, and cleanup targets the exact probe name created by this attempt rather than sweeping by a forgeable label.

Carried findings:

  • None

Docs: Fern docs and architecture guidance were updated for the user-visible Podman OCI WorkingDir behavior.

E2E: test:e2e is already applied; the required E2E gate is still running.

Next state: gator:watch-pipeline

@matthewgrossman matthewgrossman added gator:watch-pipeline Gator is monitoring PR CI/CD status gator:approval-needed Gator completed review; maintainer approval needed and removed gator:in-review Gator is reviewing or awaiting PR review feedback gator:watch-pipeline Gator is monitoring PR CI/CD status labels Aug 5, 2026
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@matthewgrossman matthewgrossman removed the gator:approval-needed Gator completed review; maintainer approval needed label Aug 7, 2026
@matthewgrossman matthewgrossman added gator:watch-pipeline Gator is monitoring PR CI/CD status gator:approval-needed Gator completed review; maintainer approval needed and removed gator:watch-pipeline Gator is monitoring PR CI/CD status labels Aug 7, 2026
@matthewgrossman

Copy link
Copy Markdown
Contributor Author

gator-agent

Maintainer Approval Needed

Gator validation and PR monitoring are complete for the current effective patch.

Validation: This PR is project-valid because it implements maintainer-authored issue #2526 by extending the merged OCI WorkingDir support to the Podman driver.
Head SHA: 10faeb4d40800942e21eea394e7bc661cbc54350
Patch ID: 897b5986b6d07fd18fe79401e8a6ca725423b9d7
Gator payload: 2
Review: No blocking findings remain. The prior GATOR-2069f047-01 probe-cleanup finding was resolved in the reviewed patch, and the latest head is rebase-equivalent to that reviewed patch.
Docs: Fern docs and architecture guidance were updated for the user-visible Podman OCI WorkingDir behavior.
Checks: Required gates are green: OpenShell / Branch Checks, OpenShell / Helm Lint, and OpenShell / E2E.
E2E: test:e2e is applied and the core E2E gate passed.

Human maintainer approval is now required.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Comment thread crates/openshell-driver-docker/src/lib.rs Outdated
Comment thread crates/openshell-driver-docker/src/lib.rs

@matthewgrossman matthewgrossman left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

PR Review Status

Validation: This PR remains project-valid because it implements the Podman portion of maintainer-authored issue #2526 after the Docker predecessor merged.
Head SHA: 02ae9bc8d5b8e841a9fc3d4c8d28551d816dc23c
Base SHA: 170961997fa26cfd7c52a41d302158d0cd0f24b7
Merge base SHA: 170961997fa26cfd7c52a41d302158d0cd0f24b7
Patch ID: eb9b432e24ccaa777624c6138ad18598bd5dfa45
Gator payload: 3
Review mode: follow_up
Previous reviewed SHA: fdf4a19e6fd1b82bfe5a6b8b286e6e8cca433edb

Blocking findings:

  • No blocking findings remain. The latest author-only delta was reviewed, and resolved finding GATOR-2069f047-01 remains resolved.

Carried findings:

  • None.

Docs: Fern docs, architecture guidance, Podman driver documentation, and companion agent guidance cover the user-visible OCI WorkingDir behavior.

Checks: Required OpenShell / Branch Checks, OpenShell / Helm Lint, and OpenShell / E2E gates are green; DCO passes.

E2E: test:e2e is applied, including successful rootless Podman coverage.

Next state: gator:approval-needed — human maintainer approval is required.

Comment thread crates/openshell-driver-podman/Cargo.toml
Comment thread crates/openshell-supervisor-process/src/process.rs Outdated
@matthewgrossman matthewgrossman added gator:in-review Gator is reviewing or awaiting PR review feedback and removed gator:approval-needed Gator completed review; maintainer approval needed labels Aug 11, 2026
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@matthewgrossman

Copy link
Copy Markdown
Contributor Author

gator-agent

Review Convergence Checkpoint

Head SHA: b26333aec2e6044ec6ddbd47767dbfdde676cacb
Base SHA: 170961997fa26cfd7c52a41d302158d0cd0f24b7
Merge base SHA: 170961997fa26cfd7c52a41d302158d0cd0f24b7
Patch ID: 3981f3fee116cd04544d2d0be8045ea3d8239082
Gator payload: 3

Three finding-bearing review rounds have completed.

Root-cause findings:

  • GATOR-2069f047-01: Podman workspace-probe cleanup must not remove unrelated containers selected through forgeable metadata. This finding remains resolved: probe names are attempt-unique and cleanup targets only the exact probe created by the current attempt.

Scope growth:

  • None. The latest author delta is confined to protected OCI identity-environment handling and Linux-specific supplementary-group setup.

Reviewer-quality signals:

  • The ledger recorded one unique finding repeated across later review dispositions (four duplicate finding-ID occurrences). The bounded checkpoint scan proposed no duplicate, waived, resolved, or unchanged-code findings and found no newly introduced Critical defect.

Maintainer action: accept the current scope, split follow-up work, waive a finding, or explicitly authorize another autonomous review round.

Next state: gator:blocked

@matthewgrossman matthewgrossman added gator:blocked Gator is blocked by process or repository gates and removed gator:in-review Gator is reviewing or awaiting PR review feedback labels Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gator:blocked Gator is blocked by process or repository gates test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant