Expose explicit sandbox backend modes#206
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
cell(subinterpreter) with stronger OS-level boundaries (process/microvm).Description
BackendModetype and constantsDEFAULT_BACKEND,SUPPORTED_BACKENDS, andIMPLEMENTED_BACKENDSand validation helpers_normalize_backendand_require_implemented_backendinpyisolate/supervisor.py.backend: BackendModeparameter through the publicSupervisor.spawn(...)and module-levelspawn(...)helpers, pre-validating and fail-closing on unimplemented backends, and store the chosen backend on the sandbox thread as._backendwith aSandbox.backendproperty accessor.backendthrough high-level helpers by adding abackendparameter to the@sandbox(...)decorator and toPipeline.add_stage(...)and use the value when spawning stages inpyisolate/sdk.py.pyisolate(pyisolate/__init__.py) and update the docs (README.md,API.md,docs/execution-model.md) to clearly distinguishbackend="subinterpreter",backend="process", andbackend="microvm"and to note that onlysubinterpreteris implemented in this build.tests/test_supervisor.pythat assertbackend="subinterpreter"is selectable, thatprocess/microvmfail closed withNotImplementedError, and that unknown backend values raiseValueError.Testing
python -m py_compile pyisolate/supervisor.py pyisolate/sdk.py pyisolate/__init__.py, which succeeded.blackon the modified files, which completed successfully.pytest tests/test_supervisor.pyandpytest tests/test_sdk.py tests/test_supervisor.py, and those test runs passed (all tests in those runs succeeded).pytest) and observed many unrelated failures caused by an existing test stub altering theBPFManager.loadsignature during metrics tests; these failures are not caused by the backend plumbing and indicate a separate test-environment stub interaction that must be addressed independently.Codex Task