7490336709
- apps/dag_engine/app.md Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.3 KiB
2.3 KiB
name, lang, domain, description, tags, uses_functions, uses_types, framework, entry_point, dir_path
| name | lang | domain | description | tags | uses_functions | uses_types | framework | entry_point | dir_path | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| dag_engine | go | infra | Motor de ejecucion de DAGs con CLI y interfaz web. Reemplaza Dagu con implementacion propia compatible con el formato YAML existente. Almacena historial de ejecuciones en SQLite. |
|
|
|
net/http + vite + react | main.go | apps/dag_engine |
Arquitectura
CLI + servidor web en un unico binario:
dag-engine run <path.yaml> # ejecuta un DAG desde terminal
dag-engine list [dir] # lista DAGs con schedule y estado
dag-engine status [dag_name] # historial de ejecuciones
dag-engine validate <path.yaml> # valida sin ejecutar
dag-engine server # arranca HTTP + frontend web
Backend (Go)
net/httpconServeMux(Go 1.22+ pattern routing)- SQLite via
go-sqlite3para historial de runs - Executor: parse -> validate -> topo_sort -> spawn/wait por nivel -> store
- Scheduler: cron_ticker por cada DAG con schedule
Frontend (Vite + React + Mantine)
- DagList: tabla de DAGs con schedule, tags, ultimo status
- DagDetail: metadata + "Run Now" + historial
- RunDetail: timeline de steps con stdout/stderr expandible
Storage
SQLite dag_engine.db:
dag_runs: id, dag_name, status, trigger, started_at, finished_at, errordag_step_results: id, run_id, step_name, status, exit_code, stdout, stderr, duration_ms
Build
cd frontend && pnpm install && pnpm build
cd .. && CGO_ENABLED=1 go build -tags fts5 -o dag-engine .
Uso
# CLI
./dag-engine run ~/dagu/dags/example.yaml
./dag-engine list ~/dagu/dags/
# Servidor web
./dag-engine server --port 8090 --dags-dir ~/dagu/dags/ --scheduler
# Browser: http://localhost:8090
Notas
Compatible con el formato YAML de Dagu. Lee DAGs existentes de ~/dagu/dags/ sin modificaciones.
Puerto por defecto 8090 (mismo que Dagu).