-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
128 lines (95 loc) · 5.2 KB
/
Copy pathMakefile
File metadata and controls
128 lines (95 loc) · 5.2 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
.PHONY: help build build-agent build-control-plane test test-agent test-control-plane fmt lint doctor dev-preflight dev-up dev-down demo dev-db-reset example-intake example-schedule example-launch-plan example-launch-validate example-launch-dry-run example-launch-execute example-launch-list example-launch-observe example-readiness example-orphans
# Configuration
BIN_DIR=bin
AGENT_BIN=$(BIN_DIR)/schedune-agent
CONTROL_PLANE_BIN=$(BIN_DIR)/schedune
SQLITE_DB=var/schedune.db
help: ## Show this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
build: build-agent build-control-plane ## Build all binaries
build-agent: ## Build the Rust agent
@echo "Building Schedune Agent..."
@mkdir -p $(BIN_DIR)
@cd schedune-agent && . $$HOME/.cargo/env && cargo build --release
@cp schedune-agent/target/release/schedune-agent $(AGENT_BIN)
build-control-plane: ## Build the Go control plane
@echo "Building Schedune Control Plane..."
@mkdir -p $(BIN_DIR)
@cd schedune-control-plane && export CGO_ENABLED=1 && export PATH=$$PATH:$$HOME/.local/go/bin && go build -o ../$(CONTROL_PLANE_BIN) ./cmd/schedune
test: test-agent test-control-plane ## Run all tests
test-agent: ## Run Rust tests
@cd schedune-agent && . $$HOME/.cargo/env && cargo test
test-control-plane: ## Run Go tests
@cd schedune-control-plane && export CGO_ENABLED=1 && export PATH=$$PATH:$$HOME/.local/go/bin && go test ./... -v
fmt: ## Format all code
@cd schedune-agent && . $$HOME/.cargo/env && cargo fmt
@cd schedune-control-plane && export PATH=$$PATH:$$HOME/.local/go/bin && gofmt -w .
lint: ## Lint all code
@cd schedune-agent && . $$HOME/.cargo/env && cargo clippy -- -D warnings
@cd schedune-control-plane && export CGO_ENABLED=1 && export PATH=$$PATH:$$HOME/.local/go/bin && go vet ./...
doctor: build-control-plane ## Run preflight checks to verify local readiness for evaluation
@./$(CONTROL_PLANE_BIN) doctor
dev-preflight: doctor ## Alias for doctor
dev-db-reset: ## Reset the local SQLite database
@echo "Resetting local database..."
@rm -f $(SQLITE_DB)
@echo "Done."
dev-up: build ## Start the control plane in the background (port 9090)
@echo "Starting Schedune Control Plane..."
@./$(CONTROL_PLANE_BIN) server & echo $$! > .schedune.pid
@echo "Control plane running on http://127.0.0.1:9090"
@echo "To stop, run 'make dev-down'"
dev-down: ## Stop the background control plane
@if [ -f .schedune.pid ]; then kill $$(cat .schedune.pid) && rm .schedune.pid && echo "Control plane stopped."; else echo "Not running."; fi
smoke-test: build ## Run headless E2E automated API smoke test
@bash scripts/smoke-test.sh
demo: doctor build dev-db-reset ## Run the automated end-to-end evaluator demo
@bash scripts/demo.sh
demo-fixture: build-control-plane dev-db-reset ## Run the fixture-backed evaluator demo (macOS/non-Linux friendly)
@bash scripts/demo-fixture.sh
demo-fixture-once: build-control-plane dev-db-reset ## Run the fixture-backed evaluator demo and exit cleanly
@bash scripts/demo-fixture.sh --once
demo-live-lab: build dev-db-reset ## Run the live lab KVM demo interactively
@bash scripts/demo-live-lab.sh
demo-live-lab-once: build dev-db-reset ## Run the live lab KVM demo and exit cleanly
@bash scripts/demo-live-lab.sh --once
example-nodes: ## List normalized node summaries
@curl -s http://127.0.0.1:9090/api/v1alpha1/nodes
example-node-explain: ## Explain scheduling eligibility for a specific node (Requires NODE_ID)
@if [ -z "$(NODE_ID)" ]; then \
echo "Usage: make example-node-explain NODE_ID=<id>"; \
else \
curl -s http://127.0.0.1:9090/api/v1alpha1/nodes/$(NODE_ID)/explain; \
fi
example-intake: ## Ingest the local node capability payload
@bash examples/curls/intake.sh
example-schedule: ## Run a workload eligibility evaluation explanation
@bash examples/curls/schedule-explain.sh
example-launch-plan: ## Plan a launch (placement, validation, and dry-run) without executing
@bash examples/curls/plan-launch.sh
example-launch-validate: ## Validate a launch without executing it
@bash examples/curls/launch-validate.sh
example-launch-dry-run: ## Dry-run a launch without executing it
@bash examples/curls/launch-dry-run.sh
example-launch-execute: ## Execute a launch on a local runtime
@bash examples/curls/launch-execute.sh
example-launch-list: ## List all executions on the node
@curl -s http://127.0.0.1:9090/api/v1alpha1/launch; echo ""
example-launch-observe: ## Observe a full execution summary (Requires EXECUTION_ID)
@if [ -z "$(EXECUTION_ID)" ]; then \
echo "Usage: make example-launch-observe EXECUTION_ID=<id>"; \
echo "Run 'make example-launch-execute' first to get an execution ID."; \
else \
curl -s http://127.0.0.1:9090/api/v1alpha1/launch/$(EXECUTION_ID)/observe; \
echo ""; \
fi
example-readiness: ## Check readiness for an execution (Requires EXECUTION_ID)
@if [ -z "$(EXECUTION_ID)" ]; then \
echo "Usage: make example-readiness EXECUTION_ID=<id>"; \
echo "Run 'make example-launch-execute' first to get an execution ID."; \
else \
curl -s http://127.0.0.1:9090/api/v1alpha1/launch/$(EXECUTION_ID)/readiness; \
echo ""; \
fi
example-orphans: ## List orphaned runtimes on the node
@curl -s http://127.0.0.1:9090/api/v1alpha1/recovery/orphans; echo ""