-
Notifications
You must be signed in to change notification settings - Fork 739
Add auto pause on timeout to SDK #568
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
Closed
dobrac
wants to merge
415
commits into
add-pause-and-resume-to-sdk-e2b-1190
from
add-autopause-option-to-sdk-e2b-1461
Closed
Add auto pause on timeout to SDK #568
dobrac
wants to merge
415
commits into
add-pause-and-resume-to-sdk-e2b-1190
from
add-autopause-option-to-sdk-e2b-1461
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
This documents the new SDK method implemented [here](#543)
run to => to run 🙂
Hide metrics route in the docs sidebar until the feature is fully released
Added code snippets to documentation for using Groq with E2B.
show metrics route in the docs sidebar now that the metrics feature is released
- Removed code runtime version check to prevent issues until further investigation
Adds recursive directory watch to the SDK and documentation section. Requires merging and deploying e2b-dev/infra#210 first. ### Proposed API change: **JS** ```js await sandbox.files.watchDir(dirname, handler, { recursive: true }) ``` **Python** ```py sandbox.files.watch_dir(dirname, recursive=True) ``` --- ### Notes Python SDK was generated using buf.build/protocolbuffers/python:v28.3. The runtime check was removed for now. Further tests might be required to make sure the runtime is at least the generated version before including the runtime check. Changing the following in the file spec/envd/buf-python.gen.yaml (generator) allows using different protoc-gen-python version: From: `plugin: python` To: `plugin: buf.build/protocolbuffers/python:v28.3`
# Description The response from backend for port is actual integer
# Description The test was moved to integration tests directly in infra repo
# Description This PR allows to codegen without worrying about your environment and dependencies for consistent outcomes in what code is generated from openapi and envd protobuf spec. Will generate files for `js-sdk` and `python-sdk` - [x] create Docker image with all the pinned deps needed to codegen - [x] create codegen script using this container with mapped volumes - [x] adapt Makefiles to this new approach - [x] adapt where we install the connect-python protobuf binary for this to work # Test ```sh make codegen # this command is similar to `make generate` but w/o the hassle Generating SDK code from openapi and envd spec cd packages/js-sdk && pnpm generate > [email protected] generate /workspace/packages/js-sdk > python ./../../spec/remove_extra_tags.py sandboxes templates && openapi-typescript ../../spec/openapi_generated.yml -x api_key --arr ay-length --alphabetize --output src/api/schema.gen.ts ✨ openapi-typescript 7.6.1 🚀 ../../spec/openapi_generated.yml → src/api/schema.gen.ts [44.2ms] cd packages/js-sdk && pnpm generate-envd-api > [email protected] generate-envd-api /workspace/packages/js-sdk > openapi-typescript ../../spec/envd/envd.yaml -x api_key --array-length --alphabetize --output src/envd/schema.gen.ts ✨ openapi-typescript 7.6.1 🚀 ../../spec/envd/envd.yaml → src/envd/schema.gen.ts [22.7ms] [...] cd packages/python-sdk && make generate-api All done! ✨ 🍰 ✨ ``` --------- Co-authored-by: Jiri Sveceny <[email protected]>
- Minor type fix
One should now be able to use sb.filesystem.write(WriteEntry[]) in a typesafe way. --------- Co-authored-by: Mish <[email protected]>
There was a type in dataclass declaration that caused the WriteEntry to behave incorrectly.
…lder during publish (#682) ### Description This was initially performed in [the legacy workflow](https://github.com/e2b-dev/E2B/blob/d27f81c5d3a85e2791258e388eb7ebd5f2e5eaa9/.github/workflows/generate_sdk_ref.yml#L101-L117) but has since been removed, adding it back to have latest [desktop & code-interpreter SDK references](https://e2b.dev/docs/sdk-reference) on our docs ### Test <img width="234" alt="Screenshot 2025-04-15 at 1 47 16 PM" src="https://github.com/user-attachments/assets/b00347d9-794d-41f1-98db-c4704c59f50d" /> #### should become: - [ ] desktop: - [ ] js-sdk `v1.7.01@latest` - [ ] python-sdk `v1.6.1@latest` - [ ] code-interpreter - [ ] js-sdk `v1.1.1@latest` - [ ] python-sdk `v1.2.0@latest`
Because our docs nextjs app is being proxied by our dashboard nextjs app, we need to ensure the docs nextjs app uses absolute urls to handle it's assets. Because when it is proxied by another nextjs app, the proxy tries to reference the docs nextjs apps assets relatively, which results in assets not being found. Before this pr, we set an assetPrefix for every node production deployment, which caused issues on preview deployments, since these can consist of multiple assigned domains and depending on which one was opened, the asset prefixing failed. These changes ensure that only the production deployment of the docs application has an assetPrefix. Here we can be certain on which domain it will live. I created a new environment variable `PRODUCTION_URL` here to ensure 100% consistency with `e2b-dev/dashboard`s proxy domain config, without relying on the vercel projects assigned domain setup.
Add latest changes in main to the auto-pause feature branch - [x] python-sdk - [x] successful build? - [x] successful unit tests? - [x] js-sdk - [x] successful build? - [x] successful unit tests? --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Ben Fornefeld <[email protected]> Co-authored-by: never not exploring <[email protected]> Co-authored-by: Vasek Mlejnsky <[email protected]> Co-authored-by: Vasek Mlejnsky <[email protected]> Co-authored-by: handlebauer <[email protected]> Co-authored-by: Tereza Tizkova <[email protected]> Co-authored-by: tizkovatereza <[email protected]> Co-authored-by: Jakub Dobrý <[email protected]> Co-authored-by: Jakub Novak <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tomas Valenta <[email protected]> Co-authored-by: r33drichards <[email protected]> Co-authored-by: James Murdza <[email protected]> Co-authored-by: yushengchen <[email protected]> Co-authored-by: Ziray Hao <[email protected]> Co-authored-by: Mish Ushakov <[email protected]> Co-authored-by: Ziray Hao <[email protected]> Co-authored-by: Jiri Sveceny <[email protected]> Co-authored-by: yusheng chen <[email protected]> Co-authored-by: David Batey <[email protected]> Co-authored-by: Penny Templeton <[email protected]>
- Added notices in "Connect to running sandbox", "Sandbox metadata" docs. - Updated "List sandboxes", "Sandbox persistence" docs. - Renamed route "List running sandboxes" > "List sandboxes".
…use-option-to-sdk-e2b-1461
- [x] js-sdk - [x] successful build? - [x] successful unit tests? - [x] python-sdk - [x] successful build? - [x] successful unit tests? --------- Co-authored-by: Jakub Novak <[email protected]> Co-authored-by: Tomáš Rychlik <[email protected]> Co-authored-by: Mish <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Member
|
Merged via #854 |
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.
Changes the following
autoPause: trueandauto_pause=TrueresumewithconnectSDK Change
The autoPause option is required, and has to be set to true.
JS
Python - Async
Python - Sync
For both Python implementations, the exit now calls .pause() instead of .kill()
Tasks
Update web documentation(not for now, until we know the final SDK DX)Temporary solution for connect
There is a setTimeout for every connect to resolve issues where paused sandbox can immediately timeout.
Options discussed:
1. No set - never sure how long the sandbox will be running
2. Always set the timeout in code - the user can't just connect to the sandbox
without changing the timeout, round trip to the server time
3. Set the timeout in resume on backend - side effect on error
4. Create new endpoint for connect