Build
Once a template definition is ready, useTemplate.build(...) to build it. The build accepts a template name plus optional build settings such as CPU, memory, tags, cache behavior, and a build log callback.
Template.buildInBackground(...) / Template.build_in_background(...) and later inspect the build status.
Names
Every build needs a template name. Keep names stable for a logical template family, for example:my-python-templateagent-runtime-basesandbox-webapp
Tags & versioning
Tags let you label builds for release management without changing the underlying template name. Typical patterns include:- semantic versions such as
v1.0.0 - promotion labels such as
stagingorproduction - moving channels such as
latest
Logging
Build logs help you inspect provisioning progress and diagnose failures. In JavaScript and TypeScript, passonBuildLogs to Template.build(...). The SDK also exports defaultBuildLogger(...) for a standard console logger.
Template.getBuildStatus(...) / Template.get_build_status(...) to poll status and retrieve log entries later.
Error handling
Template builds can fail for several common reasons:- invalid credentials for a private registry
- package install failures inside
runCmd(...)/run_cmd(...) - a start command that exits unexpectedly
- a ready command that never succeeds
- CPU and memory settings that do not satisfy platform limits
- inspect build logs first
- validate the template source image or Dockerfile
- rerun with cache disabled if you suspect a stale layer
- reduce the template to the smallest failing instruction sequence
building, waiting, ready, and error.