Skip to content
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

Docs persistence #509

Merged
merged 4 commits into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 37 additions & 17 deletions apps/web/src/app/(docs)/docs/sandbox/persistence/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<Note>
Sandbox persistence is currently in beta:
1. [Reach out to us](/docs/support) to get access to the beta.
1. You need to install the [beta version of the SDKs](#installing-the-beta-version-of-the-sdks).
1. [Reach out to us](/docs/support) with your use case to get access to the beta.
1. You'll need to install the [beta version of the SDKs](#installing-the-beta-version-of-the-sdks).
mlejva marked this conversation as resolved.
Show resolved Hide resolved
1. Consider [some limitations](#limitations-while-in-beta).
1. The persistence is free for all users during the beta.
</Note>
Expand All @@ -18,12 +18,22 @@ To use the sandbox persistence, you need to install the beta version of the SDKs
<CodeGroup>
```bash {{ language: 'js' }}
npm i @e2b/code-interpreter@beta
#
# or use Core: https://github.com/e2b-dev/e2b
# npm i e2b@beta
#
# or use Desktop: https://github.com/e2b-dev/desktop
# npm i @e2b/desktop@beta
```

```bash {{ language: 'python' }}
# Install the latest beta version of the SDK on PyPi
# https://pypi.org/project/e2b/#history
pip install e2b-code-interpreter==1.0.4b
#
# or use Core: https://github.com/e2b-dev/e2b
# pip install e2b==1.1.0.b
#
# or use Desktop: https://github.com/e2b-dev/desktop
# pip install e2b-desktop==1.1.0.b
```
</CodeGroup>

Expand All @@ -33,9 +43,9 @@ When you pause a sandbox, both the sandbox's filesystem and memory state will be

<CodeGroup>
```js
import { Sandbox } from 'e2b'
// or use Code Interpreter: https://github.com/e2b-dev/code-interpreter
// import { Sandbox } from '@e2b/code-interpreter'
import { Sandbox } from '@e2b/code-interpreter'
// or use Core: https://github.com/e2b-dev/e2b
// import { Sandbox } from 'e2b'
//
// or use Desktop: https://github.com/e2b-dev/desktop
// import { Sandbox } from '@e2b/desktop'
Expand All @@ -50,9 +60,9 @@ const sandboxId = await sbx.pause() // $HighlightLine
console.log('Sandbox paused', sandboxId) // $HighlightLine
```
```python
from e2b import Sandbox
# or use Code Interpreter: https://github.com/e2b-dev/code-interpreter
# from e2b_code_interpreter import Sandbox
from e2b_code_interpreter import Sandbox
# or use Core: https://github.com/e2b-dev/e2b
# from e2b import Sandbox
#
# or use Desktop: https://github.com/e2b-dev/desktop
# from e2b_desktop import Sandbox
Expand All @@ -75,9 +85,9 @@ This means that all the files in the sandbox's filesystem will be restored and a

<CodeGroup>
```js
import { Sandbox } from 'e2b'
// or use Code Interpreter: https://github.com/e2b-dev/code-interpreter
// import { Sandbox } from '@e2b/code-interpreter'
import { Sandbox } from '@e2b/code-interpreter'
// or use Core: https://github.com/e2b-dev/e2b
// import { Sandbox } from 'e2b'
//
// or use Desktop: https://github.com/e2b-dev/desktop
// import { Sandbox } from '@e2b/desktop'
Expand All @@ -97,8 +107,8 @@ console.log('Sandbox resumed', sameSbx.sandboxId) // $HighlightLine
```
```python
from e2b import Sandbox
# or use Code Interpreter: https://github.com/e2b-dev/code-interpreter
# from e2b_code_interpreter import Sandbox
# or use Core: https://github.com/e2b-dev/e2b
# from e2b import Sandbox
#
# or use Desktop: https://github.com/e2b-dev/desktop
# from e2b_desktop import Sandbox
Expand Down Expand Up @@ -126,12 +136,22 @@ You can pass a custom timeout to the `Sandbox.resume()` method like this:

<CodeGroup>
```js
import { Sandbox } from 'e2b'
import { Sandbox } from '@e2b/code-interpreter'
// or use Core: https://github.com/e2b-dev/e2b
// import { Sandbox } from 'e2b'
//
// or use Desktop: https://github.com/e2b-dev/desktop
// import { Sandbox } from '@e2b/desktop'

const sbx = await Sandbox.resume(sandboxId, { timeoutMs: 60 * 1000 }) // 60 seconds
```
```python
from e2b import Sandbox
from e2b_code_interpreter import Sandbox
# or use Core: https://github.com/e2b-dev/e2b
# from e2b import Sandbox
#
# or use Desktop: https://github.com/e2b-dev/desktop
# from e2b_desktop import Sandbox

sbx = Sandbox.resume(sandbox_id, timeout=60) # 60 seconds
```
Expand Down
Loading