Skip to content

refactor(driver-sdk): move the driver contract types into the SDK - #5488

Open
elezar wants to merge 1 commit into
refactor/5383-carve-out-driver-sdk/elezarfrom
refactor/5456-driver-contract-types/elezar
Open

elezar wants to merge 1 commit into
refactor/5383-carve-out-driver-sdk/elezarfrom
refactor/5456-driver-contract-types/elezar

Conversation

@elezar

@elezar elezar commented Nov 11, 2026

Copy link
Copy Markdown
Member

Summary

Move the Rust types for the documents a compute driver hands to the supervisor and the sandbox boundary into openshell-driver-sdk, so the Docker, Podman, and VM drivers no longer depend on openshell-core, openshell-sandbox-backend, or openshell-isolation-interface. This stacks on #5405, which carves out the SDK and deliberately left these types in place.

Related Issue

Part of #5456. This PR covers one part of that issue: removing the driver crates' dependency on the core crates. It does not specify the documents in a language-neutral form, and it does not cover the shared-supervision registration; those remain open in #5456.

Stacked on #5405: the base branch is refactor/5383-carve-out-driver-sdk/elezar, and this PR should merge after it.

Changes

  • Add a legacy_contract module to openshell-driver-sdk behind a legacy-contract feature. It holds BoundaryConfig, SandboxRuntimeDescriptor, SandboxTransport, BoundaryListener, the TLS types, GatewayVerificationKey, ResolvedWorkloadIdentity, ProvisioningEvidence, Sha256Digest, BackendError, BackendDescriptor, generate_sandbox_tls_material, the route handle check, and the backend name, resource claim, and supervisor CA path constants.
  • Re-export every moved item from openshell-sandbox-backend and openshell-isolation-interface at its current path, so each item has one definition and existing callers are unchanged. The From impl from the registered endpoint transport became transport_from_registration, because the orphan rule forbids it in either crate.
  • Repoint the Docker, Podman, and VM drivers to the SDK and drop their dependencies on the three core crates. The VM driver also drops openshell-policy; it used only the sandbox UID range, which the SDK already defines.
  • Document the module as legacy in the SDK README and in the module docs: it describes the format that exists today, accepts no new fields, and is removed once a replacement ships. The README also records the replacement options and a possible migration path. Nothing about the replacement is decided here.
  • Add golden JSON examples and a round-trip test that pins the encoding of each document and checks that readers reject invalid ones.

Testing

  • Checks appropriate to the affected code and behavior pass
    • cargo check --workspace --all-targets and cargo clippy on the touched crates are clean, and the pre-commit hooks pass.
    • cargo tree shows the three drivers no longer depend on openshell-core, openshell-sandbox-backend, openshell-isolation-interface, or openshell-policy for normal builds.
  • Unit tests added/updated (if applicable)
    • openshell-driver-sdk, openshell-isolation-interface, openshell-sandbox-backend, and the Docker and Podman drivers pass. Six VM driver tests fail on a machine without mke2fs (e2fsprogs); they need that tool and I did not run them on the base branch.
  • E2E tests added/updated (if applicable)
    • The Docker, Podman, and VM e2e suites have not been run, so "no behavior change" is verified only by compilation and unit tests.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Docker, Podman, and the VM driver hand the supervisor and the sandbox
boundary a set of JSON documents whose only definition is Rust types in
openshell-sandbox-backend and openshell-isolation-interface, which pull
in openshell-core. Move those types into an openshell-driver-sdk module
behind the legacy-contract feature, re-export them from their old paths,
and repoint the three drivers.

The module is documented as legacy: it describes the format that exists
today, accepts no new fields, and is removed once a replacement ships.
Golden JSON examples and a round-trip test pin the encoding.

The drivers no longer depend on openshell-core, openshell-sandbox-backend,
openshell-isolation-interface, or openshell-policy for normal builds.

Signed-off-by: Evan Lezar <elezar@nvidia.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant