Forward `volumes` through `OpenSandboxBackend` to `Sandbox.create`
Merged
PY
9d ago+63+63+01234567890123456789-6-6-0123456789
OpenSandboxBackend.create() had no volumes argument, so harness users could not mount host directories into an OpenSandbox sandbox.
Changes:
- Add keyword-only
volumestoOpenSandboxBackend.create(), stored on the backend and forwarded toSandbox.create(_backend.py).Noneserializes to novolumeskey, so existing request bodies are unchanged. - Capture the create-body
volumeskey in the fake transport. The existing default test now also asserts novolumeskey is sent, and the existing pass-through test (renamedtest_creation_options_pass_through) pins the exactvolumeswire body. - Document the option in
docs/harness/opensandbox-sandbox.mdand the package README, with the issue's case: a read-write PVC mounted at the working directory, so a later sandbox starts with the last one's files.
Tests: pytest tests/harness/opensandbox_sandbox/test_backend.py -k "creation_options_pass_through or creation_requests_the_network_policy" (4 passed), pytest tests/harness/test_docs_parity.py -k opensandbox (10 passed), pyright and ruff clean on the touched files, API compatibility check against v2.75.0 clean.
Closes #14278
Summary by cubic
OpenSandboxBackend now accepts a volumes argument and forwards it to Sandbox.create, so harness users can mount host directories, PVCs, or OSSFS buckets into new sandboxes.
New Features
volumestakes the SDK'sVolumeobjects and passes them through unchanged; omitting it leaves the request body as before.- Volumes only apply at creation; attaching to a ref leaves its mounts untouched.
- Documents the option with an example in the harness docs and package README.