Daytona Sandboxes
Daytona provides hosted sandboxes. Struo runs each uncached action in a Daytona sandbox built from a container image, then deletes it.
Struo transfers declared inputs, runs the command, retrieves declared outputs, and deletes the sandbox.
Capabilities#
| Capability | Support |
|---|---|
| Shared cache | No; use a cache provider |
| Remote execution | Hosted sandboxes from a container image |
| Artifact publication | No |
| Project setup | Manual configuration |
| Authentication | DAYTONA_API_KEY |
Prerequisites#
- A Daytona account and API key with sandbox access.
- A Linux container image with the stable tools your actions need, including
tar. Keep repository dependencies such asnode_modulesin the action graph so a lockfile change invalidates the right action.
Configuration#
Bind the image in the repository root struo.toml. A Vitest workflow can use a
pinned Node.js image:
[infrastructures.remote_tests]
kind = "daytona"
image = "node:22.18.0-bookworm"
[infrastructure.execution]
provider = "remote_tests"Struo asks Daytona to build the sandbox environment from that image.
Authentication#
Set the provider access key outside the script:
export DAYTONA_API_KEY=...STRUO_DAYTONA_API_KEY takes precedence when both variables are present. Struo
does not forward the key to the action process.
Self-hosted or test endpoints can override the control and toolbox addresses
with STRUO_DAYTONA_CONTROL_URL and STRUO_DAYTONA_TOOLBOX_URL.
Usage#
Run a literal command on the provider:
struo exec --remote --compute remote_tests -- node --versionOmit --compute remote_tests to use the workspace's default execution provider.
Run an annotated test script#
Save this script as scripts/test.sh:
#!/bin/sh
# struo remote "remote_tests"
# struo cwd ".."
# struo input "../node_modules"
# struo input "../package.json"
# struo input "../tests"
# struo output "../reports"
node node_modules/vitest/vitest.mjs run \
--reporter=json --outputFile=reports/vitest.jsonRun it:
struo exec --script -- sh scripts/test.shDeclare any additional source, configuration, or setup files your tests read.
Native dependencies must match the guest's Linux architecture and runtime. To
produce node_modules in a separate cacheable action, see
Remote Execution.
Limits and cleanup#
- Daytona returns standard output and standard error as one combined result. Struo exposes it as standard output.
- The sandbox stops automatically after an interval derived from the action timeout, with extra time for provisioning and transfers. Actions without an explicit timeout use Daytona's short-lived execution policy.
Struo sends an explicit delete request after success, command failure, timeout, or transfer failure. It also marks each sandbox as ephemeral with immediate deletion after stop, so Daytona removes it if the client disappears first. See Daytona's sandbox lifecycle guide.
Next steps#
- Remote Execution: split dependency installation and tests into separate cacheable actions.
- Infrastructure: pick a cache provider so other machines reuse remote results.
- Execution provider contract: see what every execution provider guarantees.