Jakub Novák
e34d69525f
Expose sandbox metrics in SDKs and CLI ( #828 )
...
# Description
Expose sandbox metrics in SDKs and CLI
```
e2b sbx mt il98ycmohc6enybi79uf8
Metrics for sandbox il98ycmohc6enybi79uf8:
[2025-07-25 14:05:55Z] CPU: 8.27% / 2 Cores | Memory: 31 / 484 MiB | Disk: 1445 / 2453 MiB
[2025-07-25 14:06:00Z] CPU: 0.5% / 2 Cores | Memory: 32 / 484 MiB | Disk: 1445 / 2453 MiB
[2025-07-25 14:06:05Z] CPU: 0.1% / 2 Cores | Memory: 32 / 484 MiB | Disk: 1445 / 2453 MiB
[2025-07-25 14:06:10Z] CPU: 0.3% / 2 Cores | Memory: 32 / 484 MiB | Disk: 1445 / 2453 MiB
```
---------
Co-authored-by: Tomas Valenta <valenta.and.thomas@gmail.com >
2025-07-30 12:17:30 -07:00
Mish Ushakov
edeafb1cdd
Adds files.getInfo / files.get_info methods to retrieve information about directory/files ( #724 )
...
**Changelog**
- Adds `files.getInfo`, `files.get_info` methods to the SDKs.
- Adds tests for the new methods
- Adds documentation for the above.
**Examples**
JavaScript
```js
import { Sandbox } from '@e2b/code-interpreter'
const sandbox = await Sandbox.create()
// Create a new file
await sandbox.files.write('test_file.txt', 'Hello, world!')
// Get information about the file
const info = await sandbox.files.getInfo('test_file.txt')
console.log(info)
// {
// name: 'test_file.txt',
// type: 'file',
// path: '/home/user/test_file.txt'
// }
```
Python
```py
from e2b_code_interpreter import Sandbox
sandbox = Sandbox()
# Create a new file
sandbox.files.write('test_file', 'Hello, world!')
# Get information about the file
info = sandbox.files.get_info('test_file')
print(info)
# EntryInfo(name='test_file.txt', type=<FileType.FILE: 'file'>, path='/home/user/test_file.txt')
```
---------
Co-authored-by: Jakub Novak <jakub@e2b.dev >
2025-07-29 03:39:42 -07:00
Jiri Sveceny
10e9a28a82
Support sandbox domain in sdk and cli ( #821 )
...
Support sandbox traffic routing to the custom domain returned from API.
2025-07-18 13:15:12 +02:00
Mish Ushakov
5c68eb7a25
Fixes Sandbox.connect not working when trying to pass API key via parameters ( #772 )
...
fixes https://github.com/e2b-dev/E2B/issues/746
- Renamed SandboxApi.get_info() > SandboxApi._cls_get_info()
- Properly overloaded Sandbox.get_info()
- Passed connect parameters to SandboxApi._cls_get_info()
2025-07-10 15:41:33 +02:00
0div
9b4861d2ea
Add sandbox metadata docs and update env var tests ( #804 )
...
# Description
- [x] update env var docs to include new default sandbox metadata env
vars
- [x] update js-sdk tests
- [x] update python tests
# Test
```sh
$ [packages/js-sdk] pnpm test env
$ [packages/python-sdk] poetry run pytest --verbose -x tests/async/sandbox_async/commands/test_env_vars.py
$ [packages/python-sdk] poetry run pytest --verbose -x tests/sync/sandbox_sync/commands/test_env_vars.py
```
2025-07-03 14:44:27 -07:00
Mish Ushakov
b21f86c543
Added lint workflow for JS, Python SDKs ( #759 )
...
- Linted all existing files
- Added GitHub workflow to check everything is linted correctly
2025-06-05 14:52:48 +02:00
Mish Ushakov
bf7e862a07
Added skip if debug for some tests ( #737 )
2025-05-20 03:15:31 -07:00
Jiri Sveceny
2def1305f3
Flag for securing envd access with auth token ( #688 )
...
Waiting until secure flag will be available in production cluster.
---------
Co-authored-by: Jakub Novák <jakub@e2b.dev >
2025-05-14 15:15:18 +00:00
Jakub Novák
106d0a7715
Remove closed port tests ( #722 )
...
# Description
They will be moved to infra, they are integration tests
2025-05-12 13:32:30 -07:00
Tomas Valenta
88266d6ae6
Unify passing of template used in tests and log background commands output ( #704 )
...
- Show errors from background commands
- Unify passing of template used in tests
2025-05-06 00:55:03 -07:00
0div
a5b08de85f
Add optional depth parameter to SDK file listing methods. ( #649 )
...
# Description
Do not merge before https://github.com/e2b-dev/infra/pull/524 is merged
and deployed.
The DX would look like this:
```js
const files = await sandbox.files.list(dirName, { depth: 3 })
```
- [x] update `envd` pb spec
- [x] generate for `js-sdk`
- [x] update `js-sdk` `file.list` method to include optional depth param
- [x] update `js-sdk` tests
- [x] generate for `python-sdk`
- [x] update `python-sdk` `file.list` method to include optional depth
param
- [x] sync
- [x] async
- [x] update `python-sdk` tests
- [x] sync
- [x] async
---------
Co-authored-by: Mish <10400064+mishushakov@users.noreply.github.com >
2025-05-05 09:17:08 -07:00
0div
e0c1bc752d
Make codegen robust and deterministic for js and python SDKs ( #664 )
...
# 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
> e2b@1.2.1 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
> e2b@1.2.1 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 <jiri.sveceny@icloud.com >
2025-04-07 17:00:31 +02:00
Jakub Novák
74a6944140
Fix test for closed ports ( #668 )
...
# Description
The response from backend for port is actual integer
2025-04-05 20:38:38 +01:00
0div
bd4398f30d
address PR comments
2025-03-25 15:53:42 -07:00
0div
6dd18e2832
allow writing files that are of type io.BufferedReader and update tests
2025-03-25 14:39:58 -07:00
Mish
c0efd6f322
added additional test coverage for getInfo, updated doc
2025-03-24 16:59:37 +01:00
Mish Ushakov
d4f4352aa3
Add getInfo/get_info methods to the SDKs ( #625 )
...
- Rebased version of #517
2025-03-24 14:26:18 +01:00
Jakub Novák
5c4d07536f
Add filtering option for listing sandboxes ( #532 )
...
# Description
Allow users to filter out sandbox based on metadata
---------
Co-authored-by: Mish Ushakov <10400064+mishushakov@users.noreply.github.com >
2025-03-21 15:57:48 +01:00
0div
d26ff435d6
Fix release test for multi-file write support ( #615 )
...
The previous [release
workflow]([Release](https://github.com/e2b-dev/E2B/commit/b3fe5e6777357a7d814c7dbe4525a18f3f83288f/checks ))
errored after merging this [old
PR](https://github.com/e2b-dev/E2B/pull/451 ), here are the fixes:
- [x] use `WatchOpts` instead of `FilesystemOpts` to avoid TS errors in
js-sdk filesystem method
- [x] fix python-sdk watch test.
2025-03-19 16:07:37 -07:00
0div
a8e88de846
fix merge conflict with main
2025-03-18 09:09:13 -07:00
Jakub Novák
e045df9d50
Fix comments in tests ( #613 )
2025-03-18 08:47:16 -07:00
Jakub Novák
71415ed9e5
Fix flaky tests - Increase the timeout for pinging the server ( #612 )
...
Also changed the ports, so if you run locally there's no port collision
2025-03-18 08:26:25 -07:00
0div
e905d9be34
Test sandbox closed port error ( #597 )
...
this PR adds tests in js and python SDKs for closed port errors
enhancement #265
2025-03-14 02:19:27 -07:00
Jakub Novák
fe7ed15c61
Process time out returns incorrect exception in pythonsdk e2b 1476 ( #550 )
...
Handle the exception properly
2025-01-28 11:45:39 -08:00
Jakub Dobrý
6596eda139
Test for recursive folder creation, add newline after code to docs
2025-01-28 11:26:32 -08:00
Jakub Dobrý
76b4ac02ad
Regenerated python stubs with version 5.28.3
...
- Removed code runtime version check to prevent issues until further investigation
2025-01-28 11:26:32 -08:00
Jakub Dobrý
c8914c2114
Improve recursive watch tests and folders naming
2025-01-28 11:26:32 -08:00
Jakub Dobrý
d92a166d8f
Update watch test file formatting
2025-01-28 11:25:43 -08:00
Jakub Dobrý
25c4539de6
Add watch dir recursive option (missing python client regeneration)
2025-01-28 11:25:42 -08:00
Jakub Novak
ae61d831d2
Add test
2025-01-23 21:22:35 -08:00
Jakub Novak
2e5398c4b6
Add python tests
2025-01-22 20:55:34 -08:00
Jakub Novak
238887b03d
Add retry block to host and stdin tests
2025-01-17 14:24:01 -08:00
0div
4ca24147f6
fixed typing syntax and watch tests
2024-12-12 15:18:06 -08:00
0div
97d0cc1ef5
merge main
2024-12-12 14:54:24 -08:00
0div
bff11dc02e
add the same fixes to python async
2024-12-11 17:29:46 -08:00
0div
3c525220d9
make stdout and stderr decode handle errors by replacing with unicode replacement char; add tests
2024-12-11 17:07:36 -08:00
Tomas Valenta
497bdc95d9
Fix sandbox killing in tests
2024-10-28 14:11:42 -07:00
Tomas Valenta
95baca5d1b
Update async Python docstrings
2024-10-16 00:52:13 -07:00
Jakub Novak
bfc4bb51d8
Rename watch to watch dir
2024-10-14 14:01:34 -07:00
Jakub Novak
bc42ba1e66
Refactor watch dir
2024-10-14 13:01:59 -07:00
Jakub Novak
5c31902cc4
Change close to stop for watch dir
2024-10-14 12:10:17 -07:00
0div
2956a6e7b9
better error messages in python-sdk
2024-10-10 12:04:42 +02:00
0div
f5cd1c0767
add multifile upload to sanbox_async
2024-10-09 14:07:14 +02:00
0div
7767d8f2ee
updated js-sdk tests to check empty path behavior
2024-10-09 13:37:05 +02:00
0div
365af432f1
add extra tests to sandbox_sync write
2024-10-09 12:29:59 +02:00
0div
fbc4af4908
allow passing empty array of files in python-sdk
2024-10-08 18:23:46 +02:00
0div
68ac0383df
merge beta
2024-10-08 16:00:56 +02:00
Jakub Novak
f2bec0544f
Fix empty file + add tests
2024-10-08 15:28:24 +02:00
Jakub Novak
506f70c7b8
Add docstrings to SDKs
2024-10-08 13:04:39 +02:00
0div
608ef45fa5
Use @overload
2024-10-08 12:32:33 +02:00