update multihop example
Some checks failed
/ setup (push) Has been cancelled

This commit is contained in:
Stuart Axelbrooke 2025-11-27 14:48:35 +08:00
parent 9a072ff74d
commit d812bb51e2
5 changed files with 19 additions and 13 deletions

1
.gitignore vendored
View file

@ -17,6 +17,7 @@ generated_number
target target
logs/databuild/ logs/databuild/
**/logs/databuild/ **/logs/databuild/
**/.databuild
# DSL generated code # DSL generated code
**/generated/ **/generated/

View file

@ -200,8 +200,8 @@ fn cmd_status(config_path: &str) {
println!("━━━━━━━━━━━━━━━━━━━━━━━━"); println!("━━━━━━━━━━━━━━━━━━━━━━━━");
println!("Graph: {}", config.graph_label); println!("Graph: {}", config.graph_label);
println!("Status: {}", if healthy { "Running" } else if running { "Unhealthy" } else { "Stopped" }); println!("Status: {}", if healthy { "Running" } else if running { "Unhealthy" } else { "Stopped" });
println!("URL: http://127.0.0.1:{}", state.port);
println!("PID: {}", state.pid); println!("PID: {}", state.pid);
println!("Port: {}", state.port);
println!("Database: {}", config.effective_bel_uri()); println!("Database: {}", config.effective_bel_uri());
if config_changed { if config_changed {
println!(); println!();

1
scripts/databuild Symbolic link
View file

@ -0,0 +1 @@
../bazel-bin/databuild/databuild

View file

@ -3,9 +3,11 @@ set -euo pipefail
# Navigate to repository root # Navigate to repository root
cd "$(dirname "$0")/.." cd "$(dirname "$0")/.."
REPO_ROOT="$(pwd)"
CONFIG="examples/multihop/config.json" EXAMPLE_DIR="$REPO_ROOT/examples/multihop"
FLAG_FILE="/tmp/databuild_multihop_alpha_complete" FLAG_FILE="/tmp/databuild_multihop_alpha_complete"
CLI="$REPO_ROOT/bazel-bin/databuild/databuild"
echo "=== DataBuild Multi-Hop Example ===" echo "=== DataBuild Multi-Hop Example ==="
echo echo
@ -13,8 +15,8 @@ echo
# Clean up previous state # Clean up previous state
echo "Cleaning up previous state..." echo "Cleaning up previous state..."
rm -f "$FLAG_FILE" rm -f "$FLAG_FILE"
rm -rf .databuild/multihop/ rm -rf "$EXAMPLE_DIR/.databuild/"
./bazel-bin/databuild/databuild --config "$CONFIG" stop 2>/dev/null || true (cd "$EXAMPLE_DIR" && "$CLI" stop 2>/dev/null || true)
# Build the binary # Build the binary
echo "Building databuild CLI..." echo "Building databuild CLI..."
@ -25,34 +27,36 @@ echo "=== Starting server ==="
echo echo
# Start the server by making a request (triggers auto-start) # Start the server by making a request (triggers auto-start)
OUTPUT=$(./bazel-bin/databuild/databuild --config "$CONFIG" wants list 2>&1) cd "$EXAMPLE_DIR"
OUTPUT=$("$CLI" wants list 2>&1)
# Extract port from status # Extract port from status
PORT=$(./bazel-bin/databuild/databuild --config "$CONFIG" status 2>&1 | grep "Port:" | awk '{print $2}') PORT=$("$CLI" status 2>&1 | grep "Port:" | awk '{print $2}')
echo echo
echo "Server running at: http://127.0.0.1:${PORT}" echo "Server running at: http://127.0.0.1:${PORT}"
echo echo
echo "=== Ready to run example ===" echo "=== Ready to run example ==="
echo echo
echo "Try the following commands:" echo "From the examples/multihop directory, try the following commands:"
echo "(The CLI uses databuild.json by default)"
echo echo
echo " # Check server status" echo " # Check server status"
echo " ./bazel-bin/databuild/databuild --config $CONFIG status" echo " databuild status"
echo echo
echo " # Create a want for data/beta (triggers dependency chain)" echo " # Create a want for data/beta (triggers dependency chain)"
echo " ./bazel-bin/databuild/databuild --config $CONFIG want data/beta" echo " databuild want data/beta"
echo echo
echo " # Monitor wants" echo " # Monitor wants"
echo " ./bazel-bin/databuild/databuild --config $CONFIG wants list" echo " databuild wants list"
echo echo
echo " # Monitor job runs" echo " # Monitor job runs"
echo " ./bazel-bin/databuild/databuild --config $CONFIG job-runs list" echo " databuild job-runs list"
echo echo
echo " # Monitor partitions" echo " # Monitor partitions"
echo " ./bazel-bin/databuild/databuild --config $CONFIG partitions list" echo " databuild partitions list"
echo echo
echo " # Stop the server when done" echo " # Stop the server when done"
echo " ./bazel-bin/databuild/databuild --config $CONFIG stop" echo " databuild stop"
echo echo
echo "===========================================" echo "==========================================="