# Repository Briefing: andylizf/open-daytona
> Source: https://repoforai.com/repo/andylizf/open-daytona (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/andylizf/open-daytona
- **Official Docs / Website**: https://zhifei.li/open-daytona/
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: A (85/100 · Maintenance 35/35 · Adoption 10/25 · Releases 20/20 · License 20/20)
- **Latest Release**: runsc-20261123.0-62-devpts-isig1-cow1-recyc2-mapr1-segv1-admit1 (2026-12-03) — https://github.com/andylizf/open-daytona/releases
- **Review Snapshot**: 2026-12-02 (Note: runsc-20261123.0-62-devpts-isig1-cow1-recyc2-mapr1-segv1-admit1 on 2026-12-03 shipped after this review; verify latest release notes)
- **Deployment / Stack Signals**: Self-Hosted, CLI, GPU, API
- **Momentum**: 241 ★ total (+33 24h / +241 7d) · 13 forks
- **Topics**: `agent-sandbox`, `agentic-rl`, `code-execution`, `daytona`, `gvisor`, `hpc`, `llm-agents`, `reinforcement-learning`, `rootless`, `sandbox`, `slurm`, `terminal-bench`
- **When to Use**: Best for: Teams with Slurm capacity running terminal-agent RL, evaluation, or replay that want self-hosted isolation and can validate their Daytona SDK calls against the compatibility list. Skip if: You need public preview endpoints, Docker Compose inside sandboxes, hard cgroup-style quotas, or multi-node GPU sandboxes, or cannot enable unprivileged user namespaces.

## Overview
```text
### Architecture & Core Mechanics
open-daytona turns ordinary Slurm allocations into a sandbox pool. Rollout workers send bearer-authenticated HTTP requests to the Python gateway, which places new sandboxes on the least-loaded node with a preference for cached images. Later calls go to the daemon that owns the sandbox. Gateway and daemon expose the same native API, so a worker can also target one node directly. Pilot jobs register daemons on shared storage; reverse SSH relays cover deployments where the gateway cannot reach compute nodes directly.

On each node, sbxd.py re-executes under `unshare -Ur` and launches gVisor runsc as root only inside its own user namespace. This avoids host root, Docker, subordinate UID ranges, and delegated cgroups. The node stack splits image builds, memory enforcement, and network proxying into builder.py, memenforce.py, and netproxy.py. Python code uses the standard library by default; the gateway adds the Daytona protocol layer alongside the native /v1 API.

### Key Capabilities & Differentiators
The pool provides per-sandbox networking and a disk cap that surfaces as ENOSPC inside the sandbox. When the polled memory limit triggers, the largest process is killed with exit code 137 while the sandbox stays alive. CPU admission defaults to one running sandbox per 0.8 core, with excess creates queued in FIFO order. The unmodified Daytona SDK passed 21 of 21 checks at 0.234.0 and 20 of 20 at 2.3.0. Native Python and asyncio clients offer alternatives for custom harnesses.

A replay of 1,536 recorded terminal-agent episodes, with no model or GPU, measured a median command round trip of 0.070 s under CPU admission versus 0.156 s on hosted Daytona from the same client machine. A separate run that started all 1,536 sandboxes at once measured a 4.0 s median from create to ready versus 32.1 s on hosted Daytona. These measure different operating modes: under default admission, queue time can dominate time to readiness. Neither result is a GPU throughput benchmark.

### Trade-offs & Limitations
Compared with hosted Daytona, open-daytona trades a managed service for control over Slurm allocations, admission, and image locality. Rootless deployment is useful where administrators won't delegate cgroups, but core pinning is not a hard CPU quota, and polling allows memory overshoot before enforcement. The single gateway serves plain HTTP; keep it on a trusted network rather than exposing it as a public service. The measured latency advantage does not account for the effort of operating the gateway, pilots, and cache.

Treat Daytona compatibility as a tested subset, not interchangeability. Some SDK setters have no effect; inbound ports, preview links, and Docker-in-Docker are unavailable. The image builder supports one FROM stage, and cold builds take tens of seconds to minutes. GPU support is NVIDIA-only through gVisor nvproxy; all GPUs for a sandbox must be on one node, and GPU sandboxes cannot be stopped and restarted. Test syscall-heavy, memory-mapping-heavy, small-file, and network-intensive workloads before committing capacity.

### Hardware & Deployment Guide
Deploy on Linux x86_64 or aarch64 with unprivileged user namespaces enabled and verify `unshare -Ur true` on the target nodes. The server scripts require Python 3.9 or newer; the packaged CLI requires 3.10 or newer. Plan for tens of GB of node-local disk. The checkout workflow lists curl, bzip2, and tar, plus lz4 for the shared image cache. Slurm pools need storage shared between login and compute nodes for configuration and pilot registration.

For single-node evaluation, `open-daytona up` starts a loopback gateway and one daemon and prints the endpoint and credentials. The Linux x86_64 wheel bundles runsc and static BusyBox, so startup itself needs no downloads; offline sandbox creation still needs images available via the shared cache. For a cluster, configure slurm/open-daytona.env.example, submit pilots with slurm/start_pilots.sh, and point the gateway at their registry. The recent x86_64 runsc releases revise the small-waste recycling patch and then add a SIGSEGV mapping patch. The installer defaults to the patched build and offers `--upstream` for stock gVisor. GPU deployment also requires a driver supported by nvproxy.
```

## Key Capabilities
```text
- Capacity: Slurm pilot jobs register node daemons on a shared filesystem; the gateway places sandboxes by load and image locality.
- Isolation: gVisor runsc runs inside an unprivileged user namespace without Docker, host root, subordinate UID ranges, or delegated cgroups.
- Integration: Daytona SDK 0.x and 2.x protocol support alongside a native /v1 API and an asyncio adapter.
- Admission: The default keeps one running sandbox per 0.8 core and queues excess creates in FIFO order.
- Benchmarking: replay/ compares environment responses across backends without rerunning the model; command latency and burst startup were measured in separate runs.
- Packaging: The Linux x86_64 wheel bundles patched runsc and static BusyBox, so the service can start offline if sandbox images are available from a shared cache.
```

## Quick Start / Clone
```bash
pip install open-daytona            # add [harbor] for Harbor
open-daytona up                     # prints DAYTONA_API_URL and DAYTONA_API_KEY
eval "$(open-daytona env)"          # in any shell, while the pool runs
open-daytona down                   # stops the pool and its sandboxes
```
