-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat(sandbox): add Daytona as a manual-flip failover for E2B #5860
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: staging
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,12 @@ import { sha256Hex } from '@sim/security/hash' | |
| import { getErrorMessage } from '@sim/utils/errors' | ||
| import { isE2BDocEnabled } from '@/lib/core/config/env-flags' | ||
| import { isFeatureEnabled } from '@/lib/core/config/feature-flags' | ||
| import { executeInE2B, executeShellInE2B, type SandboxFile } from '@/lib/execution/e2b' | ||
| import { CodeLanguage } from '@/lib/execution/languages' | ||
| import { | ||
| executeInSandbox, | ||
| executeShellInSandbox, | ||
| type SandboxFile, | ||
| } from '@/lib/execution/remote-sandbox' | ||
| import { runSandboxTask } from '@/lib/execution/sandbox/run-task' | ||
| import { | ||
| fetchWorkspaceFileBuffer, | ||
|
|
@@ -259,7 +263,7 @@ async function compileDocViaE2BPython( | |
| // unaffected. Runs only after the user's script succeeds. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Document compilation still enters this path through |
||
| const code = fmt.ext === 'xlsx' ? `${source}\n${XLSX_RECALC_SNIPPET}` : source | ||
|
|
||
| const result = await executeInE2B({ | ||
| const result = await executeInSandbox({ | ||
| code, | ||
| language: CodeLanguage.Python, | ||
| timeoutMs: DOC_COMPILE_TIMEOUT_MS, | ||
|
|
@@ -342,7 +346,7 @@ ${finalize} | |
| })().then(() => console.log('__DOC_OK__')).catch((e) => { console.error('__DOC_ERR__' + (e && e.message ? e.message : String(e))); process.exit(1); }); | ||
| ` | ||
|
|
||
| const result = await executeShellInE2B({ | ||
| const result = await executeShellInSandbox({ | ||
| code: 'NODE_PATH=$(npm root -g) node /home/user/script.js', | ||
| envs: {}, | ||
| timeoutMs: DOC_COMPILE_TIMEOUT_MS, | ||
|
|
||
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.
When Daytona is configured but
E2B_ENABLEDis false, the existing shell, Python, and JavaScript gates reject the request before this provider-neutral call can resolve Daytona. A Daytona-only failover configuration therefore cannot run function blocks; entry into the remote-sandbox path must depend on the selected provider's availability.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!