From 5d937869958ff05fab088e810b3f7bfc49684d73 Mon Sep 17 00:00:00 2001 From: Ben Duncan <5178243+benduncan@users.noreply.github.com> Date: Wed, 18 Mar 2026 01:04:12 +0000 Subject: [PATCH] refactor: rename hive to spinifex in all shell scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update scripts/: start-dev, stop-dev, dev-setup, setup, setup-ovn, etc. - Update tests/e2e/: all E2E test scripts - Update scripts/iac/: rename hive-test.sh โ†’ spinifex-test.sh, update TF files - Update config/: rename hive.service and install script - Binary refs use spx, env vars use SPINIFEX_, paths use spinifex --- config/hive.service | 49 -- ...service.sh => install-spinifex-service.sh} | 28 +- config/spinifex.service | 49 ++ scripts/clone-deps.sh | 8 +- scripts/coverage.sh | 4 +- scripts/create-multi-node.sh | 8 +- scripts/dev-setup.sh | 48 +- scripts/iac/aws/main.tf | 24 +- scripts/iac/configure-cluster.sh | 14 +- scripts/iac/proxmox/variables.tf | 4 +- scripts/iac/proxmox/vms.tf | 2 +- .../iac/{hive-test.sh => spinifex-test.sh} | 18 +- scripts/iac/test-cluster.sh | 2 +- scripts/reset-dev-env.sh | 18 +- scripts/run-bench.sh | 50 +-- scripts/run-instance.sh | 18 +- scripts/setup-ovn.sh | 20 +- scripts/setup.sh | 188 ++++---- scripts/start-dev.sh | 146 +++--- scripts/start-multi-nats.sh | 2 +- scripts/stop-dev.sh | 44 +- tests/e2e/lib/multinode-helpers.sh | 14 +- tests/e2e/run-e2e.sh | 104 ++--- tests/e2e/run-multinode-e2e.sh | 80 ++-- tests/e2e/run-pseudo-multinode-e2e.sh | 418 +++++++++--------- tests/e2e/run-vpc-e2e.sh | 4 +- 26 files changed, 682 insertions(+), 682 deletions(-) delete mode 100644 config/hive.service rename config/{install-hive-service.sh => install-spinifex-service.sh} (60%) create mode 100644 config/spinifex.service rename scripts/iac/{hive-test.sh => spinifex-test.sh} (90%) diff --git a/config/hive.service b/config/hive.service deleted file mode 100644 index 17c02c47a..000000000 --- a/config/hive.service +++ /dev/null @@ -1,49 +0,0 @@ -[Unit] -Description=Hive Services -Documentation=https://github.com/mulgadc/hive -After=network.target -Wants=network.target - -[Service] -Type=oneshot -RemainAfterExit=yes -User=root -Group=root -WorkingDirectory=/opt/hive -Environment=PATH=/opt/hive/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - -# Start NATS service -ExecStart=/opt/hive/bin/hive service nats start -ExecStartPost=/bin/sleep 3 - -# Start Predastore service -ExecStart=/opt/hive/bin/hive service predastore start -ExecStartPost=/bin/sleep 2 - -# Start Viperblock service -ExecStart=/opt/hive/bin/hive service viperblock start - -# Stop services in reverse order -ExecStop=/opt/hive/bin/hive service viperblock stop -ExecStopPost=/bin/sleep 2 -ExecStop=/opt/hive/bin/hive service predastore stop -ExecStopPost=/bin/sleep 2 -ExecStop=/opt/hive/bin/hive service nats stop - -# Restart policy -Restart=on-failure -RestartSec=10 - -# Security settings -NoNewPrivileges=true -ProtectSystem=strict -ProtectHome=true -ReadWritePaths=/opt/hive /var/log /var/run - -# Logging -StandardOutput=journal -StandardError=journal -SyslogIdentifier=hive - -[Install] -WantedBy=multi-user.target \ No newline at end of file diff --git a/config/install-hive-service.sh b/config/install-spinifex-service.sh similarity index 60% rename from config/install-hive-service.sh rename to config/install-spinifex-service.sh index 793f94e08..da2901ca2 100755 --- a/config/install-hive-service.sh +++ b/config/install-spinifex-service.sh @@ -1,7 +1,7 @@ #!/bin/bash -# Hive Service Installation Script -# This script installs the hive systemd service on Ubuntu/Debian systems +# Spinifex Service Installation Script +# This script installs the spinifex systemd service on Ubuntu/Debian systems set -e @@ -38,7 +38,7 @@ fi # Get the directory where this script is located SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -SERVICE_FILE="$SCRIPT_DIR/hive.service" +SERVICE_FILE="$SCRIPT_DIR/spinifex.service" # Check if service file exists if [[ ! -f "$SERVICE_FILE" ]]; then @@ -46,7 +46,7 @@ if [[ ! -f "$SERVICE_FILE" ]]; then exit 1 fi -print_status "Installing Hive systemd service..." +print_status "Installing Spinifex systemd service..." # Copy service file to systemd directory cp "$SERVICE_FILE" /etc/systemd/system/ @@ -55,20 +55,20 @@ cp "$SERVICE_FILE" /etc/systemd/system/ systemctl daemon-reload # Enable the service to start on boot -systemctl enable hive.service +systemctl enable spinifex.service print_status "Service installed successfully!" print_status "You can now use the following commands:" -echo " systemctl start hive # Start the service" -echo " systemctl stop hive # Stop the service" -echo " systemctl status hive # Check service status" -echo " systemctl restart hive # Restart the service" -echo " journalctl -u hive -f # View service logs" +echo " systemctl start spinifex # Start the service" +echo " systemctl stop spinifex # Stop the service" +echo " systemctl status spinifex # Check service status" +echo " systemctl restart spinifex # Restart the service" +echo " journalctl -u spinifex -f # View service logs" -# Check if hive binary exists -if [[ ! -f "/opt/hive/bin/hive" ]]; then - print_warning "Hive binary not found at /opt/hive/bin/hive" - print_warning "Please ensure hive is installed in /opt/hive before starting the service" +# Check if spinifex binary exists +if [[ ! -f "/opt/spinifex/bin/spinifex" ]]; then + print_warning "Spinifex binary not found at /opt/spinifex/bin/spinifex" + print_warning "Please ensure spinifex is installed in /opt/spinifex before starting the service" fi print_status "Installation complete!" \ No newline at end of file diff --git a/config/spinifex.service b/config/spinifex.service new file mode 100644 index 000000000..23cbbd790 --- /dev/null +++ b/config/spinifex.service @@ -0,0 +1,49 @@ +[Unit] +Description=Spinifex Services +Documentation=https://github.com/mulgadc/spinifex +After=network.target +Wants=network.target + +[Service] +Type=oneshot +RemainAfterExit=yes +User=root +Group=root +WorkingDirectory=/opt/spinifex +Environment=PATH=/opt/spinifex/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +# Start NATS service +ExecStart=/opt/spinifex/bin/spinifex service nats start +ExecStartPost=/bin/sleep 3 + +# Start Predastore service +ExecStart=/opt/spinifex/bin/spinifex service predastore start +ExecStartPost=/bin/sleep 2 + +# Start Viperblock service +ExecStart=/opt/spinifex/bin/spinifex service viperblock start + +# Stop services in reverse order +ExecStop=/opt/spinifex/bin/spinifex service viperblock stop +ExecStopPost=/bin/sleep 2 +ExecStop=/opt/spinifex/bin/spinifex service predastore stop +ExecStopPost=/bin/sleep 2 +ExecStop=/opt/spinifex/bin/spinifex service nats stop + +# Restart policy +Restart=on-failure +RestartSec=10 + +# Security settings +NoNewPrivileges=true +ProtectSystem=strict +ProtectHome=true +ReadWritePaths=/opt/spinifex /var/log /var/run + +# Logging +StandardOutput=journal +StandardError=journal +SyslogIdentifier=spinifex + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/scripts/clone-deps.sh b/scripts/clone-deps.sh index 46af2b09b..ec10d6e59 100755 --- a/scripts/clone-deps.sh +++ b/scripts/clone-deps.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Hive Development Dependencies Setup Script +# Spinifex Development Dependencies Setup Script # This script clones Viperblock and Predastore repositories for cross-repo development # TODO: Improve, remove CLAUDE readme reference, simplify next-steps @@ -10,13 +10,13 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" MULGA_ROOT="$(cd "$PROJECT_ROOT/.." && pwd)" -echo "๐Ÿ—๏ธ Setting up Hive development environment..." +echo "๐Ÿ—๏ธ Setting up Spinifex development environment..." echo "Project root: $PROJECT_ROOT" echo "Mulga root: $MULGA_ROOT" # Check if we're in the correct directory structure if [[ ! -f "$PROJECT_ROOT/go.mod" ]]; then - echo "โŒ Error: Cannot find go.mod. Please run this script from the hive repository." + echo "โŒ Error: Cannot find go.mod. Please run this script from the spinifex repository." exit 1 fi @@ -70,7 +70,7 @@ fi # Verify directory structure echo "" echo "๐Ÿ“ Directory structure:" -ls -la "$MULGA_ROOT" | grep -E "(hive|viperblock|predastore)" || true +ls -la "$MULGA_ROOT" | grep -E "(spinifex|viperblock|predastore)" || true echo "" echo "๐ŸŽ‰ Development environment setup complete!" diff --git a/scripts/coverage.sh b/scripts/coverage.sh index 34de0ddac..33187dd19 100755 --- a/scripts/coverage.sh +++ b/scripts/coverage.sh @@ -3,12 +3,12 @@ set -euo pipefail # Run Go tests with coverage and report total code coverage. -COVERPROFILE=$(mktemp /tmp/hive-coverage-XXXXXX.out) +COVERPROFILE=$(mktemp /tmp/spinifex-coverage-XXXXXX.out) trap 'rm -f "$COVERPROFILE"' EXIT echo "Running tests with coverage..." echo "" -LOG_IGNORE=1 go test -timeout 120s -coverprofile="$COVERPROFILE" -covermode=atomic ./hive/... 2>&1 +LOG_IGNORE=1 go test -timeout 120s -coverprofile="$COVERPROFILE" -covermode=atomic ./spinifex/... 2>&1 if [[ ! -s "$COVERPROFILE" ]]; then echo "No coverage data collected." diff --git a/scripts/create-multi-node.sh b/scripts/create-multi-node.sh index e18bb48f7..96b7e98f9 100755 --- a/scripts/create-multi-node.sh +++ b/scripts/create-multi-node.sh @@ -26,13 +26,13 @@ echo "=========================" echo "Starting init node (127.0.0.1) and joining nodes (127.0.0.2, 127.0.0.3)..." # Init blocks until all nodes join, so run in background -./bin/hive admin init \ +./bin/spx admin init \ --node node1 \ --nodes 3 \ --bind 127.0.0.1 \ --cluster-bind 127.0.0.1 \ --port 4432 \ - --hive-dir ~/node1/ \ + --spinifex-dir ~/node1/ \ --config-dir ~/node1/config/ \ --region ap-southeast-2 \ --az ap-southeast-2a & @@ -42,7 +42,7 @@ INIT_PID=$! sleep 2 # Join nodes concurrently -./bin/hive admin join \ +./bin/spx admin join \ --node node2 \ --bind 127.0.0.2 \ --cluster-bind 127.0.0.2 \ @@ -53,7 +53,7 @@ sleep 2 --az ap-southeast-2a & JOIN2_PID=$! -./bin/hive admin join \ +./bin/spx admin join \ --node node3 \ --bind 127.0.0.3 \ --cluster-bind 127.0.0.3 \ diff --git a/scripts/dev-setup.sh b/scripts/dev-setup.sh index 94c933b0d..950071c36 100755 --- a/scripts/dev-setup.sh +++ b/scripts/dev-setup.sh @@ -1,7 +1,7 @@ #!/bin/bash -# Hive Platform Development Environment Setup -# This script sets up a complete development environment for the Hive platform +# Spinifex Platform Development Environment Setup +# This script sets up a complete development environment for the Spinifex platform set -e @@ -12,17 +12,17 @@ MULGA_ROOT="$(cd "$PROJECT_ROOT/.." && pwd)" # Default configuration NATS_PORT=4222 PREDASTORE_PORT=8443 -HIVE_GATEWAY_PORT=9999 -DATA_DIR="$HOME/hive" -# Use CONFIG_DIR environment variable if set, otherwise default to ~/hive/config -CONFIG_DIR="${CONFIG_DIR:-$HOME/hive/config}" +SPINIFEX_GATEWAY_PORT=9999 +DATA_DIR="$HOME/spinifex" +# Use CONFIG_DIR environment variable if set, otherwise default to ~/spinifex/config +CONFIG_DIR="${CONFIG_DIR:-$HOME/spinifex/config}" -echo "๐Ÿš€ Setting up Hive development environment..." +echo "๐Ÿš€ Setting up Spinifex development environment..." echo "Project root: $PROJECT_ROOT" echo "Data directory: $DATA_DIR" # Create necessary directories -mkdir -p "$DATA_DIR"/{nats,predastore,viperblock,logs,hive} +mkdir -p "$DATA_DIR"/{nats,predastore,viperblock,logs,spinifex} mkdir -p "$CONFIG_DIR" # Function to check if command exists @@ -124,7 +124,7 @@ done echo "" echo "๐Ÿ”Œ Checking port availability..." -ports=("$NATS_PORT:NATS" "$PREDASTORE_PORT:Predastore" "$HIVE_GATEWAY_PORT:Hive Gateway") +ports=("$NATS_PORT:NATS" "$PREDASTORE_PORT:Predastore" "$SPINIFEX_GATEWAY_PORT:Spinifex Gateway") for port_info in "${ports[@]}"; do port="${port_info%:*}" service="${port_info#*:}" @@ -135,24 +135,24 @@ for port_info in "${ports[@]}"; do fi done -# Build Hive first (needed for admin init) +# Build Spinifex first (needed for admin init) echo "" -echo "๐Ÿ”จ Building Hive..." +echo "๐Ÿ”จ Building Spinifex..." cd "$PROJECT_ROOT" make build -echo "โœ… Hive built successfully" +echo "โœ… Spinifex built successfully" -# Initialize Hive configuration using admin init +# Initialize Spinifex configuration using admin init #echo "" -#echo "๐Ÿ” Initializing Hive configuration..." +#echo "๐Ÿ” Initializing Spinifex configuration..." -#if [[ ! -f "$CONFIG_DIR/hive.toml" ]]; then -# echo "๐Ÿ“‹ Running hive admin init..." -# ./bin/hive admin init --config-dir "$CONFIG_DIR" -# echo "โœ… Hive configuration initialized" +#if [[ ! -f "$CONFIG_DIR/spinifex.toml" ]]; then +# echo "๐Ÿ“‹ Running spx admin init..." +# ./bin/spx admin init --config-dir "$CONFIG_DIR" +# echo "โœ… Spinifex configuration initialized" #else -# echo "โœ… Hive configuration already exists" -# echo " To re-initialize, run: ./bin/hive admin init --force" +# echo "โœ… Spinifex configuration already exists" +# echo " To re-initialize, run: ./bin/spx admin init --force" #fi # Build components @@ -182,9 +182,9 @@ fi echo "" echo "๐ŸŽ‰ Development environment setup complete!" echo "" -echo "When running Hive for the first time, run the init function to create the" +echo "When running Spinifex for the first time, run the init function to create the" echo "default directories for data, config files and layout required." -echo "./bin/hive admin init" +echo "./bin/spx admin init" echo "" echo "๐Ÿš€ To start the development environment:" echo " ./scripts/start-dev.sh" @@ -193,7 +193,7 @@ echo "๐Ÿ›‘ To stop the development environment:" echo " ./scripts/stop-dev.sh" echo "" echo "๐Ÿ”ง Development endpoints:" -echo " - Hive Gateway: https://localhost:$HIVE_GATEWAY_PORT" +echo " - Spinifex Gateway: https://localhost:$SPINIFEX_GATEWAY_PORT" echo " - Predastore S3: https://localhost:$PREDASTORE_PORT" echo " - NATS: nats://localhost:$NATS_PORT" echo "" @@ -201,4 +201,4 @@ echo "๐Ÿ“Š Monitor logs:" echo " tail -f $DATA_DIR/logs/*.log" echo "" echo "๐Ÿงช Test with AWS CLI:" -echo " aws --endpoint-url https://localhost:$HIVE_GATEWAY_PORT --no-verify-ssl ec2 describe-instances" +echo " aws --endpoint-url https://localhost:$SPINIFEX_GATEWAY_PORT --no-verify-ssl ec2 describe-instances" diff --git a/scripts/iac/aws/main.tf b/scripts/iac/aws/main.tf index 6b1a921a5..eca6e7705 100644 --- a/scripts/iac/aws/main.tf +++ b/scripts/iac/aws/main.tf @@ -79,19 +79,19 @@ data "aws_ami" "debian12" { } } -# Keypair: hive-test +# Keypair: spinifex-test resource "tls_private_key" "hive_test" { algorithm = "ED25519" } resource "aws_key_pair" "hive_test" { - key_name = "hive-test" + key_name = "spinifex-test" public_key = tls_private_key.hive_test.public_key_openssh } # Save private key locally for SSH resource "local_file" "hive_test_pem" { - filename = "${path.module}/hive-test.pem" + filename = "${path.module}/spinifex-test.pem" content = tls_private_key.hive_test.private_key_openssh file_permission = "0600" } @@ -103,7 +103,7 @@ resource "aws_vpc" "main" { enable_dns_support = true tags = { - Name = "hive-test-vpc" + Name = "spinifex-test-vpc" } } @@ -112,7 +112,7 @@ resource "aws_internet_gateway" "igw" { vpc_id = aws_vpc.main.id tags = { - Name = "hive-test-igw" + Name = "spinifex-test-igw" } } @@ -124,7 +124,7 @@ resource "aws_subnet" "public" { map_public_ip_on_launch = true tags = { - Name = "hive-test-public-subnet" + Name = "spinifex-test-public-subnet" } } @@ -137,7 +137,7 @@ resource "aws_route_table" "public" { } tags = { - Name = "hive-test-public-rt" + Name = "spinifex-test-public-rt" } } @@ -148,7 +148,7 @@ resource "aws_route_table_association" "public" { # 3: Security group resource "aws_security_group" "web_ssh" { - name = "hive-test-sg" + name = "spinifex-test-sg" description = "Allow inbound 22,80,443; allow all outbound" vpc_id = aws_vpc.main.id @@ -185,13 +185,13 @@ resource "aws_security_group" "web_ssh" { } tags = { - Name = "hive-test-sg" + Name = "spinifex-test-sg" } } # 4: Ensure 3 servers on different underlying hardware (spread placement group) resource "aws_placement_group" "spread" { - name = "hive-test-spread" + name = "spinifex-test-spread" strategy = "spread" } @@ -208,7 +208,7 @@ resource "aws_instance" "vm" { placement_group = aws_placement_group.spread.name tags = { - Name = "hive-test-vm-${count.index + 1}" + Name = "spinifex-test-vm-${count.index + 1}" } } @@ -219,6 +219,6 @@ output "instance_public_ips" { output "ssh_commands" { value = [ for ip in aws_instance.vm[*].public_ip : - "ssh -i hive-test.pem admin@${ip}" + "ssh -i spinifex-test.pem admin@${ip}" ] } diff --git a/scripts/iac/configure-cluster.sh b/scripts/iac/configure-cluster.sh index d56291dfa..47ac5113d 100755 --- a/scripts/iac/configure-cluster.sh +++ b/scripts/iac/configure-cluster.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -# Configure a provisioned Hive cluster: clone repo, build, form cluster, start services. +# Configure a provisioned Spinifex cluster: clone repo, build, form cluster, start services. # Usage: configure-cluster.sh CLUSTER_NAME="${1:?Usage: configure-cluster.sh }" @@ -93,7 +93,7 @@ NODE1_IP="${MGMT_IPS[0]}" # Node 1: init echo " Starting init on node1 ($NODE1_IP)..." -remote_bg "$NODE1_IP" "export PATH=\$PATH:/usr/local/go/bin && cd ~/Development/mulga/hive && ./bin/hive admin init \ +remote_bg "$NODE1_IP" "export PATH=\$PATH:/usr/local/go/bin && cd ~/Development/mulga/hive && ./bin/spx admin init \ --node node1 \ --bind $NODE1_IP \ --cluster-bind $NODE1_IP \ @@ -103,8 +103,8 @@ remote_bg "$NODE1_IP" "export PATH=\$PATH:/usr/local/go/bin && cd ~/Development/ --nodes $NODE_COUNT \ --region $REGION \ --az $AZ \ - --hive-dir ~/hive/ \ - --config-dir ~/hive/config/" + --hive-dir ~/spinifex/ \ + --config-dir ~/spinifex/config/" INIT_PID=$! # Wait for formation server to be ready @@ -128,14 +128,14 @@ if [ "$NODE_COUNT" -gt 1 ]; then ip="${MGMT_IPS[$i]}" node_num=$((i + 1)) echo " Starting join on node$node_num ($ip)..." - remote_bg "$ip" "export PATH=\$PATH:/usr/local/go/bin && cd ~/Development/mulga/hive && ./bin/hive admin join \ + remote_bg "$ip" "export PATH=\$PATH:/usr/local/go/bin && cd ~/Development/mulga/hive && ./bin/spx admin join \ --node node$node_num \ --bind $ip \ --cluster-bind $ip \ --cluster-routes $NODE1_IP:4248 \ --host $NODE1_IP:4432 \ - --data-dir ~/hive/ \ - --config-dir ~/hive/config/ \ + --data-dir ~/spinifex/ \ + --config-dir ~/spinifex/config/ \ --region $REGION \ --az $AZ" JOIN_PIDS+=($!) diff --git a/scripts/iac/proxmox/variables.tf b/scripts/iac/proxmox/variables.tf index cae8bdfe2..0286e9f9f 100644 --- a/scripts/iac/proxmox/variables.tf +++ b/scripts/iac/proxmox/variables.tf @@ -62,7 +62,7 @@ variable "nodes" { variable "cluster_name" { type = string - description = "Name for the Hive cluster (used in VM names and tags)" + description = "Name for the Spinifex cluster (used in VM names and tags)" validation { condition = can(regex("^[a-z0-9-]+$", var.cluster_name)) @@ -72,7 +72,7 @@ variable "cluster_name" { variable "node_count" { type = number - description = "Number of Hive VMs to create" + description = "Number of Spinifex VMs to create" default = 3 validation { diff --git a/scripts/iac/proxmox/vms.tf b/scripts/iac/proxmox/vms.tf index dc830c959..573ad12c4 100644 --- a/scripts/iac/proxmox/vms.tf +++ b/scripts/iac/proxmox/vms.tf @@ -3,7 +3,7 @@ resource "proxmox_virtual_environment_vm" "hive_node" { name = "${var.cluster_name}-${count.index + 1}" description = "Managed by Terraform" - tags = ["terraform", "hive", var.cluster_name] + tags = ["terraform", "spinifex", var.cluster_name] node_name = var.nodes[count.index % length(var.nodes)].name initialization { diff --git a/scripts/iac/hive-test.sh b/scripts/iac/spinifex-test.sh similarity index 90% rename from scripts/iac/hive-test.sh rename to scripts/iac/spinifex-test.sh index a9b8d7caf..18b4432f0 100755 --- a/scripts/iac/hive-test.sh +++ b/scripts/iac/spinifex-test.sh @@ -7,7 +7,7 @@ CLUSTERS_DIR="$TOFU_DIR/clusters" usage() { cat <<'USAGE' -Usage: hive-test.sh [options] +Usage: spinifex-test.sh [options] Commands: up Provision VMs with OpenTofu @@ -25,13 +25,13 @@ Options: --disk-size-gb=N Disk size per VM in GB (default: 32) Examples: - ./scripts/iac/hive-test.sh up hive-test1 - ./scripts/iac/hive-test.sh configure hive-test1 - ./scripts/iac/hive-test.sh test hive-test1 - ./scripts/iac/hive-test.sh status hive-test1 - ./scripts/iac/hive-test.sh ssh hive-test1 2 - ./scripts/iac/hive-test.sh down hive-test1 - ./scripts/iac/hive-test.sh full hive-test1 --node-count=3 + ./scripts/iac/spinifex-test.sh up spinifex-test1 + ./scripts/iac/spinifex-test.sh configure spinifex-test1 + ./scripts/iac/spinifex-test.sh test spinifex-test1 + ./scripts/iac/spinifex-test.sh status spinifex-test1 + ./scripts/iac/spinifex-test.sh ssh spinifex-test1 2 + ./scripts/iac/spinifex-test.sh down spinifex-test1 + ./scripts/iac/spinifex-test.sh full spinifex-test1 --node-count=3 USAGE exit 1 } @@ -195,7 +195,7 @@ cmd_status() { cmd_ssh() { if [ -z "$SSH_NODE" ]; then - echo "Usage: hive-test.sh ssh " + echo "Usage: spinifex-test.sh ssh " exit 1 fi diff --git a/scripts/iac/test-cluster.sh b/scripts/iac/test-cluster.sh index c93e13b4d..a2e00caba 100755 --- a/scripts/iac/test-cluster.sh +++ b/scripts/iac/test-cluster.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -# Run smoke tests against a configured Hive cluster. +# Run smoke tests against a configured Spinifex cluster. # Usage: test-cluster.sh CLUSTER_NAME="${1:?Usage: test-cluster.sh }" diff --git a/scripts/reset-dev-env.sh b/scripts/reset-dev-env.sh index e467ff4d3..41ce24ed3 100755 --- a/scripts/reset-dev-env.sh +++ b/scripts/reset-dev-env.sh @@ -8,26 +8,26 @@ echo "Shutting down services" echo "Removing data" -rm -rf ~/hive/predastore/ +rm -rf ~/spinifex/predastore/ -rm -rf ~/hive/hive/* +rm -rf ~/spinifex/hive/* -rm -rf ~/hive/viperblock/* +rm -rf ~/spinifex/viperblock/* -rm -rf ~/hive/nats/* +rm -rf ~/spinifex/nats/* -rm -rf ~/hive/images/* +rm -rf ~/spinifex/images/* # Enable pprof for development -PPROF_ENABLED=1 PPROF_OUTPUT=/tmp/hive-vm.prof ./scripts/start-dev.sh --build +PPROF_ENABLED=1 PPROF_OUTPUT=/tmp/spinifex-vm.prof ./scripts/start-dev.sh --build # Follow INSTALL.md steps echo "Importing AMI" -export AWS_PROFILE=hive +export AWS_PROFILE=spinifex # Step 1 SSH key -aws ec2 import-key-pair --key-name "hive-key" --public-key-material fileb://~/.ssh/hive-key.pub +aws ec2 import-key-pair --key-name "spinifex-key" --public-key-material fileb://~/.ssh/spinifex-key.pub echo "Validating key pair imported" @@ -45,7 +45,7 @@ else fi echo "Detected architecture: $ARCH, using image: $IMAGE_NAME" -./bin/hive admin images import --name "$IMAGE_NAME" +./bin/spx admin images import --name "$IMAGE_NAME" aws ec2 describe-images diff --git a/scripts/run-bench.sh b/scripts/run-bench.sh index 382577644..d203ed8ae 100755 --- a/scripts/run-bench.sh +++ b/scripts/run-bench.sh @@ -1,15 +1,15 @@ #!/bin/sh # List running instances using ubuntu image and run disk performance benchmark -export AWS_PROFILE=hive +export AWS_PROFILE=spinifex # Initialize perf tracking variables PERF_PID="" NBDKIT_PID="" -# Check HIVE_AMI set, if not try to detect it -if [ -z "$HIVE_AMI" ]; then - echo "HIVE_AMI not set, attempting to detect..." +# Check SPINIFEX_AMI set, if not try to detect it +if [ -z "$SPINIFEX_AMI" ]; then + echo "SPINIFEX_AMI not set, attempting to detect..." ARCH=$(uname -m) if [ "$ARCH" = "x86_64" ]; then IMAGE_NAME="ami-ubuntu-24.04-x86_64" @@ -18,23 +18,23 @@ if [ -z "$HIVE_AMI" ]; then else IMAGE_NAME="ami-ubuntu-24.04-x86_64" fi - HIVE_AMI=$(aws ec2 describe-images --query "Images[?Name=='$IMAGE_NAME'].ImageId" --output text) - if [ -z "$HIVE_AMI" ]; then + SPINIFEX_AMI=$(aws ec2 describe-images --query "Images[?Name=='$IMAGE_NAME'].ImageId" --output text) + if [ -z "$SPINIFEX_AMI" ]; then echo "Error: Could not find image with Name '$IMAGE_NAME'" exit 1 fi - echo "Detected HIVE_AMI: $HIVE_AMI" + echo "Detected SPINIFEX_AMI: $SPINIFEX_AMI" fi # Get running instances matching the AMI # Retry loop: wait for instance to come online (up to 120 seconds) -echo "Finding running instances with ImageId: $HIVE_AMI" +echo "Finding running instances with ImageId: $SPINIFEX_AMI" MAX_ATTEMPTS=120 ATTEMPT=0 INSTANCE_ID="" while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do - INSTANCE_JSON=$(aws ec2 describe-instances --filters "Name=image-id,Values=$HIVE_AMI" "Name=instance-state-name,Values=running" --output json 2>/dev/null) + INSTANCE_JSON=$(aws ec2 describe-instances --filters "Name=image-id,Values=$SPINIFEX_AMI" "Name=instance-state-name,Values=running" --output json 2>/dev/null) # Extract InstanceId using jq (handle nested structure) INSTANCE_ID=$(echo "$INSTANCE_JSON" | jq -r '.Reservations[0].Instances[0].InstanceId // empty' 2>/dev/null) @@ -52,7 +52,7 @@ while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do done if [ -z "$INSTANCE_ID" ] || [ "$INSTANCE_ID" = "null" ]; then - echo "Error: No running instances found with ImageId $HIVE_AMI after $MAX_ATTEMPTS attempts" + echo "Error: No running instances found with ImageId $SPINIFEX_AMI after $MAX_ATTEMPTS attempts" echo "Available instances:" aws ec2 describe-instances --query "Reservations[*].Instances[*].[InstanceId,ImageId,State.Name]" --output table exit 1 @@ -113,7 +113,7 @@ else # Start perf record in the background (will run until interrupted) echo "Starting perf profiling for nbdkit process (PID: $NBDKIT_PID)..." - sudo perf record -g -p "$NBDKIT_PID" -o /tmp/hive-nbdkit-perf.data > /tmp/perf.log 2>&1 & + sudo perf record -g -p "$NBDKIT_PID" -o /tmp/spinifex-nbdkit-perf.data > /tmp/perf.log 2>&1 & PERF_PID=$! echo "Perf profiling started (PID: $PERF_PID), will record during benchmark execution" fi @@ -137,7 +137,7 @@ SSH_READY=false while [ $SSH_ATTEMPTS -lt $MAX_SSH_ATTEMPTS ]; do ssh-keyscan -p "$SSH_PORT" 127.0.0.1 >> ~/.ssh/known_hosts 2>/dev/null - if ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=2 -p "$SSH_PORT" -i ~/.ssh/hive-key ec2-user@127.0.0.1 'echo ready' >/dev/null 2>&1; then + if ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=2 -p "$SSH_PORT" -i ~/.ssh/spinifex-key ec2-user@127.0.0.1 'echo ready' >/dev/null 2>&1; then SSH_READY=true echo "SSH is ready!" break @@ -156,7 +156,7 @@ if [ "$SSH_READY" != "true" ]; then fi echo "Copying benchmark script to instance..." -scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -P "$SSH_PORT" -i ~/.ssh/hive-key "$BENCH_SCRIPT" ec2-user@127.0.0.1:~/disk-performance.sh +scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -P "$SSH_PORT" -i ~/.ssh/spinifex-key "$BENCH_SCRIPT" ec2-user@127.0.0.1:~/disk-performance.sh if [ $? -ne 0 ]; then echo "Error: Failed to copy benchmark script to instance" @@ -165,19 +165,19 @@ fi # Execute benchmark script echo "Running benchmark on instance..." -ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p "$SSH_PORT" -i ~/.ssh/hive-key ec2-user@127.0.0.1 'chmod +x ~/disk-performance.sh && ~/disk-performance.sh' > /tmp/hive-vm-disk.log 2>&1 +ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p "$SSH_PORT" -i ~/.ssh/spinifex-key ec2-user@127.0.0.1 'chmod +x ~/disk-performance.sh && ~/disk-performance.sh' > /tmp/spinifex-vm-disk.log 2>&1 if [ $? -ne 0 ]; then - echo "Error: Benchmark execution failed, check /tmp/hive-vm-disk.log for details" + echo "Error: Benchmark execution failed, check /tmp/spinifex-vm-disk.log for details" # Stop perf if it was running if [ -n "$PERF_PID" ]; then echo "Stopping perf profiling..." sudo kill -INT "$PERF_PID" 2>/dev/null || true # Wait for perf to finish writing sleep 3 - if [ -f /tmp/hive-nbdkit-perf.data ]; then - sudo chmod 644 /tmp/hive-nbdkit-perf.data - echo "Perf data saved to /tmp/hive-nbdkit-perf.data" + if [ -f /tmp/spinifex-nbdkit-perf.data ]; then + sudo chmod 644 /tmp/spinifex-nbdkit-perf.data + echo "Perf data saved to /tmp/spinifex-nbdkit-perf.data" fi fi exit 1 @@ -191,19 +191,19 @@ if [ -n "$PERF_PID" ]; then # Wait for perf to finish writing data sleep 3 - if [ -f /tmp/hive-nbdkit-perf.data ]; then - sudo chmod 644 /tmp/hive-nbdkit-perf.data - echo "Perf benchmarks saved to /tmp/hive-nbdkit-perf.data" - echo "To view: sudo perf report -i /tmp/hive-nbdkit-perf.data" + if [ -f /tmp/spinifex-nbdkit-perf.data ]; then + sudo chmod 644 /tmp/spinifex-nbdkit-perf.data + echo "Perf benchmarks saved to /tmp/spinifex-nbdkit-perf.data" + echo "To view: sudo perf report -i /tmp/spinifex-nbdkit-perf.data" else - echo "Warning: Perf data file not found at /tmp/hive-nbdkit-perf.data" + echo "Warning: Perf data file not found at /tmp/spinifex-nbdkit-perf.data" fi fi # Display results echo "" echo "Benchmark completed successfully!" -echo "Results saved to /tmp/hive-vm-disk.log" +echo "Results saved to /tmp/spinifex-vm-disk.log" echo "" echo "=== Benchmark Results ===" -cat /tmp/hive-vm-disk.log +cat /tmp/spinifex-vm-disk.log diff --git a/scripts/run-instance.sh b/scripts/run-instance.sh index 43122f0b4..71ccb29d7 100755 --- a/scripts/run-instance.sh +++ b/scripts/run-instance.sh @@ -1,7 +1,7 @@ #!/bin/sh # Query images, get Ubuntu image -export AWS_PROFILE=hive +export AWS_PROFILE=spinifex # Detect architecture ARCH=$(uname -m) @@ -14,7 +14,7 @@ else IMAGE_NAME="ami-ubuntu-24.04-x86_64" fi -# Query available instance types from Hive and pick the first micro type +# Query available instance types from Spinifex and pick the first micro type INSTANCE_TYPE=$(aws ec2 describe-instance-types --query "InstanceTypes[?contains(InstanceType, '.micro')].InstanceType | [0]" --output text) if [ -z "$INSTANCE_TYPE" ] || [ "$INSTANCE_TYPE" = "None" ]; then echo "Error: Could not find available micro instance type" @@ -28,27 +28,27 @@ echo "Detected architecture: $ARCH" echo "Looking for image with Name: $IMAGE_NAME" # Query images and extract ImageId matching the IMAGE_NAME -HIVE_AMI=$(aws ec2 describe-images --query "Images[?Name=='$IMAGE_NAME'].ImageId" --output text) +SPINIFEX_AMI=$(aws ec2 describe-images --query "Images[?Name=='$IMAGE_NAME'].ImageId" --output text) -if [ -z "$HIVE_AMI" ]; then +if [ -z "$SPINIFEX_AMI" ]; then echo "Error: Could not find image with Name '$IMAGE_NAME'" echo "Available images:" aws ec2 describe-images --query "Images[*].[Name,ImageId]" --output table exit 1 fi -export HIVE_AMI=$HIVE_AMI +export SPINIFEX_AMI=$SPINIFEX_AMI -echo "Found ImageId: $HIVE_AMI" -export HIVE_AMI +echo "Found ImageId: $SPINIFEX_AMI" +export SPINIFEX_AMI echo "Launching instance" # Launch instance aws ec2 run-instances \ - --image-id "$HIVE_AMI" \ + --image-id "$SPINIFEX_AMI" \ --instance-type "$INSTANCE_TYPE" \ - --key-name hive-key \ + --key-name spinifex-key \ --security-group-ids sg-0123456789abcdef0 \ --subnet-id subnet-6e7f829e \ --count 1 diff --git a/scripts/setup-ovn.sh b/scripts/setup-ovn.sh index fae91f580..1a78ec5c1 100755 --- a/scripts/setup-ovn.sh +++ b/scripts/setup-ovn.sh @@ -1,6 +1,6 @@ #!/bin/bash -# OVN Compute Node Setup for Hive VPC Networking +# OVN Compute Node Setup for Spinifex VPC Networking # # This script bootstraps a compute node for OVN-based VPC networking: # 1. Installs OVN/OVS packages (if not present) @@ -71,7 +71,7 @@ if [ -z "$CHASSIS_ID" ]; then echo "Auto-detected chassis ID: $CHASSIS_ID" fi -echo "=== Hive OVN Compute Node Setup ===" +echo "=== Spinifex OVN Compute Node Setup ===" echo " Management node: $MANAGEMENT" echo " OVN Remote (SB): $OVN_REMOTE" echo " Encap IP: $ENCAP_IP" @@ -161,8 +161,8 @@ echo " ovn-controller: started" echo "" echo "Step 6: Applying sysctl for overlay networking..." -sudo tee /etc/sysctl.d/99-hive-vpc.conf >/dev/null <<'SYSCTL' -# Hive VPC networking: enable IP forwarding and disable rp_filter +sudo tee /etc/sysctl.d/99-spinifex-vpc.conf >/dev/null <<'SYSCTL' +# Spinifex VPC networking: enable IP forwarding and disable rp_filter # for Geneve overlay traffic on OVS bridges. net.ipv4.ip_forward=1 net.ipv4.conf.all.rp_filter=0 @@ -226,9 +226,9 @@ fi # Create persistent systemd override so permissions survive OVS restarts OVERRIDE_DIR="/etc/systemd/system/openvswitch-switch.service.d" -if [ ! -f "$OVERRIDE_DIR/hive-perms.conf" ]; then +if [ ! -f "$OVERRIDE_DIR/spinifex-perms.conf" ]; then sudo mkdir -p "$OVERRIDE_DIR" - sudo tee "$OVERRIDE_DIR/hive-perms.conf" >/dev/null <<'OVERRIDE' + sudo tee "$OVERRIDE_DIR/spinifex-perms.conf" >/dev/null <<'OVERRIDE' [Service] ExecStartPost=/bin/chmod 0666 /var/run/openvswitch/db.sock OVERRIDE @@ -240,11 +240,11 @@ fi # Create sudoers rule for network commands that always need root # (ip tuntap, ip link set โ€” NET_ADMIN operations) -SUDOERS_FILE="/etc/sudoers.d/hive-network" +SUDOERS_FILE="/etc/sudoers.d/spinifex-network" if [ ! -f "$SUDOERS_FILE" ]; then CURRENT_USER=$(whoami) sudo tee "$SUDOERS_FILE" >/dev/null </dev/null 2>&1; then echo " cleaned up stale .log.log files" fi -LOGROTATE_FILE="/etc/logrotate.d/ovn-hive" +LOGROTATE_FILE="/etc/logrotate.d/ovn-spinifex" sudo tee "$LOGROTATE_FILE" >/dev/null <<'LOGROTATE' /var/log/ovn/ovn-controller.log /var/log/ovn/ovn-northd.log @@ -288,7 +288,7 @@ LOGROTATE echo " logrotate config: $LOGROTATE_FILE (daily, 100M max, 3 rotations, explicit filenames)" # --- Step 10: Disable auto-start on boot --- -# start-dev.sh / stop-dev.sh manage the OVN lifecycle. Without hive services +# start-dev.sh / stop-dev.sh manage the OVN lifecycle. Without spinifex services # running, ovn-controller spins in a tight reconnect loop burning CPU. echo "" echo "Step 10: Disabling OVN auto-start on boot (start-dev.sh will manage lifecycle)..." diff --git a/scripts/setup.sh b/scripts/setup.sh index 503cca66a..55c939dba 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -1,17 +1,17 @@ #!/bin/bash -# Hive binary installer +# Spinifex binary installer # Usage: curl -sfL https://install.mulgadc.com | bash # # Environment variables: -# INSTALL_HIVE_CHANNEL Release channel: latest (default), dev -# INSTALL_HIVE_VERSION Pin to specific version (overrides channel) -# INSTALL_HIVE_TARBALL Path to local tarball (skips download, for testing/air-gapped) -# INSTALL_HIVE_SKIP_APT Set to 1 to skip apt dependency install -# INSTALL_HIVE_SKIP_AWS Set to 1 to skip AWS CLI install +# INSTALL_SPINIFEX_CHANNEL Release channel: latest (default), dev +# INSTALL_SPINIFEX_VERSION Pin to specific version (overrides channel) +# INSTALL_SPINIFEX_TARBALL Path to local tarball (skips download, for testing/air-gapped) +# INSTALL_SPINIFEX_SKIP_APT Set to 1 to skip apt dependency install +# INSTALL_SPINIFEX_SKIP_AWS Set to 1 to skip AWS CLI install set -e -INSTALL_HIVE_CHANNEL="${INSTALL_HIVE_CHANNEL:-latest}" +INSTALL_SPINIFEX_CHANNEL="${INSTALL_SPINIFEX_CHANNEL:-latest}" INSTALL_BASE_URL="${INSTALL_BASE_URL:-https://install.mulgadc.com}" # --- Colors --- @@ -60,7 +60,7 @@ detect_os() { fi ;; *) - fatal "Unsupported OS: $ID $VERSION_ID. Hive requires Debian 12+ or Ubuntu 22.04+" + fatal "Unsupported OS: $ID $VERSION_ID. Spinifex requires Debian 12+ or Ubuntu 22.04+" ;; esac @@ -82,7 +82,7 @@ detect_arch() { AWS_ARCH="aarch64" ;; *) - fatal "Unsupported architecture: $MACHINE. Hive requires x86_64 or aarch64" + fatal "Unsupported architecture: $MACHINE. Spinifex requires x86_64 or aarch64" ;; esac @@ -92,30 +92,30 @@ detect_arch() { # --- Detect service user --- detect_service_user() { # Use the real user โ€” either the current user, or SUDO_USER if running via sudo - HIVE_USER="${SUDO_USER:-$(whoami)}" - HIVE_GROUP="$(id -gn "$HIVE_USER")" + SPINIFEX_USER="${SUDO_USER:-$(whoami)}" + SPINIFEX_GROUP="$(id -gn "$SPINIFEX_USER")" - if [ "$HIVE_USER" = "root" ]; then + if [ "$SPINIFEX_USER" = "root" ]; then fatal "Cannot determine service user. Do not run as root directly โ€” use: curl ... | bash (as a normal user)" fi - info "Services will run as: $HIVE_USER:$HIVE_GROUP" + info "Services will run as: $SPINIFEX_USER:$SPINIFEX_GROUP" # Allow the service user to manage OVN/OVS and tap devices - $SUDO tee /etc/sudoers.d/hive-network > /dev/null << SUDOERS -# Hive VPC networking: allow service user to manage tap devices, OVS, and OVN -${HIVE_USER} ALL=(root) NOPASSWD: /sbin/ip, /usr/sbin/ip -${HIVE_USER} ALL=(root) NOPASSWD: /usr/bin/ovs-vsctl, /usr/bin/ovs-appctl -${HIVE_USER} ALL=(root) NOPASSWD: /usr/bin/ovn-nbctl, /usr/bin/ovn-sbctl + $SUDO tee /etc/sudoers.d/spinifex-network > /dev/null << SUDOERS +# Spinifex VPC networking: allow service user to manage tap devices, OVS, and OVN +${SPINIFEX_USER} ALL=(root) NOPASSWD: /sbin/ip, /usr/sbin/ip +${SPINIFEX_USER} ALL=(root) NOPASSWD: /usr/bin/ovs-vsctl, /usr/bin/ovs-appctl +${SPINIFEX_USER} ALL=(root) NOPASSWD: /usr/bin/ovn-nbctl, /usr/bin/ovn-sbctl SUDOERS - $SUDO chmod 0440 /etc/sudoers.d/hive-network - info "Sudoers rules installed for $HIVE_USER" + $SUDO chmod 0440 /etc/sudoers.d/spinifex-network + info "Sudoers rules installed for $SPINIFEX_USER" } # --- Install apt dependencies --- install_apt_deps() { - if [ "${INSTALL_HIVE_SKIP_APT}" = "1" ]; then - info "Skipping apt dependencies (INSTALL_HIVE_SKIP_APT=1)" + if [ "${INSTALL_SPINIFEX_SKIP_APT}" = "1" ]; then + info "Skipping apt dependencies (INSTALL_SPINIFEX_SKIP_APT=1)" return fi @@ -135,8 +135,8 @@ install_apt_deps() { # --- Install AWS CLI --- install_aws_cli() { - if [ "${INSTALL_HIVE_SKIP_AWS}" = "1" ]; then - info "Skipping AWS CLI (INSTALL_HIVE_SKIP_AWS=1)" + if [ "${INSTALL_SPINIFEX_SKIP_AWS}" = "1" ]; then + info "Skipping AWS CLI (INSTALL_SPINIFEX_SKIP_AWS=1)" return fi @@ -156,42 +156,42 @@ install_aws_cli() { } # --- Download tarball --- -download_hive() { - HIVE_TMPDIR=$(mktemp -d) - TARBALL="$HIVE_TMPDIR/hive.tar.gz" +download_spinifex() { + SPINIFEX_TMPDIR=$(mktemp -d) + TARBALL="$SPINIFEX_TMPDIR/hive.tar.gz" # Local tarball override โ€” skip download (for testing and air-gapped installs) - if [ -n "$INSTALL_HIVE_TARBALL" ]; then - info "Using local tarball: $INSTALL_HIVE_TARBALL" - cp "$INSTALL_HIVE_TARBALL" "$TARBALL" + if [ -n "$INSTALL_SPINIFEX_TARBALL" ]; then + info "Using local tarball: $INSTALL_SPINIFEX_TARBALL" + cp "$INSTALL_SPINIFEX_TARBALL" "$TARBALL" info "Extracting..." - tar -xzf "$TARBALL" -C "$HIVE_TMPDIR" - EXTRACT_DIR="$HIVE_TMPDIR" + tar -xzf "$TARBALL" -C "$SPINIFEX_TMPDIR" + EXTRACT_DIR="$SPINIFEX_TMPDIR" return fi - if [ -n "$INSTALL_HIVE_VERSION" ]; then - DOWNLOAD_URL="${INSTALL_BASE_URL}/download/${INSTALL_HIVE_VERSION}/${ARCH}" - info "Downloading Hive $INSTALL_HIVE_VERSION ($ARCH)..." + if [ -n "$INSTALL_SPINIFEX_VERSION" ]; then + DOWNLOAD_URL="${INSTALL_BASE_URL}/download/${INSTALL_SPINIFEX_VERSION}/${ARCH}" + info "Downloading Spinifex $INSTALL_SPINIFEX_VERSION ($ARCH)..." else - DOWNLOAD_URL="${INSTALL_BASE_URL}/download/${INSTALL_HIVE_CHANNEL}/${ARCH}" - info "Downloading Hive ($INSTALL_HIVE_CHANNEL channel, $ARCH)..." + DOWNLOAD_URL="${INSTALL_BASE_URL}/download/${INSTALL_SPINIFEX_CHANNEL}/${ARCH}" + info "Downloading Spinifex ($INSTALL_SPINIFEX_CHANNEL channel, $ARCH)..." fi HTTP_CODE=$(curl -fsSL -w '%{http_code}' -o "$TARBALL" "$DOWNLOAD_URL" 2>/dev/null) || true if [ ! -f "$TARBALL" ] || [ "$HTTP_CODE" -ge 400 ] 2>/dev/null; then - rm -rf "$HIVE_TMPDIR" - fatal "Failed to download Hive from $DOWNLOAD_URL (HTTP $HTTP_CODE)" + rm -rf "$SPINIFEX_TMPDIR" + fatal "Failed to download Spinifex from $DOWNLOAD_URL (HTTP $HTTP_CODE)" fi # Verify checksum if available CHECKSUM_URL="${DOWNLOAD_URL}.sha256" - if curl -fsSL -o "$HIVE_TMPDIR/checksum.sha256" "$CHECKSUM_URL" 2>/dev/null; then + if curl -fsSL -o "$SPINIFEX_TMPDIR/checksum.sha256" "$CHECKSUM_URL" 2>/dev/null; then info "Verifying checksum..." - EXPECTED=$(awk '{print $1}' "$HIVE_TMPDIR/checksum.sha256") + EXPECTED=$(awk '{print $1}' "$SPINIFEX_TMPDIR/checksum.sha256") ACTUAL=$(sha256sum "$TARBALL" | awk '{print $1}') if [ "$EXPECTED" != "$ACTUAL" ]; then - rm -rf "$HIVE_TMPDIR" + rm -rf "$SPINIFEX_TMPDIR" fatal "Checksum verification failed. Expected: $EXPECTED, Got: $ACTUAL" fi info "Checksum verified" @@ -201,8 +201,8 @@ download_hive() { # Extract info "Extracting..." - tar -xzf "$TARBALL" -C "$HIVE_TMPDIR" - EXTRACT_DIR="$HIVE_TMPDIR" + tar -xzf "$TARBALL" -C "$SPINIFEX_TMPDIR" + EXTRACT_DIR="$SPINIFEX_TMPDIR" } # --- Place files --- @@ -210,8 +210,8 @@ install_files() { info "Installing files..." # Binary - $SUDO install -m 0755 "$EXTRACT_DIR/hive" /usr/local/bin/hive - info " /usr/local/bin/hive" + $SUDO install -m 0755 "$EXTRACT_DIR/spx" /usr/local/bin/spx + info " /usr/local/bin/spx" # nbdkit plugin PLUGINDIR=$(nbdkit --dump-config 2>/dev/null | grep ^plugindir= | cut -d= -f2) @@ -228,10 +228,10 @@ install_files() { info " $PLUGINDIR/nbdkit-viperblock-plugin.so" # Setup scripts - $SUDO mkdir -p /usr/local/share/hive + $SUDO mkdir -p /usr/local/share/spinifex if [ -f "$EXTRACT_DIR/setup-ovn.sh" ]; then - $SUDO install -m 0755 "$EXTRACT_DIR/setup-ovn.sh" /usr/local/share/hive/setup-ovn.sh - info " /usr/local/share/hive/setup-ovn.sh" + $SUDO install -m 0755 "$EXTRACT_DIR/setup-ovn.sh" /usr/local/share/spinifex/setup-ovn.sh + info " /usr/local/share/spinifex/setup-ovn.sh" fi } @@ -239,39 +239,39 @@ install_files() { create_directories() { info "Creating directories..." - $SUDO mkdir -p /etc/hive - $SUDO chmod 0700 /etc/hive - $SUDO chown "$HIVE_USER:$HIVE_GROUP" /etc/hive + $SUDO mkdir -p /etc/spinifex + $SUDO chmod 0700 /etc/spinifex + $SUDO chown "$SPINIFEX_USER:$SPINIFEX_GROUP" /etc/spinifex - $SUDO mkdir -p /var/lib/hive - $SUDO chown "$HIVE_USER:$HIVE_GROUP" /var/lib/hive + $SUDO mkdir -p /var/lib/spinifex + $SUDO chown "$SPINIFEX_USER:$SPINIFEX_GROUP" /var/lib/spinifex - # Symlink so services that expect BaseDir/config/ can find /etc/hive/ - if [ ! -e /var/lib/hive/config ]; then - $SUDO ln -s /etc/hive /var/lib/hive/config + # Symlink so services that expect BaseDir/config/ can find /etc/spinifex/ + if [ ! -e /var/lib/spinifex/config ]; then + $SUDO ln -s /etc/spinifex /var/lib/spinifex/config fi - # Symlink so services that write logs to BaseDir/logs/ use /var/log/hive/ - if [ ! -e /var/lib/hive/logs ]; then - $SUDO ln -s /var/log/hive /var/lib/hive/logs + # Symlink so services that write logs to BaseDir/logs/ use /var/log/spinifex/ + if [ ! -e /var/lib/spinifex/logs ]; then + $SUDO ln -s /var/log/spinifex /var/lib/spinifex/logs fi - $SUDO mkdir -p /var/log/hive - $SUDO chown "$HIVE_USER:$HIVE_GROUP" /var/log/hive + $SUDO mkdir -p /var/log/spinifex + $SUDO chown "$SPINIFEX_USER:$SPINIFEX_GROUP" /var/log/spinifex - $SUDO mkdir -p /run/hive - $SUDO chown "$HIVE_USER:$HIVE_GROUP" /run/hive + $SUDO mkdir -p /run/spinifex + $SUDO chown "$SPINIFEX_USER:$SPINIFEX_GROUP" /run/spinifex - $SUDO mkdir -p /var/lib/hive/viperblock - $SUDO chown "$HIVE_USER:$HIVE_GROUP" /var/lib/hive/viperblock + $SUDO mkdir -p /var/lib/spinifex/viperblock + $SUDO chown "$SPINIFEX_USER:$SPINIFEX_GROUP" /var/lib/spinifex/viperblock # Generate environment file with install-specific values (e.g. arch-dependent paths) - $SUDO tee /etc/hive/systemd.env > /dev/null << EOF + $SUDO tee /etc/spinifex/systemd.env > /dev/null << EOF # Generated by setup.sh โ€” install-specific environment variables -HIVE_VIPERBLOCK_PLUGIN_PATH=${PLUGINDIR}/nbdkit-viperblock-plugin.so +SPINIFEX_VIPERBLOCK_PLUGIN_PATH=${PLUGINDIR}/nbdkit-viperblock-plugin.so EOF - $SUDO chown "$HIVE_USER:$HIVE_GROUP" /etc/hive/systemd.env - info "Generated /etc/hive/systemd.env" + $SUDO chown "$SPINIFEX_USER:$SPINIFEX_GROUP" /etc/spinifex/systemd.env + info "Generated /etc/spinifex/systemd.env" } # --- Install systemd units --- @@ -284,20 +284,20 @@ install_systemd() { for unit in "$EXTRACT_DIR"/systemd/*; do # Substitute User= and Group= with the detected service user - sed "s/^User=hive$/User=$HIVE_USER/;s/^Group=hive$/Group=$HIVE_GROUP/" \ + sed "s/^User=hive$/User=$SPINIFEX_USER/;s/^Group=hive$/Group=$SPINIFEX_GROUP/" \ "$unit" | $SUDO tee "/etc/systemd/system/$(basename "$unit")" > /dev/null $SUDO chmod 0644 "/etc/systemd/system/$(basename "$unit")" info " /etc/systemd/system/$(basename "$unit")" done $SUDO systemctl daemon-reload - info "Systemd units installed (running as $HIVE_USER:$HIVE_GROUP)" + info "Systemd units installed (running as $SPINIFEX_USER:$SPINIFEX_GROUP)" } # --- Install logrotate --- install_logrotate() { - if [ -f "$EXTRACT_DIR/logrotate-hive" ]; then - $SUDO install -m 0644 "$EXTRACT_DIR/logrotate-hive" /etc/logrotate.d/hive + if [ -f "$EXTRACT_DIR/logrotate-spinifex" ]; then + $SUDO install -m 0644 "$EXTRACT_DIR/logrotate-spinifex" /etc/logrotate.d/hive else warn "Logrotate config not found in tarball, skipping" return @@ -307,61 +307,61 @@ install_logrotate() { # --- Upgrade handling --- handle_upgrade() { - if $SUDO systemctl is-active --quiet hive.target 2>/dev/null; then - warn "Hive services are running. Stopping for upgrade..." - $SUDO systemctl stop hive.target + if $SUDO systemctl is-active --quiet spinifex.target 2>/dev/null; then + warn "Spinifex services are running. Stopping for upgrade..." + $SUDO systemctl stop spinifex.target RESTART_AFTER=true fi } restart_if_needed() { if [ "${RESTART_AFTER}" = "true" ]; then - info "Restarting Hive services..." - $SUDO systemctl start hive.target + info "Restarting Spinifex services..." + $SUDO systemctl start spinifex.target fi } # --- Print summary --- print_summary() { - INSTALLED_VERSION=$(/usr/local/bin/hive version 2>/dev/null || echo "unknown") + INSTALLED_VERSION=$(/usr/local/bin/spx version 2>/dev/null || echo "unknown") echo "" echo "============================================" - echo " Hive installed successfully" + echo " Spinifex installed successfully" echo "============================================" echo "" echo " Version: $INSTALLED_VERSION" echo " Architecture: $ARCH" - echo " Service user: $HIVE_USER" - echo " Binary: /usr/local/bin/hive" - echo " Config: /etc/hive/" - echo " Data: /var/lib/hive/" - echo " Logs: /var/log/hive/" + echo " Service user: $SPINIFEX_USER" + echo " Binary: /usr/local/bin/spx" + echo " Config: /etc/spinifex/" + echo " Data: /var/lib/spinifex/" + echo " Logs: /var/log/spinifex/" echo "" echo " Next steps:" echo "" echo " 1. Setup OVN networking:" - echo " sudo /usr/local/share/hive/setup-ovn.sh --management" + echo " sudo /usr/local/share/spinifex/setup-ovn.sh --management" echo "" echo " 2. Initialize a region:" - echo " sudo hive admin init --region --az --node node1 --nodes 1" + echo " sudo spx admin init --region --az --node node1 --nodes 1" echo "" echo " 3. Trust the CA certificate:" - echo " sudo cp /etc/hive/ca.pem /usr/local/share/ca-certificates/hive-ca.crt" + echo " sudo cp /etc/spinifex/ca.pem /usr/local/share/ca-certificates/hive-ca.crt" echo " sudo update-ca-certificates" echo "" echo " 4. Start services:" - echo " sudo systemctl start hive.target" + echo " sudo systemctl start spinifex.target" echo "" echo " 5. Verify:" - echo " export AWS_PROFILE=hive" + echo " export AWS_PROFILE=spinifex" echo " aws ec2 describe-instance-types" echo "" } # --- Main --- main() { - info "Hive installer" + info "Spinifex installer" echo "" setup_sudo @@ -371,12 +371,12 @@ main() { install_apt_deps install_aws_cli detect_service_user - download_hive + download_spinifex install_files create_directories install_systemd install_logrotate - rm -rf "$HIVE_TMPDIR" + rm -rf "$SPINIFEX_TMPDIR" restart_if_needed print_summary } diff --git a/scripts/start-dev.sh b/scripts/start-dev.sh index 6dd2c60ae..8327ebfd2 100755 --- a/scripts/start-dev.sh +++ b/scripts/start-dev.sh @@ -1,13 +1,13 @@ #!/bin/bash -# Start Hive development environment -# This script starts all required services in the correct order using Hive service commands +# Start Spinifex development environment +# This script starts all required services in the correct order using Spinifex service commands # 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) +# data-dir: Optional data directory path (default: ~/spinifex) # # Environment variables: -# UI=false Skip starting Hive UI (e.g., UI=false ./scripts/start-dev.sh) +# UI=false Skip starting Spinifex UI (e.g., UI=false ./scripts/start-dev.sh) set -e @@ -17,7 +17,7 @@ MULGA_ROOT="$(cd "$PROJECT_ROOT/.." && pwd)" # Parse arguments BUILD=false -DATA_DIR="$HOME/hive" +DATA_DIR="$HOME/spinifex" for arg in "$@"; do case "$arg" in --build) BUILD=true ;; @@ -31,15 +31,15 @@ CONFIG_DIR="${CONFIG_DIR:-$DATA_DIR/config}" echo "Using data directory: $DATA_DIR" echo "Using configuration directory: $CONFIG_DIR" LOGS_DIR="$DATA_DIR/logs" -WAL_DIR="$DATA_DIR/hive" +WAL_DIR="$DATA_DIR/spinifex" -echo "๐Ÿš€ Starting Hive development environment..." +echo "๐Ÿš€ Starting Spinifex development environment..." echo "Project root: $PROJECT_ROOT" echo "Data directory: $DATA_DIR" -# Parse services from hive.toml โ€” defaults to all if not set +# Parse services from spinifex.toml โ€” defaults to all if not set parse_services() { - local config_file="$CONFIG_DIR/hive.toml" + local config_file="$CONFIG_DIR/spinifex.toml" if [ -f "$config_file" ]; then local svc_line=$(grep -m1 '^services' "$config_file" | sed 's/.*\[//;s/\].*//;s/"//g;s/,/ /g') if [ -n "$svc_line" ]; then @@ -59,7 +59,7 @@ echo "Services: $SERVICES" # Detect multi-node cluster from config is_multinode() { - local config_file="$CONFIG_DIR/hive.toml" + local config_file="$CONFIG_DIR/spinifex.toml" if [ -f "$config_file" ]; then local node_count=$(grep -c '^\[nodes\.' "$config_file") [ "$node_count" -gt 1 ] @@ -71,8 +71,8 @@ is_multinode() { # Confirm configuration directory exists if [ ! -d "$CONFIG_DIR" ]; then echo "โš ๏ธ Configuration directory $CONFIG_DIR does not exist." - echo "Please init the hive environment using the CLI." - echo "hive admin init" + echo "Please init the spinifex environment using the CLI." + echo "spx admin init" exit 1 fi @@ -177,7 +177,7 @@ check_service() { if [ "$BUILD" = "true" ]; then echo "โœˆ๏ธ Pre-flight, compiling latest..." - echo " Building hive..." + echo " Building spinifex..." make build echo " Building predastore..." @@ -231,14 +231,14 @@ if has_service "nats"; then echo "1๏ธโƒฃ Starting NATS server..." if [ -f "$CONFIG_DIR/nats/nats.conf" ]; then - export HIVE_CONFIG_PATH=$CONFIG_DIR/nats/nats.conf + export SPINIFEX_CONFIG_PATH=$CONFIG_DIR/nats/nats.conf echo " Using NATS config file: $CONFIG_DIR/nats/nats.conf" else echo " โš ๏ธ NATS config file not found at $CONFIG_DIR/nats/nats.conf, using defaults" - export HIVE_NATS_HOST=0.0.0.0 - export HIVE_NATS_PORT=4222 - export HIVE_NATS_DATA_DIR=$DATA_DIR/nats/ - export HIVE_NATS_JETSTREAM=false + export SPINIFEX_NATS_HOST=0.0.0.0 + export SPINIFEX_NATS_PORT=4222 + export SPINIFEX_NATS_DATA_DIR=$DATA_DIR/nats/ + export SPINIFEX_NATS_JETSTREAM=false fi # Extract NATS listen address from config (multi-node binds to specific IP, not 127.0.0.1) @@ -250,14 +250,14 @@ if has_service "nats"; then fi fi - NATS_CMD="./bin/hive service nats start" + NATS_CMD="./bin/spx service nats start" start_service "nats" "$NATS_CMD" set_oom_score "nats" "-500" check_service "NATS" "$NATS_CHECK_HOST" "4222" # Wait for NATS JetStream to be ready before Predastore starts. # Predastore lazily opens IAM KV buckets โ€” it starts with config-only auth - # and activates IAM auth once the hive daemon creates the KV buckets. + # and activates IAM auth once the spinifex daemon creates the KV buckets. echo "๐Ÿ” Waiting for NATS JetStream..." NATS_JS_READY=false for i in $(seq 1 15); do @@ -280,43 +280,43 @@ fi echo "" if has_service "predastore"; then echo "2๏ธโƒฃ Starting Predastore..." - unset HIVE_CONFIG_PATH + unset SPINIFEX_CONFIG_PATH - export HIVE_PREDASTORE_BASE_PATH=$DATA_DIR/predastore/ - export HIVE_PREDASTORE_CONFIG_PATH=$CONFIG_DIR/predastore/predastore.toml - export HIVE_PREDASTORE_TLS_CERT=$CONFIG_DIR/server.pem - export HIVE_PREDASTORE_TLS_KEY=$CONFIG_DIR/server.key + export SPINIFEX_PREDASTORE_BASE_PATH=$DATA_DIR/predastore/ + export SPINIFEX_PREDASTORE_CONFIG_PATH=$CONFIG_DIR/predastore/predastore.toml + export SPINIFEX_PREDASTORE_TLS_CERT=$CONFIG_DIR/server.pem + export SPINIFEX_PREDASTORE_TLS_KEY=$CONFIG_DIR/server.key - # Auto-detect Predastore host:port from hive.toml [nodes..predastore] section + # Auto-detect Predastore host:port from spinifex.toml [nodes..predastore] section PREDASTORE_BIND="0.0.0.0:8443" - if [ -f "$CONFIG_DIR/hive.toml" ]; then - DETECTED_PREDASTORE_HOST=$(awk -F'"' '/\[nodes\..*\.predastore\]/{found=1} found && /^host/{print $2; exit}' "$CONFIG_DIR/hive.toml") + if [ -f "$CONFIG_DIR/spinifex.toml" ]; then + DETECTED_PREDASTORE_HOST=$(awk -F'"' '/\[nodes\..*\.predastore\]/{found=1} found && /^host/{print $2; exit}' "$CONFIG_DIR/spinifex.toml") if [ -n "$DETECTED_PREDASTORE_HOST" ]; then PREDASTORE_BIND="$DETECTED_PREDASTORE_HOST" - echo " Auto-detected Predastore bind=$PREDASTORE_BIND from hive.toml" + echo " Auto-detected Predastore bind=$PREDASTORE_BIND from spinifex.toml" fi fi - export HIVE_PREDASTORE_HOST="${PREDASTORE_BIND%%:*}" - export HIVE_PREDASTORE_PORT="${PREDASTORE_BIND##*:}" + export SPINIFEX_PREDASTORE_HOST="${PREDASTORE_BIND%%:*}" + export SPINIFEX_PREDASTORE_PORT="${PREDASTORE_BIND##*:}" - export HIVE_PREDASTORE_BACKEND=distributed + export SPINIFEX_PREDASTORE_BACKEND=distributed - # Auto-detect Predastore NODE_ID from hive.toml if not already set - if [ -z "$HIVE_PREDASTORE_NODE_ID" ]; then - if [ -f "$CONFIG_DIR/hive.toml" ]; then - DETECTED_NODE_ID=$(awk -F'= *' '/node_id/{gsub(/ /,"",$2); print $2; exit}' "$CONFIG_DIR/hive.toml") + # Auto-detect Predastore NODE_ID from spinifex.toml if not already set + if [ -z "$SPINIFEX_PREDASTORE_NODE_ID" ]; then + if [ -f "$CONFIG_DIR/spinifex.toml" ]; then + DETECTED_NODE_ID=$(awk -F'= *' '/node_id/{gsub(/ /,"",$2); print $2; exit}' "$CONFIG_DIR/spinifex.toml") if [ -n "$DETECTED_NODE_ID" ] && [ "$DETECTED_NODE_ID" != "0" ]; then - export HIVE_PREDASTORE_NODE_ID="$DETECTED_NODE_ID" - echo " Auto-detected Predastore NODE_ID=$DETECTED_NODE_ID from hive.toml" + export SPINIFEX_PREDASTORE_NODE_ID="$DETECTED_NODE_ID" + echo " Auto-detected Predastore NODE_ID=$DETECTED_NODE_ID from spinifex.toml" fi fi fi - export HIVE_PREDASTORE_NODE_ID="${HIVE_PREDASTORE_NODE_ID:-}" + export SPINIFEX_PREDASTORE_NODE_ID="${SPINIFEX_PREDASTORE_NODE_ID:-}" - PREDASTORE_CMD="./bin/hive service predastore start" + PREDASTORE_CMD="./bin/spx service predastore start" start_service "predastore" "$PREDASTORE_CMD" set_oom_score "predastore" "-500" - check_service "Predastore" "$HIVE_PREDASTORE_HOST" "$HIVE_PREDASTORE_PORT" + check_service "Predastore" "$SPINIFEX_PREDASTORE_HOST" "$SPINIFEX_PREDASTORE_PORT" else echo "2๏ธโƒฃ Skipping Predastore (not a local service)" fi @@ -344,31 +344,31 @@ if has_service "viperblock"; then cd "$PROJECT_ROOT" fi - export HIVE_CONFIG_PATH=$CONFIG_DIR/hive.toml - export HIVE_VIPERBLOCK_PLUGIN_PATH=$NBD_PLUGIN_PATH - export HIVE_BASE_DIR=$VB_BASE_DIR + export SPINIFEX_CONFIG_PATH=$CONFIG_DIR/spinifex.toml + export SPINIFEX_VIPERBLOCK_PLUGIN_PATH=$NBD_PLUGIN_PATH + export SPINIFEX_BASE_DIR=$VB_BASE_DIR - VIPERBLOCK_CMD="./bin/hive service viperblock start" + VIPERBLOCK_CMD="./bin/spx service viperblock start" start_service "viperblock" "$VIPERBLOCK_CMD" set_oom_score "viperblock" "-500" else echo "3๏ธโƒฃ Skipping Viperblock (not a local service)" fi -# 4๏ธโƒฃ Start Hive Gateway/Daemon +# 4๏ธโƒฃ Start Spinifex Gateway/Daemon echo "" if has_service "daemon"; then - echo "4๏ธโƒฃ. Starting Hive Gateway..." + echo "4๏ธโƒฃ. Starting Spinifex Gateway..." - export HIVE_CONFIG_PATH=$CONFIG_DIR/hive.toml - export HIVE_BASE_DIR=$DATA_DIR/hive/ - export HIVE_WAL_DIR=$WAL_DIR + export SPINIFEX_CONFIG_PATH=$CONFIG_DIR/spinifex.toml + export SPINIFEX_BASE_DIR=$DATA_DIR/spinifex/ + export SPINIFEX_WAL_DIR=$WAL_DIR - HIVE_CMD="./bin/hive service hive start" - start_service "hive" "$HIVE_CMD" - set_oom_score "hive" "-500" + SPINIFEX_CMD="./bin/spx service hive start" + start_service "spinifex" "$SPINIFEX_CMD" + set_oom_score "spinifex" "-500" else - echo "4๏ธโƒฃ. Skipping Hive Gateway (not a local service)" + echo "4๏ธโƒฃ. Skipping Spinifex Gateway (not a local service)" fi @@ -377,14 +377,14 @@ echo "" if has_service "awsgw"; then echo "5๏ธโƒฃ. Starting AWS Gateway..." - unset HIVE_NATS_HOST - unset HIVE_PREDASTORE_HOST - export HIVE_BASE_DIR=$DATA_DIR - export HIVE_CONFIG_PATH=$CONFIG_DIR/hive.toml - export HIVE_AWSGW_TLS_CERT=$CONFIG_DIR/server.pem - export HIVE_AWSGW_TLS_KEY=$CONFIG_DIR/server.key + unset SPINIFEX_NATS_HOST + unset SPINIFEX_PREDASTORE_HOST + export SPINIFEX_BASE_DIR=$DATA_DIR + export SPINIFEX_CONFIG_PATH=$CONFIG_DIR/spinifex.toml + export SPINIFEX_AWSGW_TLS_CERT=$CONFIG_DIR/server.pem + export SPINIFEX_AWSGW_TLS_KEY=$CONFIG_DIR/server.key - AWSGW_CMD="./bin/hive service awsgw start" + AWSGW_CMD="./bin/spx service awsgw start" start_service "awsgw" "$AWSGW_CMD" set_oom_score "awsgw" "-500" else @@ -397,33 +397,33 @@ echo "" if has_service "vpcd"; then echo "6๏ธโƒฃ. Starting vpcd (VPC daemon)..." - export HIVE_CONFIG_PATH=$CONFIG_DIR/hive.toml + export SPINIFEX_CONFIG_PATH=$CONFIG_DIR/spinifex.toml - VPCD_CMD="./bin/hive service vpcd start" + VPCD_CMD="./bin/spx service vpcd start" start_service "vpcd" "$VPCD_CMD" set_oom_score "vpcd" "-500" else echo "6๏ธโƒฃ. Skipping vpcd (not a local service)" fi -# 7๏ธโƒฃ Start Hive UI (skip with UI=false or if not a local service) +# 7๏ธโƒฃ Start Spinifex UI (skip with UI=false or if not a local service) if [ "${UI}" != "false" ] && has_service "ui"; then echo "" - echo "7๏ธโƒฃ. Starting Hive UI..." + echo "7๏ธโƒฃ. Starting Spinifex UI..." - HIVEUI_CMD="./bin/hive service hive-ui start" - start_service "hive-ui" "$HIVEUI_CMD" - set_oom_score "hive-ui" "-500" + HIVEUI_CMD="./bin/spx service spinifex-ui start" + start_service "spinifex-ui" "$HIVEUI_CMD" + set_oom_score "spinifex-ui" "-500" else echo "" - echo "7๏ธโƒฃ. Skipping Hive UI" + echo "7๏ธโƒฃ. Skipping Spinifex UI" fi echo "" echo "๐Ÿ”— Service endpoints will be:" if [ "${UI}" != "false" ]; then - echo " - Hive UI: https://localhost:3000" + echo " - Spinifex UI: https://localhost:3000" fi echo " - NATS: nats://localhost:4222" echo " - Predastore: https://localhost:8443" @@ -433,7 +433,7 @@ echo "๐Ÿ“Š Monitor background service logs:" echo " tail -f $LOGS_DIR/*.log" echo "" echo "๐Ÿงช Test with AWS CLI (once daemon is running):" -echo " export AWS_PROFILE=hive" +echo " export AWS_PROFILE=spinifex" echo " aws ec2 describe-instances" echo "" @@ -445,7 +445,7 @@ if is_multinode; then /^\[nodes\./ { node=1; daemon=0 } node && /^\[.*\.daemon\]/ { daemon=1 } daemon && /^host/ { gsub(/[" ]/, "", $3); print $3; daemon=0 } - ' "$CONFIG_DIR/hive.toml") + ' "$CONFIG_DIR/spinifex.toml") for peer in $peer_hosts; do attempts=0 @@ -469,4 +469,4 @@ fi # This will only be reached if air/daemon exits normally #echo "" -#echo "๐Ÿ›‘ Hive development environment stopped" +#echo "๐Ÿ›‘ Spinifex development environment stopped" diff --git a/scripts/start-multi-nats.sh b/scripts/start-multi-nats.sh index 8b1a4bb14..3bec1bb71 100755 --- a/scripts/start-multi-nats.sh +++ b/scripts/start-multi-nats.sh @@ -1,3 +1,3 @@ #!/bin/sh -HIVE_CONFIG_PATH=~/node1/config/nats/nats.conf ./bin/hive service nats start +SPINIFEX_CONFIG_PATH=~/node1/config/nats/nats.conf ./bin/spx service nats start diff --git a/scripts/stop-dev.sh b/scripts/stop-dev.sh index 5835831ba..57313650b 100755 --- a/scripts/stop-dev.sh +++ b/scripts/stop-dev.sh @@ -1,12 +1,12 @@ #!/bin/bash -# Stop Hive development environment +# Stop Spinifex development environment # This script stops all services started by start-dev.sh # Usage: ./scripts/stop-dev.sh # Note: Services are stopped using PID files, so data-dir is not required # Accept optional data directory argument -DATA_DIR="${1:-$HOME/hive}" +DATA_DIR="${1:-$HOME/spinifex}" # Always use the logs directory for PID files โ€” start-dev.sh writes shell PIDs # there, and Go services write PIDs to their own data dirs. This ensures @@ -20,16 +20,16 @@ LOGS_DIR="$PROJECT_ROOT/data/logs" # Check if /mnt/ramdisk is mounted #if mountpoint -q /mnt/ramdisk; then - #echo "๐Ÿ›‘ Stopping Hive development environment..." + #echo "๐Ÿ›‘ Stopping Spinifex development environment..." #sudo umount /mnt/ramdisk #fi -echo "Stopping Hive development environment..." +echo "Stopping Spinifex development environment..." -# Parse services from hive.toml โ€” defaults to all if not set +# Parse services from spinifex.toml โ€” defaults to all if not set CONFIG_DIR="${CONFIG_DIR:-$DATA_DIR/config}" parse_services() { - local config_file="$CONFIG_DIR/hive.toml" + local config_file="$CONFIG_DIR/spinifex.toml" if [ -f "$config_file" ]; then local svc_line=$(grep -m1 '^services' "$config_file" | sed 's/.*\[//;s/\].*//;s/"//g;s/,/ /g') if [ -n "$svc_line" ]; then @@ -44,15 +44,15 @@ SERVICES=$(parse_services) has_service() { local svc="$1" case "$svc" in - hive) svc="daemon" ;; - hive-ui) svc="ui" ;; + spinifex) svc="daemon" ;; + spinifex-ui) svc="ui" ;; esac echo "$SERVICES" | grep -qw "$svc" } # Detect multi-node cluster from config is_multinode() { - local config_file="$CONFIG_DIR/hive.toml" + local config_file="$CONFIG_DIR/spinifex.toml" if [ -f "$config_file" ]; then # Count only top-level node sections [nodes.X], not subsections [nodes.X.Y] local node_count=$(grep -cE '^\[nodes\.[^.]+\]' "$config_file") @@ -65,10 +65,10 @@ is_multinode() { # For multi-node clusters, delegate to coordinated shutdown via NATS. # Only when called without arguments (default path). When a data-dir is # explicitly provided (e.g., E2E per-node cleanup), use per-service stop. -if is_multinode && [ -z "$HIVE_FORCE_LOCAL_STOP" ] && [ -z "$1" ]; then +if is_multinode && [ -z "$SPINIFEX_FORCE_LOCAL_STOP" ] && [ -z "$1" ]; then echo "Multi-node cluster detected. Using coordinated shutdown..." - echo " (Set HIVE_FORCE_LOCAL_STOP=1 to force per-service stop)" - exec $PROJECT_ROOT/bin/hive admin cluster shutdown + echo " (Set SPINIFEX_FORCE_LOCAL_STOP=1 to force per-service stop)" + exec $PROJECT_ROOT/bin/spx admin cluster shutdown fi # Function to stop service by PID file @@ -84,8 +84,8 @@ stop_service() { kill -SIGTERM $(cat "$pidpath/$name.pid" 2>/dev/null) 2>/dev/null || rc=$? sleep 1 else - # Correct graceful shutdown via hive binary, waits for clean exit - $PROJECT_ROOT/bin/hive service $name stop || rc=$? + # Correct graceful shutdown via spx binary, waits for clean exit + $PROJECT_ROOT/bin/spx service $name stop || rc=$? fi if [[ $rc -ne 0 ]]; then @@ -101,11 +101,11 @@ stop_service() { # Stop services in reverse order echo "Stopping services..." echo "" -# Stop Hive UI first (last to start) -has_service "hive-ui" && stop_service "hive-ui" "$PID_DIR" +# Stop Spinifex UI first (last to start) +has_service "spinifex-ui" && stop_service "spinifex-ui" "$PID_DIR" -# Stop Hive daemon/gateway (it will terminate running instances, unmount nbd devices) -has_service "hive" && stop_service "hive" "$PID_DIR" +# Stop Spinifex daemon/gateway (it will terminate running instances, unmount nbd devices) +has_service "spinifex" && stop_service "spinifex" "$PID_DIR" # Wait for all QEMU instances to exit before stopping infrastructure services. # The daemon sends system_powerdown to VMs during shutdown, but may be killed @@ -143,7 +143,7 @@ has_service "predastore" && stop_service "predastore" "$PID_DIR" # Stop NATS has_service "nats" && stop_service "nats" "$PID_DIR" -# Stop OVN networking (prevents idle CPU burn when hive isn't running) +# Stop OVN networking (prevents idle CPU burn when spinifex isn't running) if pidof systemd >/dev/null 2>&1; then echo "๐Ÿ›‘ Stopping OVN networking..." sudo systemctl stop ovn-controller 2>/dev/null && echo "โœ… ovn-controller stopped" || true @@ -154,10 +154,10 @@ if pidof systemd >/dev/null 2>&1; then fi echo "" -echo "โœ… Hive development environment stopped" +echo "โœ… Spinifex development environment stopped" -# Show any remaining hive-related processes -remaining=$(pgrep -af '(bin/hive|hive-ui|nats-server|predastore|viperblock|vpcd|qemu-system)' | grep -v "stop-dev.sh" || true) +# Show any remaining spinifex-related processes +remaining=$(pgrep -af '(bin/spx|spinifex-ui|nats-server|predastore|viperblock|vpcd|qemu-system)' | grep -v "stop-dev.sh" || true) if [[ -n "$remaining" ]]; then echo "" echo "โš ๏ธ Some related processes may still be running:" diff --git a/tests/e2e/lib/multinode-helpers.sh b/tests/e2e/lib/multinode-helpers.sh index b9f0318d8..9e27cb474 100755 --- a/tests/e2e/lib/multinode-helpers.sh +++ b/tests/e2e/lib/multinode-helpers.sh @@ -348,7 +348,7 @@ get_instance_node() { for i in 1 2 3; do local data_dir="$HOME/node$i" - local instances_file="$data_dir/hive/instances.json" + local instances_file="$data_dir/spinifex/instances.json" if [ -f "$instances_file" ]; then if jq -e ".[\"$instance_id\"]" "$instances_file" > /dev/null 2>&1; then @@ -506,7 +506,7 @@ dump_all_node_logs() { echo "" echo "=== Node$i Logs ===" - for log in nats predastore viperblock hive awsgw; do + for log in nats predastore viperblock spinifex awsgw; do if [ -f "$logs_dir/$log.log" ]; then echo "" echo "--- $log.log (last 50 lines) ---" @@ -631,7 +631,7 @@ force_cleanup_all_nodes() { local logs_dir="$data_dir/logs" if [ -d "$logs_dir" ]; then - for svc in hive-ui hive awsgw viperblock predastore nats; do + for svc in spinifex-ui spinifex awsgw viperblock predastore nats; do local pidfile="$logs_dir/$svc.pid" if [ -f "$pidfile" ]; then local pid @@ -654,7 +654,7 @@ force_cleanup_all_nodes() { local logs_dir="$data_dir/logs" if [ -d "$logs_dir" ]; then - for svc in hive-ui hive awsgw viperblock predastore nats; do + for svc in spinifex-ui spinifex awsgw viperblock predastore nats; do local pidfile="$logs_dir/$svc.pid" if [ -f "$pidfile" ]; then local pid @@ -722,7 +722,7 @@ init_leader_node() { rm -rf "$HOME/node1/" # Start init in background โ€” formation server will wait for joins - ./bin/hive admin init \ + ./bin/spinifex admin init \ --node node1 \ --bind "${NODE1_IP}" \ --cluster-bind "${NODE1_IP}" \ @@ -731,7 +731,7 @@ init_leader_node() { --port ${CLUSTER_PORT} \ --region ap-southeast-2 \ --az ap-southeast-2a \ - --hive-dir "$HOME/node1/" \ + --spinifex-dir "$HOME/node1/" \ --config-dir "$HOME/node1/config/" & LEADER_INIT_PID=$! @@ -762,7 +762,7 @@ join_follower_node() { rm -rf "$data_dir/" # Route to node1 (seed node) - other nodes discovered via NATS gossip - ./bin/hive admin join \ + ./bin/spinifex admin join \ --node "node$node_num" \ --bind "$node_ip" \ --cluster-bind "$node_ip" \ diff --git a/tests/e2e/run-e2e.sh b/tests/e2e/run-e2e.sh index e890ac94a..0a6d05bf6 100755 --- a/tests/e2e/run-e2e.sh +++ b/tests/e2e/run-e2e.sh @@ -16,28 +16,28 @@ cleanup() { if [ $EXIT_CODE -ne 0 ]; then echo "" echo "=== NATS Service Log ===" - if [ -f ~/hive/logs/nats.log ]; then - tail -100 ~/hive/logs/nats.log 2>/dev/null + if [ -f ~/spinifex/logs/nats.log ]; then + tail -100 ~/spinifex/logs/nats.log 2>/dev/null fi echo "" echo "=== Predastore Service Log ===" - if [ -f ~/hive/logs/predastore.log ]; then - tail -100 ~/hive/logs/predastore.log 2>/dev/null + if [ -f ~/spinifex/logs/predastore.log ]; then + tail -100 ~/spinifex/logs/predastore.log 2>/dev/null fi echo "" echo "=== Viperblock Service Log ===" - if [ -f ~/hive/logs/viperblock.log ]; then - tail -100 ~/hive/logs/viperblock.log 2>/dev/null + if [ -f ~/spinifex/logs/viperblock.log ]; then + tail -100 ~/spinifex/logs/viperblock.log 2>/dev/null fi echo "" - echo "=== Hive Daemon Log ===" - if [ -f ~/hive/logs/hive.log ]; then - tail -200 ~/hive/logs/hive.log 2>/dev/null + echo "=== Spinifex Daemon Log ===" + if [ -f ~/spinifex/logs/hive.log ]; then + tail -200 ~/spinifex/logs/hive.log 2>/dev/null fi echo "" echo "=== AWS Gateway Log ===" - if [ -f ~/hive/logs/awsgw.log ]; then - tail -200 ~/hive/logs/awsgw.log 2>/dev/null + if [ -f ~/spinifex/logs/awsgw.log ]; then + tail -200 ~/spinifex/logs/awsgw.log 2>/dev/null fi fi # Only stop services if we started them (not when bootstrapped) @@ -48,15 +48,15 @@ cleanup() { } trap cleanup EXIT -# Use Hive profile (hive admin init sets endpoint_url, ca_bundle, region in ~/.aws/config) -export AWS_PROFILE=hive +# Use Spinifex profile (spx admin init sets endpoint_url, ca_bundle, region in ~/.aws/config) +export AWS_PROFILE=spinifex -# Detect bootstrapped environment from hive.toml config +# Detect bootstrapped environment from spinifex.toml config BOOTSTRAPPED="false" GATEWAY_HOST="localhost" PREDASTORE_HOST="localhost" -if [ -f ~/hive/config/hive.toml ]; then - # Resolve gateway host from AWS profile endpoint_url (set by hive admin init) +if [ -f ~/spinifex/config/spinifex.toml ]; then + # Resolve gateway host from AWS profile endpoint_url (set by spx admin init) ENDPOINT_URL=$(aws configure get endpoint_url 2>/dev/null || true) if [ -n "$ENDPOINT_URL" ]; then DETECTED_GW_HOST=$(echo "$ENDPOINT_URL" | sed 's|https\?://||;s|:.*||') @@ -64,8 +64,8 @@ if [ -f ~/hive/config/hive.toml ]; then GATEWAY_HOST="$DETECTED_GW_HOST" fi fi - # Resolve predastore host from hive.toml - DETECTED_PS_HOST=$(awk -F'"' '/\[nodes\..*\.predastore\]/{found=1} found && /^host/{print $2; exit}' ~/hive/config/hive.toml) + # Resolve predastore host from spinifex.toml + DETECTED_PS_HOST=$(awk -F'"' '/\[nodes\..*\.predastore\]/{found=1} found && /^host/{print $2; exit}' ~/spinifex/config/spinifex.toml) if [ -n "$DETECTED_PS_HOST" ]; then PREDASTORE_HOST="${DETECTED_PS_HOST%%:*}" fi @@ -78,7 +78,7 @@ if [ -f ~/hive/config/hive.toml ]; then fi fi -# Helper: set up an AWS CLI profile with credentials + endpoint/CA config from the hive profile +# Helper: set up an AWS CLI profile with credentials + endpoint/CA config from the spinifex profile setup_test_profile() { local profile="$1" key_id="$2" secret="$3" aws configure set aws_access_key_id "$key_id" --profile "$profile" @@ -107,16 +107,16 @@ else fi if [ "$BOOTSTRAPPED" != "true" ]; then - ./bin/hive admin init --region ap-southeast-2 --az ap-southeast-2a --node node1 --nodes 1 + ./bin/spx admin init --region ap-southeast-2 --az ap-southeast-2a --node node1 --nodes 1 - # Trust the Hive CA certificate for AWS CLI SSL verification - echo "Adding Hive CA certificate to system trust store..." - sudo cp ~/hive/config/ca.pem /usr/local/share/ca-certificates/hive-ca.crt + # Trust the Spinifex CA certificate for AWS CLI SSL verification + echo "Adding Spinifex CA certificate to system trust store..." + sudo cp ~/spinifex/config/ca.pem /usr/local/share/ca-certificates/hive-ca.crt sudo update-ca-certificates # Start all services # Ensure logs directory exists for start-dev.sh - mkdir -p ~/hive/logs + mkdir -p ~/spinifex/logs ./scripts/start-dev.sh fi @@ -140,28 +140,28 @@ fi wait_for_daemon_ready "https://${GATEWAY_HOST}:9999" # Discover the cluster's availability zone and region dynamically -HIVE_AZ=$(aws ec2 describe-availability-zones --query 'AvailabilityZones[0].ZoneName' --output text) -HIVE_REGION=$(aws ec2 describe-availability-zones --query 'AvailabilityZones[0].RegionName' --output text) -echo "Discovered AZ: $HIVE_AZ, Region: $HIVE_REGION" +SPINIFEX_AZ=$(aws ec2 describe-availability-zones --query 'AvailabilityZones[0].ZoneName' --output text) +SPINIFEX_REGION=$(aws ec2 describe-availability-zones --query 'AvailabilityZones[0].RegionName' --output text) +echo "Discovered AZ: $SPINIFEX_AZ, Region: $SPINIFEX_REGION" # No need for AWS_EC2/AWS_IAM vars โ€” endpoint_url and ca_bundle are in the profile config # Phase 1b: Cluster Stats CLI echo "Phase 1b: Cluster Stats CLI" -# Test hive get nodes โ€” should show node1 as Ready -echo "Testing hive get nodes..." -GET_NODES_OUTPUT=$(./bin/hive get nodes --config ~/hive/config/hive.toml --timeout 5s 2>/dev/null) +# Test spx get nodes โ€” should show node1 as Ready +echo "Testing spx get nodes..." +GET_NODES_OUTPUT=$(./bin/spx get nodes --config ~/spinifex/config/spinifex.toml --timeout 5s 2>/dev/null) echo "$GET_NODES_OUTPUT" if ! echo "$GET_NODES_OUTPUT" | grep -q "Ready"; then - echo "hive get nodes did not show any Ready nodes" + echo "spx get nodes did not show any Ready nodes" exit 1 fi -echo "hive get nodes passed" +echo "spx get nodes passed" # Test hive top nodes โ€” should show CPU/MEM stats echo "Testing hive top nodes..." -TOP_NODES_OUTPUT=$(./bin/hive top nodes --config ~/hive/config/hive.toml --timeout 5s 2>/dev/null) +TOP_NODES_OUTPUT=$(./bin/spx top nodes --config ~/spinifex/config/spinifex.toml --timeout 5s 2>/dev/null) echo "$TOP_NODES_OUTPUT" if ! echo "$TOP_NODES_OUTPUT" | grep -q "0/"; then echo "hive top nodes did not show resource stats" @@ -169,15 +169,15 @@ if ! echo "$TOP_NODES_OUTPUT" | grep -q "0/"; then fi echo "hive top nodes passed" -# Test hive get vms โ€” should show no VMs yet -echo "Testing hive get vms (empty)..." -GET_VMS_OUTPUT=$(./bin/hive get vms --config ~/hive/config/hive.toml --timeout 5s 2>/dev/null) +# Test spx get vms โ€” should show no VMs yet +echo "Testing spx get vms (empty)..." +GET_VMS_OUTPUT=$(./bin/spx get vms --config ~/spinifex/config/spinifex.toml --timeout 5s 2>/dev/null) echo "$GET_VMS_OUTPUT" if ! echo "$GET_VMS_OUTPUT" | grep -q "No VMs found"; then - echo "hive get vms should show 'No VMs found' before any launches" + echo "spx get vms should show 'No VMs found' before any launches" exit 1 fi -echo "hive get vms (empty) passed" +echo "spx get vms (empty) passed" # Phase 2: Discovery & Metadata echo "Phase 2: Discovery & Metadata" @@ -196,8 +196,8 @@ if [ "$AZ_STATE" != "available" ]; then fi echo "DescribeAvailabilityZones verified (Zone=$AZ_NAME, State=$AZ_STATE)" -# Discover available instance types from Hive -# Hive generates these based on the host CPU (e.g., m7i.micro, m8g.small, etc.) +# Discover available instance types from Spinifex +# Spinifex generates these based on the host CPU (e.g., m7i.micro, m8g.small, etc.) echo "Discovering available instance types..." AVAILABLE_TYPES=$(aws ec2 describe-instance-types --query 'InstanceTypes[*].InstanceType' --output text) echo "Available instance types: $AVAILABLE_TYPES" @@ -301,7 +301,7 @@ if [ "$BOOTSTRAPPED" = "true" ]; then AMI_ID=$(aws ec2 describe-images --query 'Images[0].ImageId' --output text) else echo "Importing pre-cached Ubuntu image..." - IMPORT_LOG=$(./bin/hive admin images import \ + IMPORT_LOG=$(./bin/spx admin images import \ --file ~/images/ubuntu-24.04.img \ --arch "$ARCH" \ --distro ubuntu \ @@ -384,15 +384,15 @@ if [ "$STATE" != "running" ]; then exit 1 fi -# Phase 5a-pre: Verify hive get vms shows running instance +# Phase 5a-pre: Verify spx get vms shows running instance echo "Phase 5a-pre: Cluster Stats CLI (with running VM)" -GET_VMS_OUTPUT=$(./bin/hive get vms --config ~/hive/config/hive.toml --timeout 5s 2>/dev/null) +GET_VMS_OUTPUT=$(./bin/spx get vms --config ~/spinifex/config/spinifex.toml --timeout 5s 2>/dev/null) echo "$GET_VMS_OUTPUT" if ! echo "$GET_VMS_OUTPUT" | grep -q "$INSTANCE_ID"; then - echo "hive get vms did not show running instance $INSTANCE_ID" + echo "spx get vms did not show running instance $INSTANCE_ID" exit 1 fi -echo "hive get vms shows running instance" +echo "spx get vms shows running instance" # Phase 5a: Validate instance metadata fields echo "Phase 5a: Instance Metadata Validation" @@ -518,8 +518,8 @@ echo "Phase 5b: Volume Lifecycle (Attach/Detach)" echo "Testing volume create -> resize -> attach -> detach -> delete..." # Create a test volume -echo "Creating 10GB volume in ${HIVE_AZ}..." -CREATE_OUTPUT=$(aws ec2 create-volume --size 10 --availability-zone "$HIVE_AZ") +echo "Creating 10GB volume in ${SPINIFEX_AZ}..." +CREATE_OUTPUT=$(aws ec2 create-volume --size 10 --availability-zone "$SPINIFEX_AZ") TEST_VOLUME_ID=$(echo "$CREATE_OUTPUT" | jq -r '.VolumeId') if [ -z "$TEST_VOLUME_ID" ] || [ "$TEST_VOLUME_ID" == "null" ]; then @@ -735,7 +735,7 @@ echo "Describe snapshot verified (VolumeId=$DESC_VOL_ID, Size=$DESC_SIZE, Descri # Copy the snapshot echo "Copying snapshot $SNAPSHOT_ID..." -COPY_OUTPUT=$(aws ec2 copy-snapshot --source-snapshot-id "$SNAPSHOT_ID" --source-region "$HIVE_REGION" --description "e2e-copy") +COPY_OUTPUT=$(aws ec2 copy-snapshot --source-snapshot-id "$SNAPSHOT_ID" --source-region "$SPINIFEX_REGION" --description "e2e-copy") COPY_SNAPSHOT_ID=$(echo "$COPY_OUTPUT" | jq -r '.SnapshotId') if [ -z "$COPY_SNAPSHOT_ID" ] || [ "$COPY_SNAPSHOT_ID" == "null" ]; then @@ -1014,7 +1014,7 @@ echo "Reboot-stopped correctly rejected" # Phase 7a: Attach volume to stopped instance (should fail) echo "Phase 7a: Attach Volume to Stopped Instance (Error Path)" echo "Creating a volume to test attach-to-stopped..." -STOPPED_VOL_OUTPUT=$(aws ec2 create-volume --size 10 --availability-zone "$HIVE_AZ") +STOPPED_VOL_OUTPUT=$(aws ec2 create-volume --size 10 --availability-zone "$SPINIFEX_AZ") STOPPED_VOL_ID=$(echo "$STOPPED_VOL_OUTPUT" | jq -r '.VolumeId') echo "Created volume: $STOPPED_VOL_ID" @@ -1867,7 +1867,7 @@ echo "Phase 8 Step 1: Account Setup" echo "----------------------------------------" echo " Creating Team Alpha account..." -ALPHA_OUTPUT=$(./bin/hive admin account create --name "Team Alpha" 2>&1) +ALPHA_OUTPUT=$(./bin/spx admin account create --name "Team Alpha" 2>&1) echo "$ALPHA_OUTPUT" ALPHA_ACCOUNT=$(echo "$ALPHA_OUTPUT" | grep "Account ID:" | awk '{print $NF}') ALPHA_KEY_ID=$(echo "$ALPHA_OUTPUT" | grep "Access Key ID:" | awk '{print $NF}') @@ -1881,7 +1881,7 @@ echo " Team Alpha: account=$ALPHA_ACCOUNT key=$ALPHA_KEY_ID" setup_test_profile hive-team-alpha "$ALPHA_KEY_ID" "$ALPHA_SECRET" echo " Creating Team Beta account..." -BETA_OUTPUT=$(./bin/hive admin account create --name "Team Beta" 2>&1) +BETA_OUTPUT=$(./bin/spx admin account create --name "Team Beta" 2>&1) echo "$BETA_OUTPUT" BETA_ACCOUNT=$(echo "$BETA_OUTPUT" | grep "Account ID:" | awk '{print $NF}') BETA_KEY_ID=$(echo "$BETA_OUTPUT" | grep "Access Key ID:" | awk '{print $NF}') @@ -2416,7 +2416,7 @@ echo "----------------------------------------" # Empty account (Gamma) echo " Creating empty Gamma account..." -GAMMA_OUTPUT=$(./bin/hive admin account create --name "Team Gamma" 2>&1) +GAMMA_OUTPUT=$(./bin/spx admin account create --name "Team Gamma" 2>&1) GAMMA_KEY_ID=$(echo "$GAMMA_OUTPUT" | grep "Access Key ID:" | awk '{print $NF}') GAMMA_SECRET=$(echo "$GAMMA_OUTPUT" | grep "Secret Access Key:" | awk '{print $NF}') setup_test_profile hive-team-gamma "$GAMMA_KEY_ID" "$GAMMA_SECRET" diff --git a/tests/e2e/run-multinode-e2e.sh b/tests/e2e/run-multinode-e2e.sh index 165638571..27c402a04 100755 --- a/tests/e2e/run-multinode-e2e.sh +++ b/tests/e2e/run-multinode-e2e.sh @@ -3,7 +3,7 @@ set -euo pipefail # Multi-Node E2E Test Suite (real 3-node cluster) # Runs inside node1 of a 3-node cluster provisioned by tofu (env2). -# Bootstrap has already: built hive, set up OVN, run init/join, started services, +# Bootstrap has already: built spinifex, set up OVN, run init/join, started services, # installed CA certs, imported SSH key + AMI, created VPC + subnet. # # Usage: run-multinode-e2e.sh @@ -11,7 +11,7 @@ set -euo pipefail # Ensure Go is on PATH (SSH non-interactive shells don't source .bashrc) export PATH="/usr/local/go/bin:$HOME/go/bin:$PATH" -# Ensure we are in the hive project root +# Ensure we are in the spinifex project root cd "$(dirname "$0")/../.." # ========================================================================== @@ -36,14 +36,14 @@ NATS_MONITOR_PORT=8222 PREDASTORE_PORT=8443 AWSGW_PORT=9999 SSH_KEY_PATH="$HOME/.ssh/tf-user-ap-southeast-2" -HIVE_DATA_DIR="$HOME/hive" -HIVE_CONFIG="$HIVE_DATA_DIR/config/hive.toml" -HIVE_BIN="./bin/hive" +SPINIFEX_DATA_DIR="$HOME/spinifex" +SPINIFEX_CONFIG="$SPINIFEX_DATA_DIR/config/spinifex.toml" +SPINIFEX_BIN="./bin/spx" -# Use Hive profile for AWS CLI -export AWS_PROFILE=hive -# Trust Hive CA for AWS CLI v2 (bundles its own Python/certifi, ignores system CA store) -export AWS_CA_BUNDLE="$HIVE_DATA_DIR/config/ca.pem" +# Use Spinifex profile for AWS CLI +export AWS_PROFILE=spinifex +# Trust Spinifex CA for AWS CLI v2 (bundles its own Python/certifi, ignores system CA store) +export AWS_CA_BUNDLE="$SPINIFEX_DATA_DIR/config/ca.pem" # Track test results TESTS_PASSED=0 @@ -107,13 +107,13 @@ dump_all_node_logs() { echo "" echo "=== Node $((i+1)) ($ip) ===" if [ "$ip" = "$LOCAL_IP" ]; then - for f in "$HIVE_DATA_DIR/logs/"*.log; do + for f in "$SPINIFEX_DATA_DIR/logs/"*.log; do [ -f "$f" ] || continue echo "--- $(basename "$f") (last 50 lines) ---" tail -50 "$f" 2>/dev/null || echo "(not found)" done else - peer_ssh "$ip" 'for f in ~/hive/logs/*.log; do + peer_ssh "$ip" 'for f in ~/spinifex/logs/*.log; do [ -f "$f" ] || continue echo "--- $(basename "$f") (last 50 lines) ---" tail -50 "$f" 2>/dev/null || echo "(not found)" @@ -401,23 +401,23 @@ if [ -z "$TYPES" ] || [ "$TYPES" == "None" ]; then fi pass_test "Daemon readiness" -# Hive CLI: get nodes -echo "Checking hive get nodes..." -GET_NODES_OUTPUT=$($HIVE_BIN get nodes --config "$HIVE_CONFIG" --timeout 5s 2>/dev/null) +# Spinifex CLI: get nodes +echo "Checking spx get nodes..." +GET_NODES_OUTPUT=$($SPINIFEX_BIN get nodes --config "$SPINIFEX_CONFIG" --timeout 5s 2>/dev/null) echo "$GET_NODES_OUTPUT" READY_COUNT=$(echo "$GET_NODES_OUTPUT" | grep -c "Ready" || true) if [ "$READY_COUNT" -ge 3 ]; then - pass_test "hive get nodes ($READY_COUNT Ready)" + pass_test "spx get nodes ($READY_COUNT Ready)" else - echo " WARNING: hive get nodes shows $READY_COUNT Ready nodes (expected 3)" - fail_test "hive get nodes" + echo " WARNING: spx get nodes shows $READY_COUNT Ready nodes (expected 3)" + fail_test "spx get nodes" fi -# Hive CLI: get vms (should be empty) -echo "Checking hive get vms (empty)..." -GET_VMS_OUTPUT=$($HIVE_BIN get vms --config "$HIVE_CONFIG" --timeout 5s 2>/dev/null) +# Spinifex CLI: get vms (should be empty) +echo "Checking spx get vms (empty)..." +GET_VMS_OUTPUT=$($SPINIFEX_BIN get vms --config "$SPINIFEX_CONFIG" --timeout 5s 2>/dev/null) echo "$GET_VMS_OUTPUT" -pass_test "hive get vms (empty)" +pass_test "spx get vms (empty)" echo "" @@ -450,7 +450,7 @@ for i in 1 2 3; do RUN_OUTPUT=$($AWS_EC2 run-instances \ --image-id "$AMI_ID" \ --instance-type "$INSTANCE_TYPE" \ - --key-name hive-key) + --key-name spinifex-key) INSTANCE_ID=$(echo "$RUN_OUTPUT" | jq -r '.Instances[0].InstanceId') if [ -z "$INSTANCE_ID" ] || [ "$INSTANCE_ID" == "null" ]; then @@ -475,7 +475,7 @@ for instance_id in "${INSTANCE_IDS[@]}"; do } done -# Check distribution via hive get vms or QEMU process check +# Check distribution via spx get vms or QEMU process check echo "" echo "Checking instance distribution across nodes..." declare -A NODE_INSTANCE_COUNT @@ -497,17 +497,17 @@ else pass_test "Instance distribution (non-deterministic)" fi -# Verify hive get vms shows all instances +# Verify spx get vms shows all instances echo "" -echo "Verifying hive get vms..." -GET_VMS_OUTPUT=$($HIVE_BIN get vms --config "$HIVE_CONFIG" --timeout 5s 2>/dev/null) +echo "Verifying spx get vms..." +GET_VMS_OUTPUT=$($SPINIFEX_BIN get vms --config "$SPINIFEX_CONFIG" --timeout 5s 2>/dev/null) echo "$GET_VMS_OUTPUT" for instance_id in "${INSTANCE_IDS[@]}"; do if ! echo "$GET_VMS_OUTPUT" | grep -q "$instance_id"; then - echo " WARNING: hive get vms did not show $instance_id" + echo " WARNING: spx get vms did not show $instance_id" fi done -pass_test "hive get vms (with instances)" +pass_test "spx get vms (with instances)" echo "" @@ -543,7 +543,7 @@ for idx in "${!INSTANCE_IDS[@]}"; do -o BatchMode=yes \ -o LogLevel=ERROR \ -p "$SSH_PORT" \ - -i "$HOME/.ssh/hive-key" \ + -i "$HOME/.ssh/spinifex-key" \ ec2-user@"$host_ip" 'echo ready' > /dev/null 2>&1; then SSH_READY=true break @@ -566,7 +566,7 @@ for idx in "${!INSTANCE_IDS[@]}"; do -o BatchMode=yes \ -o LogLevel=ERROR \ -p "$SSH_PORT" \ - -i "$HOME/.ssh/hive-key" \ + -i "$HOME/.ssh/spinifex-key" \ ec2-user@"$host_ip" 'id' 2>&1) || { echo " ERROR: SSH 'id' command failed" fail_test "Guest SSH ($instance_id)" @@ -589,7 +589,7 @@ for idx in "${!INSTANCE_IDS[@]}"; do -o BatchMode=yes \ -o LogLevel=ERROR \ -p "$SSH_PORT" \ - -i "$HOME/.ssh/hive-key" \ + -i "$HOME/.ssh/spinifex-key" \ ec2-user@"$host_ip" 'lsblk' 2>&1) || true echo " lsblk: $(echo "$LSBLK_OUTPUT" | head -5)" @@ -605,12 +605,12 @@ echo "Phase 5: Volume Lifecycle" echo "========================================" # Discover AZ -HIVE_AZ=$($AWS_EC2 describe-availability-zones --query 'AvailabilityZones[0].ZoneName' --output text) -echo "AZ: $HIVE_AZ" +SPINIFEX_AZ=$($AWS_EC2 describe-availability-zones --query 'AvailabilityZones[0].ZoneName' --output text) +echo "AZ: $SPINIFEX_AZ" # Create volume echo "Creating 10GB test volume..." -CREATE_OUTPUT=$($AWS_EC2 create-volume --size 10 --availability-zone "$HIVE_AZ") +CREATE_OUTPUT=$($AWS_EC2 create-volume --size 10 --availability-zone "$SPINIFEX_AZ") TEST_VOLUME_ID=$(echo "$CREATE_OUTPUT" | jq -r '.VolumeId') if [ -z "$TEST_VOLUME_ID" ] || [ "$TEST_VOLUME_ID" == "null" ]; then echo " ERROR: Failed to create volume" @@ -772,9 +772,9 @@ echo "Phase 8: Node Failure" echo "========================================" echo "Stopping services on node2 ($NODE2_IP) to simulate node failure..." -# Stop services on node2 only โ€” HIVE_FORCE_LOCAL_STOP prevents coordinated +# Stop services on node2 only โ€” SPINIFEX_FORCE_LOCAL_STOP prevents coordinated # cluster shutdown which would kill all nodes via NATS -peer_ssh "$NODE2_IP" "cd ~/Development/mulga/hive && HIVE_FORCE_LOCAL_STOP=1 ./scripts/stop-dev.sh" || { +peer_ssh "$NODE2_IP" "cd ~/Development/mulga/spinifex && SPINIFEX_FORCE_LOCAL_STOP=1 ./scripts/stop-dev.sh" || { echo " WARNING: stop-dev.sh returned non-zero (may be expected)" } @@ -835,7 +835,7 @@ echo "Phase 9: Node Recovery" echo "========================================" echo "Restarting services on node2 ($NODE2_IP)..." -peer_ssh "$NODE2_IP" "cd ~/Development/mulga/hive && ./scripts/start-dev.sh" || { +peer_ssh "$NODE2_IP" "cd ~/Development/mulga/spinifex && ./scripts/start-dev.sh" || { echo " ERROR: Failed to restart services on node2" fail_test "Node2 restart" } @@ -884,9 +884,9 @@ else fail_test "Node2 gateway recovery" fi -# Verify hive get nodes shows 3 Ready again -echo " Checking hive get nodes after recovery..." -GET_NODES_RECOVER=$($HIVE_BIN get nodes --config "$HIVE_CONFIG" --timeout 10s 2>/dev/null || echo "") +# Verify spx get nodes shows 3 Ready again +echo " Checking spx get nodes after recovery..." +GET_NODES_RECOVER=$($SPINIFEX_BIN get nodes --config "$SPINIFEX_CONFIG" --timeout 10s 2>/dev/null || echo "") echo "$GET_NODES_RECOVER" READY_RECOVER=$(echo "$GET_NODES_RECOVER" | grep -c "Ready" || true) if [ "$READY_RECOVER" -ge 3 ]; then diff --git a/tests/e2e/run-pseudo-multinode-e2e.sh b/tests/e2e/run-pseudo-multinode-e2e.sh index 8c8ac15e2..471aaa67b 100755 --- a/tests/e2e/run-pseudo-multinode-e2e.sh +++ b/tests/e2e/run-pseudo-multinode-e2e.sh @@ -5,7 +5,7 @@ set -e export PATH="/usr/local/go/bin:$HOME/go/bin:$PATH" # Pseudo Multi-Node E2E test runner -# This script sets up a 3-node Hive cluster using simulated IPs on the loopback interface +# This script sets up a 3-node Spinifex cluster using simulated IPs on the loopback interface # and runs distributed instance tests on a single VM. # Ensure we are in the project root @@ -33,7 +33,7 @@ cleanup() { # Try coordinated shutdown first (only if NATS is likely still up) if [ "$CLUSTER_SERVICES_STARTED" = "true" ]; then echo "Attempting coordinated cluster shutdown..." - if timeout 60 ./bin/hive admin cluster shutdown --force --timeout 30s --config "$HOME/node1/config/hive.toml" 2>/dev/null; then + if timeout 60 ./bin/spx admin cluster shutdown --force --timeout 30s --config "$HOME/node1/config/spinifex.toml" 2>/dev/null; then echo "Coordinated shutdown succeeded" else echo "Coordinated shutdown failed, falling back to per-node stop..." @@ -60,9 +60,9 @@ JOIN3_PID="" # Track whether cluster services have been started (for cleanup trap) CLUSTER_SERVICES_STARTED="false" -# Use Hive profile for AWS CLI -export AWS_PROFILE=hive -# Trust Hive CA for all profiles (AWS CLI v2 bundles its own Python/certifi, ignores system CA store) +# Use Spinifex profile for AWS CLI +export AWS_PROFILE=spinifex +# Trust Spinifex CA for all profiles (AWS CLI v2 bundles its own Python/certifi, ignores system CA store) export AWS_CA_BUNDLE="$HOME/node1/config/ca.pem" @@ -114,8 +114,8 @@ init_leader_node # Trust CA cert (exists before formation completes โ€” cert generation is the first step) echo "" -echo "Adding Hive CA certificate to system trust store..." -sudo cp ~/node1/config/ca.pem /usr/local/share/ca-certificates/hive-ca.crt +echo "Adding Spinifex CA certificate to system trust store..." +sudo cp ~/node1/config/ca.pem /usr/local/share/ca-certificates/spinifex-ca.crt sudo update-ca-certificates # Background BOTH joins โ€” they poll /formation/status until all 3 nodes have joined. @@ -178,39 +178,39 @@ AWS_EC2="aws --endpoint-url https://${NODE1_IP}:${AWSGW_PORT} ec2" AWS_IAM="aws --endpoint-url https://${NODE1_IP}:${AWSGW_PORT} iam" # Discover the cluster's availability zone and region dynamically -HIVE_AZ=$($AWS_EC2 describe-availability-zones --query 'AvailabilityZones[0].ZoneName' --output text) -HIVE_REGION=$($AWS_EC2 describe-availability-zones --query 'AvailabilityZones[0].RegionName' --output text) -echo "Discovered AZ: $HIVE_AZ, Region: $HIVE_REGION" +SPINIFEX_AZ=$($AWS_EC2 describe-availability-zones --query 'AvailabilityZones[0].ZoneName' --output text) +SPINIFEX_REGION=$($AWS_EC2 describe-availability-zones --query 'AvailabilityZones[0].RegionName' --output text) +echo "Discovered AZ: $SPINIFEX_AZ, Region: $SPINIFEX_REGION" # Phase 3b: Cluster Stats CLI (Multi-Node) echo "" echo "Phase 3b: Cluster Stats CLI (Multi-Node)" echo "========================================" -# Test hive get nodes โ€” should show all 3 nodes as Ready -echo "Testing hive get nodes..." -GET_NODES_OUTPUT=$(./bin/hive get nodes --config "$HOME/node1/config/hive.toml" --timeout 5s 2>/dev/null) +# Test spx get nodes โ€” should show all 3 nodes as Ready +echo "Testing spx get nodes..." +GET_NODES_OUTPUT=$(./bin/spx get nodes --config "$HOME/node1/config/spinifex.toml" --timeout 5s 2>/dev/null) echo "$GET_NODES_OUTPUT" READY_COUNT=$(echo "$GET_NODES_OUTPUT" | grep -c "Ready" || true) if [ "$READY_COUNT" -lt 3 ]; then - echo "WARNING: hive get nodes shows $READY_COUNT Ready nodes (expected 3)" + echo "WARNING: spx get nodes shows $READY_COUNT Ready nodes (expected 3)" fi -echo "hive get nodes passed ($READY_COUNT Ready nodes)" +echo "spx get nodes passed ($READY_COUNT Ready nodes)" -# Test hive top nodes โ€” should show resource stats for all nodes -echo "Testing hive top nodes..." -TOP_NODES_OUTPUT=$(./bin/hive top nodes --config "$HOME/node1/config/hive.toml" --timeout 5s 2>/dev/null) +# Test spx top nodes โ€” should show resource stats for all nodes +echo "Testing spx top nodes..." +TOP_NODES_OUTPUT=$(./bin/spx top nodes --config "$HOME/node1/config/spinifex.toml" --timeout 5s 2>/dev/null) echo "$TOP_NODES_OUTPUT" if ! echo "$TOP_NODES_OUTPUT" | grep -q "INSTANCE TYPE"; then - echo "WARNING: hive top nodes did not show instance type capacity table" + echo "WARNING: spx top nodes did not show instance type capacity table" fi -echo "hive top nodes passed" +echo "spx top nodes passed" -# Test hive get vms โ€” should show no VMs yet -echo "Testing hive get vms (empty)..." -GET_VMS_OUTPUT=$(./bin/hive get vms --config "$HOME/node1/config/hive.toml" --timeout 5s 2>/dev/null) +# Test spx get vms โ€” should show no VMs yet +echo "Testing spx get vms (empty)..." +GET_VMS_OUTPUT=$(./bin/spx get vms --config "$HOME/node1/config/spinifex.toml" --timeout 5s 2>/dev/null) echo "$GET_VMS_OUTPUT" -echo "hive get vms (empty) passed" +echo "spx get vms (empty) passed" # Verify gateway responds echo "" @@ -252,16 +252,16 @@ echo "$KEY_MATERIAL" > multinode-test-key.pem chmod 600 multinode-test-key.pem echo " Key created: multinode-test-key" -# Import Ubuntu image (use node1's config and hive-dir) +# Import Ubuntu image (use node1's config and spinifex-dir) echo "" echo "Importing Ubuntu image..." -IMPORT_LOG=$(./bin/hive admin images import \ +IMPORT_LOG=$(./bin/spx admin images import \ --file ~/images/ubuntu-24.04.img \ --arch "$ARCH" \ --distro ubuntu \ --version 24.04 \ - --config "$HOME/node1/config/hive.toml" \ - --hive-dir "$HOME/node1/" \ + --config "$HOME/node1/config/spinifex.toml" \ + --spinifex-dir "$HOME/node1/" \ --force) echo "Import output: $IMPORT_LOG" AMI_ID=$(echo "$IMPORT_LOG" | grep -o 'ami-[a-z0-9]\+') @@ -361,17 +361,17 @@ done echo "" check_instance_distribution -# Verify hive get vms shows all running instances +# Verify spx get vms shows all running instances echo "" -echo "Verifying hive get vms (with running VMs)..." -GET_VMS_OUTPUT=$(./bin/hive get vms --config "$HOME/node1/config/hive.toml" --timeout 5s 2>/dev/null) +echo "Verifying spx get vms (with running VMs)..." +GET_VMS_OUTPUT=$(./bin/spx get vms --config "$HOME/node1/config/spinifex.toml" --timeout 5s 2>/dev/null) echo "$GET_VMS_OUTPUT" for instance_id in "${INSTANCE_IDS[@]}"; do if ! echo "$GET_VMS_OUTPUT" | grep -q "$instance_id"; then - echo "WARNING: hive get vms did not show instance $instance_id" + echo "WARNING: spx get vms did not show instance $instance_id" fi done -echo "hive get vms shows launched instances" +echo "spx get vms shows launched instances" # Test 1a-ii: SSH Connectivity & Volume Verification echo "" @@ -451,7 +451,7 @@ for idx in "${!INSTANCE_IDS[@]}"; do -i "multinode-test-key.pem" \ ec2-user@"$SSH_HOST" 'hostname' 2>/dev/null) echo " VM hostname: $VM_HOSTNAME" - # Hostname uses truncated ID: hive-vm- + # Hostname uses truncated ID: spinifex-vm- SHORT_ID=$(echo "$instance_id" | sed 's/^i-//' | cut -c1-8) if echo "$VM_HOSTNAME" | grep -q "$SHORT_ID"; then echo " Hostname contains instance ID prefix ($SHORT_ID)" @@ -470,8 +470,8 @@ echo "----------------------------------------" echo "Testing volume create -> resize -> attach -> detach -> delete..." # Create a test volume -echo " Creating 10GB volume in ${HIVE_AZ}..." -CREATE_OUTPUT=$($AWS_EC2 create-volume --size 10 --availability-zone "$HIVE_AZ") +echo " Creating 10GB volume in ${SPINIFEX_AZ}..." +CREATE_OUTPUT=$($AWS_EC2 create-volume --size 10 --availability-zone "$SPINIFEX_AZ") TEST_VOLUME_ID=$(echo "$CREATE_OUTPUT" | jq -r '.VolumeId') if [ -z "$TEST_VOLUME_ID" ] || [ "$TEST_VOLUME_ID" == "null" ]; then @@ -676,7 +676,7 @@ echo " Describe verified (VolumeId=$DESC_VOL_ID, Size=$DESC_SIZE, Description=$ # Copy the snapshot echo " Copying snapshot $SNAPSHOT_ID..." -COPY_OUTPUT=$($AWS_EC2 copy-snapshot --source-snapshot-id "$SNAPSHOT_ID" --source-region "$HIVE_REGION" --description "multinode-e2e-copy") +COPY_OUTPUT=$($AWS_EC2 copy-snapshot --source-snapshot-id "$SNAPSHOT_ID" --source-region "$SPINIFEX_REGION" --description "multinode-e2e-copy") COPY_SNAPSHOT_ID=$(echo "$COPY_OUTPUT" | jq -r '.SnapshotId') if [ -z "$COPY_SNAPSHOT_ID" ] || [ "$COPY_SNAPSHOT_ID" == "null" ]; then @@ -1041,10 +1041,10 @@ else echo " ERROR: Instance failed to recover from crash" # Dump daemon logs for debugging for i in 1 2 3; do - if [ -f "$HOME/node$i/logs/hive.log" ]; then + if [ -f "$HOME/node$i/logs/spinifex.log" ]; then echo "" echo " --- node$i daemon log (last 30 lines) ---" - tail -30 "$HOME/node$i/logs/hive.log" + tail -30 "$HOME/node$i/logs/spinifex.log" fi done exit 1 @@ -1169,7 +1169,7 @@ echo "Step 1: Create Accounts" echo "----------------------------------------" echo " Creating Team Alpha account..." -ALPHA_OUTPUT=$(./bin/hive admin account create --name "Team Alpha" --config "$HOME/node1/config/hive.toml" 2>&1) +ALPHA_OUTPUT=$(./bin/spx admin account create --name "Team Alpha" --config "$HOME/node1/config/spinifex.toml" 2>&1) echo "$ALPHA_OUTPUT" ALPHA_ACCOUNT=$(echo "$ALPHA_OUTPUT" | grep "Account ID:" | awk '{print $NF}') ALPHA_KEY_ID=$(echo "$ALPHA_OUTPUT" | grep "Access Key ID:" | awk '{print $NF}') @@ -1182,12 +1182,12 @@ fi echo " Team Alpha: account=$ALPHA_ACCOUNT key=$ALPHA_KEY_ID" # Configure alpha profile (in case auto-config used a different endpoint) -aws configure set aws_access_key_id "$ALPHA_KEY_ID" --profile hive-team-alpha -aws configure set aws_secret_access_key "$ALPHA_SECRET" --profile hive-team-alpha -aws configure set region us-east-1 --profile hive-team-alpha +aws configure set aws_access_key_id "$ALPHA_KEY_ID" --profile spinifex-team-alpha +aws configure set aws_secret_access_key "$ALPHA_SECRET" --profile spinifex-team-alpha +aws configure set region us-east-1 --profile spinifex-team-alpha echo " Creating Team Beta account..." -BETA_OUTPUT=$(./bin/hive admin account create --name "Team Beta" --config "$HOME/node1/config/hive.toml" 2>&1) +BETA_OUTPUT=$(./bin/spx admin account create --name "Team Beta" --config "$HOME/node1/config/spinifex.toml" 2>&1) echo "$BETA_OUTPUT" BETA_ACCOUNT=$(echo "$BETA_OUTPUT" | grep "Account ID:" | awk '{print $NF}') BETA_KEY_ID=$(echo "$BETA_OUTPUT" | grep "Access Key ID:" | awk '{print $NF}') @@ -1199,9 +1199,9 @@ if [ -z "$BETA_ACCOUNT" ] || [ -z "$BETA_KEY_ID" ]; then fi echo " Team Beta: account=$BETA_ACCOUNT key=$BETA_KEY_ID" -aws configure set aws_access_key_id "$BETA_KEY_ID" --profile hive-team-beta -aws configure set aws_secret_access_key "$BETA_SECRET" --profile hive-team-beta -aws configure set region us-east-1 --profile hive-team-beta +aws configure set aws_access_key_id "$BETA_KEY_ID" --profile spinifex-team-beta +aws configure set aws_secret_access_key "$BETA_SECRET" --profile spinifex-team-beta +aws configure set region us-east-1 --profile spinifex-team-beta # Verify sequential IDs echo " Verifying sequential account IDs..." @@ -1213,7 +1213,7 @@ fi # List accounts echo " Listing accounts..." -ACCOUNT_LIST=$(./bin/hive admin account list --config "$HOME/node1/config/hive.toml" 2>&1) +ACCOUNT_LIST=$(./bin/spx admin account list --config "$HOME/node1/config/spinifex.toml" 2>&1) echo "$ACCOUNT_LIST" if echo "$ACCOUNT_LIST" | grep -q "Team Alpha" && echo "$ACCOUNT_LIST" | grep -q "Team Beta"; then echo " Account list verified" @@ -1228,15 +1228,15 @@ echo "Step 2: Account Admin Auth" echo "----------------------------------------" echo " Testing alpha admin auth..." -aws $AWS_EP ec2 describe-instances --profile hive-team-alpha > /dev/null +aws $AWS_EP ec2 describe-instances --profile spinifex-team-alpha > /dev/null echo " Alpha admin: ec2 OK" -aws $AWS_EP iam list-users --profile hive-team-alpha > /dev/null +aws $AWS_EP iam list-users --profile spinifex-team-alpha > /dev/null echo " Alpha admin: iam OK" echo " Testing beta admin auth..." -aws $AWS_EP ec2 describe-instances --profile hive-team-beta > /dev/null +aws $AWS_EP ec2 describe-instances --profile spinifex-team-beta > /dev/null echo " Beta admin: ec2 OK" -aws $AWS_EP iam list-users --profile hive-team-beta > /dev/null +aws $AWS_EP iam list-users --profile spinifex-team-beta > /dev/null echo " Beta admin: iam OK" # Step 3: Account-scoped users @@ -1246,29 +1246,29 @@ echo "----------------------------------------" # Same username in different accounts echo " Creating alice in both accounts..." -aws $AWS_EP iam create-user --user-name alice --profile hive-team-alpha > /dev/null -ALPHA_ALICE_ARN=$(aws $AWS_EP iam get-user --user-name alice --profile hive-team-alpha | jq -r '.User.Arn') +aws $AWS_EP iam create-user --user-name alice --profile spinifex-team-alpha > /dev/null +ALPHA_ALICE_ARN=$(aws $AWS_EP iam get-user --user-name alice --profile spinifex-team-alpha | jq -r '.User.Arn') echo " Alpha alice: $ALPHA_ALICE_ARN" -aws $AWS_EP iam create-user --user-name alice --profile hive-team-beta > /dev/null -BETA_ALICE_ARN=$(aws $AWS_EP iam get-user --user-name alice --profile hive-team-beta | jq -r '.User.Arn') +aws $AWS_EP iam create-user --user-name alice --profile spinifex-team-beta > /dev/null +BETA_ALICE_ARN=$(aws $AWS_EP iam get-user --user-name alice --profile spinifex-team-beta | jq -r '.User.Arn') echo " Beta alice: $BETA_ALICE_ARN" # Additional users -aws $AWS_EP iam create-user --user-name team-member --profile hive-team-alpha > /dev/null -aws $AWS_EP iam create-user --user-name dev-user --profile hive-team-beta > /dev/null +aws $AWS_EP iam create-user --user-name team-member --profile spinifex-team-alpha > /dev/null +aws $AWS_EP iam create-user --user-name dev-user --profile spinifex-team-beta > /dev/null # List users โ€” scoped echo " Verifying scoped user lists..." -ALPHA_USERS=$(aws $AWS_EP iam list-users --profile hive-team-alpha | jq -r '.Users[].UserName' | sort | tr '\n' ',') +ALPHA_USERS=$(aws $AWS_EP iam list-users --profile spinifex-team-alpha | jq -r '.Users[].UserName' | sort | tr '\n' ',') echo " Alpha users: $ALPHA_USERS" -BETA_USERS=$(aws $AWS_EP iam list-users --profile hive-team-beta | jq -r '.Users[].UserName' | sort | tr '\n' ',') +BETA_USERS=$(aws $AWS_EP iam list-users --profile spinifex-team-beta | jq -r '.Users[].UserName' | sort | tr '\n' ',') echo " Beta users: $BETA_USERS" # Cross-account isolation echo " Verifying cross-account isolation..." set +e -CROSS_CHECK=$(aws $AWS_EP iam get-user --user-name dev-user --profile hive-team-alpha 2>&1) +CROSS_CHECK=$(aws $AWS_EP iam get-user --user-name dev-user --profile spinifex-team-alpha 2>&1) set -e if echo "$CROSS_CHECK" | grep -q "NoSuchEntity"; then echo " Alpha cannot see Beta's dev-user โ€” isolation OK" @@ -1278,7 +1278,7 @@ else fi set +e -CROSS_CHECK2=$(aws $AWS_EP iam get-user --user-name team-member --profile hive-team-beta 2>&1) +CROSS_CHECK2=$(aws $AWS_EP iam get-user --user-name team-member --profile spinifex-team-beta 2>&1) set -e if echo "$CROSS_CHECK2" | grep -q "NoSuchEntity"; then echo " Beta cannot see Alpha's team-member โ€” isolation OK" @@ -1292,23 +1292,23 @@ echo "" echo "Step 4: Account-Scoped Access Keys" echo "----------------------------------------" -ALPHA_ALICE_KEY=$(aws $AWS_EP iam create-access-key --user-name alice --profile hive-team-alpha) +ALPHA_ALICE_KEY=$(aws $AWS_EP iam create-access-key --user-name alice --profile spinifex-team-alpha) ALPHA_ALICE_KEY_ID=$(echo "$ALPHA_ALICE_KEY" | jq -r '.AccessKey.AccessKeyId') ALPHA_ALICE_SECRET=$(echo "$ALPHA_ALICE_KEY" | jq -r '.AccessKey.SecretAccessKey') echo " Alpha alice key: $ALPHA_ALICE_KEY_ID" -aws configure set aws_access_key_id "$ALPHA_ALICE_KEY_ID" --profile hive-alpha-alice -aws configure set aws_secret_access_key "$ALPHA_ALICE_SECRET" --profile hive-alpha-alice -aws configure set region us-east-1 --profile hive-alpha-alice +aws configure set aws_access_key_id "$ALPHA_ALICE_KEY_ID" --profile spinifex-alpha-alice +aws configure set aws_secret_access_key "$ALPHA_ALICE_SECRET" --profile spinifex-alpha-alice +aws configure set region us-east-1 --profile spinifex-alpha-alice -BETA_ALICE_KEY=$(aws $AWS_EP iam create-access-key --user-name alice --profile hive-team-beta) +BETA_ALICE_KEY=$(aws $AWS_EP iam create-access-key --user-name alice --profile spinifex-team-beta) BETA_ALICE_KEY_ID=$(echo "$BETA_ALICE_KEY" | jq -r '.AccessKey.AccessKeyId') BETA_ALICE_SECRET=$(echo "$BETA_ALICE_KEY" | jq -r '.AccessKey.SecretAccessKey') echo " Beta alice key: $BETA_ALICE_KEY_ID" -aws configure set aws_access_key_id "$BETA_ALICE_KEY_ID" --profile hive-beta-alice -aws configure set aws_secret_access_key "$BETA_ALICE_SECRET" --profile hive-beta-alice -aws configure set region us-east-1 --profile hive-beta-alice +aws configure set aws_access_key_id "$BETA_ALICE_KEY_ID" --profile spinifex-beta-alice +aws configure set aws_secret_access_key "$BETA_ALICE_SECRET" --profile spinifex-beta-alice +aws configure set region us-east-1 --profile spinifex-beta-alice # Step 5: Account-scoped policies & enforcement echo "" @@ -1326,7 +1326,7 @@ aws $AWS_EP iam create-policy \ "Action": ["ec2:DescribeInstances", "ec2:DescribeVpcs"], "Resource": "*" }] - }' --profile hive-team-alpha > /dev/null + }' --profile spinifex-team-alpha > /dev/null # Beta: broad EC2 Describe* wildcard echo " Creating EC2ReadOnly in Beta (broad Describe*)..." @@ -1339,36 +1339,36 @@ aws $AWS_EP iam create-policy \ "Action": "ec2:Describe*", "Resource": "*" }] - }' --profile hive-team-beta > /dev/null + }' --profile spinifex-team-beta > /dev/null # Attach policies echo " Attaching policies..." aws $AWS_EP iam attach-user-policy --user-name alice \ - --policy-arn "arn:aws:iam::${ALPHA_ACCOUNT}:policy/EC2ReadOnly" --profile hive-team-alpha + --policy-arn "arn:aws:iam::${ALPHA_ACCOUNT}:policy/EC2ReadOnly" --profile spinifex-team-alpha aws $AWS_EP iam attach-user-policy --user-name alice \ - --policy-arn "arn:aws:iam::${BETA_ACCOUNT}:policy/EC2ReadOnly" --profile hive-team-beta + --policy-arn "arn:aws:iam::${BETA_ACCOUNT}:policy/EC2ReadOnly" --profile spinifex-team-beta # Verify scoped enforcement echo " Verifying scoped enforcement..." # Alpha alice: narrow policy -aws $AWS_EP ec2 describe-instances --profile hive-alpha-alice > /dev/null +aws $AWS_EP ec2 describe-instances --profile spinifex-alpha-alice > /dev/null echo " Alpha alice: describe-instances โ€” allowed" -aws $AWS_EP ec2 describe-vpcs --profile hive-alpha-alice > /dev/null +aws $AWS_EP ec2 describe-vpcs --profile spinifex-alpha-alice > /dev/null echo " Alpha alice: describe-vpcs โ€” allowed" -expect_error "AccessDenied" aws $AWS_EP ec2 describe-key-pairs --profile hive-alpha-alice +expect_error "AccessDenied" aws $AWS_EP ec2 describe-key-pairs --profile spinifex-alpha-alice echo " Alpha alice: describe-key-pairs โ€” denied (narrow policy)" # Beta alice: broad policy -aws $AWS_EP ec2 describe-instances --profile hive-beta-alice > /dev/null +aws $AWS_EP ec2 describe-instances --profile spinifex-beta-alice > /dev/null echo " Beta alice: describe-instances โ€” allowed" -aws $AWS_EP ec2 describe-key-pairs --profile hive-beta-alice > /dev/null +aws $AWS_EP ec2 describe-key-pairs --profile spinifex-beta-alice > /dev/null echo " Beta alice: describe-key-pairs โ€” allowed (Describe* wildcard)" # Both denied non-Describe -expect_error "AccessDenied" aws $AWS_EP ec2 create-key-pair --key-name x --profile hive-alpha-alice +expect_error "AccessDenied" aws $AWS_EP ec2 create-key-pair --key-name x --profile spinifex-alpha-alice echo " Alpha alice: create-key-pair โ€” denied" -expect_error "AccessDenied" aws $AWS_EP ec2 create-key-pair --key-name x --profile hive-beta-alice +expect_error "AccessDenied" aws $AWS_EP ec2 create-key-pair --key-name x --profile spinifex-beta-alice echo " Beta alice: create-key-pair โ€” denied" echo " Scoped enforcement verified" @@ -1381,14 +1381,14 @@ echo "----------------------------------------" # Delete Alpha's alice echo " Deleting Alpha's alice..." aws $AWS_EP iam detach-user-policy --user-name alice \ - --policy-arn "arn:aws:iam::${ALPHA_ACCOUNT}:policy/EC2ReadOnly" --profile hive-team-alpha + --policy-arn "arn:aws:iam::${ALPHA_ACCOUNT}:policy/EC2ReadOnly" --profile spinifex-team-alpha aws $AWS_EP iam delete-access-key --user-name alice \ - --access-key-id "$ALPHA_ALICE_KEY_ID" --profile hive-team-alpha -aws $AWS_EP iam delete-user --user-name alice --profile hive-team-alpha + --access-key-id "$ALPHA_ALICE_KEY_ID" --profile spinifex-team-alpha +aws $AWS_EP iam delete-user --user-name alice --profile spinifex-team-alpha # Verify Alpha alice gone set +e -ALPHA_CHECK=$(aws $AWS_EP iam get-user --user-name alice --profile hive-team-alpha 2>&1) +ALPHA_CHECK=$(aws $AWS_EP iam get-user --user-name alice --profile spinifex-team-alpha 2>&1) set -e if echo "$ALPHA_CHECK" | grep -q "NoSuchEntity"; then echo " Alpha alice deleted" @@ -1398,10 +1398,10 @@ else fi # Verify Beta alice unaffected -aws $AWS_EP iam get-user --user-name alice --profile hive-team-beta > /dev/null +aws $AWS_EP iam get-user --user-name alice --profile spinifex-team-beta > /dev/null echo " Beta alice still exists (isolation OK)" -aws $AWS_EP ec2 describe-instances --profile hive-beta-alice > /dev/null +aws $AWS_EP ec2 describe-instances --profile spinifex-beta-alice > /dev/null echo " Beta alice auth still works (isolation OK)" # ========================================================================== @@ -1420,8 +1420,8 @@ echo "Step 7a: Instance Scoping" echo "----------------------------------------" # Create per-account key pairs (key pairs are account-scoped, root's multinode-test-key is invisible) -$AWS_EC2 create-key-pair --key-name alpha-instance-key --profile hive-team-alpha > /dev/null -$AWS_EC2 create-key-pair --key-name beta-instance-key --profile hive-team-beta > /dev/null +$AWS_EC2 create-key-pair --key-name alpha-instance-key --profile spinifex-team-alpha > /dev/null +$AWS_EC2 create-key-pair --key-name beta-instance-key --profile spinifex-team-beta > /dev/null echo " Created per-account key pairs for instance launches" echo " Alpha launching instance..." @@ -1429,7 +1429,7 @@ ALPHA_INST_RUN=$($AWS_EC2 run-instances \ --image-id "$AMI_ID" \ --instance-type "$INSTANCE_TYPE" \ --key-name alpha-instance-key \ - --profile hive-team-alpha) + --profile spinifex-team-alpha) ALPHA_INST=$(echo "$ALPHA_INST_RUN" | jq -r '.Instances[0].InstanceId') echo " Alpha instance: $ALPHA_INST" @@ -1438,7 +1438,7 @@ BETA_INST_RUN=$($AWS_EC2 run-instances \ --image-id "$AMI_ID" \ --instance-type "$INSTANCE_TYPE" \ --key-name beta-instance-key \ - --profile hive-team-beta) + --profile spinifex-team-beta) BETA_INST=$(echo "$BETA_INST_RUN" | jq -r '.Instances[0].InstanceId') echo " Beta instance: $BETA_INST" @@ -1446,9 +1446,9 @@ echo " Beta instance: $BETA_INST" echo " Waiting for instances to reach running state..." COUNT=0 while [ $COUNT -lt 30 ]; do - A_STATE=$($AWS_EC2 describe-instances --instance-ids "$ALPHA_INST" --profile hive-team-alpha \ + A_STATE=$($AWS_EC2 describe-instances --instance-ids "$ALPHA_INST" --profile spinifex-team-alpha \ --query 'Reservations[0].Instances[0].State.Name' --output text 2>/dev/null || echo "pending") - B_STATE=$($AWS_EC2 describe-instances --instance-ids "$BETA_INST" --profile hive-team-beta \ + B_STATE=$($AWS_EC2 describe-instances --instance-ids "$BETA_INST" --profile spinifex-team-beta \ --query 'Reservations[0].Instances[0].State.Name' --output text 2>/dev/null || echo "pending") echo " Alpha=$A_STATE, Beta=$B_STATE" if [ "$A_STATE" == "running" ] && [ "$B_STATE" == "running" ]; then break; fi @@ -1462,7 +1462,7 @@ fi echo " Both instances running" # Describe isolation -ALPHA_DESC=$($AWS_EC2 describe-instances --profile hive-team-alpha \ +ALPHA_DESC=$($AWS_EC2 describe-instances --profile spinifex-team-alpha \ --query 'Reservations[].Instances[].InstanceId' --output text) if echo "$ALPHA_DESC" | grep -q "$BETA_INST"; then echo " ERROR: Alpha can see Beta's instance" @@ -1470,7 +1470,7 @@ if echo "$ALPHA_DESC" | grep -q "$BETA_INST"; then fi echo " Alpha sees only own instances" -BETA_DESC=$($AWS_EC2 describe-instances --profile hive-team-beta \ +BETA_DESC=$($AWS_EC2 describe-instances --profile spinifex-team-beta \ --query 'Reservations[].Instances[].InstanceId' --output text) if echo "$BETA_DESC" | grep -q "$ALPHA_INST"; then echo " ERROR: Beta can see Alpha's instance" @@ -1479,7 +1479,7 @@ fi echo " Beta sees only own instances" # OwnerId verification -ALPHA_OWNER=$($AWS_EC2 describe-instances --profile hive-team-alpha \ +ALPHA_OWNER=$($AWS_EC2 describe-instances --profile spinifex-team-alpha \ --query 'Reservations[0].OwnerId' --output text) if [ "$ALPHA_OWNER" != "$ALPHA_ACCOUNT" ]; then echo " ERROR: Alpha OwnerId mismatch: expected $ALPHA_ACCOUNT, got $ALPHA_OWNER" @@ -1489,15 +1489,15 @@ echo " Alpha OwnerId correct: $ALPHA_OWNER" # Cross-account operations expect_error "InvalidInstanceID.NotFound" \ - $AWS_EC2 stop-instances --instance-ids "$BETA_INST" --profile hive-team-alpha + $AWS_EC2 stop-instances --instance-ids "$BETA_INST" --profile spinifex-team-alpha echo " Alpha cannot stop Beta's instance" expect_error "InvalidInstanceID.NotFound" \ - $AWS_EC2 terminate-instances --instance-ids "$ALPHA_INST" --profile hive-team-beta + $AWS_EC2 terminate-instances --instance-ids "$ALPHA_INST" --profile spinifex-team-beta echo " Beta cannot terminate Alpha's instance" expect_error "InvalidInstanceID.NotFound" \ - $AWS_EC2 get-console-output --instance-id "$ALPHA_INST" --profile hive-team-beta + $AWS_EC2 get-console-output --instance-id "$ALPHA_INST" --profile spinifex-team-beta echo " Beta cannot get console output of Alpha's instance" echo " Instance scoping passed" @@ -1507,16 +1507,16 @@ echo "" echo "Step 7b: Volume Scoping" echo "----------------------------------------" -ALPHA_VOL=$($AWS_EC2 create-volume --availability-zone "$HIVE_AZ" --size 10 \ - --volume-type gp3 --profile hive-team-alpha | jq -r '.VolumeId') +ALPHA_VOL=$($AWS_EC2 create-volume --availability-zone "$SPINIFEX_AZ" --size 10 \ + --volume-type gp3 --profile spinifex-team-alpha | jq -r '.VolumeId') echo " Alpha volume: $ALPHA_VOL" -BETA_VOL=$($AWS_EC2 create-volume --availability-zone "$HIVE_AZ" --size 10 \ - --volume-type gp3 --profile hive-team-beta | jq -r '.VolumeId') +BETA_VOL=$($AWS_EC2 create-volume --availability-zone "$SPINIFEX_AZ" --size 10 \ + --volume-type gp3 --profile spinifex-team-beta | jq -r '.VolumeId') echo " Beta volume: $BETA_VOL" # Describe isolation -ALPHA_VOLS=$($AWS_EC2 describe-volumes --profile hive-team-alpha \ +ALPHA_VOLS=$($AWS_EC2 describe-volumes --profile spinifex-team-alpha \ --query 'Volumes[].VolumeId' --output text) if echo "$ALPHA_VOLS" | grep -q "$BETA_VOL"; then echo " ERROR: Alpha can see Beta's volume" @@ -1526,33 +1526,33 @@ echo " Alpha sees only own volumes" # Cross-account operations expect_error "InvalidVolume.NotFound" \ - $AWS_EC2 describe-volumes --volume-ids "$BETA_VOL" --profile hive-team-alpha + $AWS_EC2 describe-volumes --volume-ids "$BETA_VOL" --profile spinifex-team-alpha echo " Alpha cannot describe Beta's volume by ID" expect_error "InvalidVolume.NotFound" \ - $AWS_EC2 delete-volume --volume-id "$ALPHA_VOL" --profile hive-team-beta + $AWS_EC2 delete-volume --volume-id "$ALPHA_VOL" --profile spinifex-team-beta echo " Beta cannot delete Alpha's volume" expect_error "InvalidVolume.NotFound" \ $AWS_EC2 attach-volume --volume-id "$ALPHA_VOL" \ - --instance-id "$BETA_INST" --device /dev/sdf --profile hive-team-beta + --instance-id "$BETA_INST" --device /dev/sdf --profile spinifex-team-beta echo " Beta cannot attach Alpha's volume" # Attach Alpha's volume, then test cross-account detach $AWS_EC2 attach-volume --volume-id "$ALPHA_VOL" \ - --instance-id "$ALPHA_INST" --device /dev/sdf --profile hive-team-alpha > /dev/null + --instance-id "$ALPHA_INST" --device /dev/sdf --profile spinifex-team-alpha > /dev/null sleep 2 expect_error "InvalidVolume.NotFound" \ - $AWS_EC2 detach-volume --volume-id "$ALPHA_VOL" --profile hive-team-beta + $AWS_EC2 detach-volume --volume-id "$ALPHA_VOL" --profile spinifex-team-beta echo " Beta cannot detach Alpha's volume" expect_error "InvalidVolume.NotFound" \ - $AWS_EC2 modify-volume --volume-id "$ALPHA_VOL" --size 20 --profile hive-team-beta + $AWS_EC2 modify-volume --volume-id "$ALPHA_VOL" --size 20 --profile spinifex-team-beta echo " Beta cannot modify Alpha's volume" # Detach for later cleanup -$AWS_EC2 detach-volume --volume-id "$ALPHA_VOL" --profile hive-team-alpha > /dev/null +$AWS_EC2 detach-volume --volume-id "$ALPHA_VOL" --profile spinifex-team-alpha > /dev/null sleep 2 echo " Volume scoping passed" @@ -1562,16 +1562,16 @@ echo "" echo "Step 7c: Key Pair Scoping" echo "----------------------------------------" -$AWS_EC2 create-key-pair --key-name alpha-key --profile hive-team-alpha > /dev/null +$AWS_EC2 create-key-pair --key-name alpha-key --profile spinifex-team-alpha > /dev/null ALPHA_KEYPAIR_ID=$($AWS_EC2 describe-key-pairs --key-names alpha-key \ - --profile hive-team-alpha --query 'KeyPairs[0].KeyPairId' --output text) + --profile spinifex-team-alpha --query 'KeyPairs[0].KeyPairId' --output text) echo " Alpha key: alpha-key ($ALPHA_KEYPAIR_ID)" -$AWS_EC2 create-key-pair --key-name beta-key --profile hive-team-beta > /dev/null +$AWS_EC2 create-key-pair --key-name beta-key --profile spinifex-team-beta > /dev/null echo " Beta key: beta-key" # Describe isolation -ALPHA_KEYS=$($AWS_EC2 describe-key-pairs --profile hive-team-alpha \ +ALPHA_KEYS=$($AWS_EC2 describe-key-pairs --profile spinifex-team-alpha \ --query 'KeyPairs[].KeyName' --output text) if echo "$ALPHA_KEYS" | grep -q "beta-key"; then echo " ERROR: Alpha can see Beta's key" @@ -1580,12 +1580,12 @@ fi echo " Alpha sees only own keys" # Same name, different accounts -$AWS_EC2 create-key-pair --key-name shared-name --profile hive-team-alpha > /dev/null -$AWS_EC2 create-key-pair --key-name shared-name --profile hive-team-beta > /dev/null +$AWS_EC2 create-key-pair --key-name shared-name --profile spinifex-team-alpha > /dev/null +$AWS_EC2 create-key-pair --key-name shared-name --profile spinifex-team-beta > /dev/null ALPHA_SHARED_ID=$($AWS_EC2 describe-key-pairs --key-names shared-name \ - --profile hive-team-alpha --query 'KeyPairs[0].KeyPairId' --output text) + --profile spinifex-team-alpha --query 'KeyPairs[0].KeyPairId' --output text) BETA_SHARED_ID=$($AWS_EC2 describe-key-pairs --key-names shared-name \ - --profile hive-team-beta --query 'KeyPairs[0].KeyPairId' --output text) + --profile spinifex-team-beta --query 'KeyPairs[0].KeyPairId' --output text) if [ "$ALPHA_SHARED_ID" == "$BETA_SHARED_ID" ]; then echo " ERROR: Same KeyPairId for shared-name in both accounts" exit 1 @@ -1593,9 +1593,9 @@ fi echo " Namespace isolation: alpha=$ALPHA_SHARED_ID, beta=$BETA_SHARED_ID" # Cross-account delete (idempotent, but shouldn't affect other account) -$AWS_EC2 delete-key-pair --key-name alpha-key --profile hive-team-beta +$AWS_EC2 delete-key-pair --key-name alpha-key --profile spinifex-team-beta ALPHA_KEY_CHECK=$($AWS_EC2 describe-key-pairs --key-names alpha-key \ - --profile hive-team-alpha --query 'KeyPairs[0].KeyPairId' --output text) + --profile spinifex-team-alpha --query 'KeyPairs[0].KeyPairId' --output text) if [ "$ALPHA_KEY_CHECK" != "$ALPHA_KEYPAIR_ID" ]; then echo " ERROR: Beta's delete affected Alpha's key" exit 1 @@ -1605,8 +1605,8 @@ echo " Cross-account delete had no effect on Alpha's key" # Import key pair โ€” account scoped ssh-keygen -t ed25519 -f /tmp/test-import-key -N "" -q $AWS_EC2 import-key-pair --key-name imported-key \ - --public-key-material fileb:///tmp/test-import-key.pub --profile hive-team-alpha > /dev/null -BETA_IMPORT_CHECK=$($AWS_EC2 describe-key-pairs --profile hive-team-beta \ + --public-key-material fileb:///tmp/test-import-key.pub --profile spinifex-team-alpha > /dev/null +BETA_IMPORT_CHECK=$($AWS_EC2 describe-key-pairs --profile spinifex-team-beta \ --query 'KeyPairs[].KeyName' --output text) if echo "$BETA_IMPORT_CHECK" | grep -q "imported-key"; then echo " ERROR: Beta can see Alpha's imported key" @@ -1623,15 +1623,15 @@ echo "Step 7d: Snapshot Scoping" echo "----------------------------------------" ALPHA_SNAP=$($AWS_EC2 create-snapshot --volume-id "$ALPHA_VOL" \ - --description "Alpha snapshot" --profile hive-team-alpha | jq -r '.SnapshotId') + --description "Alpha snapshot" --profile spinifex-team-alpha | jq -r '.SnapshotId') echo " Alpha snapshot: $ALPHA_SNAP" BETA_SNAP=$($AWS_EC2 create-snapshot --volume-id "$BETA_VOL" \ - --description "Beta snapshot" --profile hive-team-beta | jq -r '.SnapshotId') + --description "Beta snapshot" --profile spinifex-team-beta | jq -r '.SnapshotId') echo " Beta snapshot: $BETA_SNAP" # Describe isolation -ALPHA_SNAPS=$($AWS_EC2 describe-snapshots --owner-ids self --profile hive-team-alpha \ +ALPHA_SNAPS=$($AWS_EC2 describe-snapshots --owner-ids self --profile spinifex-team-alpha \ --query 'Snapshots[].SnapshotId' --output text) if echo "$ALPHA_SNAPS" | grep -q "$BETA_SNAP"; then echo " ERROR: Alpha can see Beta's snapshot" @@ -1640,7 +1640,7 @@ fi echo " Alpha sees only own snapshots" # OwnerId verification -ALPHA_SNAP_OWNER=$($AWS_EC2 describe-snapshots --owner-ids self --profile hive-team-alpha \ +ALPHA_SNAP_OWNER=$($AWS_EC2 describe-snapshots --owner-ids self --profile spinifex-team-alpha \ --query 'Snapshots[0].OwnerId' --output text) if [ "$ALPHA_SNAP_OWNER" != "$ALPHA_ACCOUNT" ]; then echo " ERROR: Snapshot OwnerId mismatch: expected $ALPHA_ACCOUNT, got $ALPHA_SNAP_OWNER" @@ -1650,13 +1650,13 @@ echo " Alpha snapshot OwnerId correct" # Cross-account delete expect_error "UnauthorizedOperation" \ - $AWS_EC2 delete-snapshot --snapshot-id "$ALPHA_SNAP" --profile hive-team-beta + $AWS_EC2 delete-snapshot --snapshot-id "$ALPHA_SNAP" --profile spinifex-team-beta echo " Beta cannot delete Alpha's snapshot" # Cross-account snapshot from other's volume expect_error "InvalidVolume.NotFound" \ $AWS_EC2 create-snapshot --volume-id "$ALPHA_VOL" \ - --description "stolen" --profile hive-team-beta + --description "stolen" --profile spinifex-team-beta echo " Beta cannot snapshot Alpha's volume" echo " Snapshot scoping passed" @@ -1667,15 +1667,15 @@ echo "Step 7e: VPC/Subnet Scoping" echo "----------------------------------------" ALPHA_VPC=$($AWS_EC2 create-vpc --cidr-block 10.0.0.0/16 \ - --profile hive-team-alpha --query 'Vpc.VpcId' --output text) + --profile spinifex-team-alpha --query 'Vpc.VpcId' --output text) echo " Alpha VPC: $ALPHA_VPC" BETA_VPC=$($AWS_EC2 create-vpc --cidr-block 10.0.0.0/16 \ - --profile hive-team-beta --query 'Vpc.VpcId' --output text) + --profile spinifex-team-beta --query 'Vpc.VpcId' --output text) echo " Beta VPC: $BETA_VPC (same CIDR โ€” no conflict)" # Describe isolation -ALPHA_VPCS=$($AWS_EC2 describe-vpcs --profile hive-team-alpha \ +ALPHA_VPCS=$($AWS_EC2 describe-vpcs --profile spinifex-team-alpha \ --query 'Vpcs[].VpcId' --output text) if echo "$ALPHA_VPCS" | grep -q "$BETA_VPC"; then echo " ERROR: Alpha can see Beta's VPC" @@ -1684,24 +1684,24 @@ fi echo " VPC describe isolation OK" expect_error "InvalidVpcID.NotFound" \ - $AWS_EC2 describe-vpcs --vpc-ids "$BETA_VPC" --profile hive-team-alpha + $AWS_EC2 describe-vpcs --vpc-ids "$BETA_VPC" --profile spinifex-team-alpha echo " Alpha cannot describe Beta's VPC by ID" expect_error "InvalidVpcID.NotFound" \ - $AWS_EC2 delete-vpc --vpc-id "$ALPHA_VPC" --profile hive-team-beta + $AWS_EC2 delete-vpc --vpc-id "$ALPHA_VPC" --profile spinifex-team-beta echo " Beta cannot delete Alpha's VPC" # Create subnets ALPHA_SUBNET=$($AWS_EC2 create-subnet --vpc-id "$ALPHA_VPC" --cidr-block 10.0.1.0/24 \ - --profile hive-team-alpha --query 'Subnet.SubnetId' --output text) + --profile spinifex-team-alpha --query 'Subnet.SubnetId' --output text) echo " Alpha subnet: $ALPHA_SUBNET" BETA_SUBNET=$($AWS_EC2 create-subnet --vpc-id "$BETA_VPC" --cidr-block 10.0.1.0/24 \ - --profile hive-team-beta --query 'Subnet.SubnetId' --output text) + --profile spinifex-team-beta --query 'Subnet.SubnetId' --output text) echo " Beta subnet: $BETA_SUBNET" # Subnet describe isolation -ALPHA_SUBNETS=$($AWS_EC2 describe-subnets --profile hive-team-alpha \ +ALPHA_SUBNETS=$($AWS_EC2 describe-subnets --profile spinifex-team-alpha \ --query 'Subnets[].SubnetId' --output text) if echo "$ALPHA_SUBNETS" | grep -q "$BETA_SUBNET"; then echo " ERROR: Alpha can see Beta's subnet" @@ -1711,11 +1711,11 @@ echo " Subnet describe isolation OK" expect_error "InvalidVpcID.NotFound" \ $AWS_EC2 create-subnet --vpc-id "$ALPHA_VPC" --cidr-block 10.0.2.0/24 \ - --profile hive-team-beta + --profile spinifex-team-beta echo " Beta cannot create subnet in Alpha's VPC" expect_error "InvalidSubnetID.NotFound" \ - $AWS_EC2 delete-subnet --subnet-id "$ALPHA_SUBNET" --profile hive-team-beta + $AWS_EC2 delete-subnet --subnet-id "$ALPHA_SUBNET" --profile spinifex-team-beta echo " Beta cannot delete Alpha's subnet" echo " VPC/Subnet scoping passed" @@ -1725,16 +1725,16 @@ echo "" echo "Step 7f: IGW + EIGW Scoping" echo "----------------------------------------" -ALPHA_IGW=$($AWS_EC2 create-internet-gateway --profile hive-team-alpha \ +ALPHA_IGW=$($AWS_EC2 create-internet-gateway --profile spinifex-team-alpha \ --query 'InternetGateway.InternetGatewayId' --output text) echo " Alpha IGW: $ALPHA_IGW" -BETA_IGW=$($AWS_EC2 create-internet-gateway --profile hive-team-beta \ +BETA_IGW=$($AWS_EC2 create-internet-gateway --profile spinifex-team-beta \ --query 'InternetGateway.InternetGatewayId' --output text) echo " Beta IGW: $BETA_IGW" # IGW describe isolation -ALPHA_IGWS=$($AWS_EC2 describe-internet-gateways --profile hive-team-alpha \ +ALPHA_IGWS=$($AWS_EC2 describe-internet-gateways --profile spinifex-team-alpha \ --query 'InternetGateways[].InternetGatewayId' --output text) if echo "$ALPHA_IGWS" | grep -q "$BETA_IGW"; then echo " ERROR: Alpha can see Beta's IGW" @@ -1744,40 +1744,40 @@ echo " IGW describe isolation OK" expect_error "InvalidInternetGatewayID.NotFound" \ $AWS_EC2 describe-internet-gateways --internet-gateway-ids "$BETA_IGW" \ - --profile hive-team-alpha + --profile spinifex-team-alpha echo " Alpha cannot describe Beta's IGW by ID" expect_error "InvalidInternetGatewayID.NotFound" \ $AWS_EC2 delete-internet-gateway --internet-gateway-id "$ALPHA_IGW" \ - --profile hive-team-beta + --profile spinifex-team-beta echo " Beta cannot delete Alpha's IGW" expect_error "InvalidInternetGatewayID.NotFound" \ $AWS_EC2 attach-internet-gateway --internet-gateway-id "$BETA_IGW" \ - --vpc-id "$ALPHA_VPC" --profile hive-team-alpha + --vpc-id "$ALPHA_VPC" --profile spinifex-team-alpha echo " Alpha cannot attach Beta's IGW to own VPC" # Attach Alpha's IGW, test cross-account detach $AWS_EC2 attach-internet-gateway --internet-gateway-id "$ALPHA_IGW" \ - --vpc-id "$ALPHA_VPC" --profile hive-team-alpha > /dev/null + --vpc-id "$ALPHA_VPC" --profile spinifex-team-alpha > /dev/null expect_error "InvalidInternetGatewayID.NotFound" \ $AWS_EC2 detach-internet-gateway --internet-gateway-id "$ALPHA_IGW" \ - --vpc-id "$ALPHA_VPC" --profile hive-team-beta + --vpc-id "$ALPHA_VPC" --profile spinifex-team-beta echo " Beta cannot detach Alpha's IGW" # EIGW ALPHA_EIGW=$($AWS_EC2 create-egress-only-internet-gateway --vpc-id "$ALPHA_VPC" \ - --profile hive-team-alpha \ + --profile spinifex-team-alpha \ --query 'EgressOnlyInternetGateway.EgressOnlyInternetGatewayId' --output text) echo " Alpha EIGW: $ALPHA_EIGW" BETA_EIGW=$($AWS_EC2 create-egress-only-internet-gateway --vpc-id "$BETA_VPC" \ - --profile hive-team-beta \ + --profile spinifex-team-beta \ --query 'EgressOnlyInternetGateway.EgressOnlyInternetGatewayId' --output text) echo " Beta EIGW: $BETA_EIGW" # EIGW describe isolation -ALPHA_EIGWS=$($AWS_EC2 describe-egress-only-internet-gateways --profile hive-team-alpha \ +ALPHA_EIGWS=$($AWS_EC2 describe-egress-only-internet-gateways --profile spinifex-team-alpha \ --query 'EgressOnlyInternetGateways[].EgressOnlyInternetGatewayId' --output text) if echo "$ALPHA_EIGWS" | grep -q "$BETA_EIGW"; then echo " ERROR: Alpha can see Beta's EIGW" @@ -1788,9 +1788,9 @@ echo " EIGW describe isolation OK" # Cross-account EIGW delete (verify Alpha's still exists after Beta's attempt) set +e $AWS_EC2 delete-egress-only-internet-gateway \ - --egress-only-internet-gateway-id "$ALPHA_EIGW" --profile hive-team-beta 2>/dev/null + --egress-only-internet-gateway-id "$ALPHA_EIGW" --profile spinifex-team-beta 2>/dev/null set -e -ALPHA_EIGW_CHECK=$($AWS_EC2 describe-egress-only-internet-gateways --profile hive-team-alpha \ +ALPHA_EIGW_CHECK=$($AWS_EC2 describe-egress-only-internet-gateways --profile spinifex-team-alpha \ --query 'EgressOnlyInternetGateways[].EgressOnlyInternetGatewayId' --output text) if ! echo "$ALPHA_EIGW_CHECK" | grep -q "$ALPHA_EIGW"; then echo " ERROR: Alpha's EIGW was deleted by Beta" @@ -1805,8 +1805,8 @@ echo "" echo "Step 7g: Account Settings" echo "----------------------------------------" -$AWS_EC2 enable-ebs-encryption-by-default --profile hive-team-alpha > /dev/null -BETA_ENC=$($AWS_EC2 get-ebs-encryption-by-default --profile hive-team-beta \ +$AWS_EC2 enable-ebs-encryption-by-default --profile spinifex-team-alpha > /dev/null +BETA_ENC=$($AWS_EC2 get-ebs-encryption-by-default --profile spinifex-team-beta \ --query 'EbsEncryptionByDefault' --output text) if [ "$BETA_ENC" != "False" ]; then echo " ERROR: Alpha's encryption setting leaked to Beta (got $BETA_ENC)" @@ -1814,18 +1814,18 @@ if [ "$BETA_ENC" != "False" ]; then fi echo " Alpha enable did not affect Beta" -$AWS_EC2 enable-ebs-encryption-by-default --profile hive-team-beta > /dev/null -$AWS_EC2 disable-ebs-encryption-by-default --profile hive-team-alpha > /dev/null -ALPHA_ENC=$($AWS_EC2 get-ebs-encryption-by-default --profile hive-team-alpha \ +$AWS_EC2 enable-ebs-encryption-by-default --profile spinifex-team-beta > /dev/null +$AWS_EC2 disable-ebs-encryption-by-default --profile spinifex-team-alpha > /dev/null +ALPHA_ENC=$($AWS_EC2 get-ebs-encryption-by-default --profile spinifex-team-alpha \ --query 'EbsEncryptionByDefault' --output text) -BETA_ENC=$($AWS_EC2 get-ebs-encryption-by-default --profile hive-team-beta \ +BETA_ENC=$($AWS_EC2 get-ebs-encryption-by-default --profile spinifex-team-beta \ --query 'EbsEncryptionByDefault' --output text) if [ "$ALPHA_ENC" != "False" ] || [ "$BETA_ENC" != "True" ]; then echo " ERROR: Independent settings failed: alpha=$ALPHA_ENC beta=$BETA_ENC" exit 1 fi echo " Independent toggle verified: alpha=$ALPHA_ENC, beta=$BETA_ENC" -$AWS_EC2 disable-ebs-encryption-by-default --profile hive-team-beta > /dev/null +$AWS_EC2 disable-ebs-encryption-by-default --profile spinifex-team-beta > /dev/null echo " Account settings scoping passed" @@ -1834,9 +1834,9 @@ echo "" echo "Step 7h: Global Resources" echo "----------------------------------------" -ALPHA_REGIONS=$($AWS_EC2 describe-regions --profile hive-team-alpha \ +ALPHA_REGIONS=$($AWS_EC2 describe-regions --profile spinifex-team-alpha \ --query 'Regions[].RegionName' --output text) -BETA_REGIONS=$($AWS_EC2 describe-regions --profile hive-team-beta \ +BETA_REGIONS=$($AWS_EC2 describe-regions --profile spinifex-team-beta \ --query 'Regions[].RegionName' --output text) if [ "$ALPHA_REGIONS" != "$BETA_REGIONS" ]; then echo " ERROR: Regions differ between accounts" @@ -1844,9 +1844,9 @@ if [ "$ALPHA_REGIONS" != "$BETA_REGIONS" ]; then fi echo " Regions identical" -ALPHA_AZS=$($AWS_EC2 describe-availability-zones --profile hive-team-alpha \ +ALPHA_AZS=$($AWS_EC2 describe-availability-zones --profile spinifex-team-alpha \ --query 'AvailabilityZones[].ZoneName' --output text) -BETA_AZS=$($AWS_EC2 describe-availability-zones --profile hive-team-beta \ +BETA_AZS=$($AWS_EC2 describe-availability-zones --profile spinifex-team-beta \ --query 'AvailabilityZones[].ZoneName' --output text) if [ "$ALPHA_AZS" != "$BETA_AZS" ]; then echo " ERROR: AZs differ between accounts" @@ -1854,9 +1854,9 @@ if [ "$ALPHA_AZS" != "$BETA_AZS" ]; then fi echo " Availability zones identical" -ALPHA_TYPES=$($AWS_EC2 describe-instance-types --profile hive-team-alpha \ +ALPHA_TYPES=$($AWS_EC2 describe-instance-types --profile spinifex-team-alpha \ --query 'InstanceTypes[].InstanceType' --output text | tr '\t' '\n' | sort) -BETA_TYPES=$($AWS_EC2 describe-instance-types --profile hive-team-beta \ +BETA_TYPES=$($AWS_EC2 describe-instance-types --profile spinifex-team-beta \ --query 'InstanceTypes[].InstanceType' --output text | tr '\t' '\n' | sort) if [ "$ALPHA_TYPES" != "$BETA_TYPES" ]; then echo " ERROR: Instance types differ between accounts" @@ -1873,14 +1873,14 @@ echo "----------------------------------------" # Empty account (Gamma) echo " Creating empty Gamma account..." -GAMMA_OUTPUT=$(./bin/hive admin account create --name "Team Gamma" --config "$HOME/node1/config/hive.toml" 2>&1) +GAMMA_OUTPUT=$(./bin/spx admin account create --name "Team Gamma" --config "$HOME/node1/config/spinifex.toml" 2>&1) GAMMA_KEY_ID=$(echo "$GAMMA_OUTPUT" | grep "Access Key ID:" | awk '{print $NF}') GAMMA_SECRET=$(echo "$GAMMA_OUTPUT" | grep "Secret Access Key:" | awk '{print $NF}') -aws configure set aws_access_key_id "$GAMMA_KEY_ID" --profile hive-team-gamma -aws configure set aws_secret_access_key "$GAMMA_SECRET" --profile hive-team-gamma -aws configure set region us-east-1 --profile hive-team-gamma +aws configure set aws_access_key_id "$GAMMA_KEY_ID" --profile spinifex-team-gamma +aws configure set aws_secret_access_key "$GAMMA_SECRET" --profile spinifex-team-gamma +aws configure set region us-east-1 --profile spinifex-team-gamma -GAMMA_INSTANCES=$($AWS_EC2 describe-instances --profile hive-team-gamma \ +GAMMA_INSTANCES=$($AWS_EC2 describe-instances --profile spinifex-team-gamma \ --query 'Reservations' --output text) if [ -n "$GAMMA_INSTANCES" ] && [ "$GAMMA_INSTANCES" != "None" ]; then echo " ERROR: Gamma has instances" @@ -1891,7 +1891,7 @@ echo " Gamma: no instances" # Skip volume check: root-account volumes (empty TenantID) are visible to all accounts by design echo " Gamma: volumes skipped (root legacy volumes visible to all)" -GAMMA_KEYS=$($AWS_EC2 describe-key-pairs --profile hive-team-gamma \ +GAMMA_KEYS=$($AWS_EC2 describe-key-pairs --profile spinifex-team-gamma \ --query 'KeyPairs' --output text) if [ -n "$GAMMA_KEYS" ] && [ "$GAMMA_KEYS" != "None" ]; then echo " ERROR: Gamma has key pairs" @@ -1911,28 +1911,28 @@ echo " Root cannot see tenant instances" # Non-existent resource IDs โ€” same error as cross-account expect_error "InvalidVolume.NotFound" \ - $AWS_EC2 delete-volume --volume-id vol-00000000000000000 --profile hive-team-alpha + $AWS_EC2 delete-volume --volume-id vol-00000000000000000 --profile spinifex-team-alpha echo " Non-existent volume: same error as cross-account" expect_error "InvalidSnapshot.NotFound" \ - $AWS_EC2 delete-snapshot --snapshot-id snap-00000000000000000 --profile hive-team-alpha + $AWS_EC2 delete-snapshot --snapshot-id snap-00000000000000000 --profile spinifex-team-alpha echo " Non-existent snapshot: same error as cross-account" # Race condition: parallel key creation from both accounts echo " Testing parallel key creation (race condition)..." for i in $(seq 1 5); do - $AWS_EC2 create-key-pair --key-name "race-alpha-$i" --profile hive-team-alpha > /dev/null & - $AWS_EC2 create-key-pair --key-name "race-beta-$i" --profile hive-team-beta > /dev/null & + $AWS_EC2 create-key-pair --key-name "race-alpha-$i" --profile spinifex-team-alpha > /dev/null & + $AWS_EC2 create-key-pair --key-name "race-beta-$i" --profile spinifex-team-beta > /dev/null & done wait -ALPHA_RACE_COUNT=$($AWS_EC2 describe-key-pairs --profile hive-team-alpha \ +ALPHA_RACE_COUNT=$($AWS_EC2 describe-key-pairs --profile spinifex-team-alpha \ --query 'KeyPairs[].KeyName' --output text | tr '\t' '\n' | grep -c "race-alpha" || true) if [ "$ALPHA_RACE_COUNT" -ne 5 ]; then echo " ERROR: Expected 5 race-alpha keys, got $ALPHA_RACE_COUNT" exit 1 fi -ALPHA_RACE_LEAK=$($AWS_EC2 describe-key-pairs --profile hive-team-alpha \ +ALPHA_RACE_LEAK=$($AWS_EC2 describe-key-pairs --profile spinifex-team-alpha \ --query 'KeyPairs[].KeyName' --output text | tr '\t' '\n' | grep -c "race-beta" || true) if [ "$ALPHA_RACE_LEAK" -ne 0 ]; then echo " ERROR: Alpha sees Beta's race keys (cross-contamination)" @@ -1949,14 +1949,14 @@ echo "========================================" # Terminate instances echo " Terminating account-scoped instances..." -$AWS_EC2 terminate-instances --instance-ids "$ALPHA_INST" --profile hive-team-alpha > /dev/null -$AWS_EC2 terminate-instances --instance-ids "$BETA_INST" --profile hive-team-beta > /dev/null +$AWS_EC2 terminate-instances --instance-ids "$ALPHA_INST" --profile spinifex-team-alpha > /dev/null +$AWS_EC2 terminate-instances --instance-ids "$BETA_INST" --profile spinifex-team-beta > /dev/null COUNT=0 while [ $COUNT -lt 30 ]; do - A_STATE=$($AWS_EC2 describe-instances --instance-ids "$ALPHA_INST" --profile hive-team-alpha \ + A_STATE=$($AWS_EC2 describe-instances --instance-ids "$ALPHA_INST" --profile spinifex-team-alpha \ --query 'Reservations[0].Instances[0].State.Name' --output text 2>/dev/null || echo "terminated") - B_STATE=$($AWS_EC2 describe-instances --instance-ids "$BETA_INST" --profile hive-team-beta \ + B_STATE=$($AWS_EC2 describe-instances --instance-ids "$BETA_INST" --profile spinifex-team-beta \ --query 'Reservations[0].Instances[0].State.Name' --output text 2>/dev/null || echo "terminated") if [ "$A_STATE" == "terminated" ] && [ "$B_STATE" == "terminated" ]; then break @@ -1968,53 +1968,53 @@ echo " Instances terminated" # Delete snapshots echo " Deleting snapshots..." -$AWS_EC2 delete-snapshot --snapshot-id "$ALPHA_SNAP" --profile hive-team-alpha 2>/dev/null || true -$AWS_EC2 delete-snapshot --snapshot-id "$BETA_SNAP" --profile hive-team-beta 2>/dev/null || true +$AWS_EC2 delete-snapshot --snapshot-id "$ALPHA_SNAP" --profile spinifex-team-alpha 2>/dev/null || true +$AWS_EC2 delete-snapshot --snapshot-id "$BETA_SNAP" --profile spinifex-team-beta 2>/dev/null || true # Delete volumes sleep 3 echo " Deleting volumes..." -$AWS_EC2 delete-volume --volume-id "$ALPHA_VOL" --profile hive-team-alpha 2>/dev/null || true -$AWS_EC2 delete-volume --volume-id "$BETA_VOL" --profile hive-team-beta 2>/dev/null || true +$AWS_EC2 delete-volume --volume-id "$ALPHA_VOL" --profile spinifex-team-alpha 2>/dev/null || true +$AWS_EC2 delete-volume --volume-id "$BETA_VOL" --profile spinifex-team-beta 2>/dev/null || true # Delete key pairs echo " Deleting key pairs..." for key in alpha-key alpha-instance-key shared-name imported-key; do - $AWS_EC2 delete-key-pair --key-name "$key" --profile hive-team-alpha 2>/dev/null || true + $AWS_EC2 delete-key-pair --key-name "$key" --profile spinifex-team-alpha 2>/dev/null || true done for key in beta-key beta-instance-key shared-name; do - $AWS_EC2 delete-key-pair --key-name "$key" --profile hive-team-beta 2>/dev/null || true + $AWS_EC2 delete-key-pair --key-name "$key" --profile spinifex-team-beta 2>/dev/null || true done for i in $(seq 1 5); do - $AWS_EC2 delete-key-pair --key-name "race-alpha-$i" --profile hive-team-alpha 2>/dev/null || true - $AWS_EC2 delete-key-pair --key-name "race-beta-$i" --profile hive-team-beta 2>/dev/null || true + $AWS_EC2 delete-key-pair --key-name "race-alpha-$i" --profile spinifex-team-alpha 2>/dev/null || true + $AWS_EC2 delete-key-pair --key-name "race-beta-$i" --profile spinifex-team-beta 2>/dev/null || true done # Delete EIGWs echo " Deleting EIGWs..." $AWS_EC2 delete-egress-only-internet-gateway \ - --egress-only-internet-gateway-id "$ALPHA_EIGW" --profile hive-team-alpha 2>/dev/null || true + --egress-only-internet-gateway-id "$ALPHA_EIGW" --profile spinifex-team-alpha 2>/dev/null || true $AWS_EC2 delete-egress-only-internet-gateway \ - --egress-only-internet-gateway-id "$BETA_EIGW" --profile hive-team-beta 2>/dev/null || true + --egress-only-internet-gateway-id "$BETA_EIGW" --profile spinifex-team-beta 2>/dev/null || true # Detach + delete IGWs echo " Deleting IGWs..." $AWS_EC2 detach-internet-gateway --internet-gateway-id "$ALPHA_IGW" \ - --vpc-id "$ALPHA_VPC" --profile hive-team-alpha 2>/dev/null || true + --vpc-id "$ALPHA_VPC" --profile spinifex-team-alpha 2>/dev/null || true $AWS_EC2 delete-internet-gateway --internet-gateway-id "$ALPHA_IGW" \ - --profile hive-team-alpha 2>/dev/null || true + --profile spinifex-team-alpha 2>/dev/null || true $AWS_EC2 delete-internet-gateway --internet-gateway-id "$BETA_IGW" \ - --profile hive-team-beta 2>/dev/null || true + --profile spinifex-team-beta 2>/dev/null || true # Delete subnets echo " Deleting subnets..." -$AWS_EC2 delete-subnet --subnet-id "$ALPHA_SUBNET" --profile hive-team-alpha 2>/dev/null || true -$AWS_EC2 delete-subnet --subnet-id "$BETA_SUBNET" --profile hive-team-beta 2>/dev/null || true +$AWS_EC2 delete-subnet --subnet-id "$ALPHA_SUBNET" --profile spinifex-team-alpha 2>/dev/null || true +$AWS_EC2 delete-subnet --subnet-id "$BETA_SUBNET" --profile spinifex-team-beta 2>/dev/null || true # Delete VPCs echo " Deleting VPCs..." -$AWS_EC2 delete-vpc --vpc-id "$ALPHA_VPC" --profile hive-team-alpha 2>/dev/null || true -$AWS_EC2 delete-vpc --vpc-id "$BETA_VPC" --profile hive-team-beta 2>/dev/null || true +$AWS_EC2 delete-vpc --vpc-id "$ALPHA_VPC" --profile spinifex-team-alpha 2>/dev/null || true +$AWS_EC2 delete-vpc --vpc-id "$BETA_VPC" --profile spinifex-team-beta 2>/dev/null || true echo " EC2 resources cleaned up" @@ -2023,21 +2023,21 @@ echo " Cleaning up IAM resources..." # Beta cleanup aws $AWS_EP iam detach-user-policy --user-name alice \ - --policy-arn "arn:aws:iam::${BETA_ACCOUNT}:policy/EC2ReadOnly" --profile hive-team-beta + --policy-arn "arn:aws:iam::${BETA_ACCOUNT}:policy/EC2ReadOnly" --profile spinifex-team-beta aws $AWS_EP iam delete-access-key --user-name alice \ - --access-key-id "$BETA_ALICE_KEY_ID" --profile hive-team-beta -aws $AWS_EP iam delete-user --user-name alice --profile hive-team-beta -aws $AWS_EP iam delete-user --user-name dev-user --profile hive-team-beta + --access-key-id "$BETA_ALICE_KEY_ID" --profile spinifex-team-beta +aws $AWS_EP iam delete-user --user-name alice --profile spinifex-team-beta +aws $AWS_EP iam delete-user --user-name dev-user --profile spinifex-team-beta aws $AWS_EP iam delete-policy \ - --policy-arn "arn:aws:iam::${BETA_ACCOUNT}:policy/EC2ReadOnly" --profile hive-team-beta + --policy-arn "arn:aws:iam::${BETA_ACCOUNT}:policy/EC2ReadOnly" --profile spinifex-team-beta # Alpha cleanup (alice already deleted in Step 6) -aws $AWS_EP iam delete-user --user-name team-member --profile hive-team-alpha +aws $AWS_EP iam delete-user --user-name team-member --profile spinifex-team-alpha aws $AWS_EP iam delete-policy \ - --policy-arn "arn:aws:iam::${ALPHA_ACCOUNT}:policy/EC2ReadOnly" --profile hive-team-alpha + --policy-arn "arn:aws:iam::${ALPHA_ACCOUNT}:policy/EC2ReadOnly" --profile spinifex-team-alpha # Clean up AWS CLI profiles -for p in hive-team-alpha hive-team-beta hive-alpha-alice hive-beta-alice hive-team-gamma; do +for p in spinifex-team-alpha spinifex-team-beta spinifex-alpha-alice spinifex-beta-alice spinifex-team-gamma; do aws configure set aws_access_key_id "" --profile $p 2>/dev/null || true aws configure set aws_secret_access_key "" --profile $p 2>/dev/null || true done @@ -2282,7 +2282,7 @@ echo " VPC networking tests passed" echo "" echo "Phase 6: Cluster Shutdown + Restart" echo "========================================" -echo "Testing hive admin cluster shutdown command..." +echo "Testing spx admin cluster shutdown command..." # Test 6a: Dry-run shutdown echo "" @@ -2290,7 +2290,7 @@ echo "Test 6a: Dry-Run Shutdown" echo "----------------------------------------" echo "Running cluster shutdown in dry-run mode..." -DRY_RUN_OUTPUT=$(./bin/hive admin cluster shutdown --dry-run --config "$HOME/node1/config/hive.toml" 2>&1) +DRY_RUN_OUTPUT=$(./bin/spx admin cluster shutdown --dry-run --config "$HOME/node1/config/spinifex.toml" 2>&1) echo "$DRY_RUN_OUTPUT" # Validate dry-run output contains expected phases @@ -2309,7 +2309,7 @@ echo "Test 6b: Coordinated Cluster Shutdown" echo "----------------------------------------" echo "Running cluster shutdown..." -./bin/hive admin cluster shutdown --force --timeout 30s --config "$HOME/node1/config/hive.toml" 2>&1 || { +./bin/spx admin cluster shutdown --force --timeout 30s --config "$HOME/node1/config/spinifex.toml" 2>&1 || { echo " WARNING: Cluster shutdown command returned non-zero exit code" } CLUSTER_SERVICES_STARTED="false" diff --git a/tests/e2e/run-vpc-e2e.sh b/tests/e2e/run-vpc-e2e.sh index 2f74ee3a2..bea623ee9 100755 --- a/tests/e2e/run-vpc-e2e.sh +++ b/tests/e2e/run-vpc-e2e.sh @@ -2,7 +2,7 @@ set -e # VPC E2E Test Suite -# Tests VPC networking operations via the AWS CLI against a running Hive cluster. +# Tests VPC networking operations via the AWS CLI against a running Spinifex cluster. # Can run with or without OVN โ€” skips network-level tests when OVN is unavailable. # # Usage: @@ -12,7 +12,7 @@ set -e cd "$(dirname "$0")/../.." ENDPOINT="${ENDPOINT:-https://127.0.0.1:9999}" -export AWS_PROFILE=hive +export AWS_PROFILE=spinifex AWS_EC2="aws --endpoint-url ${ENDPOINT} ec2" PASSED=0