Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
248 lines (212 loc) · 6.97 KB
/
Copy pathTaskfile.yml
File metadata and controls
248 lines (212 loc) · 6.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
version: "3"
# duragraph Taskfile — single-binary monorepo.
#
# As of v0.7 the engine, dashboard, python SDK, and go-SDK all live in
# this repo; the legacy `workers/`, `runtime/`, and `website/` trees
# were removed during the monorepo merge and their tasks were dropped
# from this file. Workers are now end-user code that lives outside
# the repo and registers against the engine over HTTP — see
# `duragraph-examples/python/` for a sample fleet.
#
# Source-of-truth layout:
# cmd/duragraph/ - canonical cobra entrypoint (build target)
# cmd/server/ - shim that calls cmd/duragraph (legacy hosts)
# cmd/api/ - legacy entrypoint, kept until external tooling migrates
# dashboard/ - React SPA, embedded into the binary via go:embed
# python/ - Python SDK + worker runtime (pyproject)
# go-sdk/ - Go SDK
# tests/ - conformance / e2e / soak suites
# deploy/docker/ - Dockerfile.{api,server,go-worker,python-worker}
vars:
API_PORT: 18081
DASHBOARD_PORT: 3303
tasks:
default:
desc: List available tasks
silent: true
cmds:
- task --list
# === Installation ===
install:
desc: Install all dependencies (Go modules + dashboard pnpm + Python SDK uv)
deps: ["install:go", "install:dashboard", "install:python"]
install:go:
desc: Download Go module dependencies
cmds:
- go mod download
install:dashboard:
desc: Install dashboard dependencies via pnpm
dir: dashboard
cmds:
- pnpm install
install:python:
desc: Install Python SDK dependencies via uv (no venv — uv handles it)
dir: python
cmds:
- uv sync
# === Development ===
dev:
desc: Run the engine in single-binary dev mode (embedded postgres + NATS + dashboard at /)
cmds:
- go run ./cmd/duragraph dev --port {{.API_PORT}}
dashboard:dev:
desc: Start dashboard's Vite dev server with HMR (talks to engine at API_PORT)
dir: dashboard
env:
VITE_DURAGRAPH_API_URL: "http://localhost:{{.API_PORT}}"
cmds:
- pnpm dev --port {{.DASHBOARD_PORT}} --host
# === Codegen ===
gen:types:
desc: Generate TypeScript types from Go DTOs (tygo). Run after editing
anything in internal/infrastructure/http/dto so the dashboard's
`src/types/generated.ts` stays in lockstep with the wire shapes.
cmds:
- tygo generate
sources:
- internal/infrastructure/http/dto/*.go
- tygo.yaml
generates:
- dashboard/src/types/generated.ts
# === Building ===
build:
desc: Build everything (Go binary with embedded dashboard)
cmds:
- task: build:dashboard
- task: build:duragraph
build:duragraph:
desc: Build the duragraph binary. Depends on build:dashboard so the
Vite output is on disk before `go build` runs the //go:embed.
deps: ["build:dashboard"]
cmds:
- go build -o bin/duragraph ./cmd/duragraph
generates:
- bin/duragraph
build:dashboard:
desc: Build dashboard to dashboard/dist for embedding
dir: dashboard
cmds:
- pnpm build
sources:
- src/**/*
- index.html
- vite.config.ts
- package.json
generates:
- dashboard/dist/**
# === Testing ===
test:
desc: Run all unit tests
deps: ["test:go", "test:dashboard"]
test:go:
desc: Run Go unit tests (-short skips integration suites)
cmds:
- go test -short ./...
test:integration:
desc: Run Go integration tests (testcontainers — requires Docker)
cmds:
- go test -tags integration ./...
test:dashboard:
desc: Run dashboard typecheck (no jest suite today; the typecheck IS the test)
dir: dashboard
cmds:
- pnpm exec tsc -b --noEmit
test:conformance:
desc: LangGraph Cloud API conformance suite (requires running engine)
dir: tests/conformance
cmds:
- pytest -v
test:e2e:
desc: End-to-end tests against a running engine
dir: tests/e2e
cmds:
- pytest -v
test:smoke:
desc: Tier-2 smoke test — spawns a real duragraph serve subprocess
against testcontainers Postgres + NATS, exercises the public
REST + outbox→NATS pipeline end-to-end. Runs in standard CI
via `go test ./...` (no build tag); ~5s on a warm cache.
cmds:
- go test -v -count=1 ./tests/smoke/
test:soak:
desc: Load / soak tests
dir: tests/soak
cmds:
- python test_soak.py
# === Code Quality ===
lint:
desc: Lint all code
deps: ["lint:go", "lint:dashboard"]
lint:go:
desc: go vet + gofmt check on the whole module
cmds:
- go vet ./...
- test -z "$(gofmt -l .)"
lint:dashboard:
desc: Dashboard eslint
dir: dashboard
cmds:
- pnpm lint
format:
desc: Format all code
deps: ["format:go", "format:dashboard"]
format:go:
desc: gofmt on the whole module
cmds:
- go fmt ./...
format:dashboard:
desc: Prettier on dashboard
dir: dashboard
cmds:
- pnpm format
# === Docker ===
# The canonical production image is server (Dockerfile.server) — it
# builds the dashboard first then embeds it into a Go binary. Dockerfile.api
# is kept for legacy hosts that still pull `duragraph/api`.
docker:build:
desc: Build the production server image (dashboard + Go binary in one image)
cmds:
- docker build -f deploy/docker/Dockerfile.server -t duragraph/server:latest .
docker:build:api:
desc: Build the legacy API image (Dockerfile.api). Most deployments
should use `docker:build` instead.
cmds:
- docker build -f deploy/docker/Dockerfile.api -t duragraph/api:latest .
# === Utilities ===
health:
desc: Curl the engine's /health endpoint
cmds:
- curl -fsS http://localhost:{{.API_PORT}}/health
- echo
clean:
desc: Remove build artefacts (keeps deps + data dirs)
cmds:
- rm -rf bin/
- rm -rf dashboard/dist/assets
- go clean -cache
clean:deps:
desc: Wipe ALL dependency caches (forces reinstall on next run)
cmds:
- rm -rf dashboard/node_modules/
- rm -rf python/.venv/
- go clean -modcache
# Profiling shortcuts. Assume `duragraph dev` is running locally with
# its default pprof listener at 127.0.0.1:6060 (auto-enabled in dev
# mode). See docs/project/profiling for the full contributor workflow.
profile:heap:
desc: Take a heap snapshot from the running engine and open pprof
cmds:
- go tool pprof http://localhost:6060/debug/pprof/heap
profile:goroutines:
desc: Dump every goroutine's stack from the running engine
cmds:
- curl -s 'http://localhost:6060/debug/pprof/goroutine?debug=2'
profile:cpu:
desc: Capture a 30s CPU profile from the running engine and open pprof
cmds:
- go tool pprof 'http://localhost:6060/debug/pprof/profile?seconds=30'
profile:trace:
desc: Capture a 5s runtime execution trace and open in `go tool trace`
cmds:
- curl -o /tmp/duragraph-trace.out 'http://localhost:6060/debug/pprof/trace?seconds=5'
- go tool trace /tmp/duragraph-trace.out