-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo-orchestration.sh
More file actions
executable file
·96 lines (85 loc) · 2.66 KB
/
demo-orchestration.sh
File metadata and controls
executable file
·96 lines (85 loc) · 2.66 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
#!/usr/bin/env bash
# Demo script for Shapes 09-11: Pipeline Orchestration & Observability
set -e
echo "=== Flowctl Orchestration Demo ==="
echo ""
echo "This demo shows the new pipeline orchestration features:"
echo " - Shape 09: Pipeline Run Tracking API"
echo " - Shape 10: Pipeline Management CLI"
echo " - Shape 11: Interactive TUI Dashboard"
echo ""
# Start control plane with persistent storage
echo "Step 1: Starting control plane with persistent storage..."
./bin/flowctl server --db-path ./flowctl-demo.db &
SERVER_PID=$!
sleep 2
echo "✓ Control plane started (PID: $SERVER_PID)"
echo ""
# Wait for control plane to be ready
echo "Step 2: Waiting for control plane to be ready..."
timeout 10 bash -c 'until nc -z 127.0.0.1 8080; do sleep 0.5; done' || {
echo "✗ Control plane failed to start"
kill $SERVER_PID 2>/dev/null || true
exit 1
}
echo "✓ Control plane is ready"
echo ""
# List initial state (should be empty)
echo "Step 3: Checking initial state..."
echo ""
echo "$ flowctl pipelines list"
./bin/flowctl pipelines list || echo "(No pipelines yet - this is expected)"
echo ""
echo "$ flowctl pipelines active"
./bin/flowctl pipelines active
echo ""
# Note about running a pipeline
echo "Step 4: To test with a real pipeline..."
echo ""
echo "You can now run:"
echo " ./bin/flowctl run --use-external-control-plane /path/to/pipeline.yaml"
echo ""
echo "This will:"
echo " 1. Create a pipeline run record in the control plane"
echo " 2. Track the run status (STARTING → RUNNING → COMPLETED)"
echo " 3. Store metrics (events processed, throughput)"
echo ""
# Show CLI commands
echo "Step 5: Available CLI commands..."
echo ""
echo "View all pipelines:"
echo " $ flowctl pipelines list"
echo ""
echo "View run history for a pipeline:"
echo " $ flowctl pipelines runs my-pipeline"
echo ""
echo "Get detailed run information:"
echo " $ flowctl pipelines run-info <run-id>"
echo ""
echo "Stop a running pipeline:"
echo " $ flowctl pipelines stop <run-id>"
echo ""
echo "List currently active runs:"
echo " $ flowctl pipelines active"
echo ""
# Show TUI command
echo "Step 6: Interactive Dashboard..."
echo ""
echo "Launch the live TUI dashboard:"
echo " $ flowctl dashboard"
echo ""
echo "This shows:"
echo " - Active pipeline runs (with live metrics)"
echo " - Component registry (with health status)"
echo " - Auto-refreshes every 1 second"
echo " - Press 'q' to quit, 'r' to refresh"
echo ""
# Cleanup prompt
echo "=== Demo Complete ==="
echo ""
echo "Control plane is still running (PID: $SERVER_PID)"
echo ""
read -p "Press Enter to stop the control plane and cleanup..."
kill $SERVER_PID 2>/dev/null || true
rm -f ./flowctl-demo.db
echo "✓ Cleanup complete"