Sandbox to execute gorilla output code #165
Open
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.
The goal of this feature is to allow the user to run the code outputted by Gorilla (Row #26 on the spreadsheet)
Current progress: The program spawns a docker container to run the code generated with some language-level sandboxing restrictions. Since it is currently raw docker, it is not fully secure as a sandbox but the container structure should handle typical cases of code generation.
Todo: Integrate a virtualization layer to make it more secure and also implement a few more language-level sandboxing features.
How to test:
The sandboxing code is stored inside the
/inference/sandbox
folder. To test it, simply navigate into this folder and runpython3 spawn_docker_sandbox.py
. The code to be run can be changed intest.py
. The current test is the language translation example from the colab notebook.Credits:
Language-level sandboxing inspiration taken from Jessica McKellar's presentation at PyCon.