Skip to content

Commit 95c58a8

Browse files
committed
docs(rfc): clarify driver-local config schemas
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 574721f commit 95c58a8

1 file changed

Lines changed: 43 additions & 4 deletions

File tree

rfc/0005-driver-config-passthrough/README.md

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,21 @@ message DriverSandboxTemplate {
153153
The driver receives only the selected driver's inner config block. It does not
154154
receive the full public envelope.
155155

156+
Drivers may interpret the received `Struct` through driver-local typed schemas.
157+
For example, the Kubernetes driver may define a Kubernetes-specific protobuf
158+
message or Rust struct for its inner `driver_config` block and map the forwarded
159+
`Struct` into that type before validation and pod construction. That local typed
160+
decode is an implementation detail of the selected driver. It must not require
161+
the gateway to import Kubernetes-, Docker-, Podman-, or VM-specific config
162+
messages, and it must not change the public driver-keyed envelope contract.
163+
164+
Driver-local typed config should be distinct from gateway process configuration
165+
such as `[openshell.drivers.<name>]` TOML structs. Gateway process configuration
166+
contains operator-owned settings like namespaces, gateway endpoints, service
167+
accounts, TLS material, default images, and runtime state paths. Caller-provided
168+
per-sandbox `driver_config` must use a narrower create-time schema that exposes
169+
only documented, caller-safe knobs for that driver.
170+
156171
### Gateway behavior
157172

158173
The gateway handles only the top-level envelope:
@@ -317,8 +332,10 @@ surfaces include:
317332

318333
- a schema URL in `GetCapabilitiesResponse`;
319334
- an inline schema in `GetCapabilitiesResponse`;
320-
- a dedicated `GetDriverConfigSchema` RPC; or
321-
- a schema identifier or version that maps to published documentation.
335+
- a dedicated `GetDriverConfigSchema` RPC;
336+
- a schema identifier or version that maps to published documentation; or
337+
- a driver-published protobuf descriptor or type identifier for drivers that
338+
use protobuf messages to model their local config.
322339

323340
Any schema discovery mechanism should preserve the ownership boundary:
324341

@@ -327,6 +344,8 @@ Any schema discovery mechanism should preserve the ownership boundary:
327344
checks.
328345
- The gateway must not encode driver-specific schema knowledge directly.
329346
- Schema-based gateway checks must not replace driver-side validation.
347+
- A protobuf-backed schema does not imply a central `oneof` of all in-tree and
348+
out-of-tree driver configs in the public API.
330349

331350
Schema discovery is not required for the first implementation of this RFC, but
332351
the API design should not preclude adding it later.
@@ -441,9 +460,12 @@ outside this RFC.
441460
use cases.
442461
7. Implement driver-side validation for supported keys, malformed values,
443462
typed-field conflicts, protected invariants, and unsafe platform controls.
444-
8. Add examples and tests for documented Kubernetes `driver_config` keys,
463+
8. If a driver uses a local typed schema, map the selected inner `Struct` into
464+
that driver-local type inside the driver before validation. Do not add
465+
driver-specific config messages to the gateway translation layer.
466+
9. Add examples and tests for documented Kubernetes `driver_config` keys,
445467
including GPU extended resources and sidecar resource requests.
446-
9. Document built-in driver names, exact-match behavior, validation ownership,
468+
10. Document built-in driver names, exact-match behavior, validation ownership,
447469
lifecycle semantics, protected-field rules, schema evolution expectations,
448470
and supported Kubernetes keys.
449471

@@ -476,6 +498,23 @@ This keeps the public API strongly typed, but the gateway remains a bottleneck,
476498
the public API grows around driver-specific details, and new driver capabilities
477499
require coordinated releases.
478500

501+
### Central public `oneof` for per-driver config protos
502+
503+
The public API could replace the generic `Struct` envelope with a central
504+
`oneof` containing typed messages for every supported driver, or the internal
505+
driver API could require the gateway to translate the selected block into a
506+
driver-specific protobuf message before calling the driver.
507+
508+
This gives generated types to clients and the gateway, but it moves schema
509+
ownership back into the shared API surface. Every new driver config key, and
510+
every out-of-tree driver config shape, would require gateway proto changes and
511+
coordinated releases. It also makes portability harder because clients must
512+
compile against all config message variants they want to carry.
513+
514+
Driver-local protobuf messages remain compatible with this RFC when the gateway
515+
continues to forward only the selected inner `Struct` and the selected driver
516+
performs the typed decode and validation locally.
517+
479518
### Merge caller config into `platform_config`
480519

481520
The gateway could merge caller-provided config into the existing

0 commit comments

Comments
 (0)