-
Notifications
You must be signed in to change notification settings - Fork 814
feature: add sandbox integrations #320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: eugene/sandbox_exec_only
Are you sure you want to change the base?
Conversation
| @@ -0,0 +1,313 @@ | |||
| """Base sandbox implementation with execute() as the only abstract method. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
general design decision of "everything is execute()" way of fs ops + bash in sandbox? vs Provider specific file APIs (ex: from modal)
app = modal.App.lookup("sandbox-fs-demo", create_if_missing=True)
sb = modal.Sandbox.create(app=app)
with sb.open("test.txt", "w") as f:
f.write("Hello World\n")
f = sb.open("test.txt", "rb")
print(f.read())
f.close()
26920f6 to
53e9dd0
Compare
follow same structure of tools=exec but for modal --------- Co-authored-by: Eugene Yurtsev <[email protected]>
| pattern = data['pattern'] | ||
| path = data['path'] | ||
|
|
||
| os.chdir(path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changing dir here doesn't seem right, shouldn't affect state of cwd
| output = result.output.rstrip() | ||
| exit_code = result.exit_code | ||
|
|
||
| if exit_code != 0 or "Error: File not found" in output: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure we want to string match for this? seems brittle
Add protocol extension to support shell execution
Daytona
Runloop