Files
fn_registry/apps/dag_engine/app.md
T
egutierrez 7490336709 chore: auto-commit (1 archivos)
- apps/dag_engine/app.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 02:11:14 +02:00

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.
service
dag
workflow
scheduler
web
cron
dag_parse_go_core
dag_validate_go_core
dag_topo_sort_go_core
dag_resolve_env_go_core
parse_cron_expr_go_core
next_cron_time_go_core
cron_ticker_go_infra
find_go_core
process_spawn_go_infra
process_wait_go_infra
dag_definition_go_core
dag_step_go_core
dag_validation_result_go_core
cron_schedule_go_core
process_handle_go_infra
process_result_go_infra
DagRun_go_infra
DagStepResult_go_infra
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/http con ServeMux (Go 1.22+ pattern routing)
  • SQLite via go-sqlite3 para 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, error
  • dag_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).