Image definition.
How Templates Work
When you create a template, Tensorlake:- Loads a template file and discovers the
Imagedefinitions attached to its functions. - Starts a temporary sandbox from the image’s base container.
- Replays the image build steps inside that sandbox, including
run(),env(),copy(), andadd(). - Creates a snapshot of the prepared sandbox.
- Registers a template name for that snapshot in your current project.
tl sbx new --template <name>.
Prerequisites
Templates are scoped to the project selected in the CLI. Before creating one, make sure you have:Create a Template
Define an image in an application file and attach it to at least one function so the CLI can discover it.template.py
--name defaults to the image name if you omit it. Template names must be unique within a project.
Launch Sandboxes from a Template
Create a new sandbox from the registered template name:Notes
- If an template file has more than one image,
--image-nameis required. copy()andadd()sources are read from the local filesystem when you runtl sbx create-template.- Named template creation and lookup are available in the CLI.
See Also
Snapshots
Understand the underlying snapshot primitive used to save and restore sandbox state.
Lifecycle
Learn which sandbox settings you can still override when launching from a template.