From 1910347ccef1a87d68307277d886bd07af352df5 Mon Sep 17 00:00:00 2001 From: Julian Sommer <115516918+juliansommer@users.noreply.github.com> Date: Wed, 25 Feb 2026 08:33:51 +1000 Subject: [PATCH] fix: make building on start-dev.sh opt in --- INSTALL.md | 6 +++--- scripts/create-multi-node.sh | 6 +++--- scripts/iac/configure-cluster.sh | 2 +- scripts/start-dev.sh | 26 ++++++++++++++++---------- tests/e2e/lib/multinode-helpers.sh | 2 +- tests/e2e/run-e2e.sh | 2 +- 6 files changed, 25 insertions(+), 19 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 5ed12fa6a..631524bc1 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -745,9 +745,9 @@ All three processes will exit with a cluster summary once formation is complete. Start services on each node (in separate terminals or background): ```bash -HIVE_SKIP_BUILD=true UI=false ./scripts/start-dev.sh ~/node1/ -HIVE_SKIP_BUILD=true UI=false ./scripts/start-dev.sh ~/node2/ -HIVE_SKIP_BUILD=true UI=false ./scripts/start-dev.sh ~/node3/ +./scripts/start-dev.sh ~/node1/ +./scripts/start-dev.sh ~/node2/ +./scripts/start-dev.sh ~/node3/ ``` ### Option B: Real Multi-Node (Physical Servers) diff --git a/scripts/create-multi-node.sh b/scripts/create-multi-node.sh index 96f2abc5a..e18bb48f7 100755 --- a/scripts/create-multi-node.sh +++ b/scripts/create-multi-node.sh @@ -74,13 +74,13 @@ echo "Step 2: Starting Services" echo "=========================" # Start node 1 first (Predastore needs quorum) -HIVE_SKIP_BUILD=true UI=false ./scripts/start-dev.sh ~/node1/ & +UI=false ./scripts/start-dev.sh ~/node1/ & sleep 5 # Start nodes 2 and 3 -HIVE_SKIP_BUILD=true UI=false ./scripts/start-dev.sh ~/node2/ & +UI=false ./scripts/start-dev.sh ~/node2/ & sleep 2 -HIVE_SKIP_BUILD=true UI=false ./scripts/start-dev.sh ~/node3/ & +UI=false ./scripts/start-dev.sh ~/node3/ & # Wait for all start scripts to finish wait diff --git a/scripts/iac/configure-cluster.sh b/scripts/iac/configure-cluster.sh index 988cb5b7e..d56291dfa 100755 --- a/scripts/iac/configure-cluster.sh +++ b/scripts/iac/configure-cluster.sh @@ -158,7 +158,7 @@ for i in $(seq 0 $((NODE_COUNT - 1))); do ip="${MGMT_IPS[$i]}" ( echo " node$((i + 1)) ($ip): starting services..." - remote "$ip" "export PATH=\$PATH:/usr/local/go/bin && cd ~/Development/mulga/hive && HIVE_SKIP_BUILD=true ./scripts/start-dev.sh" + remote "$ip" "export PATH=\$PATH:/usr/local/go/bin && cd ~/Development/mulga/hive && ./scripts/start-dev.sh" echo " node$((i + 1)) ($ip): services started" ) & PIDS+=($!) diff --git a/scripts/start-dev.sh b/scripts/start-dev.sh index bcb11720a..a022edf40 100755 --- a/scripts/start-dev.sh +++ b/scripts/start-dev.sh @@ -2,12 +2,12 @@ # Start Hive development environment # This script starts all required services in the correct order using Hive service commands -# Usage: ./scripts/start-dev.sh [data-dir] +# Usage: ./scripts/start-dev.sh [--build] [data-dir] +# --build: Rebuild all binaries before starting (default: skip build) # data-dir: Optional data directory path (default: ~/hive) # # Environment variables: # UI=false Skip starting Hive UI (e.g., UI=false ./scripts/start-dev.sh) -# HIVE_SKIP_BUILD=true Skip building binaries before starting set -e @@ -15,8 +15,15 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" MULGA_ROOT="$(cd "$PROJECT_ROOT/.." && pwd)" -# Accept optional data directory argument -DATA_DIR="${1:-$HOME/hive}" +# Parse arguments +BUILD=false +DATA_DIR="$HOME/hive" +for arg in "$@"; do + case "$arg" in + --build) BUILD=true ;; + *) DATA_DIR="$arg" ;; + esac +done # Configuration paths # Use CONFIG_DIR environment variable if set, otherwise derive from DATA_DIR @@ -166,8 +173,8 @@ check_service() { } -# Pre-flight, compile latest -if [ "$HIVE_SKIP_BUILD" != "true" ]; then +# Pre-flight, compile latest (only with --build flag) +if [ "$BUILD" = "true" ]; then echo "✈️ Pre-flight, compiling latest..." echo " Building hive..." @@ -183,7 +190,7 @@ if [ "$HIVE_SKIP_BUILD" != "true" ]; then echo " ✅ Build complete" else - echo "✈️ Skipping build (HIVE_SKIP_BUILD=true)" + echo "✈️ Skipping build (pass --build to rebuild)" fi # 0️⃣ Verify OVN networking readiness (required — blocks service startup) @@ -306,9 +313,8 @@ if has_service "viperblock"; then if [ ! -f "$NBD_PLUGIN_PATH" ]; then echo " ⚠️ NBD plugin not found at $NBD_PLUGIN_PATH" - echo " Building Viperblock first..." - cd "$MULGA_ROOT/viperblock" - make build + echo " Building Viperblock NBD plugin..." + cd "$MULGA_ROOT/viperblock" && make build cd "$PROJECT_ROOT" fi diff --git a/tests/e2e/lib/multinode-helpers.sh b/tests/e2e/lib/multinode-helpers.sh index 469a4511d..32a1ef8b0 100755 --- a/tests/e2e/lib/multinode-helpers.sh +++ b/tests/e2e/lib/multinode-helpers.sh @@ -187,7 +187,7 @@ start_node_services() { echo "Starting services for node$node_num at $node_ip..." # Start all services - each node's config binds to its specific IP - HIVE_SKIP_BUILD=true ./scripts/start-dev.sh "$data_dir" + ./scripts/start-dev.sh "$data_dir" echo "Node$node_num services started" } diff --git a/tests/e2e/run-e2e.sh b/tests/e2e/run-e2e.sh index 526b43d00..afa93b034 100755 --- a/tests/e2e/run-e2e.sh +++ b/tests/e2e/run-e2e.sh @@ -78,7 +78,7 @@ sudo update-ca-certificates # Ensure logs directory exists for start-dev.sh mkdir -p ~/hive/logs mkdir -p /mnt/ramdisk -HIVE_SKIP_BUILD=true ./scripts/start-dev.sh +./scripts/start-dev.sh # Wait for health checks on https://localhost:9999 (AWS Gateway) echo "Waiting for AWS Gateway..."