Repository navigation
fix(sandbox): show Shell when a sandbox provider is ready, clearer setup failures, and chart-derived sandbox defaults #10767
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
Merged
+1,305
−80
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f7a56f1
fix(sandbox): show Shell when a sandbox provider is ready, clearer se…
waleedlatif1 7c8868e
fix(sandbox): tolerate an untagged release commit at publish, keep Ku…
waleedlatif1 b1ad9f4
improvement(sandbox): drop overheadPerPod, concise chart messages and…
waleedlatif1 9e88fa7
improvement(sandbox): use the shared env resolver and fold upgrade notes
waleedlatif1 a71b630
fix(sandbox): count the agent init container in the derived quota
waleedlatif1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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 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
43 changes: 35 additions & 8 deletions
43
apps/docs/content/docs/platform/self-hosting/sandboxes.mdx
Large diffs are not rendered by default.
Oops, something went wrong.
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 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { resetEnvFlagsMock, setEnvFlags } from '@sim/testing' | ||
| import { afterEach, describe, expect, it } from 'vitest' | ||
| import { CodeLanguage } from '@/lib/execution/languages' | ||
| import { FunctionBlock } from '@/blocks/blocks/function' | ||
|
|
||
| afterEach(resetEnvFlagsMock) | ||
|
|
||
| function languageIds(): string[] { | ||
| const options = FunctionBlock.subBlocks.find((subBlock) => subBlock.id === 'language')?.options | ||
| if (typeof options !== 'function') throw new Error('language options are static') | ||
| return options().map((option) => option.id) | ||
| } | ||
|
|
||
| describe('Function language options', () => { | ||
| it('offers Shell when a remote provider is ready, without the custom-Sandbox entitlement', () => { | ||
| setEnvFlags({ isRemoteSandboxEnabled: true, isSandboxesEnabled: false }) | ||
|
|
||
| expect(languageIds()).toContain(CodeLanguage.Shell) | ||
| }) | ||
|
|
||
| it('hides Shell when no remote provider is ready, even with the entitlement', () => { | ||
| setEnvFlags({ isRemoteSandboxEnabled: false, isSandboxesEnabled: true }) | ||
|
|
||
| expect(languageIds()).not.toContain(CodeLanguage.Shell) | ||
| }) | ||
| }) |
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 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 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 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 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 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 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 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| /** Self-hosted sandbox setup guide, named wherever a missing or broken sandbox stops a run. */ | ||
| export const SELF_HOSTED_SANDBOX_DOCS_URL = 'https://docs.sim.ai/platform/self-hosting/sandboxes' |
31 changes: 31 additions & 0 deletions
31
apps/sim/lib/execution/remote-sandbox/kubernetes/errors.test.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /** | ||
| * @vitest-environment node | ||
| */ | ||
| import { describe, expect, it } from 'vitest' | ||
| import { | ||
| KubernetesSandboxConfigError, | ||
| toPodCreateError, | ||
| } from '@/lib/execution/remote-sandbox/kubernetes/errors' | ||
|
|
||
| const POLICY = 'sim-sim-sandbox-pods' | ||
|
|
||
| describe('toPodCreateError for an admission policy denial', () => { | ||
| it.each([ | ||
| [ | ||
| 422, | ||
| `pods "sim-sbx-abc" is invalid: : ValidatingAdmissionPolicy '${POLICY}' with binding '${POLICY}' denied request: Every sandbox container must drop ALL capabilities.`, | ||
| ], | ||
| [ | ||
| 403, | ||
| `pods "sim-sbx-abc" is forbidden: ValidatingAdmissionPolicy '${POLICY}' with binding '${POLICY}' denied request: Sandbox pods must not set sysctls.`, | ||
| ], | ||
| ])('names the policy and the chart/app version skew on a %i', (status, message) => { | ||
| const error = toPodCreateError({ status, message }, 'sim-sandboxes') | ||
|
|
||
| expect(error).toBeInstanceOf(KubernetesSandboxConfigError) | ||
| expect(error.message).toContain(`ValidatingAdmissionPolicy "${POLICY}"`) | ||
| expect(error.message).toContain('upgrade the Helm chart and app image together') | ||
| expect(error.message).not.toContain('SANDBOX_K8S_NODE_SELECTOR') | ||
| expect(error.message).not.toContain('sandbox Role') | ||
| }) | ||
| }) |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.