-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjustfile
More file actions
305 lines (227 loc) · 11.9 KB
/
justfile
File metadata and controls
305 lines (227 loc) · 11.9 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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# OpenFoundry — Task Runner
# Usage: just <recipe>
set dotenv-load := true
# ── Default ──────────────────────────────────────────────────
default:
@just --list
# ── Build ────────────────────────────────────────────────────
# Build all Rust services and libraries
build:
cargo build --workspace
# Build in release mode
build-release:
cargo build --workspace --release
# Build a specific service
build-svc svc:
cargo build -p {{svc}}
# ── Test ─────────────────────────────────────────────────────
# Run all tests
test:
cargo test --workspace
# Run tests for a specific crate
test-svc svc:
cargo test -p {{svc}}
# Run tests with output
test-verbose:
cargo test --workspace -- --nocapture
# ── Lint & Format ────────────────────────────────────────────
# Run all lints
lint: fmt-check clippy
# Check formatting
fmt-check:
cargo fmt --all -- --check
# Format all code
fmt:
cargo fmt --all
# Run Clippy
clippy:
cargo clippy --workspace --all-targets -- -D warnings
# Run cargo-deny (license & vulnerability audit)
deny:
cargo deny check
# ── Run ──────────────────────────────────────────────────────
# Run a specific service
run svc:
cargo run -p {{svc}}
# Run the gateway
run-gateway:
cargo run -p edge-gateway-service
# Run the OpenFoundry CLI
of args='':
cargo run -p of-cli -- {{args}}
# ── Database ─────────────────────────────────────────────────
# Run all migrations
db-migrate:
@for dir in services/*/migrations; do \
svc=$(basename $(dirname "$dir")); \
echo "→ Migrating $svc..."; \
cargo sqlx migrate run --source "$dir"; \
done
# Create a new migration for a service
db-new-migration svc name:
cargo sqlx migrate add -r --source "services/{{svc}}/migrations" {{name}}
# ── Protobuf ─────────────────────────────────────────────────
# Generate code from .proto files
proto-gen:
cd proto && buf generate
# Generate OpenAPI docs from proto services
openapi-gen:
cargo run -p of-cli -- docs generate-openapi --output apps/web/static/generated/openapi/openfoundry.json
# Validate checked-in OpenAPI docs against the current proto/tooling state
openapi-check:
cargo run -p of-cli -- docs validate-openapi --input apps/web/static/generated/openapi/openfoundry.json
# Generate the official TypeScript SDK from the checked-in OpenAPI contract
sdk-typescript-gen:
cargo run -p of-cli -- docs generate-sdk-typescript --input apps/web/static/generated/openapi/openfoundry.json --output sdks/typescript/openfoundry-sdk
# Validate checked-in SDK output against the current OpenAPI contract
sdk-typescript-check:
cargo run -p of-cli -- docs validate-sdk-typescript --input apps/web/static/generated/openapi/openfoundry.json --output sdks/typescript/openfoundry-sdk
# Typecheck the generated SDK with the existing frontend TypeScript toolchain
sdk-typescript-typecheck:
cd apps/web && pnpm exec tsc -p ../../sdks/typescript/openfoundry-sdk/tsconfig.json --noEmit
# Generate the official Python SDK from the checked-in OpenAPI contract
sdk-python-gen:
cargo run -p of-cli -- docs generate-sdk-python --input apps/web/static/generated/openapi/openfoundry.json --output sdks/python/openfoundry-sdk
# Validate checked-in Python SDK output against the current OpenAPI contract
sdk-python-check:
cargo run -p of-cli -- docs validate-sdk-python --input apps/web/static/generated/openapi/openfoundry.json --output sdks/python/openfoundry-sdk
# Compile the generated Python SDK to catch syntax/import issues
sdk-python-compile:
python3 -m compileall sdks/python/openfoundry-sdk
# Generate the official Java SDK from the checked-in OpenAPI contract
sdk-java-gen:
cargo run -p of-cli -- docs generate-sdk-java --input apps/web/static/generated/openapi/openfoundry.json --output sdks/java/openfoundry-sdk
# Validate checked-in Java SDK output against the current OpenAPI contract
sdk-java-check:
cargo run -p of-cli -- docs validate-sdk-java --input apps/web/static/generated/openapi/openfoundry.json --output sdks/java/openfoundry-sdk
# Compile the generated Java SDK sources (requires JDK 17+)
sdk-java-compile:
find sdks/java/openfoundry-sdk/src/main/java -name '*.java' -print0 | xargs -0 javac --release 17
# Validate the Strimzi Kafka cluster manifest against the KRaft contract
kafka-kraft-lint:
python3 tools/kafka-lint/check_kraft.py
# Validate the Rook-Ceph manifests against the quorum / rack-awareness contract
ceph-topology-lint:
python3 tools/ceph-lint/check_topology.py
# Validate the Helm chart across base/dev/staging/prod overlays
helm-check:
helm lint infra/k8s/helm/open-foundry -f infra/k8s/helm/open-foundry/values.yaml -f infra/k8s/helm/open-foundry/values-dev.yaml
helm template open-foundry infra/k8s/helm/open-foundry --namespace openfoundry -f infra/k8s/helm/open-foundry/values.yaml >/tmp/open-foundry-base.yaml
helm template open-foundry infra/k8s/helm/open-foundry --namespace openfoundry -f infra/k8s/helm/open-foundry/values.yaml -f infra/k8s/helm/open-foundry/values-staging.yaml >/tmp/open-foundry-staging.yaml
helm template open-foundry infra/k8s/helm/open-foundry --namespace openfoundry -f infra/k8s/helm/open-foundry/values.yaml -f infra/k8s/helm/open-foundry/values-prod.yaml >/tmp/open-foundry-prod.yaml
# Generate Terraform provider schema for docs and portal consumption
terraform-schema:
cargo run -p of-cli -- terraform schema --output infra/terraform/providers/openfoundry/provider.schema.json
cargo run -p of-cli -- terraform schema --output apps/web/static/generated/terraform/openfoundry-provider.json
# Run reproducible benchmark suite against a live stack
bench-critical-paths:
cargo run -p of-cli -- bench run --scenario benchmarks/scenarios/critical-paths.json --output benchmarks/results/critical-paths.json
# Run the critical-path smoke suite against a live stack
smoke-critical-paths:
cargo run -p of-cli -- smoke run --scenario smoke/scenarios/p2-runtime-critical-path.json --output smoke/results/p2-runtime-critical-path.json
# Run the semantic/governance smoke suite against a live stack
smoke-p3-semantic-governance:
cargo run -p of-cli -- smoke run --scenario smoke/scenarios/p3-semantic-governance-critical-path.json --output smoke/results/p3-semantic-governance-critical-path.json
# Run the developer platform smoke suite against a live stack
smoke-p4-developer-platform:
cargo run -p of-cli -- smoke run --scenario smoke/scenarios/p4-developer-platform-critical-path.json --output smoke/results/p4-developer-platform-critical-path.json
# Run the AI/ML smoke suite against a live stack
smoke-p5-ai-ml:
cargo run -p of-cli -- smoke run --scenario smoke/scenarios/p5-ai-ml-critical-path.json --output smoke/results/p5-ai-ml-critical-path.json
# Run the analytics/control-panel/nexus/enterprise smoke suite against a live stack
smoke-p6-analytics-enterprise:
cargo run -p of-cli -- smoke run --scenario smoke/scenarios/p6-analytics-enterprise-critical-path.json --output smoke/results/p6-analytics-enterprise-critical-path.json
# Lint proto files
proto-lint:
cd proto && buf lint
# Check for breaking changes
proto-breaking:
cd proto && buf breaking --against '.git#branch=main'
# ── Docker ───────────────────────────────────────────────────
# Start dev infrastructure (Postgres, Redis, NATS, MinIO, Vespa Lite). Add
# `--profile demo` to also bring up the optional Meilisearch (see ADR-0007).
infra-up:
docker compose -p "${OPENFOUNDRY_DOCKER_PROJECT_NAME:-openfoundry-dev}" -f infra/docker-compose.yml -f infra/docker-compose.dev.yml up -d
# Start dev infrastructure plus containerized auth/gateway/web stack
app-up:
docker compose -p "${OPENFOUNDRY_DOCKER_PROJECT_NAME:-openfoundry-dev}" -f infra/docker-compose.yml -f infra/docker-compose.dev.yml --profile app up -d
# Build one cumulative rollout wave with bounded parallelism.
# Waves: foundation, data, knowledge, intelligence, experience, edge
stack-build wave parallel='4':
docker compose -p "${OPENFOUNDRY_DOCKER_PROJECT_NAME:-openfoundry-dev}" -f compose.yaml --profile {{wave}} build --parallel {{parallel}}
# Start one cumulative rollout wave from the repo root compose stack.
# Example: just stack-up foundation
stack-up wave:
docker compose -p "${OPENFOUNDRY_DOCKER_PROJECT_NAME:-openfoundry-dev}" -f compose.yaml --profile {{wave}} up -d
# Stop dev infrastructure
infra-down:
docker compose -p "${OPENFOUNDRY_DOCKER_PROJECT_NAME:-openfoundry-dev}" -f infra/docker-compose.yml -f infra/docker-compose.dev.yml down
# NOTE: `infra-up-full` (dev stack + monitoring) was removed because the
# `infra/docker-compose.monitoring.yml` stub was empty and gave a false signal
# of an existing monitoring stack. The recipe will be reintroduced as part of
# the formal observability work (T17). See docs/observability/index.md.
# Build all Docker images
docker-build:
@for dir in services/*/Dockerfile; do \
svc=$(basename $(dirname "$dir")); \
echo "→ Building $svc..."; \
docker build -t "open-foundry/$svc:latest" -f "$dir" .; \
done
# ── Frontend ─────────────────────────────────────────────────
# Install frontend dependencies
fe-install:
cd apps/web && pnpm install
# Run frontend dev server
fe-dev:
cd apps/web && pnpm dev
# Install documentation website dependencies
docs-install:
cd docs && npm ci
# Run documentation website locally
docs-dev:
cd docs && npm run docs:dev
# Build documentation website
docs-build:
cd docs && npm run docs:build
# Preview built documentation website
docs-preview:
cd docs && npm run docs:preview
# Start infra, backend services, and frontend together for manual local verification
dev-stack:
./infra/scripts/dev-stack.sh
# Faster restart path when infra is already running and Rust binaries are already built
dev-stack-fast:
OPENFOUNDRY_SKIP_INFRA=1 OPENFOUNDRY_SKIP_BUILD=1 ./infra/scripts/dev-stack.sh
# Smoke-test gateway, auth, datasets, and ontology against a running local stack
smoke:
./infra/scripts/smoke.sh
# Build frontend
fe-build:
cd apps/web && pnpm build
# Lint frontend
fe-lint:
cd apps/web && pnpm lint
# Typecheck frontend
fe-check:
cd apps/web && pnpm check
# Run frontend tests
fe-test:
cd apps/web && pnpm test
# Run frontend unit tests
fe-test-unit:
cd apps/web && pnpm test:unit
# Run frontend E2E tests
fe-test-e2e:
cd apps/web && pnpm test:e2e
# Run frontend CI checks locally
ci-frontend: fe-lint fe-check fe-test-unit fe-build
@echo "✅ Frontend CI checks passed"
# ── CI ───────────────────────────────────────────────────────
# Run full CI checks locally
ci: lint test proto-lint openapi-check sdk-typescript-check sdk-typescript-typecheck sdk-python-check sdk-python-compile ci-frontend
@echo "✅ All CI checks passed"
# ── Cleanup ──────────────────────────────────────────────────
# Clean build artifacts
clean:
cargo clean
rm -rf apps/web/node_modules apps/web/.svelte-kit apps/web/build