Remote Runtimes
SSH, Daytona, Modal, and Singularity — remote and sandboxed shell execution, distinct from the agent-capable runtime providers.
3 min read
Remote runtimes execute a shell command in a remote or isolated environment. They are not agent runtimes in the same sense as local/claude-code/cursor/codex — none of them implement a working run() agent loop. Each throws AnvioError('VALIDATION_ERROR', ...) if you try to call .run() on it directly; the real entry point is execRemote(), exposed through anvio runtime exec.
Agent streaming on SSH/Daytona/Modal/Singularity is deferred — these are for remote/container shell command execution, not for running a full agent session on a remote host. See docs/47-remote-runtimes.md.
Providers
| ID | Class | Backing mechanism | Configured when |
|---|---|---|---|
ssh | SshRuntimeProvider | Shells out to the local ssh binary | ANVIO_SSH_HOST set, or ANVIO_SSH_MOCK=1 |
daytona | DaytonaRuntimeProvider | HTTP POST /exec to Daytona API | DAYTONA_API_KEY set, or ANVIO_DAYTONA_MOCK=1 |
modal | ModalRuntimeProvider | HTTP POST /exec to Modal API | MODAL_TOKEN_ID + MODAL_TOKEN_SECRET set, or ANVIO_MODAL_MOCK=1 |
singularity | SingularityRuntimeProvider | Shells out to the local singularity/apptainer binary | SINGULARITY_IMAGE set, or ANVIO_SINGULARITY_MOCK=1 |
All four ship with a mock mode — a dedicated ANVIO_<ID>_MOCK=1 environment variable that runs the command through a local sh -c subprocess instead of the real remote backend, for development and CI without live credentials or infrastructure.
SSH
ANVIO_SSH_MOCK=1 anvio runtime exec ssh -- echo remote-ok
anvio runtime exec ssh -- uname -a # requires ANVIO_SSH_HOST set
anvio runtime test ssh # connectivity checkSshRuntimeProvider.execRemote() shells out to the system ssh binary — ssh -p <port> <user>@<host> <command> — using spawnSync. No SSH library dependency, no persistent connection pooling.
| Env var | Purpose | Default |
|---|---|---|
ANVIO_SSH_HOST | Remote host | — |
ANVIO_SSH_USER | Remote user | root |
ANVIO_SSH_PORT | SSH port | 22 |
ANVIO_SSH_MOCK | Skip real SSH, run locally | — |
Daytona and Modal
Both are serverless sandbox APIs, wired through a shared RemoteRuntimeStub base class that POSTs { command, runtime } to <apiUrl>/exec with a bearer token, and parses back { stdout, stderr, exitCode }.
ANVIO_DAYTONA_MOCK=1 anvio runtime exec daytona -- echo ok
ANVIO_MODAL_MOCK=1 anvio runtime exec modal -- echo ok| Provider | Env vars | Default API URL |
|---|---|---|
| Daytona | DAYTONA_API_KEY, DAYTONA_API_URL | https://api.daytona.io |
| Modal | MODAL_TOKEN_ID, MODAL_TOKEN_SECRET, MODAL_API_URL | https://api.modal.com |
Singularity / Apptainer
Unlike Daytona/Modal, Singularity is a local HPC container runtime — Anvio shells out to the singularity/apptainer binary directly, the same pattern DockerRuntimeProvider uses for docker. No cloud API call.
ANVIO_SINGULARITY_MOCK=1 anvio runtime exec singularity -- echo ok
# Real usage: point at a SIF image or a docker:// URI
export SINGULARITY_IMAGE=docker://ubuntu
anvio runtime exec singularity -- uname -a
anvio runtime test singularity| Env var | Purpose | Default |
|---|---|---|
SINGULARITY_IMAGE | SIF path or docker:// URI | — |
SINGULARITY_BINARY | Binary name | singularity |
ANVIO_SINGULARITY_MOCK | Skip real exec, run locally | — |
What's genuinely production-ready here
Per docs/69-post-v1.17-gap-register.md (updated 2026-07-02):
- SSH remote exec, Daytona/Modal serverless exec, and Singularity local container exec are all shipped —
execRemote()works end to end against a real backend when credentials/binaries are present, not just mock mode. - What genuinely isn't verified yet is a live soak test against real Daytona/Modal accounts in this repo's environment — the HTTP client code path is implemented and unit-tested, but nobody has run it against production Daytona/Modal credentials from this codebase.
Not yet shipped
Full agent execution (tool loop, streaming, subagents) on any remote runtime is not implemented — only single shell-command exec via execRemote(). If you need an agent to run remotely with tools, route it through local/claude-code/etc. on a host reached via one of these exec providers, rather than expecting the remote runtime itself to drive the agent loop.
Last updated on