-
Notifications
You must be signed in to change notification settings - Fork 578
Add option for a template ready check #750
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: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: fba3137 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -34,6 +36,9 @@ export function handleE2BRequestError<T>( | |||
case 500: | |||
message = 'internal server error' | |||
break | |||
default: | |||
message = status(code) || 'unknown error' |
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.
translate also all other error codes to text, so it doesn't show unknown error
1f12ca8
to
507a071
Compare
@@ -0,0 +1,22 @@ | |||
# Ready Command | |||
The ready command allows you to specify a command that will determine **template sandbox** readiness before creating the snapshot. |
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.
readiness before creating the snapshot
Unsure if we explain to the user what snapshot is and when it gets created during the build process. If not, we need to explain it before we start mentioning it.
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.
We explain it in the start command. I'll reorganize this as it doesn't make sense to explain it in the start command and not in the sandbox customization (effectively template)
apps/web/src/app/(docs)/docs/sandbox-template/ready-cmd/page.mdx
Outdated
Show resolved
Hide resolved
You can specify the ready command inside the `e2b.toml` in the same directory where you run `e2b template build`. | ||
<CodeGroup isFileName title="e2b.toml" isRunnable={false}> | ||
```toml | ||
# This is a config for E2B sandbox template | ||
template_id = "1wdqsf9le9gk21ztb4mo" | ||
dockerfile = "e2b.Dockerfile" | ||
template_name = "my-agent-sandbox" | ||
ready_cmd = "<your-ready-command>" # $HighlightLine | ||
``` | ||
</CodeGroup> |
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.
Is the only way to set it through the config file? No option to do it via the CLI (similarly like we have start command option)?
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.
I've done it only through the config file as It didn't make any sense to me to have it configurable through command (as it's bound to the template, not specific build). But, the same applies for the start command too, so I'll add it there for parity. Hopefully this will be removed in the future.
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.
Co-authored-by: Vasek Mlejnsky <[email protected]>
Please make sure this is merged only after the new template manager is deployed 🙏 Maybe add a checkbox in the description so it's hard to miss. |
Add option for a template ready check. You can specify
ready_cmd
which will be run until it exits with code 0. Max timeout is 5 minutes. After exit code 0, the template will be marked as ready.If no ready command is defined,
sleep 20
is assumed when the start command is present, andsleep 0
when none is defined. It is also possible to define ready command without any start command. This might be helpful if the filesystem contains self-booted services (e.g. using systemd).This adds possibility to configure the default 20 seconds wait time for a start command.
New documentation can be found at
/docs/sandbox-template/ready-cmd
.