diff --git a/INSTALL.md b/INSTALL.md index a8e01aef8..137667c3f 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,3 +1,3 @@ -# Hive Installation +# Spinifex Installation -For documentation on using and installing Hive see [https://docs.mulgadc.com](https://docs.mulgadc.com/) +For documentation on using and installing Spinifex see [https://docs.mulgadc.com](https://docs.mulgadc.com/) diff --git a/README.md b/README.md index 4e1649ff6..8d931afee 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# Hive: An Open Source AWS-Compatible Stack for Bare-Metal, Edge, and On-Prem Deployments +# Spinifex: An Open Source AWS-Compatible Stack for Bare-Metal, Edge, and On-Prem Deployments -(Developer Preview) - Hive developed by [Mulga Defense Corporation](https://mulgadc.com/) is an open source infrastructure platform that brings the core services of AWS—like EC2, VPC, EBS, and S3—to environments where running in the cloud isn't an option. Whether you're deploying to edge sites, private data-centers, or need to operate in low-connectivity or highly contested environments, Hive gives you AWS-style workflows on your own hardware. +(Developer Preview) - Spinifex developed by [Mulga Defense Corporation](https://mulgadc.com/) is an open source infrastructure platform that brings the core services of AWS—like EC2, VPC, EBS, and S3—to environments where running in the cloud isn't an option. Whether you're deploying to edge sites, private data-centers, or need to operate in low-connectivity or highly contested environments, Spinifex gives you AWS-style workflows on your own hardware. -## What is Hive? +## What is Spinifex? -Hive replicates essential AWS primitives—virtual machines, block volumes, and object storage—using lightweight, self-contained components that are easy to deploy and integrate. +Spinifex replicates essential AWS primitives—virtual machines, block volumes, and object storage—using lightweight, self-contained components that are easy to deploy and integrate. It’s designed for developers and operators who need: @@ -13,13 +13,13 @@ It’s designed for developers and operators who need: - Drop-in compatibility with tools like the AWS CLI, SDKs, and Terraform - A secure cloud environment you control and own the entire hardware, network and software stack -You can run Hive on a few servers in a rack, a field site, or anywhere centralized cloud services aren’t feasible. +You can run Spinifex on a few servers in a rack, a field site, or anywhere centralized cloud services aren’t feasible. ## Core Components -### Hive (Compute Service – EC2 Alternative) +### Spinifex (Compute Service – EC2 Alternative) -Hive is a minimal VM orchestration layer built on top of QEMU, exposing APIs similar to EC2. It manages lifecycle operations like start, stop, and terminate, using QEMU’s QMP interface. Designed to be straightforward and scriptable, Hive lets you launch VMs using the AWS CLI, SDKs, or Terraform—without needing Kubernetes or heavyweight orchestrators. Keep in mind, you can also setup a Kubernetes environment using Hive with underlying instances. +Spinifex is a minimal VM orchestration layer built on top of QEMU, exposing APIs similar to EC2. It manages lifecycle operations like start, stop, and terminate, using QEMU’s QMP interface. Designed to be straightforward and scriptable, Spinifex lets you launch VMs using the AWS CLI, SDKs, or Terraform—without needing Kubernetes or heavyweight orchestrators. Keep in mind, you can also setup a Kubernetes environment using Spinifex with underlying instances. - EC2-like VM management on bare metal - Launches with cloud-init metadata support @@ -54,21 +54,21 @@ AWS-Compatible Interfaces – Provision infrastructure with awscli, Terraform, o ## Installation -Installation requires an Ubuntu / Debian system. See the detailed documentation at [https://docs.mulgadc.com](https://docs.mulgadc.com/) for maintaining and installing Hive. +Installation requires an Ubuntu / Debian system. See the detailed documentation at [https://docs.mulgadc.com](https://docs.mulgadc.com/) for maintaining and installing Spinifex. ### Single node install The installation is straightforward to set up and running on a single node for testing purposes. ```bash -export AWS_PROFILE=hive +export AWS_PROFILE=spinifex export AWS_REGION=ap-southeast-2-sc ``` ```bash curl https://install.mulgadc.com/ | bash -hive admin init --region $AWS_REGION +spx admin init --region $AWS_REGION aws ec2 describe-instance-types ``` @@ -79,7 +79,7 @@ For a complete development environment see the [Source Install](https://docs.mul ### Component Repositories -Hive coordinates these independent components: +Spinifex coordinates these independent components: - **[Predastore](https://github.com/mulgadc/predastore)** - S3-compatible object storage - **[Viperblock](https://github.com/mulgadc/viperblock)** - EBS-compatible block storage @@ -90,7 +90,7 @@ Each component can be developed independently. See component-specific documentat ### Built by Engineers, For Engineers -Hive is developed by experienced infrastructure engineers with deep AWS expertise, including former AWS team members who understand the intricacies of building production-grade cloud services. Our team brings decades of combined experience from AWS, enterprise infrastructure, and edge computing environments. +Spinifex is developed by experienced infrastructure engineers with deep AWS expertise, including former AWS team members who understand the intricacies of building production-grade cloud services. Our team brings decades of combined experience from AWS, enterprise infrastructure, and edge computing environments. **Real-World Experience:** @@ -101,7 +101,7 @@ Hive is developed by experienced infrastructure engineers with deep AWS expertis ### AI-Assisted Development -While Hive is architected and implemented by experienced engineers, we leverage **Claude Code** (Anthropic's AI coding assistant) to accelerate certain development tasks. This approach combines human expertise with AI efficiency: +While Spinifex is architected and implemented by experienced engineers, we leverage **Claude Code** (Anthropic's AI coding assistant) to accelerate certain development tasks. This approach combines human expertise with AI efficiency: **How We Use Claude Code:** @@ -117,8 +117,8 @@ While Hive is architected and implemented by experienced engineers, we leverage - **Performance Optimization**: Real-world performance tuning and benchmarking - **Production Operations**: Deployment strategies and operational procedures -This hybrid approach ensures Hive benefits from both proven engineering expertise and modern development acceleration, while maintaining the quality and reliability standards required for production infrastructure. +This hybrid approach ensures Spinifex benefits from both proven engineering expertise and modern development acceleration, while maintaining the quality and reliability standards required for production infrastructure. ## License -Hive is open source under the Apache 2.0 License. You're free to use, modify, and deploy it—anywhere you need reliable infrastructure without depending on centralized cloud platforms. +Spinifex is open source under the Apache 2.0 License. You're free to use, modify, and deploy it—anywhere you need reliable infrastructure without depending on centralized cloud platforms. diff --git a/config/README.md b/config/README.md index 69faa1467..8fcb009f2 100644 --- a/config/README.md +++ b/config/README.md @@ -1,71 +1,71 @@ -# Hive Systemd Service +# Spinifex Systemd Service -This directory contains the systemd service configuration for running Hive services on Ubuntu and Debian systems. +This directory contains the systemd service configuration for running Spinifex services on Ubuntu and Debian systems. ## Files -- `hive.service` - The systemd service file that manages all Hive services -- `install-hive-service.sh` - Installation script to set up the service +- `spinifex.service` - The systemd service file that manages all Spinifex services +- `install-spinifex-service.sh` - Installation script to set up the service - `README.md` - This documentation file ## Installation ### Prerequisites -1. Ensure Hive is installed in `/opt/hive/` -2. Ensure the `hive` binary is available at `/opt/hive/bin/hive` +1. Ensure Spinifex is installed in `/opt/spinifex/` +2. Ensure the `spx` binary is available at `/opt/spinifex/bin/spx` 3. Run the installation script as root ### Setup Configuration ``` -/opt/hive/bin/hive admin init +/opt/spinifex/bin/spx admin init ``` -This will init the Hive environment and create the default configuration files in the home directory, e.g `~/hive/`. +This will init the Spinifex environment and create the default configuration files in the home directory, e.g `~/spinifex/`. ``` -/home/username/hive: +/home/username/spinifex: amis config images logs nats predastore state viperblock volumes -/home/username/hive/amis: +/home/username/spinifex/amis: -/home/username/hive/config: -awsgw hive.toml nats predastore server.key server.pem +/home/username/spinifex/config: +awsgw spinifex.toml nats predastore server.key server.pem -/home/username/hive/config/awsgw: +/home/username/spinifex/config/awsgw: awsgw.toml -/home/username/hive/config/nats: +/home/username/spinifex/config/nats: nats.conf -/home/username/hive/config/predastore: +/home/username/spinifex/config/predastore: predastore.toml -/home/username/hive/images: +/home/username/spinifex/images: -/home/username/hive/logs: -awsgw.log awsgw.pid hive.log hive.pid nats.log nats.pid predastore.log predastore.pid viperblock.log viperblock.pid +/home/username/spinifex/logs: +awsgw.log awsgw.pid spinifex.log spinifex.pid nats.log nats.pid predastore.log predastore.pid viperblock.log viperblock.pid -/home/username/hive/nats: +/home/username/spinifex/nats: -/home/username/hive/predastore: +/home/username/spinifex/predastore: data -/home/username/hive/predastore/data: +/home/username/spinifex/predastore/data: predastore -/home/ben/hive/state: +/home/ben/spinifex/state: -/home/ben/hive/viperblock: +/home/ben/spinifex/viperblock: -/home/ben/hive/volumes: +/home/ben/spinifex/volumes: ``` ### Quick Installation ```bash -sudo ./config/install-hive-service.sh +sudo ./config/install-spinifex-service.sh ``` ### Manual Installation @@ -74,7 +74,7 @@ If you prefer to install manually: 1. Copy the service file: ```bash - sudo cp config/hive.service /etc/systemd/system/ + sudo cp config/spinifex.service /etc/systemd/system/ ``` 2. Reload systemd: @@ -84,44 +84,44 @@ If you prefer to install manually: 3. Enable the service: ```bash - sudo systemctl enable hive.service + sudo systemctl enable spinifex.service ``` ## Service Management ### Start the service ```bash -sudo systemctl start hive +sudo systemctl start spinifex ``` ### Stop the service ```bash -sudo systemctl stop hive +sudo systemctl stop spinifex ``` ### Check service status ```bash -sudo systemctl status hive +sudo systemctl status spinifex ``` ### Restart the service ```bash -sudo systemctl restart hive +sudo systemctl restart spinifex ``` ### View service logs ```bash -sudo journalctl -u hive -f +sudo journalctl -u spinifex -f ``` ### Disable auto-start ```bash -sudo systemctl disable hive +sudo systemctl disable spinifex ``` ## Service Details -The `hive.service` file: +The `spinifex.service` file: - Starts services in the correct order: NATS → Predastore → Viperblock - Includes proper delays between service starts to ensure dependencies are ready @@ -143,41 +143,41 @@ The service starts the following components in order: ### Check if the service is running ```bash -sudo systemctl is-active hive +sudo systemctl is-active spinifex ``` ### View recent logs ```bash -sudo journalctl -u hive --since "1 hour ago" +sudo journalctl -u spinifex --since "1 hour ago" ``` ### Check service configuration ```bash -sudo systemctl cat hive +sudo systemctl cat spinifex ``` ### Verify binary exists ```bash -ls -la /opt/hive/bin/hive +ls -la /opt/spinifex/bin/spx ``` ### Test service commands manually ```bash -/opt/hive/bin/hive service nats start -/opt/hive/bin/hive service predastore start -/opt/hive/bin/hive service viperblock start +/opt/spinifex/bin/spx service nats start +/opt/spinifex/bin/spx service predastore start +/opt/spinifex/bin/spx service viperblock start ``` ## Customization If you need to modify the service configuration: -1. Edit the service file: `sudo nano /etc/systemd/system/hive.service` +1. Edit the service file: `sudo nano /etc/systemd/system/spinifex.service` 2. Reload systemd: `sudo systemctl daemon-reload` -3. Restart the service: `sudo systemctl restart hive` +3. Restart the service: `sudo systemctl restart spinifex` ## Security Notes - The service runs as root, which is necessary for system-level services - Security hardening is enabled with `ProtectSystem=strict` and `NoNewPrivileges=true` -- Only specific paths are writable: `/opt/hive`, `/var/log`, `/var/run` \ No newline at end of file +- Only specific paths are writable: `/opt/spinifex`, `/var/log`, `/var/run` \ No newline at end of file diff --git a/docs/COMMANDS.md b/docs/COMMANDS.md index c8c379c84..4265b66ea 100644 --- a/docs/COMMANDS.md +++ b/docs/COMMANDS.md @@ -1,36 +1,36 @@ # Command Implementation Matrix -## Hive Admin CLI +## Spinifex Admin CLI Platform management commands not exposed via the AWS gateway API. These are CLI-only commands. ### Service Management -Service lifecycle commands for starting, stopping, and checking status of all Hive cluster services. Each service subcommand supports `start`, `stop`, and `status` operations. +Service lifecycle commands for starting, stopping, and checking status of all Spinifex cluster services. Each service subcommand supports `start`, `stop`, and `status` operations. | Command | Flags | Prerequisites | Basic Logic | Status | |---------|-------|---------------|-------------|--------| -| `hive service predastore start` | `--port` (default: 8443), `--host` (default: 0.0.0.0), `--base-path`, `--config-path`, `--debug`, `--tls-cert`, `--tls-key`, `--backend` (distributed/filesystem, default: distributed), `--node-id` (default: 0), `--pprof`, `--pprof-output` | TLS cert/key, base-path, config-path required | Creates predastore service instance with S3-compatible storage backend → starts service | **DONE** | -| `hive service predastore stop` | — | Predastore must be running | Stops the predastore service | **DONE** | -| `hive service predastore status` | — | None | Reports predastore service status | **DONE** | -| `hive service viperblock start` | `--s3-host` (default: 0.0.0.0:8443), `--s3-bucket` (default: predastore), `--s3-region` (default: ap-southeast-2), `--plugin-path` (default: /opt/hive/lib/nbdkit-viperblock-plugin.so) | `--config` required, plugin-path must exist on disk | Loads cluster config → connects to NATS and Predastore → starts viperblock block storage service with NBD plugin | **DONE** | -| `hive service viperblock stop` | — | Viperblock must be running | Stops the viperblock service | **DONE** | -| `hive service viperblock status` | — | None | Reports viperblock service status | **DONE** | -| `hive service nats start` | `--port` (default: 4222), `--host` (default: 0.0.0.0), `--debug`, `--data-dir`, `--jetstream` | None | Starts embedded NATS server with optional JetStream | **DONE** | -| `hive service nats stop` | — | NATS must be running | Stops the NATS service | **DONE** | -| `hive service nats status` | — | None | Reports NATS service status | **DONE** | -| `hive service hive start` | `--wal-dir` | `--config` required | Loads cluster config → starts hive daemon (VM orchestration, NATS subscriptions, health endpoint) | **DONE** | -| `hive service hive stop` | — | Hive daemon must be running | Stops the hive daemon service | **DONE** | -| `hive service hive status` | — | None | Reports hive daemon service status | **DONE** | -| `hive service awsgw start` | `--host` (default: 0.0.0.0:9999), `--tls-cert`, `--tls-key`, `--debug` | `--config` required | Loads cluster config → starts AWS-compatible gateway with SigV4 auth, IAM policy enforcement, TLS | **DONE** | -| `hive service awsgw stop` | — | AWS gateway must be running | Stops the AWS gateway service | **DONE** | -| `hive service awsgw status` | — | None | Reports AWS gateway service status | **DONE** | -| `hive service hive-ui start` | `--port` (default: 3000), `--host` (default: 0.0.0.0), `--tls-cert`, `--tls-key` | None | Starts embedded web UI server serving the React frontend. Aliases: `ui`, `hiveui` | **DONE** | -| `hive service hive-ui stop` | — | hive-ui must be running | Stops the hive-ui service | **DONE** | -| `hive service hive-ui status` | — | None | Reports hive-ui service status | **DONE** | -| `hive service vpcd start` | — | `--config` required, OVN/OVS installed | Loads cluster config → starts VPC daemon (subscribes to `vpc.*` NATS events, translates to OVN logical switches/ports/routers) | **DONE** | -| `hive service vpcd stop` | — | vpcd must be running | Stops the vpcd service | **DONE** | -| `hive service vpcd status` | — | None | Reports vpcd service status | **DONE** | +| `spx service predastore start` | `--port` (default: 8443), `--host` (default: 0.0.0.0), `--base-path`, `--config-path`, `--debug`, `--tls-cert`, `--tls-key`, `--backend` (distributed/filesystem, default: distributed), `--node-id` (default: 0), `--pprof`, `--pprof-output` | TLS cert/key, base-path, config-path required | Creates predastore service instance with S3-compatible storage backend → starts service | **DONE** | +| `spx service predastore stop` | — | Predastore must be running | Stops the predastore service | **DONE** | +| `spx service predastore status` | — | None | Reports predastore service status | **DONE** | +| `spx service viperblock start` | `--s3-host` (default: 0.0.0.0:8443), `--s3-bucket` (default: predastore), `--s3-region` (default: ap-southeast-2), `--plugin-path` (default: /opt/spinifex/lib/nbdkit-viperblock-plugin.so) | `--config` required, plugin-path must exist on disk | Loads cluster config → connects to NATS and Predastore → starts viperblock block storage service with NBD plugin | **DONE** | +| `spx service viperblock stop` | — | Viperblock must be running | Stops the viperblock service | **DONE** | +| `spx service viperblock status` | — | None | Reports viperblock service status | **DONE** | +| `spx service nats start` | `--port` (default: 4222), `--host` (default: 0.0.0.0), `--debug`, `--data-dir`, `--jetstream` | None | Starts embedded NATS server with optional JetStream | **DONE** | +| `spx service nats stop` | — | NATS must be running | Stops the NATS service | **DONE** | +| `spx service nats status` | — | None | Reports NATS service status | **DONE** | +| `spx service spinifex start` | `--wal-dir` | `--config` required | Loads cluster config → starts spinifex daemon (VM orchestration, NATS subscriptions, health endpoint) | **DONE** | +| `spx service spinifex stop` | — | Spinifex daemon must be running | Stops the spinifex daemon service | **DONE** | +| `spx service spinifex status` | — | None | Reports spinifex daemon service status | **DONE** | +| `spx service awsgw start` | `--host` (default: 0.0.0.0:9999), `--tls-cert`, `--tls-key`, `--debug` | `--config` required | Loads cluster config → starts AWS-compatible gateway with SigV4 auth, IAM policy enforcement, TLS | **DONE** | +| `spx service awsgw stop` | — | AWS gateway must be running | Stops the AWS gateway service | **DONE** | +| `spx service awsgw status` | — | None | Reports AWS gateway service status | **DONE** | +| `spx service spinifex-ui start` | `--port` (default: 3000), `--host` (default: 0.0.0.0), `--tls-cert`, `--tls-key` | None | Starts embedded web UI server serving the React frontend. Aliases: `ui`, `spinifexui` | **DONE** | +| `spx service spinifex-ui stop` | — | spinifex-ui must be running | Stops the spinifex-ui service | **DONE** | +| `spx service spinifex-ui status` | — | None | Reports spinifex-ui service status | **DONE** | +| `spx service vpcd start` | — | `--config` required, OVN/OVS installed | Loads cluster config → starts VPC daemon (subscribes to `vpc.*` NATS events, translates to OVN logical switches/ports/routers) | **DONE** | +| `spx service vpcd stop` | — | vpcd must be running | Stops the vpcd service | **DONE** | +| `spx service vpcd status` | — | None | Reports vpcd service status | **DONE** | ### Cluster Inspection @@ -38,41 +38,41 @@ Operational commands for inspecting cluster state. These fan out NATS requests t | Command | Flags | Prerequisites | Basic Logic | Output Columns | Status | |---------|-------|---------------|-------------|----------------|--------| -| `hive get nodes` | `--timeout` (default: 3s) | Cluster must be running (NATS) | Loads config → publishes to `hive.node.status` fan-out topic → collects responses within timeout → merges config-known nodes with NATS responders → nodes that don't respond shown as `NotReady` | NAME, STATUS, IP, REGION, AZ, UPTIME, VMs, SERVICES | **DONE** | -| `hive get vms` | `--timeout` (default: 3s) | Cluster must be running (NATS) | Publishes to `hive.node.vms` fan-out topic → collects VM info from all nodes → sorts by node then instance ID → prints table. Alias: `hive get instances` | INSTANCE, STATUS, TYPE, VCPU, MEM, NODE, IP, AGE | **DONE** | +| `spx get nodes` | `--timeout` (default: 3s) | Cluster must be running (NATS) | Loads config → publishes to `spinifex.node.status` fan-out topic → collects responses within timeout → merges config-known nodes with NATS responders → nodes that don't respond shown as `NotReady` | NAME, STATUS, IP, REGION, AZ, UPTIME, VMs, SERVICES | **DONE** | +| `spx get vms` | `--timeout` (default: 3s) | Cluster must be running (NATS) | Publishes to `spinifex.node.vms` fan-out topic → collects VM info from all nodes → sorts by node then instance ID → prints table. Alias: `spx get instances` | INSTANCE, STATUS, TYPE, VCPU, MEM, NODE, IP, AGE | **DONE** | ### Resource Monitoring | Command | Flags | Prerequisites | Basic Logic | Output | Status | |---------|-------|---------------|-------------|--------|--------| -| `hive top nodes` | `--timeout` (default: 3s) | Cluster must be running (NATS) | Publishes to `hive.node.status` fan-out topic → collects CPU/memory usage per node → aggregates instance type capacity across all nodes → prints two tables: per-node resource usage and cluster-wide instance type availability | Table 1: NAME, CPU (used/total), MEM (used/total), VMs. Table 2: INSTANCE TYPE, AVAILABLE, VCPU, MEMORY | **DONE** | +| `spx top nodes` | `--timeout` (default: 3s) | Cluster must be running (NATS) | Publishes to `spinifex.node.status` fan-out topic → collects CPU/memory usage per node → aggregates instance type capacity across all nodes → prints two tables: per-node resource usage and cluster-wide instance type availability | Table 1: NAME, CPU (used/total), MEM (used/total), VMs. Table 2: INSTANCE TYPE, AVAILABLE, VCPU, MEMORY | **DONE** | ### Cluster Initialization | Command | Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------|---------------|-------------|------------|--------| -| `hive admin init` | `--nodes`, `--node`, `--bind`, `--port`, `--region`, `--az`, `--cluster-name`, `--cluster-bind`, `--cluster-routes`, `--predastore-nodes`, `--services`, `--formation-timeout`, `--force` | None (first-time setup) | Generates root IAM credentials (AKIA-prefixed access key + secret) → creates master.key (AES-256, 32 bytes, 0600) → writes bootstrap.json (consumed on first start) → generates CA + server TLS certificates → creates NATS config with auth token → writes hive.toml, awsgw.toml, predastore.toml → configures AWS CLI `hive` profile → creates directory structure under `~/hive/` | 1. Init creates all config files
2. Root credentials printed once
3. master.key is 32 bytes, mode 0600
4. bootstrap.json consumed on first start
5. `--force` re-initializes existing config
6. AWS CLI profile `hive` auto-configured | **DONE** | -| `hive admin join` | `--host` (required), `--node` (required), `--bind`, `--port`, `--region`, `--az`, `--cluster-bind`, `--cluster-routes`, `--data-dir`, `--services` | Leader node must be running | Connects to leader node → retrieves cluster configuration → configures local node to join cluster and participate in distributed operations | 1. Join existing cluster
2. Missing host (error)
3. Missing node name (error) | **DONE** | +| `spx admin init` | `--nodes`, `--node`, `--bind`, `--port`, `--region`, `--az`, `--cluster-name`, `--cluster-bind`, `--cluster-routes`, `--predastore-nodes`, `--services`, `--formation-timeout`, `--force` | None (first-time setup) | Generates root IAM credentials (AKIA-prefixed access key + secret) → creates master.key (AES-256, 32 bytes, 0600) → writes bootstrap.json (consumed on first start) → generates CA + server TLS certificates → creates NATS config with auth token → writes spinifex.toml, awsgw.toml, predastore.toml → configures AWS CLI `spx` profile → creates directory structure under `~/spinifex/` | 1. Init creates all config files
2. Root credentials printed once
3. master.key is 32 bytes, mode 0600
4. bootstrap.json consumed on first start
5. `--force` re-initializes existing config
6. AWS CLI profile `spx` auto-configured | **DONE** | +| `spx admin join` | `--host` (required), `--node` (required), `--bind`, `--port`, `--region`, `--az`, `--cluster-bind`, `--cluster-routes`, `--data-dir`, `--services` | Leader node must be running | Connects to leader node → retrieves cluster configuration → configures local node to join cluster and participate in distributed operations | 1. Join existing cluster
2. Missing host (error)
3. Missing node name (error) | **DONE** | ### Cluster Operations | Command | Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------|---------------|-------------|------------|--------| -| `hive admin cluster shutdown` | — | Cluster must be running | Gracefully shuts down the entire cluster | 1. Shutdown running cluster
2. All nodes stop cleanly | **DONE** | +| `spx admin cluster shutdown` | — | Cluster must be running | Gracefully shuts down the entire cluster | 1. Shutdown running cluster
2. All nodes stop cleanly | **DONE** | ### Account Management | Command | Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------|---------------|-------------|------------|--------| -| `hive admin account create` | `--name` | Cluster must be running (NATS), master key must exist | Connects to NATS → CAS loop on `hive-account-counter:next_id` for sequential 12-digit ID → creates Account record in `hive-accounts` KV → creates `admin` user in new account → creates access key for admin → creates AdministratorAccess policy (Action:*, Resource:*) → attaches policy → prints credentials | 1. Create first account (ID 000000000001)
2. Sequential IDs (000000000002, etc.)
3. Admin user has full access
4. Credentials printed once | **DONE** | -| `hive admin account list` | — | Cluster must be running (NATS), master key must exist | Connects to NATS → IAMService.ListAccounts() → prints table with Account ID, Name, Status, Created | 1. List all accounts
2. Empty list (only global account) | **DONE** | +| `spx admin account create` | `--name` | Cluster must be running (NATS), master key must exist | Connects to NATS → CAS loop on `spinifex-account-counter:next_id` for sequential 12-digit ID → creates Account record in `spinifex-accounts` KV → creates `admin` user in new account → creates access key for admin → creates AdministratorAccess policy (Action:*, Resource:*) → attaches policy → prints credentials | 1. Create first account (ID 000000000001)
2. Sequential IDs (000000000002, etc.)
3. Admin user has full access
4. Credentials printed once | **DONE** | +| `spx admin account list` | — | Cluster must be running (NATS), master key must exist | Connects to NATS → IAMService.ListAccounts() → prints table with Account ID, Name, Status, Created | 1. List all accounts
2. Empty list (only global account) | **DONE** | ### Image Management | Command | Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------|---------------|-------------|------------|--------| -| `hive admin images import` | `--name` | Cluster must be running, image file must exist locally | Imports a local disk image (QCOW2) as an AMI → uploads to Predastore S3 → registers as available AMI | 1. Import valid QCOW2 image
2. Image appears in `describe-images` | **DONE** | -| `hive admin images list` | — | None | Lists available OS images that can be imported or downloaded | 1. List available images | **DONE** | +| `spx admin images import` | `--name` | Cluster must be running, image file must exist locally | Imports a local disk image (QCOW2) as an AMI → uploads to Predastore S3 → registers as available AMI | 1. Import valid QCOW2 image
2. Image appears in `describe-images` | **DONE** | +| `spx admin images list` | — | None | Lists available OS images that can be imported or downloaded | 1. List available images | **DONE** | ## AWS Commands @@ -87,7 +87,7 @@ Operational commands for inspecting cluster state. These fan out NATS requests t | `terminate-instances` | `--instance-ids`, `DeleteOnTermination` (per-volume flag, default true) | `--dry-run` | `run-instances` (instance must exist) | Gateway sends NATS to target node → daemon kills QEMU process → cleans up NBD mounts → deletes volumes with `DeleteOnTermination=true` via `volumeService.DeleteVolume()` (S3 cleanup of vol/, vol-efi/, vol-cloudinit/) → internal volumes (EFI, cloud-init) always cleaned up via `ebs.delete` NATS → volumes with `DeleteOnTermination=false` left in available state → state→terminated | 1. Terminate running instance
2. Terminate stopped instance
3. Terminate with DeleteOnTermination=true deletes volumes
4. Terminate with DeleteOnTermination=false preserves volumes
5. Terminate already-terminated (idempotent)
6. Internal volumes (EFI, cloud-init) always cleaned up
7. Invalid instance ID | **DONE** | | `reboot-instances` | — | `--instance-ids`, `--dry-run` | `run-instances` (instance must be running) | Gateway sends NATS to target node → daemon issues QMP `system_reset` → instance reboots without stopping | 1. Reboot running instance
2. Reboot stopped instance (error)
3. Verify instance stays in running state after reboot | **NOT STARTED** (parser test exists) | | `describe-instance-types` | `--filters` (capacity filter only) | `--instance-types`, `--max-results`, `--next-token`, `--dry-run`, all other filters | None | Gateway fans out NATS `ec2.DescribeInstanceTypes` to all nodes → each daemon reports supported types (t3.micro/small/medium/large) with vCPU/memory specs → gateway deduplicates and returns | 1. List all instance types
2. Filter by specific type
3. Filter with `capacity=true` shows available slots
4. Verify vCPU/memory specs match hardware | **DONE** | -| `modify-instance-attribute` | `--instance-id`, `--instance-type`, `--user-data` | `--disable-api-termination`, `--ebs-optimized`, `--source-dest-check`, `--instance-initiated-shutdown-behavior`, `--block-device-mappings`, `--groups`, `--ena-support`, `--sriov-net-support` | Instance must be stopped (in NATS KV) | Gateway validates input (exactly one attribute per call, instance ID format) → NATS `ec2.ModifyInstanceAttribute` with `hive-workers` queue group → daemon loads stopped instance from JetStream KV → applies attribute change → writes back to KV → returns `{}` on success. **InstanceType**: updates vm.InstanceType, Config, and Instance fields; clears StateReason (enables recovery from instance-type-missing bug). **UserData**: stores decoded content in vm.UserData and re-encodes to base64 for RunInstancesInput (cloud-init on next start). No instance type pre-validation (matches AWS — invalid types accepted, fail at StartInstances time). | 1. Change instance type while stopped
2. Change user data while stopped
3. Modify running instance (error: NotFound — running instances not in KV)
4. Instance not found (error: InvalidInstanceID.NotFound)
5. Instance not stopped (error: IncorrectInstanceState)
6. Invalid instance type accepted (fails on start with InsufficientInstanceCapacity)
7. StateReason cleared on type change (recovery from capacity-unavailable)
8. Missing/malformed instance ID (error: InvalidInstanceID.Malformed)
9. No attribute set (error: InvalidParameterValue)
10. Multiple attributes in one call (error: InvalidParameterValue) | **DONE** | +| `modify-instance-attribute` | `--instance-id`, `--instance-type`, `--user-data` | `--disable-api-termination`, `--ebs-optimized`, `--source-dest-check`, `--instance-initiated-shutdown-behavior`, `--block-device-mappings`, `--groups`, `--ena-support`, `--sriov-net-support` | Instance must be stopped (in NATS KV) | Gateway validates input (exactly one attribute per call, instance ID format) → NATS `ec2.ModifyInstanceAttribute` with `spinifex-workers` queue group → daemon loads stopped instance from JetStream KV → applies attribute change → writes back to KV → returns `{}` on success. **InstanceType**: updates vm.InstanceType, Config, and Instance fields; clears StateReason (enables recovery from instance-type-missing bug). **UserData**: stores decoded content in vm.UserData and re-encodes to base64 for RunInstancesInput (cloud-init on next start). No instance type pre-validation (matches AWS — invalid types accepted, fail at StartInstances time). | 1. Change instance type while stopped
2. Change user data while stopped
3. Modify running instance (error: NotFound — running instances not in KV)
4. Instance not found (error: InvalidInstanceID.NotFound)
5. Instance not stopped (error: IncorrectInstanceState)
6. Invalid instance type accepted (fails on start with InsufficientInstanceCapacity)
7. StateReason cleared on type change (recovery from capacity-unavailable)
8. Missing/malformed instance ID (error: InvalidInstanceID.Malformed)
9. No attribute set (error: InvalidParameterValue)
10. Multiple attributes in one call (error: InvalidParameterValue) | **DONE** | | `get-console-output` | `--instance-id` | `--latest` (always returns latest), `--dry-run` | Instance must be running on a node | Gateway sends NATS `ec2.{instanceId}.GetConsoleOutput` (per-instance topic, routed to owning node) → daemon reads console log file from disk → returns last 64KB base64-encoded with timestamp. Always available regardless of serial console access setting (matches AWS behavior). | 1. Get output from running instance
2. Empty log file returns empty output
3. Instance not found (error: InvalidInstanceID.NotFound) | **DONE** | | `monitor-instances` | — | `--instance-ids` | Instance must exist | Enable basic monitoring (CPU, disk, network) → store metrics in NATS KV → return monitoring state | 1. Enable monitoring
2. Verify monitoring state in describe-instances | **NOT STARTED** | | `unmonitor-instances` | — | `--instance-ids` | Instance must exist | Disable detailed monitoring → revert to basic monitoring → return monitoring state | 1. Disable monitoring
2. Verify monitoring state reverts in describe-instances | **NOT STARTED** | @@ -121,7 +121,7 @@ Operational commands for inspecting cluster state. These fan out NATS requests t |---------|-------------------|---------------|---------------|-------------|------------|--------| | `describe-volumes` | `--volume-ids` (fast-path lookup), `DeleteOnTermination` (from persisted VolumeMetadata) | `--filters`, `--max-results`, `--next-token`, `--dry-run` | None | NATS `ec2.DescribeVolumes` → daemon queries viperblock for volume metadata → returns volume list with state, size, attachments, type, DeleteOnTermination flag | 1. List all volumes
2. Filter by volume ID
3. Filter by attachment state
4. Non-existent volume returns empty
5. DeleteOnTermination reflects persisted value | **DONE** | | `modify-volume` | `--volume-id`, `--size`, `--volume-type`, `--iops` | `--throughput`, `--dry-run`, `--multi-attach-enabled` | Volume must exist | NATS `ec2.ModifyVolume` → daemon sends resize request to viperblock → NBD does not support live resize, instance must be stopped → returns modification state | 1. Increase volume size
2. Modify volume type
3. Decrease size (error - not supported)
4. Modify attached volume (requires stop/start) | **DONE** | -| `create-volume` | `--size`, `--availability-zone`, `--volume-type` (gp3 only), `--snapshot-id` (creates volume from snapshot) | `--iops` (hardcoded 3000), `--encrypted` (hardcoded false), `--throughput`, `--tag-specifications` | Valid AZ configured via `hive init` | Gateway validates input → NATS `ec2.CreateVolume` → daemon generates vol-ID via viperblock → creates volume (empty or from snapshot) of specified size → persists config.json to Predastore S3 → returns vol-ID with state=available | 1. Create 80GB gp3 volume
2. Boundary sizes (1 GiB min, 16384 GiB max)
3. Invalid AZ (error)
4. Verify volume in describe-volumes
5. Unsupported volume type (error - only gp3)
6. Size out of range (error)
7. Create from snapshot | **DONE** | +| `create-volume` | `--size`, `--availability-zone`, `--volume-type` (gp3 only), `--snapshot-id` (creates volume from snapshot) | `--iops` (hardcoded 3000), `--encrypted` (hardcoded false), `--throughput`, `--tag-specifications` | Valid AZ configured via `spinifex init` | Gateway validates input → NATS `ec2.CreateVolume` → daemon generates vol-ID via viperblock → creates volume (empty or from snapshot) of specified size → persists config.json to Predastore S3 → returns vol-ID with state=available | 1. Create 80GB gp3 volume
2. Boundary sizes (1 GiB min, 16384 GiB max)
3. Invalid AZ (error)
4. Verify volume in describe-volumes
5. Unsupported volume type (error - only gp3)
6. Size out of range (error)
7. Create from snapshot | **DONE** | | `delete-volume` | `--volume-id` | `--dry-run` | Volume must exist and be detached (state=available) | Gateway validates vol- prefix → NATS `ec2.DeleteVolume` → daemon confirms state=available and no AttachedInstance → NATS `ebs.delete` to viperblockd (stops nbdkit/WAL) → deletes S3 objects under vol-id/, vol-id-efi/, vol-id-cloudinit/ → returns success | 1. Delete detached volume
2. Delete attached volume (error: VolumeInUse)
3. Delete non-existent volume (error: InvalidVolume.NotFound)
4. Verify volume gone from describe-volumes
5. Malformed volume ID (error: InvalidVolumeID.Malformed)
6. Double delete (idempotent NotFound) | **DONE** | | `attach-volume` | `--volume-id`, `--instance-id`, `--device` (optional, auto-assigns `/dev/sd[f-p]`) | `--dry-run` | Volume must exist (available), instance must exist (running) | Gateway sends to `ec2.cmd.{instanceId}` → daemon validates volume (Predastore) → `ebs.mount` via NATS (viperblock starts NBD server) → QMP `blockdev-add` (nbd-{volId}) → QMP `device_add` (virtio-blk-pci, vdisk-{volId}) → three-phase rollback on failure → update EBSRequests + BlockDeviceMappings → persist to JetStream + Predastore → respond with VolumeAttachment | 1. Attach volume to running instance
2. Auto-assign device name
3. Attach already-attached volume (VolumeInUse)
4. Attach to non-existent instance (InvalidInstanceID.NotFound)
5. Attach to stopped instance (IncorrectInstanceState)
6. Volume not found (InvalidVolume.NotFound)
7. All device slots full (AttachmentLimitExceeded)
8. Volume persists across stop/start | **DONE** | | `detach-volume` | `--volume-id`, `--instance-id` (optional, resolved via DescribeVolumes), `--device` (optional cross-check), `--force` | `--dry-run` | Volume must be attached, instance must be running | Gateway resolves InstanceId if omitted (via DescribeVolumes) → sends to `ec2.cmd.{instanceId}` → daemon validates (running, attached, not boot/EFI/CloudInit, device match) → three-phase hot-unplug: QMP `device_del` (force continues on failure) → QMP `blockdev-del` (abort if fails, preserves state to prevent double-attach) → `ebs.unmount` via NATS (best-effort) → remove from EBSRequests + BlockDeviceMappings → update volume metadata to available → persist state → respond with VolumeAttachment (state=detaching) | 1. Detach with explicit InstanceId
2. Detach without InstanceId (gateway resolution)
3. Detach with correct --device cross-check
4. Missing VolumeId (InvalidParameterValue)
5. Volume not attached (IncorrectState)
6. Nonexistent volume (InvalidVolume.NotFound)
7. Nonexistent instance (InvalidInstanceID.NotFound)
8. Instance not running (IncorrectInstanceState)
9. Device mismatch (InvalidParameterValue)
10. Boot volume protection (OperationNotPermitted)
11. Force flag (continues past device_del failure)
12. Volume reusability (re-attach after detach) | **DONE** | @@ -150,8 +150,8 @@ Operational commands for inspecting cluster state. These fan out NATS requests t | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| -| `describe-regions` | *(returns configured region, endpoint, opt-in status from config — input params ignored)* | `--region-names`, `--filters`, `--all-regions`, `--dry-run` | None | Return configured region from hive init config with Endpoint and OptInStatus → local-only response, no NATS | 1. List all regions
2. Filter by region name
3. Verify endpoint URL returned
4. Verify OptInStatus returned | **DONE** | -| `describe-availability-zones` | *(returns configured AZ, region, zone ID, state, opt-in status from config — input params ignored)* | `--zone-names`, `--filters`, `--all-availability-zones` | None | Return configured AZ from hive init config with zone ID, state, group name, network border group → local-only response, no NATS | 1. List all AZs
2. Filter by zone name
3. Verify zone state is available
4. Verify region name matches config | **DONE** | +| `describe-regions` | *(returns configured region, endpoint, opt-in status from config — input params ignored)* | `--region-names`, `--filters`, `--all-regions`, `--dry-run` | None | Return configured region from spinifex init config with Endpoint and OptInStatus → local-only response, no NATS | 1. List all regions
2. Filter by region name
3. Verify endpoint URL returned
4. Verify OptInStatus returned | **DONE** | +| `describe-availability-zones` | *(returns configured AZ, region, zone ID, state, opt-in status from config — input params ignored)* | `--zone-names`, `--filters`, `--all-availability-zones` | None | Return configured AZ from spinifex init config with zone ID, state, group name, network border group → local-only response, no NATS | 1. List all AZs
2. Filter by zone name
3. Verify zone state is available
4. Verify region name matches config | **DONE** | ### EC2 - Account Attributes @@ -165,12 +165,12 @@ Persistence layer works (NATS JetStream KV), but stored values are not yet enfor | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| -| `enable-ebs-encryption-by-default` | *(no flags needed)* | `--dry-run` | None | Gateway validates input → NATS `ec2.EnableEbsEncryptionByDefault` with `hive-workers` queue group → daemon stores `EbsEncryptionByDefault=true` in JetStream KV (`hive-ec2-account-settings` bucket) → return `EbsEncryptionByDefault=true`. Enforcement deferred: stored value not yet checked by CreateVolume/CreateSnapshot. | 1. Enable encryption
2. Verify via get | **STARTED** (enforcement pending) | -| `disable-ebs-encryption-by-default` | *(no flags needed)* | `--dry-run` | None | Gateway validates input → NATS `ec2.DisableEbsEncryptionByDefault` with `hive-workers` queue group → daemon stores `EbsEncryptionByDefault=false` in JetStream KV → return `EbsEncryptionByDefault=false`. | 1. Disable encryption
2. Verify via get | **STARTED** (enforcement pending) | -| `get-ebs-encryption-by-default` | *(no flags needed)* | `--dry-run` | None | Gateway validates input → NATS `ec2.GetEbsEncryptionByDefault` with `hive-workers` queue group → daemon reads `EbsEncryptionByDefault` from JetStream KV → return current state. | 1. Get default state
2. Verify matches last enable/disable | **STARTED** (enforcement pending) | -| `enable-serial-console-access` | *(no flags needed)* | `--dry-run` | None | Gateway validates input → NATS `ec2.EnableSerialConsoleAccess` with `hive-workers` queue group → daemon stores `SerialConsoleAccessEnabled=true` in JetStream KV (`hive-ec2-account-settings` bucket) → return enabled=true. Stored for future interactive serial console support (not currently enforced by any operation). | 1. Enable access
2. Verify via get | **STARTED** (enforcement pending) | -| `disable-serial-console-access` | *(no flags needed)* | `--dry-run` | None | Gateway validates input → NATS `ec2.DisableSerialConsoleAccess` with `hive-workers` queue group → daemon stores `SerialConsoleAccessEnabled=false` in JetStream KV → return enabled=false. Stored for future interactive serial console support (not currently enforced by any operation). | 1. Disable access
2. Verify via get | **STARTED** (enforcement pending) | -| `get-serial-console-access-status` | *(no flags needed)* | `--dry-run` | None | Gateway validates input → NATS `ec2.GetSerialConsoleAccessStatus` with `hive-workers` queue group → daemon reads `SerialConsoleAccessEnabled` from JetStream KV → return current state. | 1. Get current status
2. Verify matches last enable/disable | **DONE** | +| `enable-ebs-encryption-by-default` | *(no flags needed)* | `--dry-run` | None | Gateway validates input → NATS `ec2.EnableEbsEncryptionByDefault` with `spinifex-workers` queue group → daemon stores `EbsEncryptionByDefault=true` in JetStream KV (`spinifex-ec2-account-settings` bucket) → return `EbsEncryptionByDefault=true`. Enforcement deferred: stored value not yet checked by CreateVolume/CreateSnapshot. | 1. Enable encryption
2. Verify via get | **STARTED** (enforcement pending) | +| `disable-ebs-encryption-by-default` | *(no flags needed)* | `--dry-run` | None | Gateway validates input → NATS `ec2.DisableEbsEncryptionByDefault` with `spinifex-workers` queue group → daemon stores `EbsEncryptionByDefault=false` in JetStream KV → return `EbsEncryptionByDefault=false`. | 1. Disable encryption
2. Verify via get | **STARTED** (enforcement pending) | +| `get-ebs-encryption-by-default` | *(no flags needed)* | `--dry-run` | None | Gateway validates input → NATS `ec2.GetEbsEncryptionByDefault` with `spinifex-workers` queue group → daemon reads `EbsEncryptionByDefault` from JetStream KV → return current state. | 1. Get default state
2. Verify matches last enable/disable | **STARTED** (enforcement pending) | +| `enable-serial-console-access` | *(no flags needed)* | `--dry-run` | None | Gateway validates input → NATS `ec2.EnableSerialConsoleAccess` with `spinifex-workers` queue group → daemon stores `SerialConsoleAccessEnabled=true` in JetStream KV (`spinifex-ec2-account-settings` bucket) → return enabled=true. Stored for future interactive serial console support (not currently enforced by any operation). | 1. Enable access
2. Verify via get | **STARTED** (enforcement pending) | +| `disable-serial-console-access` | *(no flags needed)* | `--dry-run` | None | Gateway validates input → NATS `ec2.DisableSerialConsoleAccess` with `spinifex-workers` queue group → daemon stores `SerialConsoleAccessEnabled=false` in JetStream KV → return enabled=false. Stored for future interactive serial console support (not currently enforced by any operation). | 1. Disable access
2. Verify via get | **STARTED** (enforcement pending) | +| `get-serial-console-access-status` | *(no flags needed)* | `--dry-run` | None | Gateway validates input → NATS `ec2.GetSerialConsoleAccessStatus` with `spinifex-workers` queue group → daemon reads `SerialConsoleAccessEnabled` from JetStream KV → return current state. | 1. Get current status
2. Verify matches last enable/disable | **DONE** | | `enable-snapshot-block-public-access` | — | `--state` | None | Store snapshot block public access state in JetStream KV | 1. Enable with block-all-sharing
2. Enable with block-new-sharing | **NOT STARTED** (enforcement pending) | | `disable-snapshot-block-public-access` | — | `--dry-run` | None | Clear snapshot block public access state in JetStream KV | 1. Disable access | **NOT STARTED** (enforcement pending) | | `get-snapshot-block-public-access-state` | — | `--dry-run` | None | Read snapshot block public access state from JetStream KV | 1. Get current state | **NOT STARTED** (enforcement pending) | @@ -182,13 +182,13 @@ Persistence layer works (NATS JetStream KV), but stored values are not yet enfor ### EC2 - Egress-Only Internet Gateway -Gateway routing and KV CRUD are wired up but no OVN/OVS integration exists. EIGWs are stored in `hive-eigw` KV bucket but have no effect on network topology (no vpcd events published, unlike IGW which publishes `vpc.igw-attach`/`vpc.igw-detach`). +Gateway routing and KV CRUD are wired up but no OVN/OVS integration exists. EIGWs are stored in `spinifex-eigw` KV bucket but have no effect on network topology (no vpcd events published, unlike IGW which publishes `vpc.igw-attach`/`vpc.igw-detach`). | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| -| `create-egress-only-internet-gateway` | `--vpc-id`, `--tag-specifications` | `--client-token`, `--dry-run` | VPC must exist | Gateway validates VpcId → NATS `ec2.CreateEgressOnlyInternetGateway` → daemon generates eigw-ID → creates EgressOnlyIGWRecord in `hive-eigw` KV bucket with state=attached (always attached at creation, unlike IGW) → returns EgressOnlyInternetGateway with attachment | 1. Create with valid VpcId
2. Missing VpcId (error: MissingParameter)
3. Create with inline tags
4. Verify ID format eigw-{16hex} | **STARTED** (KV only, no OVN) | -| `delete-egress-only-internet-gateway` | `--egress-only-internet-gateway-id` | `--dry-run` | EIGW must exist | NATS `ec2.DeleteEgressOnlyInternetGateway` → daemon verifies EIGW exists in KV → deletes from `hive-eigw` KV → returns ReturnCode=true. No detach required (unlike IGW). | 1. Delete existing EIGW
2. Delete non-existent EIGW (error)
3. Missing ID (error: MissingParameter) | **STARTED** (KV only, no OVN) | -| `describe-egress-only-internet-gateways` | `--egress-only-internet-gateway-ids` | `--filters`, `--max-results`, `--next-token`, `--dry-run` | None | NATS `ec2.DescribeEgressOnlyInternetGateways` → daemon lists all keys from `hive-eigw` KV bucket → filters by ID if specified → always includes Attachments array → returns list | 1. Describe all EIGWs
2. Filter by specific ID
3. Non-existent ID returns empty list | **STARTED** (KV only, no OVN) | +| `create-egress-only-internet-gateway` | `--vpc-id`, `--tag-specifications` | `--client-token`, `--dry-run` | VPC must exist | Gateway validates VpcId → NATS `ec2.CreateEgressOnlyInternetGateway` → daemon generates eigw-ID → creates EgressOnlyIGWRecord in `spinifex-eigw` KV bucket with state=attached (always attached at creation, unlike IGW) → returns EgressOnlyInternetGateway with attachment | 1. Create with valid VpcId
2. Missing VpcId (error: MissingParameter)
3. Create with inline tags
4. Verify ID format eigw-{16hex} | **STARTED** (KV only, no OVN) | +| `delete-egress-only-internet-gateway` | `--egress-only-internet-gateway-id` | `--dry-run` | EIGW must exist | NATS `ec2.DeleteEgressOnlyInternetGateway` → daemon verifies EIGW exists in KV → deletes from `spinifex-eigw` KV → returns ReturnCode=true. No detach required (unlike IGW). | 1. Delete existing EIGW
2. Delete non-existent EIGW (error)
3. Missing ID (error: MissingParameter) | **STARTED** (KV only, no OVN) | +| `describe-egress-only-internet-gateways` | `--egress-only-internet-gateway-ids` | `--filters`, `--max-results`, `--next-token`, `--dry-run` | None | NATS `ec2.DescribeEgressOnlyInternetGateways` → daemon lists all keys from `spinifex-eigw` KV bucket → filters by ID if specified → always includes Attachments array → returns list | 1. Describe all EIGWs
2. Filter by specific ID
3. Non-existent ID returns empty list | **STARTED** (KV only, no OVN) | ### EC2 - Placement Groups @@ -254,19 +254,19 @@ Gateway routing and KV CRUD are wired up but no OVN/OVS integration exists. EIGW ### EC2 - VPC Networking (Core) -Requires OVN/OVS (`apt install openvswitch-switch ovn-host`). VPC/Subnet/ENI CRUD stores metadata in NATS KV and publishes events to vpcd (the network topology daemon) which translates to OVN logical switches, ports, and routers. Single AZ for Hive v1. IPAM uses CAS-based allocation from NATS KV (`hive-vpc-ipam` bucket). +Requires OVN/OVS (`apt install openvswitch-switch ovn-host`). VPC/Subnet/ENI CRUD stores metadata in NATS KV and publishes events to vpcd (the network topology daemon) which translates to OVN logical switches, ports, and routers. Single AZ for Spinifex v1. IPAM uses CAS-based allocation from NATS KV (`spinifex-vpc-ipam` bucket). | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| -| `create-vpc` | `--cidr-block`, `--tag-specifications` | `--instance-tenancy`, `--dry-run` | None | Gateway validates CidrBlock (required, valid CIDR, /16–/28 prefix) → NATS `ec2.CreateVpc` → daemon allocates unique VNI from `hive-vpc-vni-counter` KV → generates vpc-ID → stores VPCRecord in `hive-vpc-vpcs` KV → publishes `vpc.create` event to vpcd (creates OVN logical switch) → returns VPC with state=available | 1. Create VPC with /16 CIDR
2. Invalid CIDR format (error: InvalidVpcRange)
3. CIDR prefix outside /16–/28 (error)
4. Verify in describe-vpcs
5. Tags applied at creation | **DONE** | -| `delete-vpc` | `--vpc-id` | `--dry-run` | VPC must be empty (no subnets) | Gateway validates VpcId → NATS `ec2.DeleteVpc` → daemon checks for dependent subnets in `hive-vpc-subnets` KV → returns DependencyViolation if subnets exist → deletes from `hive-vpc-vpcs` KV → publishes `vpc.delete` event to vpcd (removes OVN resources) | 1. Delete empty VPC
2. Delete VPC with subnets (DependencyViolation)
3. Delete non-existent VPC (error) | **DONE** | -| `describe-vpcs` | `--vpc-ids` | `--filters`, `--max-results`, `--dry-run` | None | NATS `ec2.DescribeVpcs` → daemon lists all keys from `hive-vpc-vpcs` KV → filters by VPC IDs if specified → returns error for non-existent requested IDs → returns VPC list with CIDR, state, CIDR associations | 1. List all VPCs
2. Filter by VPC ID
3. Non-existent VPC ID returns error | **DONE** | +| `create-vpc` | `--cidr-block`, `--tag-specifications` | `--instance-tenancy`, `--dry-run` | None | Gateway validates CidrBlock (required, valid CIDR, /16–/28 prefix) → NATS `ec2.CreateVpc` → daemon allocates unique VNI from `spinifex-vpc-vni-counter` KV → generates vpc-ID → stores VPCRecord in `spinifex-vpc-vpcs` KV → publishes `vpc.create` event to vpcd (creates OVN logical switch) → returns VPC with state=available | 1. Create VPC with /16 CIDR
2. Invalid CIDR format (error: InvalidVpcRange)
3. CIDR prefix outside /16–/28 (error)
4. Verify in describe-vpcs
5. Tags applied at creation | **DONE** | +| `delete-vpc` | `--vpc-id` | `--dry-run` | VPC must be empty (no subnets) | Gateway validates VpcId → NATS `ec2.DeleteVpc` → daemon checks for dependent subnets in `spinifex-vpc-subnets` KV → returns DependencyViolation if subnets exist → deletes from `spinifex-vpc-vpcs` KV → publishes `vpc.delete` event to vpcd (removes OVN resources) | 1. Delete empty VPC
2. Delete VPC with subnets (DependencyViolation)
3. Delete non-existent VPC (error) | **DONE** | +| `describe-vpcs` | `--vpc-ids` | `--filters`, `--max-results`, `--dry-run` | None | NATS `ec2.DescribeVpcs` → daemon lists all keys from `spinifex-vpc-vpcs` KV → filters by VPC IDs if specified → returns error for non-existent requested IDs → returns VPC list with CIDR, state, CIDR associations | 1. List all VPCs
2. Filter by VPC ID
3. Non-existent VPC ID returns error | **DONE** | | `modify-vpc-attribute` | — | `--vpc-id`, `--enable-dns-support`, `--enable-dns-hostnames` | VPC must exist | NATS `ec2.ModifyVpcAttribute` → daemon updates VPC attribute in KV → return success | 1. Enable DNS support
2. Enable DNS hostnames
3. Missing VPC ID (error) | **NOT STARTED** | | `associate-vpc-cidr-block` | — | `--vpc-id`, `--cidr-block` | VPC must exist | NATS `ec2.AssociateVpcCidrBlock` → daemon adds secondary CIDR to VPC metadata → return association | 1. Add secondary CIDR
2. Overlapping CIDR (error)
3. Max CIDR blocks exceeded (error) | **NOT STARTED** | | `disassociate-vpc-cidr-block` | — | `--association-id` | Association must exist | NATS `ec2.DisassociateVpcCidrBlock` → daemon removes secondary CIDR from VPC → return success | 1. Remove secondary CIDR
2. Remove primary CIDR (error) | **NOT STARTED** | -| `create-subnet` | `--vpc-id`, `--cidr-block`, `--availability-zone`, `--tag-specifications` | `--dry-run` | VPC must exist | Gateway validates VpcId + CidrBlock (required, valid CIDR, /16–/28 prefix) → NATS `ec2.CreateSubnet` → daemon verifies parent VPC exists → validates subnet CIDR is within VPC CIDR range → checks for overlapping subnets in same VPC → calculates available IPs (total hosts - 5 AWS-reserved: .0/.1/.2/.3/.255) → generates subnet-ID → stores SubnetRecord in `hive-vpc-subnets` KV → publishes `vpc.create-subnet` event to vpcd → defaults AZ from config if omitted | 1. Create subnet within VPC CIDR
2. Subnet CIDR outside VPC range (error: InvalidSubnetRange)
3. Overlapping subnet CIDRs (error: InvalidSubnetConflict)
4. CIDR prefix outside /16–/28 (error)
5. Missing VPC or CIDR (error: MissingParameter) | **DONE** | -| `delete-subnet` | `--subnet-id` | `--dry-run` | Subnet must exist | NATS `ec2.DeleteSubnet` → daemon verifies subnet exists → deletes from `hive-vpc-subnets` KV → publishes `vpc.delete-subnet` event to vpcd | 1. Delete existing subnet
2. Delete non-existent subnet (error) | **DONE** | -| `describe-subnets` | `--subnet-ids`, `--filters` (vpc-id) | `--max-results`, `--dry-run` | None | NATS `ec2.DescribeSubnets` → daemon lists all keys from `hive-vpc-subnets` KV → applies vpc-id filter if present → filters by subnet IDs if specified → recalculates available IPs from CIDR → returns error for non-existent requested IDs | 1. List all subnets
2. Filter by VPC ID
3. Filter by subnet ID
4. Non-existent subnet returns error | **DONE** | +| `create-subnet` | `--vpc-id`, `--cidr-block`, `--availability-zone`, `--tag-specifications` | `--dry-run` | VPC must exist | Gateway validates VpcId + CidrBlock (required, valid CIDR, /16–/28 prefix) → NATS `ec2.CreateSubnet` → daemon verifies parent VPC exists → validates subnet CIDR is within VPC CIDR range → checks for overlapping subnets in same VPC → calculates available IPs (total hosts - 5 AWS-reserved: .0/.1/.2/.3/.255) → generates subnet-ID → stores SubnetRecord in `spinifex-vpc-subnets` KV → publishes `vpc.create-subnet` event to vpcd → defaults AZ from config if omitted | 1. Create subnet within VPC CIDR
2. Subnet CIDR outside VPC range (error: InvalidSubnetRange)
3. Overlapping subnet CIDRs (error: InvalidSubnetConflict)
4. CIDR prefix outside /16–/28 (error)
5. Missing VPC or CIDR (error: MissingParameter) | **DONE** | +| `delete-subnet` | `--subnet-id` | `--dry-run` | Subnet must exist | NATS `ec2.DeleteSubnet` → daemon verifies subnet exists → deletes from `spinifex-vpc-subnets` KV → publishes `vpc.delete-subnet` event to vpcd | 1. Delete existing subnet
2. Delete non-existent subnet (error) | **DONE** | +| `describe-subnets` | `--subnet-ids`, `--filters` (vpc-id) | `--max-results`, `--dry-run` | None | NATS `ec2.DescribeSubnets` → daemon lists all keys from `spinifex-vpc-subnets` KV → applies vpc-id filter if present → filters by subnet IDs if specified → recalculates available IPs from CIDR → returns error for non-existent requested IDs | 1. List all subnets
2. Filter by VPC ID
3. Filter by subnet ID
4. Non-existent subnet returns error | **DONE** | | `modify-subnet-attribute` | — | `--subnet-id`, `--map-public-ip-on-launch`, `--assign-ipv6-address-on-creation` | Subnet must exist | NATS `ec2.ModifySubnetAttribute` → daemon updates subnet attribute in KV → return success | 1. Enable auto-assign public IP
2. Missing subnet ID (error) | **NOT STARTED** | | `associate-subnet-cidr-block` | — | `--subnet-id`, `--ipv6-cidr-block` | Subnet must exist | NATS `ec2.AssociateSubnetCidrBlock` → daemon adds IPv6 CIDR to subnet → return association | 1. Add IPv6 CIDR
2. Missing subnet ID (error) | **NOT STARTED** | | `disassociate-subnet-cidr-block` | — | `--association-id` | Association must exist | NATS `ec2.DisassociateSubnetCidrBlock` → daemon removes IPv6 CIDR from subnet → return success | 1. Remove IPv6 CIDR
2. Invalid association (error) | **NOT STARTED** | @@ -277,11 +277,11 @@ Requires OVN/OVS (`apt install openvswitch-switch ovn-host`). VPC/Subnet/ENI CRU | `authorize-security-group-egress` | — | `--group-id`, `--protocol`, `--port`, `--cidr` | SG must exist | Add outbound rule → create OVS OpenFlow rule → persist to metadata | 1. Allow HTTPS outbound
2. Restrict to specific CIDR | **NOT STARTED** | | `revoke-security-group-ingress` | — | `--group-id`, `--protocol`, `--port`, `--cidr` | SG must exist, rule must exist | Remove inbound rule → delete OVS OpenFlow rule → update metadata | 1. Revoke existing rule
2. Revoke non-existent rule (error) | **NOT STARTED** | | `revoke-security-group-egress` | — | `--group-id`, `--protocol`, `--port`, `--cidr` | SG must exist, rule must exist | Remove outbound rule → delete OVS OpenFlow rule → update metadata | 1. Revoke existing rule
2. Revoke non-existent rule (error) | **NOT STARTED** | -| `create-internet-gateway` | `--tag-specifications` | `--dry-run` | None | NATS `ec2.CreateInternetGateway` → daemon generates igw-ID → creates IGWRecord in `hive-igw` KV bucket with state=available (not attached) → returns InternetGateway with empty Attachments | 1. Create IGW
2. Verify in describe-internet-gateways
3. Tags applied at creation | **DONE** | +| `create-internet-gateway` | `--tag-specifications` | `--dry-run` | None | NATS `ec2.CreateInternetGateway` → daemon generates igw-ID → creates IGWRecord in `spinifex-igw` KV bucket with state=available (not attached) → returns InternetGateway with empty Attachments | 1. Create IGW
2. Verify in describe-internet-gateways
3. Tags applied at creation | **DONE** | | `attach-internet-gateway` | `--internet-gateway-id`, `--vpc-id` | `--dry-run` | IGW and VPC must exist | NATS `ec2.AttachInternetGateway` → daemon validates IGW exists and is not already attached (ResourceAlreadyAssociated) → sets VpcId on record → state=attached → publishes `vpc.igw-attach` event to vpcd (creates OVN external switch, gateway port, SNAT rules) | 1. Attach IGW to VPC
2. Attach already-attached IGW (ResourceAlreadyAssociated)
3. Non-existent IGW (error)
4. Missing params (MissingParameter) | **DONE** | | `detach-internet-gateway` | `--internet-gateway-id`, `--vpc-id` | `--dry-run` | IGW must be attached to specified VPC | NATS `ec2.DetachInternetGateway` → daemon validates IGW exists and is attached to specified VPC (GatewayNotAttached if wrong VPC) → clears VpcId → state=available → publishes `vpc.igw-detach` event to vpcd (removes OVN resources) | 1. Detach attached IGW
2. Detach from wrong VPC (GatewayNotAttached)
3. Detach unattached IGW (error) | **DONE** | -| `delete-internet-gateway` | `--internet-gateway-id` | `--dry-run` | IGW must be detached | NATS `ec2.DeleteInternetGateway` → daemon validates IGW exists and VpcId is empty (DependencyViolation if attached) → deletes from `hive-igw` KV | 1. Delete detached IGW
2. Delete attached IGW (DependencyViolation)
3. Delete non-existent (error) | **DONE** | -| `describe-internet-gateways` | `--internet-gateway-ids` | `--filters`, `--max-results`, `--dry-run` | None | NATS `ec2.DescribeInternetGateways` → daemon lists all keys from `hive-igw` KV → filters by IGW IDs if specified → returns list with Attachments array (if attached) | 1. List all IGWs
2. Filter by IGW ID
3. Verify attachment info | **DONE** | +| `delete-internet-gateway` | `--internet-gateway-id` | `--dry-run` | IGW must be detached | NATS `ec2.DeleteInternetGateway` → daemon validates IGW exists and VpcId is empty (DependencyViolation if attached) → deletes from `spinifex-igw` KV | 1. Delete detached IGW
2. Delete attached IGW (DependencyViolation)
3. Delete non-existent (error) | **DONE** | +| `describe-internet-gateways` | `--internet-gateway-ids` | `--filters`, `--max-results`, `--dry-run` | None | NATS `ec2.DescribeInternetGateways` → daemon lists all keys from `spinifex-igw` KV → filters by IGW IDs if specified → returns list with Attachments array (if attached) | 1. List all IGWs
2. Filter by IGW ID
3. Verify attachment info | **DONE** | ### EC2 - Route Tables @@ -365,13 +365,13 @@ Requires OVN/OVS (`apt install openvswitch-switch ovn-host`). VPC/Subnet/ENI CRU ### EC2 - Network Interfaces -ENIs are managed via `hive-vpc-enis` KV bucket with CAS-based IPAM allocation from `hive-vpc-ipam`. ENIs are auto-created by `run-instances --subnet-id` and auto-deleted on termination. MAC addresses are deterministically generated from the ENI ID. Attach/detach are internal operations used by instance lifecycle — no standalone attach/detach API yet. +ENIs are managed via `spinifex-vpc-enis` KV bucket with CAS-based IPAM allocation from `spinifex-vpc-ipam`. ENIs are auto-created by `run-instances --subnet-id` and auto-deleted on termination. MAC addresses are deterministically generated from the ENI ID. Attach/detach are internal operations used by instance lifecycle — no standalone attach/detach API yet. | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| -| `create-network-interface` | `--subnet-id`, `--private-ip-address`, `--description`, `--tag-specifications` | `--groups`, `--dry-run` | Subnet must exist | Gateway validates SubnetId (required) → NATS `ec2.CreateNetworkInterface` → daemon verifies subnet exists in `hive-vpc-subnets` KV → if no PrivateIpAddress, allocates from IPAM pool (CAS-based, up to 5 retries) → generates eni-ID → generates deterministic MAC from ENI ID → stores ENIRecord in `hive-vpc-enis` KV → publishes `vpc.create-port` event to vpcd (creates OVN logical port) → returns NetworkInterface with status=available | 1. Create in subnet (auto-allocate IP)
2. Create with specific private IP
3. Missing subnet ID (MissingParameter)
4. Non-existent subnet (error)
5. Tags applied at creation | **DONE** | -| `delete-network-interface` | `--network-interface-id` | `--dry-run` | Must not be attached (status != in-use) | NATS `ec2.DeleteNetworkInterface` → daemon verifies ENI exists and status is not "in-use" (InvalidNetworkInterfaceInUse) → releases IP back to IPAM pool → deletes from `hive-vpc-enis` KV → publishes `vpc.delete-port` event to vpcd | 1. Delete detached ENI
2. Delete attached ENI (InvalidNetworkInterfaceInUse)
3. Delete non-existent (error) | **DONE** | -| `describe-network-interfaces` | `--network-interface-ids`, `--filters` (subnet-id, vpc-id, attachment.instance-id) | `--max-results`, `--dry-run` | None | NATS `ec2.DescribeNetworkInterfaces` → daemon lists all keys from `hive-vpc-enis` KV → applies filters (subnet-id, vpc-id, attachment.instance-id) → filters by ENI IDs if specified → returns error for non-existent requested IDs | 1. List all ENIs
2. Filter by subnet-id
3. Filter by vpc-id
4. Filter by attachment.instance-id
5. Non-existent ENI returns error | **DONE** | +| `create-network-interface` | `--subnet-id`, `--private-ip-address`, `--description`, `--tag-specifications` | `--groups`, `--dry-run` | Subnet must exist | Gateway validates SubnetId (required) → NATS `ec2.CreateNetworkInterface` → daemon verifies subnet exists in `spinifex-vpc-subnets` KV → if no PrivateIpAddress, allocates from IPAM pool (CAS-based, up to 5 retries) → generates eni-ID → generates deterministic MAC from ENI ID → stores ENIRecord in `spinifex-vpc-enis` KV → publishes `vpc.create-port` event to vpcd (creates OVN logical port) → returns NetworkInterface with status=available | 1. Create in subnet (auto-allocate IP)
2. Create with specific private IP
3. Missing subnet ID (MissingParameter)
4. Non-existent subnet (error)
5. Tags applied at creation | **DONE** | +| `delete-network-interface` | `--network-interface-id` | `--dry-run` | Must not be attached (status != in-use) | NATS `ec2.DeleteNetworkInterface` → daemon verifies ENI exists and status is not "in-use" (InvalidNetworkInterfaceInUse) → releases IP back to IPAM pool → deletes from `spinifex-vpc-enis` KV → publishes `vpc.delete-port` event to vpcd | 1. Delete detached ENI
2. Delete attached ENI (InvalidNetworkInterfaceInUse)
3. Delete non-existent (error) | **DONE** | +| `describe-network-interfaces` | `--network-interface-ids`, `--filters` (subnet-id, vpc-id, attachment.instance-id) | `--max-results`, `--dry-run` | None | NATS `ec2.DescribeNetworkInterfaces` → daemon lists all keys from `spinifex-vpc-enis` KV → applies filters (subnet-id, vpc-id, attachment.instance-id) → filters by ENI IDs if specified → returns error for non-existent requested IDs | 1. List all ENIs
2. Filter by subnet-id
3. Filter by vpc-id
4. Filter by attachment.instance-id
5. Non-existent ENI returns error | **DONE** | | `attach-network-interface` | — | `--network-interface-id`, `--instance-id`, `--device-index` | ENI and instance must exist | Internal operation used by `run-instances --subnet-id`. Marks ENI as "in-use", sets instance attachment, generates attachment ID. No standalone API endpoint yet. | 1. Attach ENI to instance
2. Already attached (error)
3. Missing device index (error) | **NOT STARTED** (internal only) | | `detach-network-interface` | — | `--attachment-id`, `--force` | ENI must be attached | Internal operation used by terminate-instances. Marks ENI as "available", clears attachment info. No standalone API endpoint yet. | 1. Detach ENI
2. Force detach
3. Not attached (error) | **NOT STARTED** (internal only) | | `modify-network-interface-attribute` | — | `--network-interface-id`, `--description`, `--source-dest-check`, `--groups` | ENI must exist | NATS `ec2.ModifyNetworkInterfaceAttribute` → daemon updates ENI attributes in KV → return success | 1. Modify description
2. Toggle source/dest check
3. Update security groups | **NOT STARTED** | @@ -409,7 +409,7 @@ ENIs are managed via `hive-vpc-enis` KV bucket with CAS-based IPAM allocation fr ### S3 (via Predastore) -Currently S3 operations are handled directly by Predastore. Consider moving control/data plane to Hive format for AWS gateway integration. +Currently S3 operations are handled directly by Predastore. Consider moving control/data plane to Spinifex format for AWS gateway integration. | Command | Implemented Flags | Missing Flags | Prerequisites | Basic Logic | Test Cases | Status | |---------|-------------------|---------------|---------------|-------------|------------|--------| diff --git a/docs/DESIGN.md b/docs/DESIGN.md index aa1ccdca2..f26911ae3 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -1,6 +1,6 @@ -# Hive Architecture +# Spinifex Architecture -Hive is an AWS-compatible infrastructure platform for bare-metal, edge, and on-premise deployments. It provides EC2-compatible VM orchestration backed by QEMU/KVM, with storage provided by companion projects Viperblock (EBS) and Predastore (S3). +Spinifex is an AWS-compatible infrastructure platform for bare-metal, edge, and on-premise deployments. It provides EC2-compatible VM orchestration backed by QEMU/KVM, with storage provided by companion projects Viperblock (EBS) and Predastore (S3). ## High-Level Architecture @@ -19,7 +19,7 @@ Hive is an AWS-compatible infrastructure platform for bare-metal, edge, and on-p │ • EC2 Query Protocol parsing • Routes to service handlers │ │ • XML response generation • NATS client connection │ │ │ -│ File: hive/services/awsgw/awsgw.go │ +│ File: spinifex/services/awsgw/awsgw.go │ └─────────────────────────────────────────────────────────────────────────────┘ │ │ JSON over NATS @@ -28,7 +28,7 @@ Hive is an AWS-compatible infrastructure platform for bare-metal, edge, and on-p │ NATS Message Broker │ │ │ │ Topics: Queue Groups: │ -│ • ec2.RunInstances • hive-workers (load balanced) │ +│ • ec2.RunInstances • spinifex-workers (load balanced) │ │ • ec2.DescribeInstances • No queue (fan-out to all nodes) │ │ • ec2.cmd.{instanceID} (per-instance start/stop/terminate) │ │ • ebs.mount / ebs.unmount │ @@ -37,7 +37,7 @@ Hive is an AWS-compatible infrastructure platform for bare-metal, edge, and on-p ┌─────────────────┼─────────────────┐ ▼ ▼ ▼ ┌──────────────────────┐ ┌──────────────────────┐ ┌──────────────────────┐ -│ Hive Daemon │ │ Hive Daemon │ │ Hive Daemon │ +│ Spinifex Daemon │ │ Spinifex Daemon │ │ Spinifex Daemon │ │ (Node 1) │ │ (Node 2) │ │ (Node N) │ │ │ │ │ │ │ │ • NATS subscriber │ │ • NATS subscriber │ │ • NATS subscriber │ @@ -58,7 +58,7 @@ Hive is an AWS-compatible infrastructure platform for bare-metal, edge, and on-p ### 1. AWS SDK Request -Users interact with Hive using standard AWS SDKs or the AWS CLI by pointing to a custom endpoint: +Users interact with Spinifex using standard AWS SDKs or the AWS CLI by pointing to a custom endpoint: ```bash aws --endpoint-url https://localhost:9999 --no-verify-ssl ec2 run-instances \ @@ -73,7 +73,7 @@ The AWS SDK formats this as an HTTP POST with: ### 2. AWS Gateway -The gateway (`hive/services/awsgw/awsgw.go:57-107`) is the entry point: +The gateway (`spinifex/services/awsgw/awsgw.go:57-107`) is the entry point: ```go // awsgw.go:74 - Connect to NATS @@ -89,7 +89,7 @@ gw := gateway.GatewayConfig{ log.Fatal(app.ListenTLS(nodeConfig.AWSGW.Host, nodeConfig.AWSGW.TLSCert, nodeConfig.AWSGW.TLSKey)) ``` -Request routing (`hive/gateway/gateway.go:125-156`): +Request routing (`spinifex/gateway/gateway.go:125-156`): 1. **Authentication**: SigV4 middleware validates AWS credentials (`gateway.go:104`) 2. **Service Detection**: Extracts service name (ec2, iam, account) from Authorization header (`gateway.go:158-186`) @@ -109,7 +109,7 @@ case "iam": ### 3. EC2 Handler -The EC2 handler (`hive/gateway/ec2.go`) parses the Action parameter and delegates to specific handlers: +The EC2 handler (`spinifex/gateway/ec2.go`) parses the Action parameter and delegates to specific handlers: ```go // ec2.go - Action routing @@ -124,7 +124,7 @@ case "DescribeInstances": ### 4. NATS Messaging -The gateway communicates with daemons via NATS request/response (`hive/handlers/ec2/instance/service_nats.go:24-57`): +The gateway communicates with daemons via NATS request/response (`spinifex/handlers/ec2/instance/service_nats.go:24-57`): ```go // service_nats.go:24-57 @@ -145,13 +145,13 @@ func (s *NATSInstanceService) RunInstances(input *ec2.RunInstancesInput) (*ec2.R ### 5. Daemon Processing -Daemons (`hive/daemon/daemon.go`) subscribe to NATS topics and handle requests: +Daemons (`spinifex/daemon/daemon.go`) subscribe to NATS topics and handle requests: ```go // daemon.go:319 - Subscribe with queue group for load balancing d.natsSubscriptions["ec2.RunInstances"], err = d.natsConn.QueueSubscribe( "ec2.RunInstances", - "hive-workers", // Queue group - only one daemon handles each request + "spinifex-workers", // Queue group - only one daemon handles each request d.handleEC2RunInstances, ) @@ -162,7 +162,7 @@ d.natsSubscriptions["ec2.DescribeInstances"], err = d.natsConn.Subscribe( ) ``` -**Queue Groups**: Topics subscribed with a queue group (`hive-workers`) are load-balanced - only one daemon handles each request. Topics without a queue group fan out to all daemons. +**Queue Groups**: Topics subscribed with a queue group (`spinifex-workers`) are load-balanced - only one daemon handles each request. Topics without a queue group fan out to all daemons. ### 6. VM Launch @@ -225,19 +225,19 @@ type ResourceManager struct { | Topic | Queue Group | Purpose | |-------|-------------|---------| -| `ec2.RunInstances` | `hive-workers` | Launch new instances | +| `ec2.RunInstances` | `spinifex-workers` | Launch new instances | | `ec2.DescribeInstances` | None (fan-out) | Query all nodes for instances | | `ec2.cmd.{instanceID}` | None (owner only) | Per-instance commands (start/stop/terminate, attach/detach volume) | -| `ec2.CreateKeyPair` | `hive-workers` | Generate SSH keypair | -| `ec2.DescribeKeyPairs` | `hive-workers` | List SSH keypairs | -| `ec2.DescribeImages` | `hive-workers` | List AMIs | +| `ec2.CreateKeyPair` | `spinifex-workers` | Generate SSH keypair | +| `ec2.DescribeKeyPairs` | `spinifex-workers` | List SSH keypairs | +| `ec2.DescribeImages` | `spinifex-workers` | List AMIs | | `ebs.mount` | - | Mount volume via Viperblock | | `ebs.unmount` | - | Unmount volume | -| `hive.admin.{node}.health` | None | Node health checks | +| `spinifex.admin.{node}.health` | None | Node health checks | ### Multi-Node Aggregation -For operations that need data from all nodes (like `DescribeInstances`), the gateway uses inbox-based fan-out (`hive/gateway/ec2/instance/DescribeInstances.go`): +For operations that need data from all nodes (like `DescribeInstances`), the gateway uses inbox-based fan-out (`spinifex/gateway/ec2/instance/DescribeInstances.go`): ```go // DescribeInstances.go:16-111 @@ -288,13 +288,13 @@ Object storage used for: ## Configuration -Cluster configuration (`hive/config/config.go`): +Cluster configuration (`spinifex/config/config.go`): ```go type ClusterConfig struct { Epoch uint64 // Incremented on config changes Node string // This node's identifier - Version string // Hive version + Version string // Spinifex version Nodes map[string]Config // Configuration for all nodes } @@ -312,8 +312,8 @@ type Config struct { ## File Structure ``` -hive/ -├── hive/ +spinifex/ +├── spinifex/ │ ├── services/ │ │ └── awsgw/ │ │ └── awsgw.go # AWS Gateway service entry point @@ -340,7 +340,7 @@ hive/ │ └── qmp/ │ └── qmp.go # QEMU Machine Protocol client └── cmd/ - └── hive/ + └── spinifex/ └── main.go # CLI entry point ``` @@ -351,8 +351,8 @@ hive/ 1. Start NATS broker 2. Start Predastore (S3) 3. Start Viperblock (EBS) -4. Start Hive Gateway (`hive awsgw`) -5. Start Hive Daemon(s) (`hive daemon`) +4. Start Spinifex Gateway (`hive awsgw`) +5. Start Spinifex Daemon(s) (`hive daemon`) ### Testing with AWS CLI diff --git a/docs/INSTALL_ORIGINAL.md b/docs/INSTALL_ORIGINAL.md index 3334d25b1..85a79390a 100644 --- a/docs/INSTALL_ORIGINAL.md +++ b/docs/INSTALL_ORIGINAL.md @@ -1,4 +1,4 @@ -# Hive Installation +# Spinifex Installation Notes for development environment installation. @@ -15,20 +15,20 @@ For the development preview, please use one of the supported versions above. ## Download -Create the base directory for the Hive development environment. +Create the base directory for the Spinifex development environment. ```bash mkdir -p ~/Development/mulga/ cd ~/Development/mulga/ -git clone https://github.com/mulgadc/hive.git +git clone https://github.com/mulgadc/spinifex.git ``` ### Quick Install -To bootstrap all dependencies of Hive in one step (QEMU, Go, AWS CLI, OVN/OVS): +To bootstrap all dependencies of Spinifex in one step (QEMU, Go, AWS CLI, OVN/OVS): ```bash -sudo make -C hive quickinstall +sudo make -C spinifex quickinstall ``` Ensure Go is available in your `PATH` if not previously installed: @@ -56,7 +56,7 @@ Confirm Go is correctly installed, and set in your $PATH. go version ``` -Hive provides AWS API/SDK layer functionality, which requires the AWS CLI tool to be installed to interface with the system. +Spinifex provides AWS API/SDK layer functionality, which requires the AWS CLI tool to be installed to interface with the system. ```bash curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" @@ -77,16 +77,16 @@ aws --version Setup the dev environment and package dependencies on [viperblock](https://github.com/mulgadc/viperblock/) and [predastore](https://github.com/mulgadc/predastore/). ```bash -cd hive +cd spinifex ./scripts/clone-deps.sh # Clone viperblock + predastore repositories ./scripts/dev-setup.sh # Setup complete development environment ``` -Once complete, confirm `./bin/hive` exists and is executable. +Once complete, confirm `./bin/spx` exists and is executable. # Single Node Installation -For rapid development and testing, `hive` can be installed locally as a single node instance. Follow the instructions below for a complete working environment. For multi node installation, skip to [Multi-Node Installation](#multi-node-installation) +For rapid development and testing, `spx` can be installed locally as a single node instance. Follow the instructions below for a complete working environment. For multi node installation, skip to [Multi-Node Installation](#multi-node-installation) ## Setup OVN @@ -96,31 +96,31 @@ OVN provides the virtual networking layer for VPC instances. This step configure ./scripts/setup-ovn.sh --management ``` -This creates the `br-int` integration bridge, starts `ovn-controller`, starts the OVN central databases (NB DB + SB DB), configures Geneve tunnel endpoints, enables IP forwarding, and creates a sudoers rule so the Hive daemon can manage tap devices and OVS ports without running as root. Hive will not start without this step. +This creates the `br-int` integration bridge, starts `ovn-controller`, starts the OVN central databases (NB DB + SB DB), configures Geneve tunnel endpoints, enables IP forwarding, and creates a sudoers rule so the Spinifex daemon can manage tap devices and OVS ports without running as root. Spinifex will not start without this step. ## Init -When running Hive for the first time, run the init function to create the default directories for data, config files and layout required. +When running Spinifex for the first time, run the init function to create the default directories for data, config files and layout required. Example single node installation to get started, this will create a new region `ap-southeast-2` and availability zone `ap-southeast-2a` on your local instance: ```bash -./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 CA Certificate (Required) -Hive generates a local Certificate Authority (CA) during initialization. For AWS CLI and other tools to trust Hive services over HTTPS, you must add the CA certificate to your system's trust store. +Spinifex generates a local Certificate Authority (CA) during initialization. For AWS CLI and other tools to trust Spinifex services over HTTPS, you must add the CA certificate to your system's trust store. ```bash -sudo cp ~/hive/config/ca.pem /usr/local/share/ca-certificates/hive-ca.crt +sudo cp ~/spinifex/config/ca.pem /usr/local/share/ca-certificates/spinifex-ca.crt sudo update-ca-certificates ``` Verify the certificate was added: ```bash -ls -la /usr/local/share/ca-certificates/hive-ca.crt +ls -la /usr/local/share/ca-certificates/spinifex-ca.crt ``` ## Launch Services @@ -134,7 +134,7 @@ Start the core services for development. Set the AWS profile to use the default admin account created during init: ```bash -export AWS_PROFILE=hive +export AWS_PROFILE=spinifex ``` All subsequent `aws` CLI commands will use this account. @@ -148,7 +148,7 @@ For first install, create or import an existing key pair which can be used to la Import an existing key pair, replace `~/.ssh/id_rsa.pub` with your specified key. ```bash -aws ec2 import-key-pair --key-name "hive-key" --public-key-material fileb://~/.ssh/id_rsa.pub +aws ec2 import-key-pair --key-name "spinifex-key" --public-key-material fileb://~/.ssh/id_rsa.pub ``` If no key exists, generate one using `ssh-keygen` and repeat the command above. @@ -163,20 +163,20 @@ Alternatively, create a new key pair using the AWS CLI tool and store the JSON o ```bash aws ec2 create-key-pair \ - --key-name hive-key \ -| jq -r '.KeyMaterial | rtrimstr("\n")' > ~/.ssh/hive-key + --key-name spinifex-key \ +| jq -r '.KeyMaterial | rtrimstr("\n")' > ~/.ssh/spinifex-key ``` Update permissions for the key for SSH to accept reading the file. ```bash -chmod 600 ~/.ssh/hive-key +chmod 600 ~/.ssh/spinifex-key ``` Next, generate a public key from the specified private key pair. ```bash -ssh-keygen -y -f ~/.ssh/hive-key > ~/.ssh/hive-key.pub +ssh-keygen -y -f ~/.ssh/spinifex-key > ~/.ssh/spinifex-key.pub ``` ### Verify New Key @@ -193,7 +193,7 @@ aws ec2 describe-key-pairs "KeyType": "ed25519", "Tags": [], "CreateTime": "2025-10-28T13:39:23.458000+00:00", - "KeyName": "hive-key", + "KeyName": "spinifex-key", "KeyFingerprint": "SHA256:/g/A5OkeZeSydz9WUErXYVdCt00b0VbfN6RLn2YVFAY" } ] @@ -202,16 +202,16 @@ aws ec2 describe-key-pairs ## Create AMI Template -The Hive CLI tool offers 2 ways of importing an image. You can use automatic image importing, and select from our range of images. Alternatively, provide your own image source file (e.g image.tar.gz, image.gz, image.tar.xz) and the tool will automatically extract and upload the raw OS image as an AMI (after validating the image contains UEFI/BIOS boot capability). +The Spinifex CLI tool offers 2 ways of importing an image. You can use automatic image importing, and select from our range of images. Alternatively, provide your own image source file (e.g image.tar.gz, image.gz, image.tar.xz) and the tool will automatically extract and upload the raw OS image as an AMI (after validating the image contains UEFI/BIOS boot capability). -**Note:** When downloading OS images, use platforms that support the `cloud-init` feature to automatically bootstrap when using the Hive EC2 functionality to access SSH and networking services. +**Note:** When downloading OS images, use platforms that support the `cloud-init` feature to automatically bootstrap when using the Spinifex EC2 functionality to access SSH and networking services. ### Automatic Image Import -Discover available images to automatically download and install. This will pull the images from the distro official mirror and simplify the process to bootstrap a Hive installation with AMIs for common operating systems. +Discover available images to automatically download and install. This will pull the images from the distro official mirror and simplify the process to bootstrap a Spinifex installation with AMIs for common operating systems. ```bash -./bin/hive admin images list +./bin/spx admin images list ``` ```bash @@ -225,7 +225,7 @@ ubuntu-24.04-x86_64 | ubuntu | 24.04 | x86_64 | bios Next, choose the image you would like to import as an AMI. Choose the appropriate `x86_64` or `arm64` architecture depending on your platform. ```bash -./bin/hive admin images import --name debian-12-arm64 +./bin/spx admin images import --name debian-12-arm64 ``` ### Manual Image Import @@ -241,7 +241,7 @@ wget https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericclou Import as an AMI to the backend store: ```bash -./bin/hive admin images import --file ~/debian-12-genericcloud-arm64.tar.xz --arch arm64 --distro debian --version 12 +./bin/spx admin images import --file ~/debian-12-genericcloud-arm64.tar.xz --arch arm64 --distro debian --version 12 ``` ### Verify Image Import @@ -249,18 +249,18 @@ Import as an AMI to the backend store: Export the AMI. ```bash -export HIVE_AMI="ami-XXX" +export SPINIFEX_AMI="ami-XXX" ``` Next, verify available disk images to confirm the import was successful. ```bash -aws ec2 describe-images --image-ids $HIVE_AMI +aws ec2 describe-images --image-ids $SPINIFEX_AMI ``` ## Create VPC and Subnet -Every EC2 instance runs inside a VPC (Virtual Private Cloud) with an isolated virtual network. Hive creates a default VPC automatically during initialization, but you can also create your own. +Every EC2 instance runs inside a VPC (Virtual Private Cloud) with an isolated virtual network. Spinifex creates a default VPC automatically during initialization, but you can also create your own. ### Create a VPC @@ -282,7 +282,7 @@ aws ec2 create-vpc --cidr-block 10.200.0.0/16 Export the VPC ID: ```bash -export HIVE_VPC="vpc-XXX" +export SPINIFEX_VPC="vpc-XXX" ``` ### Create a Subnet @@ -290,7 +290,7 @@ export HIVE_VPC="vpc-XXX" Create a subnet within the VPC. All instances launched into this subnet will receive a private IP address from its CIDR range via DHCP. ```bash -aws ec2 create-subnet --vpc-id $HIVE_VPC --cidr-block 10.200.1.0/24 +aws ec2 create-subnet --vpc-id $SPINIFEX_VPC --cidr-block 10.200.1.0/24 ``` ```json @@ -308,7 +308,7 @@ aws ec2 create-subnet --vpc-id $HIVE_VPC --cidr-block 10.200.1.0/24 Export the Subnet ID — this is required when launching instances: ```bash -export HIVE_SUBNET="subnet-XXX" +export SPINIFEX_SUBNET="subnet-XXX" ``` ### Verify VPC Networking @@ -320,15 +320,15 @@ aws ec2 describe-vpcs aws ec2 describe-subnets ``` -Behind the scenes, Hive's `vpcd` service translates these into OVN topology: the VPC becomes a logical router, the subnet becomes a logical switch with DHCP options, and each instance launched into the subnet gets an OVN port with automatic IP assignment. +Behind the scenes, Spinifex's `vpcd` service translates these into OVN topology: the VPC becomes a logical router, the subnet becomes a logical switch with DHCP options, and each instance launched into the subnet gets an OVN port with automatic IP assignment. ## Run Instance -Once Hive is successfully installed and bootstrapped with a system AMI, SSH keys, and a VPC subnet, proceed to run an instance. +Once Spinifex is successfully installed and bootstrapped with a system AMI, SSH keys, and a VPC subnet, proceed to run an instance. ### Query Instance Types -Depending on the host platform Hive is installed, different compute instances will be available. +Depending on the host platform Spinifex is installed, different compute instances will be available. Query available instance types and choose an instance type available on your host: @@ -369,19 +369,19 @@ aws ec2 describe-instance-types Export the instance-type: ```sh -export HIVE_INSTANCE="t3.small" +export SPINIFEX_INSTANCE="t3.small" ``` ### Run Instance -Next, launch a new instance. The `--subnet-id` places the instance into your VPC subnet, where it will receive a private IP address via DHCP. The `hive-key` is the SSH key specified in the previous stage. +Next, launch a new instance. The `--subnet-id` places the instance into your VPC subnet, where it will receive a private IP address via DHCP. The `spinifex-key` is the SSH key specified in the previous stage. ```bash aws ec2 run-instances \ - --image-id $HIVE_AMI \ - --instance-type $HIVE_INSTANCE \ - --key-name hive-key \ - --subnet-id $HIVE_SUBNET \ + --image-id $SPINIFEX_AMI \ + --instance-type $SPINIFEX_INSTANCE \ + --key-name spinifex-key \ + --subnet-id $SPINIFEX_SUBNET \ --count 1 ``` @@ -402,7 +402,7 @@ A sample response is below from the `RunInstance` request. Note the `InstanceId` "PrivateIpAddress": "10.200.1.5", "SubnetId": "subnet-6e7f829e3a4b1c5d0", "VpcId": "vpc-1035bd70d9bc10b06", - "KeyName": "hive-key", + "KeyName": "spinifex-key", "InstanceType": "t3.micro", "LaunchTime": "2025-11-12T13:07:47.548000+00:00", "NetworkInterfaces": [ @@ -457,7 +457,7 @@ Confirm the `State.Name` attribute is set as `running` and the instance has a `P "PrivateIpAddress": "10.200.1.5", "SubnetId": "subnet-6e7f829e3a4b1c5d0", "VpcId": "vpc-1035bd70d9bc10b06", - "KeyName": "hive-key", + "KeyName": "spinifex-key", "InstanceType": "t3.micro", "LaunchTime": "2025-11-12T13:07:47.548000+00:00" } @@ -469,7 +469,7 @@ Confirm the `State.Name` attribute is set as `running` and the instance has a `P ## SSH Connection (development) -For a Hive development environment (toggled off for production), a local SSH port forwarding will be active to connect directly to the instance, regardless of the VPC and network settings. +For a Spinifex development environment (toggled off for production), a local SSH port forwarding will be active to connect directly to the instance, regardless of the VPC and network settings. Determine the SSH port allocated. @@ -484,12 +484,12 @@ qemu-system-x86_64 -daemonize -pidfile /run/user/1000/i-36765eb0c6609e4d.pid -qm Note the `hostfwd=tcp:127.0.0.1:33683-:22`, in this case the local port `33683` will connect to the new instance. ```bash -ssh -i ~/.ssh/hive-key ec2-user@127.0.0.1 -p 33683 +ssh -i ~/.ssh/spinifex-key ec2-user@127.0.0.1 -p 33683 ... -Linux hive-vm-36765eb0 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64 -ec2-user@hive-vm-36765eb0:~$ +Linux spinifex-vm-36765eb0 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64 +ec2-user@spinifex-vm-36765eb0:~$ ``` Congratulations! Your first AMI image is imported, a new EC2 instance launched, and successfully connected via SSH for the configured SSH key, using the OS `cloud-init` procedure. @@ -542,7 +542,7 @@ aws ec2 describe-instances --instance-ids $INSTANCE_ID "Code": 80, "Name": "stopped" }, - "KeyName": "hive-key", + "KeyName": "spinifex-key", "InstanceType": "t3.micro", "LaunchTime": "2025-11-12T13:07:47.548000+00:00" } @@ -598,7 +598,7 @@ aws ec2 describe-instances --instance-ids "i-36765eb0c6609e4d2" "Code": 16, "Name": "running" }, - "KeyName": "hive-key", + "KeyName": "spinifex-key", "InstanceType": "t3.micro", "LaunchTime": "2025-11-12T13:07:47.548000+00:00" } @@ -644,29 +644,29 @@ On success no data will be returned, since the instance is no longer available. ## Additional Accounts (Optional) -The default `hive` account is created automatically during init. To create additional isolated accounts with their own resources (instances, volumes, VPCs, key pairs): +The default `spx` account is created automatically during init. To create additional isolated accounts with their own resources (instances, volumes, VPCs, key pairs): ```bash -./bin/hive admin account create --name myteam +./bin/spx admin account create --name myteam ``` -This provisions an IAM account with an admin user, generates access keys, and configures a local AWS CLI profile named `hive-myteam`. Resources created under one account are isolated from other accounts. +This provisions an IAM account with an admin user, generates access keys, and configures a local AWS CLI profile named `spinifex-myteam`. Resources created under one account are isolated from other accounts. ```bash -export AWS_PROFILE=hive-myteam +export AWS_PROFILE=spinifex-myteam ``` ## UI Management Panel -The Hive Platform also offers a web interface for managing hive services. Simply have the hive server running and go to [https://localhost:3000](https://localhost:3000) in your browser to continue. +The Spinifex Platform also offers a web interface for managing spx services. Simply have the hive server running and go to [https://localhost:3000](https://localhost:3000) in your browser to continue. -**Note:** If you are not viewing the website on the same machine that is running the hive server, you will need to go to [https://localhost:9999](https://localhost:9999) and [https://localhost:8443](https://localhost:8443) and accept the certificates. If you have added the CA to your local machine this is not needed. +**Note:** If you are not viewing the website on the same machine that is running the spinifex server, you will need to go to [https://localhost:9999](https://localhost:9999) and [https://localhost:8443](https://localhost:8443) and accept the certificates. If you have added the CA to your local machine this is not needed. # Multi-Node Installation -Hive is designed for distributed, multi-server deployments. A Hive cluster operates as a fully distributed infrastructure region — similar to an AWS Region — where multiple nodes work together to provide high availability, data durability, and fault tolerance across the platform. +Spinifex is designed for distributed, multi-server deployments. A Spinifex cluster operates as a fully distributed infrastructure region — similar to an AWS Region — where multiple nodes work together to provide high availability, data durability, and fault tolerance across the platform. -When deploying a multi-node cluster, you define a **region** (e.g., `ap-southeast-2`, `us-east-1`) and **availability zones** to organize your infrastructure. Services are distributed across nodes: NATS provides a clustered message bus for request routing and JetStream replication, Predastore uses Raft consensus with Reed-Solomon erasure coding (RS 2+1) for durable S3-compatible object storage, and the Hive daemon on each node can independently serve AWS API requests. The result is a platform where compute, storage, and API services are replicated — an AMI stored on one node is available from any node, an EC2 instance launched via any gateway is visible cluster-wide, and the loss of a single node does not compromise data or availability. +When deploying a multi-node cluster, you define a **region** (e.g., `ap-southeast-2`, `us-east-1`) and **availability zones** to organize your infrastructure. Services are distributed across nodes: NATS provides a clustered message bus for request routing and JetStream replication, Predastore uses Raft consensus with Reed-Solomon erasure coding (RS 2+1) for durable S3-compatible object storage, and the Spinifex daemon on each node can independently serve AWS API requests. The result is a platform where compute, storage, and API services are replicated — an AMI stored on one node is available from any node, an EC2 instance launched via any gateway is visible cluster-wide, and the loss of a single node does not compromise data or availability. Cluster formation is automatic. When initializing with `--nodes 3`, the init node starts a formation server and waits for other nodes to join. Once all nodes have registered, each node receives the full cluster topology — credentials, CA certificates, NATS routes, Predastore peer lists — and generates its own configuration files. No manual configuration synchronization is required. @@ -677,9 +677,9 @@ Cluster formation is automatic. When initializing with `--nodes 3`, the init nod | **Servers** | 1 machine, loopback IPs | 3+ physical/virtual servers | | **Use case** | Development & testing | Production & staging | | **Network** | `127.0.0.1/2/3` (no setup) | Real LAN IPs | -| **Data dirs** | `~/node1/`, `~/node2/`, `~/node3/` | `~/hive/` on each server | +| **Data dirs** | `~/node1/`, `~/node2/`, `~/node3/` | `~/spinifex/` on each server | -Both options use `HIVE_NODE1`, `HIVE_NODE2`, and `HIVE_NODE3` environment variables. Set them in the option you choose, then all subsequent sections (verification, usage, shutdown) reference them. +Both options use `SPINIFEX_NODE1`, `SPINIFEX_NODE2`, and `SPINIFEX_NODE3` environment variables. Set them in the option you choose, then all subsequent sections (verification, usage, shutdown) reference them. ### Option A: Simulated Multi-Node (Single Server) @@ -690,9 +690,9 @@ For development and testing, a 3-node cluster can be simulated on a single machi ```bash make build -export HIVE_NODE1=127.0.0.1 -export HIVE_NODE2=127.0.0.2 -export HIVE_NODE3=127.0.0.3 +export SPINIFEX_NODE1=127.0.0.1 +export SPINIFEX_NODE2=127.0.0.2 +export SPINIFEX_NODE3=127.0.0.3 ``` #### 2. Setup OVN @@ -712,28 +712,28 @@ The formation process requires running init and join commands concurrently. The **Terminal 1 — Initialize the leader node:** ```bash -./bin/hive admin init \ +./bin/spx admin init \ --node node1 \ --nodes 3 \ - --bind $HIVE_NODE1 \ - --cluster-bind $HIVE_NODE1 \ + --bind $SPINIFEX_NODE1 \ + --cluster-bind $SPINIFEX_NODE1 \ --port 4432 \ - --hive-dir ~/node1/ \ + --spinifex-dir ~/node1/ \ --config-dir ~/node1/config/ \ --region ap-southeast-2 \ --az ap-southeast-2a ``` -This starts a formation server on `$HIVE_NODE1:4432` and waits for 2 more nodes to join. +This starts a formation server on `$SPINIFEX_NODE1:4432` and waits for 2 more nodes to join. **Terminal 2 — Join node 2 (while init is running):** ```bash -./bin/hive admin join \ +./bin/spx admin join \ --node node2 \ - --bind $HIVE_NODE2 \ - --cluster-bind $HIVE_NODE2 \ - --host $HIVE_NODE1:4432 \ + --bind $SPINIFEX_NODE2 \ + --cluster-bind $SPINIFEX_NODE2 \ + --host $SPINIFEX_NODE1:4432 \ --data-dir ~/node2/ \ --config-dir ~/node2/config/ \ --region ap-southeast-2 \ @@ -743,11 +743,11 @@ This starts a formation server on `$HIVE_NODE1:4432` and waits for 2 more nodes **Terminal 3 — Join node 3 (while init is running):** ```bash -./bin/hive admin join \ +./bin/spx admin join \ --node node3 \ - --bind $HIVE_NODE3 \ - --cluster-bind $HIVE_NODE3 \ - --host $HIVE_NODE1:4432 \ + --bind $SPINIFEX_NODE3 \ + --cluster-bind $SPINIFEX_NODE3 \ + --host $SPINIFEX_NODE1:4432 \ --data-dir ~/node3/ \ --config-dir ~/node3/config/ \ --region ap-southeast-2 \ @@ -774,14 +774,14 @@ For production or production-like deployments across multiple physical servers o On **each server**: -1. Install Hive dependencies (see [Dependencies](#dependencies) above) +1. Install Spinifex dependencies (see [Dependencies](#dependencies) above) 2. Clone the repository and build: ```bash mkdir -p ~/Development/mulga/ cd ~/Development/mulga/ -git clone https://github.com/mulgadc/hive.git -cd hive +git clone https://github.com/mulgadc/spinifex.git +cd spinifex ./scripts/clone-deps.sh make build ``` @@ -802,9 +802,9 @@ With a **single NIC**, use the one real IP (e.g. `192.168.1.10`) for everything. Export the IPs for your three servers (replace with your actual IPs) on each server: ```bash -export HIVE_NODE1=192.168.1.10 -export HIVE_NODE2=192.168.1.11 -export HIVE_NODE3=192.168.1.12 +export SPINIFEX_NODE1=192.168.1.10 +export SPINIFEX_NODE2=192.168.1.11 +export SPINIFEX_NODE3=192.168.1.12 ``` #### 2. Setup OVN @@ -816,8 +816,8 @@ OVN must be configured on every server before forming the cluster. Server 1 runs **Server 1 — OVN central + compute (run first):** ```bash -cd ~/Development/mulga/hive -./scripts/setup-ovn.sh --management --encap-ip=$HIVE_NODE1 +cd ~/Development/mulga/spinifex +./scripts/setup-ovn.sh --management --encap-ip=$SPINIFEX_NODE1 ``` Verify OVN central is ready before proceeding to other servers: @@ -829,15 +829,15 @@ sudo ovn-sbctl show **Server 2 — Compute node (after server 1 is ready):** ```bash -cd ~/Development/mulga/hive -./scripts/setup-ovn.sh --ovn-remote=tcp:$HIVE_NODE1:6642 --encap-ip=$HIVE_NODE2 +cd ~/Development/mulga/spinifex +./scripts/setup-ovn.sh --ovn-remote=tcp:$SPINIFEX_NODE1:6642 --encap-ip=$SPINIFEX_NODE2 ``` **Server 3 — Compute node (after server 1 is ready):** ```bash -cd ~/Development/mulga/hive -./scripts/setup-ovn.sh --ovn-remote=tcp:$HIVE_NODE1:6642 --encap-ip=$HIVE_NODE3 +cd ~/Development/mulga/spinifex +./scripts/setup-ovn.sh --ovn-remote=tcp:$SPINIFEX_NODE1:6642 --encap-ip=$SPINIFEX_NODE3 ``` Verify OVN is running on all servers: @@ -861,16 +861,16 @@ If your servers have a dedicated data/overlay NIC separate from the management N **Server 1 — Initialize the cluster:** ```bash -cd ~/Development/mulga/hive +cd ~/Development/mulga/spinifex -./bin/hive admin init \ +./bin/spx admin init \ --node node1 \ --nodes 3 \ - --bind $HIVE_NODE1 \ - --cluster-bind $HIVE_NODE1 \ + --bind $SPINIFEX_NODE1 \ + --cluster-bind $SPINIFEX_NODE1 \ --port 4432 \ - --hive-dir ~/hive/ \ - --config-dir ~/hive/config/ \ + --spinifex-dir ~/spinifex/ \ + --config-dir ~/spinifex/config/ \ --region us-east-1 \ --az us-east-1a ``` @@ -878,15 +878,15 @@ cd ~/Development/mulga/hive **Server 2 — Join the cluster (while init is running):** ```bash -cd ~/Development/mulga/hive +cd ~/Development/mulga/spinifex -./bin/hive admin join \ +./bin/spx admin join \ --node node2 \ - --bind $HIVE_NODE2 \ - --cluster-bind $HIVE_NODE2 \ - --host $HIVE_NODE1:4432 \ - --data-dir ~/hive/ \ - --config-dir ~/hive/config/ \ + --bind $SPINIFEX_NODE2 \ + --cluster-bind $SPINIFEX_NODE2 \ + --host $SPINIFEX_NODE1:4432 \ + --data-dir ~/spinifex/ \ + --config-dir ~/spinifex/config/ \ --region us-east-1 \ --az us-east-1a ``` @@ -894,15 +894,15 @@ cd ~/Development/mulga/hive **Server 3 — Join the cluster (while init is running):** ```bash -cd ~/Development/mulga/hive +cd ~/Development/mulga/spinifex -./bin/hive admin join \ +./bin/spx admin join \ --node node3 \ - --bind $HIVE_NODE3 \ - --cluster-bind $HIVE_NODE3 \ - --host $HIVE_NODE1:4432 \ - --data-dir ~/hive/ \ - --config-dir ~/hive/config/ \ + --bind $SPINIFEX_NODE3 \ + --cluster-bind $SPINIFEX_NODE3 \ + --host $SPINIFEX_NODE1:4432 \ + --data-dir ~/spinifex/ \ + --config-dir ~/spinifex/config/ \ --region us-east-1 \ --az us-east-1a ``` @@ -922,41 +922,41 @@ After formation completes, start services on **all servers**: From any node, view cluster status and resource capacity: ```bash -./bin/hive get nodes +./bin/spx get nodes # NAME STATUS IP REGION AZ UPTIME VMs SERVICES -# node1 Ready $HIVE_NODE1 ... ... 2m 0 nats,predastore,viperblock,daemon,... -# node2 Ready $HIVE_NODE2 ... ... 2m 0 nats,predastore,viperblock,daemon -# node3 Ready $HIVE_NODE3 ... ... 2m 0 nats,predastore,viperblock,daemon +# node1 Ready $SPINIFEX_NODE1 ... ... 2m 0 nats,predastore,viperblock,daemon,... +# node2 Ready $SPINIFEX_NODE2 ... ... 2m 0 nats,predastore,viperblock,daemon +# node3 Ready $SPINIFEX_NODE3 ... ... 2m 0 nats,predastore,viperblock,daemon -./bin/hive top nodes +./bin/spx top nodes # NAME CPU (used/total) MEM (used/total) VMs # node1 0/16 0.0Gi/30.6Gi 0 # node2 0/16 0.0Gi/30.6Gi 0 # node3 0/16 0.0Gi/30.6Gi 0 ``` -All nodes should show `Ready` status. Use `./bin/hive get vms` to see running instances across the cluster. +All nodes should show `Ready` status. Use `./bin/spx get vms` to see running instances across the cluster. Check individual daemon health endpoints: ```bash -curl -s http://$HIVE_NODE1:4432/health -curl -s http://$HIVE_NODE2:4432/health -curl -s http://$HIVE_NODE3:4432/health +curl -s http://$SPINIFEX_NODE1:4432/health +curl -s http://$SPINIFEX_NODE2:4432/health +curl -s http://$SPINIFEX_NODE3:4432/health ``` Check NATS cluster routing (from any node): ```bash grep -i "route\|cluster" ~/node1/logs/nats.log # simulated -grep -i "route\|cluster" ~/hive/logs/nats.log # real multi-server +grep -i "route\|cluster" ~/spinifex/logs/nats.log # real multi-server ``` Check Predastore Raft consensus: ```bash grep -i "leader\|election" ~/node1/logs/predastore.log # simulated -grep -i "leader\|election" ~/hive/logs/predastore.log # real multi-server +grep -i "leader\|election" ~/spinifex/logs/predastore.log # real multi-server ``` ## Trust CA Certificate @@ -964,21 +964,21 @@ grep -i "leader\|election" ~/hive/logs/predastore.log # real multi-server The CA certificate is generated by the init node and distributed to all joining nodes during formation. On **each node** (or the single machine for simulated mode), trust the CA: ```bash -sudo cp ~/hive/config/ca.pem /usr/local/share/ca-certificates/hive-ca.crt +sudo cp ~/spinifex/config/ca.pem /usr/local/share/ca-certificates/spinifex-ca.crt sudo update-ca-certificates ``` For simulated mode, the config directory is under each node's data directory — copy from any node since the CA is the same: ```bash -sudo cp ~/node1/config/ca.pem /usr/local/share/ca-certificates/hive-ca.crt +sudo cp ~/node1/config/ca.pem /usr/local/share/ca-certificates/spinifex-ca.crt sudo update-ca-certificates ``` Set the AWS profile to use the default admin account created during init: ```bash -export AWS_PROFILE=hive +export AWS_PROFILE=spinifex ``` ## Using the Cluster @@ -986,8 +986,8 @@ export AWS_PROFILE=hive Connect to any node's AWS Gateway — all nodes serve the same cluster state: ```bash -AWS_ENDPOINT_URL=https://$HIVE_NODE1:9999 aws ec2 describe-instances -AWS_ENDPOINT_URL=https://$HIVE_NODE2:9999 aws ec2 describe-instances +AWS_ENDPOINT_URL=https://$SPINIFEX_NODE1:9999 aws ec2 describe-instances +AWS_ENDPOINT_URL=https://$SPINIFEX_NODE2:9999 aws ec2 describe-instances ``` ### Create SSH Key @@ -995,24 +995,24 @@ AWS_ENDPOINT_URL=https://$HIVE_NODE2:9999 aws ec2 describe-instances Create or import an SSH key pair from **any node** — the key is stored in Predastore and available cluster-wide: ```bash -aws ec2 import-key-pair --key-name "hive-key" --public-key-material fileb://~/.ssh/id_rsa.pub +aws ec2 import-key-pair --key-name "spinifex-key" --public-key-material fileb://~/.ssh/id_rsa.pub ``` Or generate a new key pair: ```bash aws ec2 create-key-pair \ - --key-name hive-key \ -| jq -r '.KeyMaterial | rtrimstr("\n")' > ~/.ssh/hive-key -chmod 600 ~/.ssh/hive-key + --key-name spinifex-key \ +| jq -r '.KeyMaterial | rtrimstr("\n")' > ~/.ssh/spinifex-key +chmod 600 ~/.ssh/spinifex-key ``` **Important:** If you want to ssh into instances, you will need to copy the private key to every node in the cluster. Instance SSH port forwarding is only accessible from the node running the VM, so you need the key available on all nodes: ```bash # From the node where the key was created, copy to other nodes: -scp ~/.ssh/hive-key tf-user@$HIVE_NODE2:~/.ssh/hive-key -scp ~/.ssh/hive-key tf-user@$HIVE_NODE3:~/.ssh/hive-key +scp ~/.ssh/spinifex-key tf-user@$SPINIFEX_NODE2:~/.ssh/spinifex-key +scp ~/.ssh/spinifex-key tf-user@$SPINIFEX_NODE3:~/.ssh/spinifex-key ``` ### Create AMI Template @@ -1020,15 +1020,15 @@ scp ~/.ssh/hive-key tf-user@$HIVE_NODE3:~/.ssh/hive-key Import an OS image from **any node**. The AMI is stored in Predastore and available cluster-wide: ```bash -./bin/hive admin images list -./bin/hive admin images import --name debian-12-x86_64 +./bin/spx admin images list +./bin/spx admin images import --name debian-12-x86_64 ``` Verify and export the AMI ID: ```bash aws ec2 describe-images -export HIVE_AMI="ami-XXX" +export SPINIFEX_AMI="ami-XXX" ``` See the [single-node AMI section](#create-ami-template) for more options (manual import, custom images). @@ -1039,10 +1039,10 @@ Create a VPC and subnet for your cluster. This only needs to be done once — th ```bash aws ec2 create-vpc --cidr-block 10.200.0.0/16 -export HIVE_VPC="vpc-XXX" +export SPINIFEX_VPC="vpc-XXX" -aws ec2 create-subnet --vpc-id $HIVE_VPC --cidr-block 10.200.1.0/24 -export HIVE_SUBNET="subnet-XXX" +aws ec2 create-subnet --vpc-id $SPINIFEX_VPC --cidr-block 10.200.1.0/24 +export SPINIFEX_SUBNET="subnet-XXX" ``` Verify the OVN topology was created (from server 1): @@ -1054,14 +1054,14 @@ sudo ovn-nbctl ls-list # One logical switch per subnet ### Launching Instances Across Nodes -Use `--count` to launch multiple instances in a single request. Hive distributes them across nodes in the cluster based on available capacity — instances land on different physical hosts but share the same VPC subnet, and can route traffic to each other over OVN's Geneve overlay: +Use `--count` to launch multiple instances in a single request. Spinifex distributes them across nodes in the cluster based on available capacity — instances land on different physical hosts but share the same VPC subnet, and can route traffic to each other over OVN's Geneve overlay: ```bash aws ec2 run-instances \ - --image-id $HIVE_AMI \ - --instance-type $HIVE_INSTANCE \ - --key-name hive-key \ - --subnet-id $HIVE_SUBNET \ + --image-id $SPINIFEX_AMI \ + --instance-type $SPINIFEX_INSTANCE \ + --key-name spinifex-key \ + --subnet-id $SPINIFEX_SUBNET \ --count 3 ``` @@ -1076,7 +1076,7 @@ aws ec2 describe-instances Check which node each instance landed on: ```bash -./bin/hive get vms +./bin/spx get vms ``` ### Verifying Cross-Host Connectivity @@ -1090,7 +1090,7 @@ ps auxw | grep hostfwd ``` ```bash -ssh -i ~/.ssh/hive-key ec2-user@ -p +ssh -i ~/.ssh/spinifex-key ec2-user@ -p ``` From inside the VM, ping an instance running on a **different physical node**: @@ -1101,7 +1101,7 @@ ping 10.200.1.6 If the ping succeeds across hosts, the OVN Geneve overlay is working correctly — traffic is being encapsulated and routed between physical servers transparently. -Check logs on each node for debugging. Log locations depend on your deployment mode — `~/node{1,2,3}/logs/` for simulated, `~/hive/logs/` for real multi-server. +Check logs on each node for debugging. Log locations depend on your deployment mode — `~/node{1,2,3}/logs/` for simulated, `~/spinifex/logs/` for real multi-server. ## Advanced Configuration @@ -1154,14 +1154,14 @@ Example with management NIC `192.168.1.0/24` and overlay NIC `10.0.0.0/24`. The Server 1: ```bash -./bin/hive admin init \ +./bin/spx admin init \ --node node1 \ --nodes 3 \ --bind 192.168.1.10 \ --cluster-bind 192.168.1.10 \ --port 4432 \ - --hive-dir ~/hive/ \ - --config-dir ~/hive/config/ \ + --spinifex-dir ~/spinifex/ \ + --config-dir ~/spinifex/config/ \ --region us-east-1 \ --az us-east-1a ``` @@ -1169,13 +1169,13 @@ Server 1: Server 2 (while init is running): ```bash -./bin/hive admin join \ +./bin/spx admin join \ --node node2 \ --bind 192.168.1.11 \ --cluster-bind 192.168.1.11 \ --host 192.168.1.10:4432 \ - --data-dir ~/hive/ \ - --config-dir ~/hive/config/ \ + --data-dir ~/spinifex/ \ + --config-dir ~/spinifex/config/ \ --region us-east-1 \ --az us-east-1a ``` @@ -1183,13 +1183,13 @@ Server 2 (while init is running): Server 3 (while init is running): ```bash -./bin/hive admin join \ +./bin/spx admin join \ --node node3 \ --bind 192.168.1.12 \ --cluster-bind 192.168.1.12 \ --host 192.168.1.10:4432 \ - --data-dir ~/hive/ \ - --config-dir ~/hive/config/ \ + --data-dir ~/spinifex/ \ + --config-dir ~/spinifex/config/ \ --region us-east-1 \ --az us-east-1a ``` @@ -1204,7 +1204,7 @@ sudo ip addr add 10.11.12.2/24 dev eth0 sudo ip addr add 10.11.12.3/24 dev eth0 ``` -Replace `eth0` with your network interface name (e.g., `enp0s3`, `ens33`). Then export these as your `HIVE_NODE` variables instead of the loopback addresses. +Replace `eth0` with your network interface name (e.g., `enp0s3`, `ens33`). Then export these as your `SPINIFEX_NODE` variables instead of the loopback addresses. To remove the aliases: @@ -1221,7 +1221,7 @@ When running in the multi-server cluster mode a graceful shutdown is required to On any node, issue the following command to shutdown nodes cluster wide: ```sh -./bin/hive admin cluster shutdown +./bin/spx admin cluster shutdown ``` Example output: @@ -1231,9 +1231,9 @@ Phases: gate -> drain -> storage -> persist -> infra Timeout per phase: 2m0s [GATE] Sending to 3 node(s)... - [GATE] node1: stopped awsgw, hive-ui - [GATE] node3: stopped awsgw, hive-ui - [GATE] node2: stopped awsgw, hive-ui + [GATE] node1: stopped awsgw, spinifex-ui + [GATE] node3: stopped awsgw, spinifex-ui + [GATE] node2: stopped awsgw, spinifex-ui [GATE] Complete (3/3 nodes, 2.005s) [DRAIN] Sending to 3 node(s)... diff --git a/docs/README.md b/docs/README.md index f78b0d7f0..457c407a3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,3 +1,3 @@ -# Hive Documentation +# Spinifex Documentation -This directory contains the Hive documentation. This is available in individual markdown files, and a generated website to aid navigation and browing documentation at: [https://docs.mulgadc.com](https://docs.mulgadc.com/) +This directory contains the Spinifex documentation. This is available in individual markdown files, and a generated website to aid navigation and browing documentation at: [https://docs.mulgadc.com](https://docs.mulgadc.com/) diff --git a/docs/creating-accounts/README.md b/docs/creating-accounts/README.md index 9bbf45ceb..d9a753e81 100644 --- a/docs/creating-accounts/README.md +++ b/docs/creating-accounts/README.md @@ -7,8 +7,8 @@ tags: - iam - admin resources: - - title: "Hive Repository" - url: "https://github.com/mulgadc/hive" + - title: "Spinifex Repository" + url: "https://github.com/mulgadc/spinifex" --- # Creating Accounts @@ -25,15 +25,15 @@ resources: ## Overview -Hive supports multi-tenant account isolation. Each account gets its own IAM credentials, AWS CLI profile, and isolated resource namespace. +Spinifex supports multi-tenant account isolation. Each account gets its own IAM credentials, AWS CLI profile, and isolated resource namespace. ## Instructions ## Create Account ```bash -./bin/hive admin account create --name myteam -export AWS_PROFILE=hive-myteam +./bin/spx admin account create --name myteam +export AWS_PROFILE=spinifex-myteam ``` ## Verify @@ -57,5 +57,5 @@ Ensure the `AWS_PROFILE` environment variable matches the profile name: ```bash echo $AWS_PROFILE -export AWS_PROFILE=hive-myteam +export AWS_PROFILE=spinifex-myteam ``` diff --git a/docs/creating-an-environment/README.md b/docs/creating-an-environment/README.md index dda257f69..922954b69 100644 --- a/docs/creating-an-environment/README.md +++ b/docs/creating-an-environment/README.md @@ -8,8 +8,8 @@ tags: - ec2 - ssh resources: - - title: "Hive Repository" - url: "https://github.com/mulgadc/hive" + - title: "Spinifex Repository" + url: "https://github.com/mulgadc/spinifex" - title: "Debian Cloud Images" url: "https://cloud.debian.org/images/cloud/bookworm/latest/" --- @@ -28,7 +28,7 @@ resources: ## Overview -This guide walks through the complete workflow for creating a production-ready Hive environment. +This guide walks through the complete workflow for creating a production-ready Spinifex environment. **Steps:** 1. Create a user account @@ -44,35 +44,35 @@ This guide walks through the complete workflow for creating a production-ready H ## 1. Import SSH Key ```bash -aws ec2 import-key-pair --key-name "hive-key" --public-key-material fileb://~/.ssh/id_rsa.pub +aws ec2 import-key-pair --key-name "spinifex-key" --public-key-material fileb://~/.ssh/id_rsa.pub ``` ## 2. Create VPC ```bash aws ec2 create-vpc --cidr-block 10.200.0.0/16 -export HIVE_VPC="vpc-XXX" +export SPINIFEX_VPC="vpc-XXX" -aws ec2 create-subnet --vpc-id $HIVE_VPC --cidr-block 10.200.1.0/24 -export HIVE_SUBNET="subnet-XXX" +aws ec2 create-subnet --vpc-id $SPINIFEX_VPC --cidr-block 10.200.1.0/24 +export SPINIFEX_SUBNET="subnet-XXX" ``` ## 3. Import AMI ```bash -./bin/hive admin images list -./bin/hive admin images import --name debian-12-x86_64 -export HIVE_AMI="ami-XXX" +./bin/spx admin images list +./bin/spx admin images import --name debian-12-x86_64 +export SPINIFEX_AMI="ami-XXX" ``` ## 4. Launch Instance ```bash aws ec2 run-instances \ - --image-id $HIVE_AMI \ + --image-id $SPINIFEX_AMI \ --instance-type t3.small \ - --key-name hive-key \ - --subnet-id $HIVE_SUBNET \ + --key-name spinifex-key \ + --subnet-id $SPINIFEX_SUBNET \ --count 1 ``` @@ -82,24 +82,24 @@ aws ec2 run-instances \ ps auxw | grep $INSTANCE_ID # Look for: hostfwd=tcp:127.0.0.1:-:22 -ssh -i ~/.ssh/hive-key ec2-user@127.0.0.1 -p +ssh -i ~/.ssh/spinifex-key ec2-user@127.0.0.1 -p ``` ## Troubleshooting ## Instance stuck in pending -Check the Hive daemon and QEMU logs for boot errors: +Check the Spinifex daemon and QEMU logs for boot errors: ```bash -ls ~/hive/logs/ -cat ~/hive/logs/daemon.log +ls ~/spinifex/logs/ +cat ~/spinifex/logs/daemon.log ``` Verify the AMI exists and architecture matches your host: ```bash -aws ec2 describe-images --image-ids $HIVE_AMI +aws ec2 describe-images --image-ids $SPINIFEX_AMI ``` ## SSH connection refused @@ -115,5 +115,5 @@ ps auxw | grep hostfwd Ensure you're using the correct key and port: ```bash -ssh -i ~/.ssh/hive-key ec2-user@127.0.0.1 -p +ssh -i ~/.ssh/spinifex-key ec2-user@127.0.0.1 -p ``` diff --git a/docs/hybrid-sync/README.md b/docs/hybrid-sync/README.md index 282306be3..1ff5a920b 100644 --- a/docs/hybrid-sync/README.md +++ b/docs/hybrid-sync/README.md @@ -1,19 +1,19 @@ --- title: "Hybrid Sync" -description: "Synchronize data between Hive and AWS when network connectivity is available." +description: "Synchronize data between Spinifex and AWS when network connectivity is available." category: "Migration" tags: - hybrid - sync - s3 resources: - - title: "Hive Repository" - url: "https://github.com/mulgadc/hive" + - title: "Spinifex Repository" + url: "https://github.com/mulgadc/spinifex" --- # Hybrid Sync -> Synchronize data between Hive and AWS when network connectivity is available. +> Synchronize data between Spinifex and AWS when network connectivity is available. ## Table of Contents @@ -25,7 +25,7 @@ resources: ## Overview -Hive's hybrid mode enables bidirectional data synchronization between local infrastructure and AWS cloud services. Ideal for intermittent connectivity environments. +Spinifex's hybrid mode enables bidirectional data synchronization between local infrastructure and AWS cloud services. Ideal for intermittent connectivity environments. ## Instructions @@ -33,20 +33,20 @@ Hive's hybrid mode enables bidirectional data synchronization between local infr ```bash aws s3 sync s3://local-bucket/ s3://cloud-bucket/ \ - --source-region hive --region us-east-1 + --source-region spinifex --region us-east-1 ``` ## Pull Cloud to Local ```bash aws s3 sync s3://cloud-bucket/ s3://local-bucket/ \ - --source-region us-east-1 --region hive + --source-region us-east-1 --region spinifex ``` ## EBS Volume Backup ```bash -rsync -avz /data/ user@cloud-server:/backup/hive-data/ +rsync -avz /data/ user@cloud-server:/backup/spinifex-data/ ``` ## Troubleshooting @@ -57,7 +57,7 @@ S3 sync is idempotent — re-run the same command to resume where it left off: ```bash aws s3 sync s3://local-bucket/ s3://cloud-bucket/ \ - --source-region hive --region us-east-1 + --source-region spinifex --region us-east-1 ``` Only changed or missing files will be transferred on subsequent runs. @@ -67,7 +67,7 @@ Only changed or missing files will be transferred on subsequent runs. Verify your AWS credentials are configured for both the source and destination: ```bash -aws sts get-caller-identity --profile hive +aws sts get-caller-identity --profile spinifex aws sts get-caller-identity --profile default ``` diff --git a/docs/installing-hive-airgapped/README.md b/docs/installing-spinifex-airgapped/README.md similarity index 78% rename from docs/installing-hive-airgapped/README.md rename to docs/installing-spinifex-airgapped/README.md index c27a2c6dc..48a2b4d53 100644 --- a/docs/installing-hive-airgapped/README.md +++ b/docs/installing-spinifex-airgapped/README.md @@ -1,6 +1,6 @@ --- title: "Air-Gapped Installation" -description: "Deploy Hive in environments without internet connectivity. Covers offline package caching, USB deployment, and package verification." +description: "Deploy Spinifex in environments without internet connectivity. Covers offline package caching, USB deployment, and package verification." category: "Getting Started" tags: - install @@ -8,15 +8,15 @@ tags: - offline badge: advanced resources: - - title: "Hive Repository" - url: "https://github.com/mulgadc/hive" + - title: "Spinifex Repository" + url: "https://github.com/mulgadc/spinifex" - title: "apt-cacher-ng" url: "https://wiki.debian.org/AptCacherNg" --- # Air-Gapped Installation -> Deploy Hive in environments without internet connectivity. +> Deploy Spinifex in environments without internet connectivity. ## Table of Contents @@ -28,7 +28,7 @@ resources: ## Overview -In air-gapped or disconnected environments, Hive can be deployed without internet access. This guide covers preparing offline packages on a connected machine, creating USB deployment media, and installing on the target server with package verification. +In air-gapped or disconnected environments, Spinifex can be deployed without internet access. This guide covers preparing offline packages on a connected machine, creating USB deployment media, and installing on the target server with package verification. **Deployment methods:** - **apt-cacher-ng** — Local APT cache for Debian/Ubuntu packages @@ -47,7 +47,7 @@ sudo apt install apt-cacher-ng sudo systemctl enable --now apt-cacher-ng ``` -Pre-download all Hive dependencies: +Pre-download all Spinifex dependencies: ```bash sudo apt install --download-only nbdkit nbdkit-plugin-dev pkg-config \ @@ -62,7 +62,7 @@ sudo apt install --download-only nbdkit nbdkit-plugin-dev pkg-config \ mkdir -p /media/hive-deploy/{apt-packages,go-cache,hive-source} cp /var/cache/apt/archives/*.deb /media/hive-deploy/apt-packages/ cp -r ~/go/pkg/mod/cache/ /media/hive-deploy/go-cache/ -cp -r ~/Development/mulga/hive /media/hive-deploy/hive-source/ +cp -r ~/Development/mulga/spinifex /media/hive-deploy/hive-source/ ``` ## Step 3. Verify package integrity @@ -82,8 +82,8 @@ Mount the USB and install: ```bash sudo mount /dev/sdb1 /mnt/usb sudo dpkg -i /mnt/usb/apt-packages/*.deb -cp -r /mnt/usb/hive-source ~/Development/mulga/hive -cd ~/Development/mulga/hive && make build +cp -r /mnt/usb/hive-source ~/Development/mulga/spinifex +cd ~/Development/mulga/spinifex && make build ``` Then follow the [Source Install](/docs/source-install) guide from Step 3 (Setup OVN) onwards. diff --git a/docs/installing-hive-multi-node/README.md b/docs/installing-spinifex-multi-node/README.md similarity index 74% rename from docs/installing-hive-multi-node/README.md rename to docs/installing-spinifex-multi-node/README.md index ddcce9d1d..a8c1f2ac7 100644 --- a/docs/installing-hive-multi-node/README.md +++ b/docs/installing-spinifex-multi-node/README.md @@ -1,6 +1,6 @@ --- title: "Multi-Node Installation" -description: "Deploy Hive across multiple servers to create an availability zone with high availability, data durability, and fault tolerance." +description: "Deploy Spinifex across multiple servers to create an availability zone with high availability, data durability, and fault tolerance." category: "Getting Started" tags: - install @@ -8,8 +8,8 @@ tags: - cluster badge: availability-zone resources: - - title: "Hive Repository" - url: "https://github.com/mulgadc/hive" + - title: "Spinifex Repository" + url: "https://github.com/mulgadc/spinifex" - title: "Predastore (S3)" url: "https://github.com/mulgadc/predastore" - title: "Viperblock (EBS)" @@ -18,7 +18,7 @@ resources: # Multi-Node Installation -> Deploy Hive across multiple servers to create an availability zone. +> Deploy Spinifex across multiple servers to create an availability zone. ## Table of Contents @@ -30,13 +30,13 @@ resources: ## Overview -A Hive cluster operates as a fully distributed infrastructure region — similar to an AWS Region — where multiple nodes provide high availability, data durability, and fault tolerance. +A Spinifex cluster operates as a fully distributed infrastructure region — similar to an AWS Region — where multiple nodes provide high availability, data durability, and fault tolerance. **Services distributed across nodes:** - **NATS** — Clustered message bus for request routing and JetStream replication - **Predastore** — Raft consensus with Reed-Solomon erasure coding (RS 2+1) - **Viperblock** — Block storage co-located with compute nodes -- **Hive Daemon** — Independent AWS API request serving per node +- **Spinifex Daemon** — Independent AWS API request serving per node Cluster formation is automatic. When initializing with `--nodes 3`, the init node starts a formation server and waits for peers to join. Once all nodes register, each receives the full cluster topology — credentials, CA certificates, NATS routes, Predastore peer lists — no manual configuration synchronization required. @@ -47,7 +47,7 @@ Cluster formation is automatic. When initializing with `--nodes 3`, the init nod ## Instructions -## Step 1. Install Hive on each server +## Step 1. Install Spinifex on each server Run the binary installer on **every server** in the cluster: @@ -60,9 +60,9 @@ curl https://install.mulgadc.com/ | bash On **each server**, export the IPs for all nodes (replace with your actual IPs): ```bash -export HIVE_NODE1=192.168.1.10 -export HIVE_NODE2=192.168.1.11 -export HIVE_NODE3=192.168.1.12 +export SPINIFEX_NODE1=192.168.1.10 +export SPINIFEX_NODE2=192.168.1.11 +export SPINIFEX_NODE3=192.168.1.12 ``` To find your server's IP: @@ -85,7 +85,7 @@ OVN must be configured on every server before forming the cluster. Server 1 runs **Server 1 — OVN central + compute (run first):** ```bash -sudo /usr/local/share/hive/setup-ovn.sh --management --encap-ip=$HIVE_NODE1 +sudo /usr/local/share/hive/setup-ovn.sh --management --encap-ip=$SPINIFEX_NODE1 ``` Verify OVN central is ready before proceeding: @@ -97,13 +97,13 @@ sudo ovn-sbctl show **Server 2 — Compute node (after server 1 is ready):** ```bash -sudo /usr/local/share/hive/setup-ovn.sh --ovn-remote=tcp:$HIVE_NODE1:6642 --encap-ip=$HIVE_NODE2 +sudo /usr/local/share/hive/setup-ovn.sh --ovn-remote=tcp:$SPINIFEX_NODE1:6642 --encap-ip=$SPINIFEX_NODE2 ``` **Server 3 — Compute node (after server 1 is ready):** ```bash -sudo /usr/local/share/hive/setup-ovn.sh --ovn-remote=tcp:$HIVE_NODE1:6642 --encap-ip=$HIVE_NODE3 +sudo /usr/local/share/hive/setup-ovn.sh --ovn-remote=tcp:$SPINIFEX_NODE1:6642 --encap-ip=$SPINIFEX_NODE3 ``` Verify all chassis have registered (from server 1): @@ -121,11 +121,11 @@ The formation process requires running init and join commands concurrently. The **Server 1 — Initialize the cluster:** ```bash -sudo hive admin init \ +sudo spx admin init \ --node node1 \ --nodes 3 \ - --bind $HIVE_NODE1 \ - --cluster-bind $HIVE_NODE1 \ + --bind $SPINIFEX_NODE1 \ + --cluster-bind $SPINIFEX_NODE1 \ --port 4432 \ --region $AWS_REGION \ --az $AWS_AZ @@ -134,11 +134,11 @@ sudo hive admin init \ **Server 2 — Join the cluster (while init is running):** ```bash -hive admin join \ +spx admin join \ --node node2 \ - --bind $HIVE_NODE2 \ - --cluster-bind $HIVE_NODE2 \ - --host $HIVE_NODE1:4432 \ + --bind $SPINIFEX_NODE2 \ + --cluster-bind $SPINIFEX_NODE2 \ + --host $SPINIFEX_NODE1:4432 \ --region $AWS_REGION \ --az $AWS_AZ ``` @@ -146,11 +146,11 @@ hive admin join \ **Server 3 — Join the cluster (while init is running):** ```bash -hive admin join \ +spx admin join \ --node node3 \ - --bind $HIVE_NODE3 \ - --cluster-bind $HIVE_NODE3 \ - --host $HIVE_NODE1:4432 \ + --bind $SPINIFEX_NODE3 \ + --cluster-bind $SPINIFEX_NODE3 \ + --host $SPINIFEX_NODE1:4432 \ --region $AWS_REGION \ --az $AWS_AZ ``` @@ -162,13 +162,13 @@ All three processes will exit with a cluster summary once formation is complete. Start services on **all servers**: ```bash -sudo systemctl start hive.target +sudo systemctl start spinifex.target ``` From any node, verify the cluster: ```bash -hive get nodes +spx get nodes ``` ``` @@ -183,9 +183,9 @@ node3 Ready 192.168.1.12 us-east-1 us-east-1a 2m 0 On **each server**, trust the CA generated during init: ```bash -sudo cp ~/hive/config/ca.pem /usr/local/share/ca-certificates/hive-ca.crt +sudo cp ~/spinifex/config/ca.pem /usr/local/share/ca-certificates/spinifex-ca.crt sudo update-ca-certificates -export AWS_PROFILE=hive +export AWS_PROFILE=spinifex ``` ## Step 7. Launch instances across the cluster @@ -194,17 +194,17 @@ Connect to any node's AWS Gateway — all nodes serve the same cluster state: ```bash aws ec2 run-instances \ - --image-id $HIVE_AMI \ + --image-id $SPINIFEX_AMI \ --instance-type t3.small \ - --key-name hive-key \ - --subnet-id $HIVE_SUBNET \ + --key-name spinifex-key \ + --subnet-id $SPINIFEX_SUBNET \ --count 3 ``` -Hive distributes instances across nodes based on available capacity. Check which node each instance landed on: +Spinifex distributes instances across nodes based on available capacity. Check which node each instance landed on: ```bash -hive get vms +spx get vms ``` ## Shutdown @@ -212,7 +212,7 @@ hive get vms A graceful shutdown coordinates all nodes — drains VMs, flushes storage, and stops services: ```bash -hive admin cluster shutdown +spx admin cluster shutdown ``` ## Troubleshooting @@ -224,7 +224,7 @@ The init command must still be running when you execute join on other servers. I Check that all servers can reach the init node on the formation port: ```bash -curl -s http://$HIVE_NODE1:4432/health +curl -s http://$SPINIFEX_NODE1:4432/health ``` ## OVN chassis not registering @@ -264,13 +264,13 @@ If tunnels are missing, verify `--encap-ip` was set correctly during OVN setup. Check if the daemon is running and listening on the correct IP: ```bash -curl -s http://$HIVE_NODE1:4432/health +curl -s http://$SPINIFEX_NODE1:4432/health ``` Review the daemon logs for errors: ```bash -cat ~/hive/logs/daemon.log +cat ~/spinifex/logs/daemon.log ``` Verify `--bind` was set to the correct IP during cluster formation. @@ -280,7 +280,7 @@ Verify `--bind` was set to the correct IP during cluster formation. Check NATS logs for connection errors between nodes: ```bash -grep -i "route\|cluster" ~/hive/logs/nats.log +grep -i "route\|cluster" ~/spinifex/logs/nats.log ``` Ensure `--cluster-bind` IPs are reachable between all servers. diff --git a/docs/installing-hive/README.md b/docs/installing-spinifex/README.md similarity index 56% rename from docs/installing-hive/README.md rename to docs/installing-spinifex/README.md index 48fe469dc..502ca3de5 100644 --- a/docs/installing-hive/README.md +++ b/docs/installing-spinifex/README.md @@ -1,6 +1,6 @@ --- -title: "Installing Hive" -description: "Install Hive on a single server using the binary installer. Get a working region with EC2, VPC, EBS, and S3 in minutes." +title: "Installing Spinifex" +description: "Install Spinifex on a single server using the binary installer. Get a working region with EC2, VPC, EBS, and S3 in minutes." category: "Getting Started" tags: - install @@ -8,17 +8,17 @@ tags: - quickstart badge: quickstart resources: - - title: "Hive Repository" - url: "https://github.com/mulgadc/hive" + - title: "Spinifex Repository" + url: "https://github.com/mulgadc/spinifex" - title: "Predastore (S3)" url: "https://github.com/mulgadc/predastore" - title: "Viperblock (EBS)" url: "https://github.com/mulgadc/viperblock" --- -# Installing Hive +# Installing Spinifex -> Install Hive on a single server using the binary installer. +> Install Spinifex on a single server using the binary installer. ## Table of Contents @@ -30,16 +30,16 @@ resources: ## Overview -Hive is an open-source infrastructure platform that brings core AWS services — EC2, VPC, EBS, and S3 — to bare-metal, edge, and on-prem environments. +Spinifex is an open-source infrastructure platform that brings core AWS services — EC2, VPC, EBS, and S3 — to bare-metal, edge, and on-prem environments. -This guide installs Hive on a single server using the binary installer. For multi-server clusters, see [Multi-Node Installation](/docs/installing-hive-multi-node). To build from source, see [Source Install](/docs/source-install). +This guide installs Spinifex on a single server using the binary installer. For multi-server clusters, see [Multi-Node Installation](/docs/installing-hive-multi-node). To build from source, see [Source Install](/docs/source-install). **Supported Operating Systems:** - Ubuntu 22.04 / 24.04 / 25.10 - Debian 12.13 **What gets installed:** -- Hive daemon and CLI +- Spinifex daemon and CLI - QEMU/KVM for virtual machine management - OVN/Open vSwitch for VPC networking - Predastore (S3-compatible object storage) @@ -48,41 +48,41 @@ This guide installs Hive on a single server using the binary installer. For mult ## Instructions -## Step 1. Install Hive +## Step 1. Install Spinifex ```bash curl https://install.mulgadc.com/ | bash ``` -The installer downloads the Hive binary and bootstraps all dependencies (QEMU, OVN/OVS, AWS CLI). +The installer downloads the Spinifex binary and bootstraps all dependencies (QEMU, OVN/OVS, AWS CLI). ## Step 2. Initialize a region Create your first region and availability zone, replace `ap-southeast-2` with your desired region: ```bash -hive admin init --region ap-southeast-2 --az ap-southeast-2a --node node1 --nodes 1 +spx admin init --region ap-southeast-2 --az ap-southeast-2a --node node1 --nodes 1 ``` ## Step 3. Trust the CA certificate -Hive generates a local CA during initialization. Add it to your system trust store: +Spinifex generates a local CA during initialization. Add it to your system trust store: ```bash -sudo cp ~/hive/config/ca.pem /usr/local/share/ca-certificates/hive-ca.crt +sudo cp ~/spinifex/config/ca.pem /usr/local/share/ca-certificates/spinifex-ca.crt sudo update-ca-certificates ``` ## Step 4. Start services ```bash -sudo systemctl start hive.target +sudo systemctl start spinifex.target ``` Set the AWS profile to use the default admin account: ```bash -export AWS_PROFILE=hive +export AWS_PROFILE=spinifex ``` ## Step 5. Import an AMI @@ -90,26 +90,26 @@ export AWS_PROFILE=hive List available images and import one matching your architecture: ```bash -hive admin images list -hive admin images import --name debian-12-arm64 +spx admin images list +spx admin images import --name debian-12-arm64 ``` ## Step 6. Create a VPC and launch an instance ```bash aws ec2 create-vpc --cidr-block 10.200.0.0/16 -export HIVE_VPC="vpc-XXX" +export SPINIFEX_VPC="vpc-XXX" -aws ec2 create-subnet --vpc-id $HIVE_VPC --cidr-block 10.200.1.0/24 -export HIVE_SUBNET="subnet-XXX" +aws ec2 create-subnet --vpc-id $SPINIFEX_VPC --cidr-block 10.200.1.0/24 +export SPINIFEX_SUBNET="subnet-XXX" -aws ec2 import-key-pair --key-name "hive-key" --public-key-material fileb://~/.ssh/id_rsa.pub +aws ec2 import-key-pair --key-name "spinifex-key" --public-key-material fileb://~/.ssh/id_rsa.pub aws ec2 run-instances \ - --image-id $HIVE_AMI \ + --image-id $SPINIFEX_AMI \ --instance-type t3.small \ - --key-name hive-key \ - --subnet-id $HIVE_SUBNET \ + --key-name spinifex-key \ + --subnet-id $SPINIFEX_SUBNET \ --count 1 ``` @@ -121,7 +121,7 @@ Find the forwarded SSH port and connect: ps auxw | grep hostfwd # Look for: hostfwd=tcp:127.0.0.1:-:22 -ssh -i ~/.ssh/hive-key ec2-user@127.0.0.1 -p +ssh -i ~/.ssh/spinifex-key ec2-user@127.0.0.1 -p ``` ## Troubleshooting @@ -131,7 +131,7 @@ ssh -i ~/.ssh/hive-key ec2-user@127.0.0.1 -p The binary is not in your PATH. Run the installer again or add the install directory to your PATH: ```bash -export PATH=$PATH:~/hive/bin/ +export PATH=$PATH:~/spinifex/bin/ ``` Add this to your `~/.bashrc` or `~/.zshrc` for persistence. @@ -153,26 +153,26 @@ journalctl -u ovn-controller --no-pager -n 20 ## CA certificate not trusted -AWS CLI will reject HTTPS connections if the Hive CA is not trusted. Re-add the certificate: +AWS CLI will reject HTTPS connections if the Spinifex CA is not trusted. Re-add the certificate: ```bash -sudo cp ~/hive/config/ca.pem /usr/local/share/ca-certificates/hive-ca.crt +sudo cp ~/spinifex/config/ca.pem /usr/local/share/ca-certificates/spinifex-ca.crt sudo update-ca-certificates ``` Verify it was added: ```bash -ls -la /usr/local/share/ca-certificates/hive-ca.crt +ls -la /usr/local/share/ca-certificates/spinifex-ca.crt ``` ## Instance stuck in pending -Check the Hive daemon logs for errors: +Check the Spinifex daemon logs for errors: ```bash -ls ~/hive/logs/ -cat ~/hive/logs/daemon.log +ls ~/spinifex/logs/ +cat ~/spinifex/logs/daemon.log ``` Verify the AMI was imported successfully: diff --git a/docs/launching-instances/README.md b/docs/launching-instances/README.md index 25d3e9526..05589730c 100644 --- a/docs/launching-instances/README.md +++ b/docs/launching-instances/README.md @@ -1,21 +1,21 @@ --- title: "Launching Instances" -description: "Launch, manage, and connect to EC2-compatible virtual machines on Hive." +description: "Launch, manage, and connect to EC2-compatible virtual machines on Spinifex." category: "Environments" tags: - ec2 - instances - vm resources: - - title: "Hive Repository" - url: "https://github.com/mulgadc/hive" + - title: "Spinifex Repository" + url: "https://github.com/mulgadc/spinifex" - title: "AWS EC2 CLI" url: "https://docs.aws.amazon.com/cli/latest/reference/ec2/" --- # Launching Instances -> Launch, manage, and connect to EC2-compatible virtual machines on Hive. +> Launch, manage, and connect to EC2-compatible virtual machines on Spinifex. ## Table of Contents @@ -27,7 +27,7 @@ resources: ## Overview -Hive provides EC2-compatible VM management built on QEMU/KVM. Instances support cloud-init, SSH key injection, VPC networking, and standard AWS lifecycle operations. +Spinifex provides EC2-compatible VM management built on QEMU/KVM. Instances support cloud-init, SSH key injection, VPC networking, and standard AWS lifecycle operations. **Supported operations:** - `run-instances` — Launch new VMs @@ -41,10 +41,10 @@ Hive provides EC2-compatible VM management built on QEMU/KVM. Instances support ```bash aws ec2 run-instances \ - --image-id $HIVE_AMI \ + --image-id $SPINIFEX_AMI \ --instance-type t3.small \ - --key-name hive-key \ - --subnet-id $HIVE_SUBNET \ + --key-name spinifex-key \ + --subnet-id $SPINIFEX_SUBNET \ --count 1 export INSTANCE_ID="i-XXX" @@ -63,7 +63,7 @@ aws ec2 terminate-instances --instance-ids $INSTANCE_ID ```bash ps auxw | grep $INSTANCE_ID -ssh -i ~/.ssh/hive-key ec2-user@127.0.0.1 -p +ssh -i ~/.ssh/spinifex-key ec2-user@127.0.0.1 -p ``` ## Troubleshooting @@ -73,15 +73,15 @@ ssh -i ~/.ssh/hive-key ec2-user@127.0.0.1 -p Check QEMU logs for the instance and verify the AMI architecture matches your host: ```bash -cat ~/hive/logs/daemon.log -aws ec2 describe-images --image-ids $HIVE_AMI +cat ~/spinifex/logs/daemon.log +aws ec2 describe-images --image-ids $SPINIFEX_AMI ``` If the AMI is for a different architecture (e.g. arm64 on an x86_64 host), import the correct image: ```bash -./bin/hive admin images list -./bin/hive admin images import --name debian-12-x86_64 +./bin/spx admin images list +./bin/spx admin images import --name debian-12-x86_64 ``` ## Cannot SSH into instance diff --git a/docs/moving-aws-workload/README.md b/docs/moving-aws-workload/README.md index ccfd72adc..51d76b186 100644 --- a/docs/moving-aws-workload/README.md +++ b/docs/moving-aws-workload/README.md @@ -1,6 +1,6 @@ --- title: "Moving an AWS Workload to Mulga" -description: "Migrate existing AWS workloads to Hive using compatible APIs, SDKs, and Terraform." +description: "Migrate existing AWS workloads to Spinifex using compatible APIs, SDKs, and Terraform." category: "Migration" tags: - migration @@ -8,8 +8,8 @@ tags: - terraform badge: new resources: - - title: "Hive Repository" - url: "https://github.com/mulgadc/hive" + - title: "Spinifex Repository" + url: "https://github.com/mulgadc/spinifex" - title: "AWS CLI Reference" url: "https://docs.aws.amazon.com/cli/latest/reference/" - title: "Terraform AWS Provider" @@ -18,7 +18,7 @@ resources: # Moving an AWS Workload to Mulga -> Migrate existing AWS workloads to Hive using compatible APIs, SDKs, and Terraform. +> Migrate existing AWS workloads to Spinifex using compatible APIs, SDKs, and Terraform. ## Table of Contents @@ -30,7 +30,7 @@ resources: ## Overview -Hive provides drop-in compatibility with AWS APIs, making it possible to migrate existing workloads with minimal changes. +Spinifex provides drop-in compatibility with AWS APIs, making it possible to migrate existing workloads with minimal changes. **Supported Services:** VPC, EC2, EBS, S3, IAM @@ -41,7 +41,7 @@ Hive provides drop-in compatibility with AWS APIs, making it possible to migrate ## Configure AWS CLI ```bash -export AWS_PROFILE=hive +export AWS_PROFILE=spinifex aws ec2 describe-instances aws s3 ls ``` @@ -51,8 +51,8 @@ aws s3 ls ```hcl provider "aws" { region = "ap-southeast-2" - access_key = "your-hive-access-key" - secret_key = "your-hive-secret-key" + access_key = "your-spinifex-access-key" + secret_key = "your-spinifex-secret-key" endpoints { ec2 = "https://localhost:9999" @@ -68,7 +68,7 @@ provider "aws" { ## Hybrid S3 Sync ```bash -aws s3 sync s3://local-bucket/ s3://cloud-bucket/ --source-region hive --region us-east-1 +aws s3 sync s3://local-bucket/ s3://cloud-bucket/ --source-region spinifex --region us-east-1 ``` ## Troubleshooting @@ -87,7 +87,7 @@ Without these, Terraform will try to validate credentials and metadata against r ## S3 signature errors -Hive uses AWS Signature V4. Ensure your AWS CLI is version 2.0 or higher: +Spinifex uses AWS Signature V4. Ensure your AWS CLI is version 2.0 or higher: ```bash aws --version diff --git a/docs/source-install/README.md b/docs/source-install/README.md index 8b09da751..ab481cea5 100644 --- a/docs/source-install/README.md +++ b/docs/source-install/README.md @@ -1,6 +1,6 @@ --- title: "Source Install" -description: "Build Hive from source for development, custom builds, or contributing. Includes dependency setup, compilation, and OVN configuration." +description: "Build Spinifex from source for development, custom builds, or contributing. Includes dependency setup, compilation, and OVN configuration." category: "Getting Started" tags: - install @@ -8,8 +8,8 @@ tags: - development badge: source resources: - - title: "Hive Repository" - url: "https://github.com/mulgadc/hive" + - title: "Spinifex Repository" + url: "https://github.com/mulgadc/spinifex" - title: "Predastore (S3)" url: "https://github.com/mulgadc/predastore" - title: "Viperblock (EBS)" @@ -22,7 +22,7 @@ resources: # Source Install -> Build Hive from source for development, custom builds, or contributing. +> Build Spinifex from source for development, custom builds, or contributing. ## Table of Contents @@ -34,7 +34,7 @@ resources: ## Overview -This guide covers building Hive from source code. Use this if you want to contribute to Hive, build custom versions, or inspect the codebase. For production deployments, the [binary installer](/docs/installing-hive) is recommended. +This guide covers building Spinifex from source code. Use this if you want to contribute to Spinifex, build custom versions, or inspect the codebase. For production deployments, the [binary installer](/docs/installing-hive) is recommended. **Supported Operating Systems:** - Ubuntu 22.04 / 24.04 / 25.10 @@ -56,7 +56,7 @@ This guide covers building Hive from source code. Use this if you want to contri Bootstrap all dependencies in one step: ```bash -sudo make -C hive quickinstall +sudo make -C spinifex quickinstall ``` Ensure Go is in your PATH: @@ -94,13 +94,13 @@ aws --version ```bash mkdir -p ~/Development/mulga/ cd ~/Development/mulga/ -git clone https://github.com/mulgadc/hive.git -cd hive +git clone https://github.com/mulgadc/spinifex.git +cd spinifex ./scripts/clone-deps.sh # Clone viperblock + predastore ./scripts/dev-setup.sh # Setup complete dev environment ``` -Confirm `./bin/hive` exists and is executable. +Confirm `./bin/spx` exists and is executable. ## Step 3. Setup OVN @@ -117,13 +117,13 @@ This creates the `br-int` integration bridge, starts `ovn-controller`, configure Create a region and availability zone: ```bash -./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 ``` ## Step 5. Trust the CA certificate ```bash -sudo cp ~/hive/config/ca.pem /usr/local/share/ca-certificates/hive-ca.crt +sudo cp ~/spinifex/config/ca.pem /usr/local/share/ca-certificates/spinifex-ca.crt sudo update-ca-certificates ``` @@ -131,7 +131,7 @@ sudo update-ca-certificates ```bash ./scripts/start-dev.sh -export AWS_PROFILE=hive +export AWS_PROFILE=spinifex ``` ## Troubleshooting @@ -150,7 +150,7 @@ Add this to your `~/.bashrc` or `~/.zshrc` for persistence. Verify with: go version ``` -## ./bin/hive missing after build +## ./bin/spx missing after build The build did not complete successfully. Re-run the setup: @@ -177,10 +177,10 @@ sudo ovn-sbctl show ## CA certificate not trusted -AWS CLI will reject HTTPS connections to Hive services. Re-add the certificate: +AWS CLI will reject HTTPS connections to Spinifex services. Re-add the certificate: ```bash -sudo cp ~/hive/config/ca.pem /usr/local/share/ca-certificates/hive-ca.crt +sudo cp ~/spinifex/config/ca.pem /usr/local/share/ca-certificates/spinifex-ca.crt sudo update-ca-certificates ``` diff --git a/docs/hive-admin-cli/README.md b/docs/spinifex-admin-cli/README.md similarity index 55% rename from docs/hive-admin-cli/README.md rename to docs/spinifex-admin-cli/README.md index ca6dd263a..9be4fac78 100644 --- a/docs/hive-admin-cli/README.md +++ b/docs/spinifex-admin-cli/README.md @@ -1,6 +1,6 @@ --- -title: "Hive Admin CLI" -description: "Complete reference for the Hive administration CLI. Manage accounts, nodes, VMs, and services." +title: "Spinifex Admin CLI" +description: "Complete reference for the Spinifex administration CLI. Manage accounts, nodes, VMs, and services." category: "Administration" tags: - cli @@ -8,13 +8,13 @@ tags: - reference badge: cli resources: - - title: "Hive Repository" - url: "https://github.com/mulgadc/hive" + - title: "Spinifex Repository" + url: "https://github.com/mulgadc/spinifex" --- -# Hive Admin CLI +# Spinifex Admin CLI -> Complete reference for the Hive administration CLI. +> Complete reference for the Spinifex administration CLI. ## Table of Contents @@ -26,25 +26,25 @@ resources: ## Overview -The `hive` binary is the central administration tool for managing your Hive infrastructure. It provides commands for cluster initialization, account management, node operations, VM lifecycle, and service control. +The `spx` binary is the central administration tool for managing your Spinifex infrastructure. It provides commands for cluster initialization, account management, node operations, VM lifecycle, and service control. -**Binary location:** `~/Development/mulga/hive/bin/hive` +**Binary location:** `~/Development/mulga/spinifex/bin/spx` -All services in the Hive platform are managed through this single binary. +All services in the Spinifex platform are managed through this single binary. ## Instructions ## Account Management ```bash -./bin/hive admin account create --name myteam -export AWS_PROFILE=hive-myteam +./bin/spx admin account create --name myteam +export AWS_PROFILE=spinifex-myteam ``` ## Node Management ```bash -./bin/hive get nodes +./bin/spx get nodes ``` ``` @@ -57,20 +57,20 @@ node3 Ready 127.0.0.3 ap-southeast-2 ap-southeast-2a 2m 0 ## Monitor Resources ```bash -./bin/hive top nodes +./bin/spx top nodes ``` ## Image Management ```bash -./bin/hive admin images list -./bin/hive admin images import --name debian-12-arm64 +./bin/spx admin images list +./bin/spx admin images import --name debian-12-arm64 ``` ## Cluster Shutdown ```bash -./bin/hive admin cluster shutdown +./bin/spx admin cluster shutdown ``` ## Troubleshooting @@ -80,7 +80,7 @@ node3 Ready 127.0.0.3 ap-southeast-2 ap-southeast-2a 2m 0 The binary may not be executable. Fix permissions: ```bash -chmod +x ./bin/hive +chmod +x ./bin/spx ``` If you get permission errors during operations, ensure you're running with appropriate privileges. Some OVN and networking commands require `sudo`. @@ -90,8 +90,8 @@ If you get permission errors during operations, ensure you're running with appro Check the daemon logs for specific errors: ```bash -ls ~/hive/logs/ -cat ~/hive/logs/daemon.log +ls ~/spinifex/logs/ +cat ~/spinifex/logs/daemon.log ``` Common causes include port conflicts, missing OVN configuration, or untrusted CA certificates. diff --git a/docs/vpc-networking/README.md b/docs/vpc-networking/README.md index a93f74c16..ba9465d6d 100644 --- a/docs/vpc-networking/README.md +++ b/docs/vpc-networking/README.md @@ -7,8 +7,8 @@ tags: - networking - ovn resources: - - title: "Hive Repository" - url: "https://github.com/mulgadc/hive" + - title: "Spinifex Repository" + url: "https://github.com/mulgadc/spinifex" - title: "OVN Architecture" url: "https://www.ovn.org/en/" --- @@ -27,7 +27,7 @@ resources: ## Overview -Every EC2 instance runs inside a VPC with an isolated virtual network. Hive uses OVN (Open Virtual Network) to provide the networking layer. +Every EC2 instance runs inside a VPC with an isolated virtual network. Spinifex uses OVN (Open Virtual Network) to provide the networking layer. **How it works:** - VPC becomes an OVN logical router @@ -41,14 +41,14 @@ Every EC2 instance runs inside a VPC with an isolated virtual network. Hive uses ```bash aws ec2 create-vpc --cidr-block 10.200.0.0/16 -export HIVE_VPC="vpc-XXX" +export SPINIFEX_VPC="vpc-XXX" ``` ## Create Subnet ```bash -aws ec2 create-subnet --vpc-id $HIVE_VPC --cidr-block 10.200.1.0/24 -export HIVE_SUBNET="subnet-XXX" +aws ec2 create-subnet --vpc-id $SPINIFEX_VPC --cidr-block 10.200.1.0/24 +export SPINIFEX_SUBNET="subnet-XXX" ``` ## Verify @@ -73,7 +73,7 @@ sudo systemctl is-active ovn-controller Check the vpcd logs for errors: ```bash -cat ~/hive/logs/vpcd.log +cat ~/spinifex/logs/vpcd.log ``` ## Instances cannot reach each other diff --git a/scripts/PERFORMANCE.md b/scripts/PERFORMANCE.md index d289b8d8f..82ee521cc 100644 --- a/scripts/PERFORMANCE.md +++ b/scripts/PERFORMANCE.md @@ -39,7 +39,7 @@ Reset services first to apply latest changes: ```sh ./scripts/stop-dev.sh -PPROF_ENABLED=1 PPROF_OUTPUT=/tmp/hive-vm.prof ./scripts/start-dev.sh +PPROF_ENABLED=1 PPROF_OUTPUT=/tmp/spinifex-vm.prof ./scripts/start-dev.sh ``` Once services are started, connect to the benchmarking VM @@ -48,15 +48,15 @@ Once services are started, connect to the benchmarking VM ./scripts/run-bench.sh ``` -This will run the benchmark listed in `./scripts/disk-performance.sh` and store the results in `/tmp/hive-vm-disk.log` +This will run the benchmark listed in `./scripts/disk-performance.sh` and store the results in `/tmp/spinifex-vm-disk.log` -The Linux `perf` tool is also used to benchmark the `nbdkit` process used to create the QEMU > disk > NBD > viperblock > predastore sequence, which is an important tool for debugging purposes. The results will be stored in `/tmp/hive-nbdkit-perf.data` +The Linux `perf` tool is also used to benchmark the `nbdkit` process used to create the QEMU > disk > NBD > viperblock > predastore sequence, which is an important tool for debugging purposes. The results will be stored in `/tmp/spinifex-nbdkit-perf.data` ### Analyze results -Place the output of `/tmp/hive-vm-disk.log` into the results section below, increment the VM-$ID as the test case, and provide a short description of the last changes that were benchmarked. +Place the output of `/tmp/spinifex-vm-disk.log` into the results section below, increment the VM-$ID as the test case, and provide a short description of the last changes that were benchmarked. -Store the benchmark file in `predastore-rewrite/tests/hive-vm$id.prof` for later analysis. +Store the benchmark file in `predastore-rewrite/tests/spinifex-vm$id.prof` for later analysis. # Results @@ -575,7 +575,7 @@ Disk stats (read/write): ## Root Cause: TLS Handshakes Per Request -**Profile analysis (`hive-vm.prof`) reveals 84% of CPU spent on TLS handshakes:** +**Profile analysis (`spinifex-vm.prof`) reveals 84% of CPU spent on TLS handshakes:** ``` 84.06% crypto/tls.(*Conn).HandshakeContext ← 84% of CPU! @@ -736,13 +736,13 @@ With many short-lived connections, ports stuck in TIME_WAIT can exhaust the rang ## Host Configuration (sysctl) -### Recommended Settings for Hive Host +### Recommended Settings for Spinifex Host -Create `/etc/sysctl.d/99-hive.conf`: +Create `/etc/sysctl.d/99-spinifex.conf`: ```bash # ============================================================================= -# Hive Platform - System Tuning for High-Connection Workloads +# Spinifex Platform - System Tuning for High-Connection Workloads # ============================================================================= # ----------------------------------------------------------------------------- @@ -827,21 +827,21 @@ vm.dirty_background_ratio = 5 Apply settings: ```bash -sudo sysctl -p /etc/sysctl.d/99-hive.conf +sudo sysctl -p /etc/sysctl.d/99-spinifex.conf ``` ### Process Limits (/etc/security/limits.conf) ```bash -# Add to /etc/security/limits.conf or /etc/security/limits.d/hive.conf +# Add to /etc/security/limits.conf or /etc/security/limits.d/spinifex.conf -# For predastore/hive user -hive soft nofile 1048576 -hive hard nofile 1048576 -hive soft nproc unlimited -hive hard nproc unlimited -hive soft memlock unlimited -hive hard memlock unlimited +# For predastore/spinifex user +spinifex soft nofile 1048576 +spinifex hard nofile 1048576 +spinifex soft nproc unlimited +spinifex hard nproc unlimited +spinifex soft memlock unlimited +spinifex hard memlock unlimited # Or for all users (dev environments) * soft nofile 1048576 @@ -891,7 +891,7 @@ MaxConnsPerHost: 64 IdleConnTimeout: 60 * time.Second ``` -**sysctl:** Apply full 99-hive.conf settings. +**sysctl:** Apply full 99-spinifex.conf settings. ### Large Deployment (65-256 VMs) @@ -1105,7 +1105,7 @@ client := &http.Client{ - [ ] Validate fix with fio benchmark (VM-4) - [ ] Add predastore connection metrics endpoint - [ ] Test with 8-VM deployment -- [ ] Create hive-tuning.sh script for automated sysctl configuration +- [ ] Create spinifex-tuning.sh script for automated sysctl configuration - [ ] Add Prometheus metrics for connection tracking --- @@ -1186,7 +1186,7 @@ After migrating predastore to net/http with HTTP/2 support, profiling still show Additionally, logs showed **126K+ HTTP/1.1 requests** despite HTTP/2 being configured: ```bash -cat ~/hive/logs/predastore.log | grep "HTTP/1" | wc -l +cat ~/spinifex/logs/predastore.log | grep "HTTP/1" | wc -l # 126277 ``` @@ -1235,12 +1235,12 @@ All S3 clients across the codebase were updated: | File | Purpose | |------|---------| | `viperblock/viperblock/backends/s3/s3.go` | Block storage S3 backend | -| `hive/s3client/s3client.go` | Hive S3 client | -| `hive/handlers/ec2/key/service_impl.go` | EC2 key pair operations | -| `hive/handlers/ec2/volume/service_impl.go` | EBS volume operations | -| `hive/handlers/ec2/image/service_impl.go` | AMI image operations | -| `hive/utils/utils.go` | Shared S3 client utility | -| `hive/cmd/hive/cmd/admin.go` | Admin CLI operations | +| `spinifex/s3client/s3client.go` | Spinifex S3 client | +| `spinifex/handlers/ec2/key/service_impl.go` | EC2 key pair operations | +| `spinifex/handlers/ec2/volume/service_impl.go` | EBS volume operations | +| `spinifex/handlers/ec2/image/service_impl.go` | AMI image operations | +| `spinifex/utils/utils.go` | Shared S3 client utility | +| `spinifex/cmd/spinifex/cmd/admin.go` | Admin CLI operations | | `predastore/s3db/client.go` | S3DB distributed client | ### Complete HTTP/2 Client Pattern @@ -1323,14 +1323,14 @@ After deploying the fix, verify HTTP/2 is working: ```bash # Check predastore logs for HTTP/2 requests -grep "HTTP/2" ~/hive/logs/predastore.log | head +grep "HTTP/2" ~/spinifex/logs/predastore.log | head # Count HTTP/1.1 vs HTTP/2 requests -echo "HTTP/1.1: $(grep -c 'HTTP/1' ~/hive/logs/predastore.log)" -echo "HTTP/2.0: $(grep -c 'HTTP/2' ~/hive/logs/predastore.log)" +echo "HTTP/1.1: $(grep -c 'HTTP/1' ~/spinifex/logs/predastore.log)" +echo "HTTP/2.0: $(grep -c 'HTTP/2' ~/spinifex/logs/predastore.log)" # Profile should show minimal TLS overhead -go tool pprof -top hive-vm.prof | head -20 +go tool pprof -top spinifex-vm.prof | head -20 # TLS functions should be <5% instead of 60-84% ``` @@ -1354,15 +1354,15 @@ go tool pprof -top hive-vm.prof | head -20 ### Mandatory Testing Before Changes -The Hive platform consists of three interdependent repositories: +The Spinifex platform consists of three interdependent repositories: ``` -hive ──depends on──► viperblock ──depends on──► predastore +spinifex ──depends on──► viperblock ──depends on──► predastore ``` **CRITICAL: All tests must pass across all three repositories before committing changes.** -Changes in predastore can break viperblock and hive. Changes in viperblock can break hive. +Changes in predastore can break viperblock and spinifex. Changes in viperblock can break spinifex. ### Testing Workflow @@ -1375,8 +1375,8 @@ LOG_IGNORE=1 go test ./... -count=1 cd /path/to/viperblock LOG_IGNORE=1 go test ./... -count=1 -# 3. Finally test hive (depends on both) -cd /path/to/hive +# 3. Finally test spinifex (depends on both) +cd /path/to/spinifex LOG_IGNORE=1 go test ./... -count=1 ``` @@ -1384,7 +1384,7 @@ LOG_IGNORE=1 go test ./... -count=1 Each repository uses `go.work` for local development with replace directives: -**hive/go.work:** +**spinifex/go.work:** ```go go 1.25.5 @@ -1423,7 +1423,7 @@ LOG_IGNORE=1 # Suppress log output during tests - [ ] `cd predastore && go test ./...` passes - [ ] `cd viperblock && go test ./...` passes -- [ ] `cd hive && go test ./...` passes +- [ ] `cd spinifex && go test ./...` passes - [ ] `go build ./...` succeeds in all repos - [ ] No new compiler warnings @@ -1799,7 +1799,7 @@ go tool trace /tmp/trace.out - `viperblock/viperblock/viperblock.go` - Core read/write logic (lines 1688-1856 for read path) - `viperblock/nbd/viperblock.go` - NBD plugin interface -- `predastore-rewrite/tests/hive-vm7.prof` - Predastore profile (post-HTTP2 fix) +- `predastore-rewrite/tests/spinifex-vm7.prof` - Predastore profile (post-HTTP2 fix) - `/tmp/nbdkit-perf2.data` - Viperblock perf profile ### References @@ -1851,7 +1851,7 @@ The `mapassign_fast64` bottleneck has been completely eliminated: | `crypto/md5.block` | 0.83% | AWS v4 signatures | | `crypto/sha256` | 0.58% | TLS crypto | -**Predastore Server (hive-vm8.prof):** +**Predastore Server (spinifex-vm8.prof):** | Function | CPU % | Category | |----------|-------|----------| @@ -2011,7 +2011,7 @@ Profile is now evenly distributed: - `runtime.memclrNoHeapPointers`: 1.32% - All other functions < 1.5% -### Predastore Profile (hive-vm9.prof) - Now the Bottleneck +### Predastore Profile (spinifex-vm9.prof) - Now the Bottleneck | Function | CPU % | Category | |----------|-------|----------| @@ -2058,7 +2058,7 @@ These logs were firing on every operation, adding unnecessary overhead. ### Chi Middleware Logger Overhead -**Problem Identified:** The Go profile (hive-vm9.prof) showed significant overhead from chi's RequestLogger middleware: +**Problem Identified:** The Go profile (spinifex-vm9.prof) showed significant overhead from chi's RequestLogger middleware: ``` chi/v5/middleware.init.0.RequestLogger.func1.1 27.47s 17.39% @@ -2166,11 +2166,11 @@ After deploying, run benchmark and verify: ```bash # Profile should show no chi Logger overhead -go tool pprof -top hive-vm10.prof | grep -i logger +go tool pprof -top spinifex-vm10.prof | grep -i logger # Expected: No results # I/O should now dominate -go tool pprof -top hive-vm10.prof | head -10 +go tool pprof -top spinifex-vm10.prof | head -10 # Expected: syscall.Syscall6 > 45% ``` @@ -2180,7 +2180,7 @@ go tool pprof -top hive-vm10.prof | head -10 ### Profile Analysis -**Predastore (hive-vm10.prof):** +**Predastore (spinifex-vm10.prof):** | Function | CPU % | Notes | |----------|-------|-------| | `syscall.Syscall6` | **37.32%** | I/O bound - expected | @@ -2346,7 +2346,7 @@ The `UnifiedBlockStore` has `EvictCache()` method but no automatic LRU eviction | File | Change | |------|--------| -| `hive/services/viperblockd/viperblockd.go` | Fixed HasSuffix args, fixed cache logic | +| `spinifex/services/viperblockd/viperblockd.go` | Fixed HasSuffix args, fixed cache logic | | `viperblock/viperblock/viperblock.go` | 8 read logs changed to Debug level | ### Expected Impact (VM-11) @@ -2417,11 +2417,11 @@ if hitRate < 0.5 && cacheSize < maxCache { ```bash # Check cache is enabled for main volumes -grep "Enabling 64MB cache" ~/hive/logs/viperblockd.log +grep "Enabling 64MB cache" ~/spinifex/logs/viperblockd.log # Expected: One line per main volume # Check cache disabled for auxiliary volumes -grep "Disabling cache for auxiliary" ~/hive/logs/viperblockd.log +grep "Disabling cache for auxiliary" ~/spinifex/logs/viperblockd.log # Expected: Lines for *-cloudinit and *-efi volumes # Monitor cache hit rate (if stats endpoint available) diff --git a/scripts/iac/README.md b/scripts/iac/README.md index cfd1d25de..1aa7ba89b 100644 --- a/scripts/iac/README.md +++ b/scripts/iac/README.md @@ -1,9 +1,9 @@ # IAC -Collection of OpenTofu/Terraform templates for creating Hive instances. +Collection of OpenTofu/Terraform templates for creating Spinifex instances. | Template | Description | |---|---| -| [proxmox/](proxmox/) | Provisions a 3-node Hive cluster on Proxmox VE bare-metal hypervisors | +| [proxmox/](proxmox/) | Provisions a 3-node Spinifex cluster on Proxmox VE bare-metal hypervisors | | [aws/](aws/) | Provisions infrastructure using the Terraform AWS provider, with MulgaOS AWS-compatible API as the local endpoint | -| [proxmox-template/](proxmox-template/) | Builds a Proxmox VM template with all Hive dependencies pre-installed (QEMU, Go, repos, modules) | +| [proxmox-template/](proxmox-template/) | Builds a Proxmox VM template with all Spinifex dependencies pre-installed (QEMU, Go, repos, modules) | diff --git a/scripts/iac/aws/README.md b/scripts/iac/aws/README.md index f88bd9e72..eff03a791 100644 --- a/scripts/iac/aws/README.md +++ b/scripts/iac/aws/README.md @@ -14,7 +14,7 @@ This directory contains OpenTofu/Terraform configuration files for deploying inf ``` 2. **MulgaOS services running** - - `hive daemon` - Core daemon with NATS subscriptions + - `spinifex daemon` - Core daemon with NATS subscriptions - `awsd` - AWS API gateway (default: http://localhost:8080) - `predastore` - S3-compatible storage - `viperblock` - EBS-compatible block storage @@ -26,14 +26,14 @@ This directory contains OpenTofu/Terraform configuration files for deploying inf export AWS_SECRET_ACCESS_KEY=your_secret_key # Option 2: AWS CLI profile - aws configure --profile hive - export AWS_PROFILE=hive + aws configure --profile spinifex + export AWS_PROFILE=spinifex ``` 4. **AMI available** Before running, ensure you have a Debian 12 AMI imported: ```bash - # Import an AMI using the hive CLI or aws CLI + # Import an AMI using the spinifex CLI or aws CLI aws --endpoint-url http://localhost:8080 ec2 describe-images ``` @@ -106,7 +106,7 @@ The `main.tf` creates: 5. **Security Group** - Allows SSH (22), HTTP (80), HTTPS (443) inbound 6. **Placement Group** - Spread strategy for HA 7. **3 EC2 Instances** - t3.small Debian 12 VMs -8. **SSH Key Pair** - ED25519 key saved to `hive-test.pem` +8. **SSH Key Pair** - ED25519 key saved to `spinifex-test.pem` ## SSH Access @@ -114,11 +114,11 @@ After `tofu apply`, SSH into instances: ```bash # Using the generated key -ssh -i hive-test.pem admin@ +ssh -i spinifex-test.pem admin@ # For local development with QEMU port forwarding # Find the forwarded port from QEMU args (-netdev user,id=net0,hostfwd=tcp:127.0.0.1:PORT-:22) -ssh -p PORT -i hive-test.pem admin@127.0.0.1 +ssh -p PORT -i spinifex-test.pem admin@127.0.0.1 ``` ## Troubleshooting @@ -143,7 +143,7 @@ Ensure MulgaOS services are running: curl http://localhost:8080/health # Check daemon status -hive daemon status +spinifex daemon status ``` ### "InvalidAction" errors @@ -193,7 +193,7 @@ resource "aws_instance" "vm" { | File | Description | |------|-------------| | `main.tf` | Main Terraform/OpenTofu configuration | -| `hive-test.pem` | Generated SSH private key (after apply) | +| `spinifex-test.pem` | Generated SSH private key (after apply) | | `.terraform/` | Provider plugins (after init) | | `terraform.tfstate` | State file (after apply) | | `terraform.tfvars` | Custom variables (optional) | diff --git a/scripts/iac/proxmox-template/README.md b/scripts/iac/proxmox-template/README.md index 907d617d4..5736dbd07 100644 --- a/scripts/iac/proxmox-template/README.md +++ b/scripts/iac/proxmox-template/README.md @@ -1,6 +1,6 @@ -# Hive Node Template Builder +# Spinifex Node Template Builder -Builds a Proxmox VM template with all Hive dependencies pre-installed. Cloning from this template reduces cluster spin-up from ~15 minutes to ~1-2 minutes (`git pull` + `make build`). +Builds a Proxmox VM template with all Spinifex dependencies pre-installed. Cloning from this template reduces cluster spin-up from ~15 minutes to ~1-2 minutes (`git pull` + `make build`). ## What's in the template @@ -9,7 +9,7 @@ Builds a Proxmox VM template with all Hive dependencies pre-installed. Cloning f | System packages | QEMU, nbdkit, libvirt, gcc, jq, curl, etc. (`make install-system`) | | Go | 1.26.1 (`make install-go`) | | AWS CLI | v2 (`make install-aws`) | -| Repositories | hive, viperblock, predastore (with `go.work` configured) | +| Repositories | spinifex, viperblock, predastore (with `go.work` configured) | | Module cache | `go mod download` completed for all repos | | Cloud images | Ubuntu 24.04 for nested VMs (`~/images/ubuntu-24.04.img`) | | Tuning | sysctl (rmem_max/wmem_max), kvm group, ufw disabled | @@ -65,12 +65,12 @@ On each cloned VM after boot: ```bash # Pull latest code -cd ~/Development/mulga/hive && git pull +cd ~/Development/mulga/spinifex && git pull cd ~/Development/mulga/viperblock && git pull cd ~/Development/mulga/predastore && git pull # Build (~30s with cached modules) -cd ~/Development/mulga/hive && export PATH=/usr/local/go/bin:$PATH && make build +cd ~/Development/mulga/spinifex && export PATH=/usr/local/go/bin:$PATH && make build ``` ## Testing a Different Base Image diff --git a/scripts/iac/proxmox/README.md b/scripts/iac/proxmox/README.md index d4aa7b597..07b0330a0 100644 --- a/scripts/iac/proxmox/README.md +++ b/scripts/iac/proxmox/README.md @@ -1,6 +1,6 @@ # Proxmox IaC -OpenTofu/Terraform templates for provisioning Hive development clusters on Proxmox VE. +OpenTofu/Terraform templates for provisioning Spinifex development clusters on Proxmox VE. ## Prerequisites @@ -12,9 +12,9 @@ OpenTofu/Terraform templates for provisioning Hive development clusters on Proxm - SSH keypair for cloud-init VM access - A hardcoded Debian ISO is used, which needs to be pre-installed on each Proxmox host ("debian-12-genericcloud-amd64-20240211-1654.img") https://cdimage.debian.org/images/cloud/bookworm/20240211-1654/debian-12-genericcloud-amd64-20240211-1654.qcow2 -## Quick Start (hive-test.sh) +## Quick Start (spinifex-test.sh) -The `hive-test.sh` wrapper script manages the full lifecycle: provision, configure, test, and destroy. +The `spinifex-test.sh` wrapper script manages the full lifecycle: provision, configure, test, and destroy. ```sh # Source environment @@ -22,25 +22,25 @@ source scripts/iac/proxmox/.env source ~/prox # Proxmox API token # Provision a 3-node cluster -./scripts/iac/hive-test.sh up my-cluster +./scripts/iac/spinifex-test.sh up my-cluster # Configure: clone repo, build, form cluster, start services -./scripts/iac/hive-test.sh configure my-cluster +./scripts/iac/spinifex-test.sh configure my-cluster # Run smoke tests -./scripts/iac/hive-test.sh test my-cluster +./scripts/iac/spinifex-test.sh test my-cluster # Check cluster health -./scripts/iac/hive-test.sh status my-cluster +./scripts/iac/spinifex-test.sh status my-cluster # SSH to a specific node -./scripts/iac/hive-test.sh ssh my-cluster 2 +./scripts/iac/spinifex-test.sh ssh my-cluster 2 # Destroy when done -./scripts/iac/hive-test.sh down my-cluster +./scripts/iac/spinifex-test.sh down my-cluster # Or run the full lifecycle (up → configure → test → down) -./scripts/iac/hive-test.sh full my-cluster +./scripts/iac/spinifex-test.sh full my-cluster ``` ### Options @@ -55,7 +55,7 @@ source ~/prox # Proxmox API token Example with custom sizing: ```sh -./scripts/iac/hive-test.sh up my-cluster --node-count=5 --memory-mb=8192 --cpu-cores=2 +./scripts/iac/spinifex-test.sh up my-cluster --node-count=5 --memory-mb=8192 --cpu-cores=2 ``` Per-cluster state is stored in `scripts/iac/proxmox/clusters//terraform.tfstate`, allowing multiple clusters to coexist. @@ -185,7 +185,7 @@ ssh -i ~/.ssh/your-cloud-init-key tf-user@ ## Known issues -- `~/hive/config/hive.toml` - Does not add node1, node2, node3 from config automatically -- `~/hive/config/predastore/predastore.toml` - Uses previous static local node config, needs to use the IPs for each node in the cluster +- `~/spinifex/config/spinifex.toml` - Does not add node1, node2, node3 from config automatically +- `~/spinifex/config/predastore/predastore.toml` - Uses previous static local node config, needs to use the IPs for each node in the cluster - On multi-node deployments, NATS on the primary can timeout waiting for other nodes to start, causing a race condition where NATS fails and all dependent services fail - When adding 3 nodes, `nats.conf` is not updated with the 3rd node. Each node's cluster name is hardcoded to `C1` instead of per-node names diff --git a/spinifex/handlers/NATS_HANDLER_NAMING.md b/spinifex/handlers/NATS_HANDLER_NAMING.md index 244f37cc4..c5c2a8adb 100644 --- a/spinifex/handlers/NATS_HANDLER_NAMING.md +++ b/spinifex/handlers/NATS_HANDLER_NAMING.md @@ -1,6 +1,6 @@ # NATS Handler Naming Convention -This document defines the naming convention for NATS message handlers in the Hive daemon. +This document defines the naming convention for NATS message handlers in the Spinifex daemon. ## Pattern @@ -95,7 +95,7 @@ func (d *Daemon) handleEC2RunInstances(msg *nats.Msg) { // Subscribe to EC2 RunInstances with queue group d.natsSubscriptions["ec2.RunInstances"], err = d.natsConn.QueueSubscribe( "ec2.RunInstances", // NATS topic - "hive-workers", // Queue group for load balancing + "spinifex-workers", // Queue group for load balancing d.handleEC2RunInstances, // Handler method ) ``` @@ -114,18 +114,18 @@ For backward compatibility, some handlers may subscribe to both old and new topi ```go // Legacy topic (deprecated, for backward compatibility) d.natsSubscriptions["ec2.launch"], err = d.natsConn.QueueSubscribe( - "ec2.launch", "hive-workers", d.handleEC2RunInstances) + "ec2.launch", "spinifex-workers", d.handleEC2RunInstances) // New topic (recommended) d.natsSubscriptions["ec2.RunInstances"], err = d.natsConn.QueueSubscribe( - "ec2.RunInstances", "hive-workers", d.handleEC2RunInstances) + "ec2.RunInstances", "spinifex-workers", d.handleEC2RunInstances) ``` **Recommendation**: New code should use the AWS Action name format (`ec2.RunInstances`). ## Queue Groups -All handlers use the `"hive-workers"` queue group for: +All handlers use the `"spinifex-workers"` queue group for: - **Load Balancing** - NATS distributes requests across available daemon instances - **High Availability** - If one daemon fails, others continue processing - **Scalability** - Add more daemon instances to handle increased load diff --git a/spinifex/services/spinifexui/README.md b/spinifex/services/spinifexui/README.md index 50d8adb90..7cc48277f 100644 --- a/spinifex/services/spinifexui/README.md +++ b/spinifex/services/spinifexui/README.md @@ -1,10 +1,10 @@ -# Hive UI +# Spinifex UI -Full-stack application for managing Hive AWS compatible products (EC2, S3) +Full-stack application for managing Spinifex AWS compatible products (EC2, S3) ## Development Setup -Note: This is not needed for actually building hive-ui and running it. We commit the assets so that when you build hive, it will include hive-ui without you needing to install node and build frontend from source. +Note: This is not needed for actually building spinifex-ui and running it. We commit the assets so that when you build hive, it will include spinifex-ui without you needing to install node and build frontend from source. 1. **Install Node.js using nvm** diff --git a/tests/e2e/TEST_COVERAGE.md b/tests/e2e/TEST_COVERAGE.md index 0d9489bba..5ef052e22 100644 --- a/tests/e2e/TEST_COVERAGE.md +++ b/tests/e2e/TEST_COVERAGE.md @@ -4,15 +4,15 @@ ### Phase 1: Environment Setup - KVM support check -- `hive admin init` (region/az/node config) +- `spx admin init` (region/az/node config) - CA certificate trust - Start all services (`start-dev.sh`) - Wait for AWS gateway on `localhost:9999` ### Phase 1b: Cluster Stats CLI -- `hive get nodes` — verify node shows Ready -- `hive top nodes` — verify CPU/MEM resource stats -- `hive get vms` — verify "No VMs found" before any launches +- `spx get nodes` — verify node shows Ready +- `spx top nodes` — verify CPU/MEM resource stats +- `spx get vms` — verify "No VMs found" before any launches ### Phase 2: Discovery & Metadata - `describe-regions` @@ -32,7 +32,7 @@ - `delete-key-pair` (test-key-2, verify only test-key-1 remains) ### Phase 4: Image Management -- `hive admin images import` (file-based, architecture-aware) +- `spx admin images import` (file-based, architecture-aware) - `describe-images` (verify AMI by ID) ### Phase 5: Instance Lifecycle @@ -40,7 +40,7 @@ - `describe-instances` (poll pending -> running) ### Phase 5a-pre: Cluster Stats CLI (with running VM) -- `hive get vms` — verify running instance appears in output +- `spx get vms` — verify running instance appears in output ### Phase 5a: Instance Metadata Validation - `describe-instances` — verify InstanceType matches requested type @@ -210,7 +210,7 @@ Tests that EC2 resources are properly isolated between tenant accounts (Alpha, Beta). Based on `docs/development/feature/iam-phase4-e2e-test-guide.md`. Skips CreateImage (mulga-612) and instance tags (mulga-613). #### Step 1: Account Setup -- `hive admin account create` (Team Alpha, Team Beta) +- `spx admin account create` (Team Alpha, Team Beta) - Configure AWS CLI profiles - Verify auth for both accounts @@ -306,10 +306,10 @@ Tests that EC2 resources are properly isolated between tenant accounts (Alpha, B - Simulated network IPs (no ramdisk — start-dev.sh uses disk-backed WAL/VB in CI) ### Phase 2: Cluster Initialization -- `hive admin init` (leader node1) +- `spx admin init` (leader node1) - CA certificate trust - Start node1 services -- `hive admin join` (node2, node3) +- `spx admin join` (node2, node3) - Start node2 + node3 services ### Phase 3: Cluster Health Verification @@ -320,14 +320,14 @@ Tests that EC2 resources are properly isolated between tenant accounts (Alpha, B - `describe-regions` (gateway connectivity check) ### Phase 3b: Cluster Stats CLI -- `hive get nodes` — verify all 3 nodes show Ready -- `hive top nodes` — verify instance type capacity table -- `hive get vms` — verify empty (no instances yet) +- `spx get nodes` — verify all 3 nodes show Ready +- `spx top nodes` — verify instance type capacity table +- `spx get vms` — verify empty (no instances yet) ### Phase 4: Image and Key Setup - `describe-instance-types` (discover + select nano) - `create-key-pair` -- `hive admin images import` (with node1 config paths) +- `spx admin images import` (with node1 config paths) - `describe-images` (verify AMI) ### Phase 4b: Multi-Node Key Pair Operations @@ -341,7 +341,7 @@ Tests that EC2 resources are properly isolated between tenant accounts (Alpha, B - `run-instances` x3 (distribute across nodes) - Poll all instances to running state - Check instance distribution across nodes -- `hive get vms` — verify all instances visible +- `spx get vms` — verify all instances visible #### Test 1a-ii: SSH Connectivity & Volume Verification - SSH into all 3 instances via QEMU hostfwd port @@ -415,9 +415,9 @@ Tests that EC2 resources are properly isolated between tenant accounts (Alpha, B ### Phase 5c: IAM Accounts & Cross-Account Isolation #### Step 1: Create Accounts -- `hive admin account create` (Team Alpha, Team Beta) +- `spx admin account create` (Team Alpha, Team Beta) - Verify sequential 12-digit account IDs -- `hive admin account list` (verify both accounts) +- `spx admin account list` (verify both accounts) #### Step 2: Account Admin Auth - Alpha admin authenticates via ec2 + iam @@ -526,11 +526,11 @@ Tests that EC2 resources are properly isolated between the Alpha/Beta accounts. ### Phase 6: Cluster Shutdown + Restart #### Test 6a: Dry-Run Shutdown -- `hive admin cluster shutdown --dry-run` +- `spx admin cluster shutdown --dry-run` - Validate output contains all 5 phases (GATE, DRAIN, STORAGE, PERSIST, INFRA) #### Test 6b: Coordinated Cluster Shutdown -- `hive admin cluster shutdown --force --timeout 60s` +- `spx admin cluster shutdown --force --timeout 60s` - Verify all services down on all nodes (gateway, NATS, QEMU) #### Test 6c: Cluster Restart + Recovery @@ -552,7 +552,7 @@ Tests that EC2 resources are properly isolated between the Alpha/Beta accounts. ## Real Multi-Node (`run-multinode-e2e.sh`) -Runs on a real 3-node libvirt cluster provisioned by OpenTofu (`scripts/tofu-cluster/`). Each node is a separate VM with its own OVN, NATS, Predastore, and Hive daemon. Bootstrap (`bootstrap.sh`) handles all provisioning before the test script runs. +Runs on a real 3-node libvirt cluster provisioned by OpenTofu (`scripts/tofu-cluster/`). Each node is a separate VM with its own OVN, NATS, Predastore, and Spinifex daemon. Bootstrap (`bootstrap.sh`) handles all provisioning before the test script runs. ### Bootstrap (pre-test) @@ -562,11 +562,11 @@ Runs on a real 3-node libvirt cluster provisioned by OpenTofu (`scripts/tofu-clu 4. `git fetch` + checkout test branch on all nodes (all 3 repos) 5. `make build` on all nodes (parallel) 6. `setup-ovn.sh` — primary gets `--management`, secondaries connect to primary's OVN central -7. `hive admin init` on primary, `hive admin join` on secondaries (formation server handshake) +7. `spx admin init` on primary, `spx admin join` on secondaries (formation server handshake) 8. `start-dev.sh` on all nodes 9. Wait for `/health` (awsgw=ok) on all nodes -10. Install Hive CA certificate on all nodes -11. `import-key-pair` (hive-key) + `hive admin images import` (Ubuntu 24.04) +10. Install Spinifex CA certificate on all nodes +11. `import-key-pair` (spinifex-key) + `spx admin images import` (Ubuntu 24.04) 12. `create-vpc` (10.200.0.0/16) + `create-subnet` (10.200.1.0/24) ### Phase 1: Pre-flight Validation @@ -578,8 +578,8 @@ Runs on a real 3-node libvirt cluster provisioned by OpenTofu (`scripts/tofu-clu - Predastore reachable on all 3 nodes - AWS gateway reachable on all 3 nodes - Daemon readiness (`describe-instance-types` returns results) -- `hive get nodes` — verify all 3 nodes show Ready -- `hive get vms` — verify empty (no instances yet) +- `spx get nodes` — verify all 3 nodes show Ready +- `spx get vms` — verify empty (no instances yet) ### Phase 3: Instance Lifecycle + Distribution - Discover nano instance type and AMI (from bootstrap import) @@ -587,7 +587,7 @@ Runs on a real 3-node libvirt cluster provisioned by OpenTofu (`scripts/tofu-clu - Poll all instances to running state - Check instance distribution across physical nodes (QEMU process check) - Verify at least 2 different hosting nodes (non-deterministic, non-fatal if all on 1) -- `hive get vms` — verify all 3 instances visible +- `spx get vms` — verify all 3 instances visible ### Phase 4: SSH into Guest VMs - For each instance across all nodes: @@ -627,7 +627,7 @@ Runs on a real 3-node libvirt cluster provisioned by OpenTofu (`scripts/tofu-clu - `start-dev.sh` on node2 (restart failed node) - Wait for NATS cluster to reform (2 peers again) - Verify node2 gateway is back -- `hive get nodes` — verify all 3 nodes Ready again +- `spx get nodes` — verify all 3 nodes Ready again - Verify node2 serves requests after recovery ### Phase 10: Cleanup @@ -637,7 +637,7 @@ Runs on a real 3-node libvirt cluster provisioned by OpenTofu (`scripts/tofu-clu ## VPC (`run-vpc-e2e.sh`) -Standalone VPC networking test suite. Runs against a running Hive endpoint (configurable via `ENDPOINT` env var). OVN topology tests are skipped when OVN is unavailable. +Standalone VPC networking test suite. Runs against a running Spinifex endpoint (configurable via `ENDPOINT` env var). OVN topology tests are skipped when OVN is unavailable. ### Phase 1: VPC CRUD - `create-vpc` (10.99.0.0/16, verify VpcId)