feat(providers): serve sandbox config files on demand - #3832
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Label |
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
246e09d to
2c93ac2
Compare
|
🌿 Preview your docs: https://nvidia-preview-pr-3832.docs.buildwithfern.com/openshell |
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Potential concerns• Older supervisors can start without an attached provider’s credentials in the local-policy path. The new gateway rejects the entire provider response (https://github.com/NVIDIA/ • The checked-in example does not meet issue #3830’s (#3830) documentation criterion. examples/provider-managed-files/ contains only the YAML appear in the PR description, but not in a runnable example README or the provider profile docs. The related openshell-cli skill also has no companion update. An operator using the repository or published docs cannot discover the complete workflow and its metadata/inotify limits. Design and verificationThe core choice is a complete file-map replacement ( ):an open takes content from one snapshot, so an existing descriptor keeps its bytes while later opens see the update. The PR also probes the sandbox boundary before sending a file-bearing snapshot. Rust and Go branch checks and Docker E2E pass. Podman E2E fails (https://github.com/NVIDIA/OpenShell/actions/runs/36625502817/job/109606066878) in the existing sandbox stop/start scenario: |
There was a problem hiding this comment.
Non-blocking / informational. This provides a useful subset of Kubernetes ConfigMap volume behavior for clients that open a known absolute path. The --wait acknowledgement and reopen semantics are particularly useful.
| Capability | Kubernetes ConfigMap volume | PR 3832 |
|---|---|---|
| File access | A read-only directory with normal metadata and listing. | Known absolute paths served through open, openat, and openat2; stat, access, listing, and inotify do not expose the virtual files. |
| Updates | Mounted files update eventually; environment variables require a restart, and subPath mounts do not update. ConfigMap docs |
--wait confirms publication; later opens get new bytes while existing descriptors retain their content. |
| Layout | Select keys, map them to paths, and set file modes. Projected volumes | One safe filename per entry under /run/openshell/providers/<provider>/, with an optional environment variable containing its path. |
| Data | UTF-8 data and binary binaryData, up to 1 MiB per ConfigMap. ConfigMap docs |
UTF-8 templates rendered from config.KEY, capped at 64 KiB per file and 256 KiB per sandbox. |
The most consequential gap for native clients is filesystem compatibility: a client that checks existence before opening, scans the directory, or watches for updates will not observe the virtual file. Kubernetes' atomic writer exposes updates through its ..data symlink; applications need to watch that change rather than assume a watch on the individual file will persist. Calling out the open-only boundary in the checked-in example and testing a representative native client would help users judge compatibility.
If broader compatibility is needed later, a read-only projected volume mode could provide metadata, listing, and watch behavior. Smaller possible additions are explicit escaping for template values used in TOML or JSON, binary content, and mapped or nested paths. These are future-scope suggestions, not merge blockers.
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
|
On the older-supervisor concern: commit dc36e06 removes the The tradeoff is that an older supervisor cannot serve managed files, even though a profile's |
Summary
Serve non-secret provider configuration files to sandbox workloads on demand. The profile
filesAPI is experimental and may change or be removed. The sandbox intercepts read-only opens for managed absolute paths and injects sealed, memory-backed file descriptors; provider updates replace the snapshot seen by later opens.Related Issue
Closes #3830
Changes
filestemplates to provider profiles, rendered only fromconfig.KEYvalues, with bounded sizes and safe file names. Mark the public contract and SDK types as experimental.open/openat/openat2interception. Updates affect later opens, while existing descriptors keep their original content; detach returnsENOENT.examples/provider-managed-files/, Go SDK profile conversion, and a Docker e2e scenario. Published feature docs are deferred while this interface is under review.Example
Save this profile as
acme-config.yaml:With a running gateway, import it and attach a provider:
Update the provider and reopen the path to see the new content; detach removes it for later opens:
openshell provider update acme-prod --config project=staging --wait openshell sandbox exec -n acme-demo -- cat /run/openshell/providers/acme-prod/client.toml openshell sandbox provider detach acme-demo acme-prod --waitThis open-only version supports direct absolute-path reads. Directory listing, metadata lookup, and inotify do not expose the virtual files.
Testing
mise run pre-commitpassesmise run test— provider-file compatibility and public schema inventory tests passed. The concurrentopenshell-supervisor-networkMCP forwarding test failed while expecting HTTP 200; it passed when rerun alone.OPENSHELL_E2E_DOCKER_TEST=provider_files mise run e2e:rust(shared conformance and provider-file scenario)examples/provider-managed-files/against an ephemeral Docker gateway: import, create, read, update, reopen, detach, and confirmedENOENTafter detach.mise run go:proto:genandmise run go:docs:checkmise run go:ci— unrelated gateway tests assume no system gateway, but this host has/etc/openshell/gateways/default; converter tests and other Go checks passed.Checklist