Josh Siviour 65ba60e8bc fix(gateway/ec2): fan out DescribeInstanceAttribute across daemons (#263)
* fix(gateway/ec2): fan out DescribeInstanceAttribute across daemons

DescribeInstanceAttribute was queue-grouped on `spinifex-workers`, so each
request landed on one daemon at random. The handler only consults per-daemon
state (vmMgr / stoppedStore), so 1/N requests succeeded and the rest returned
InvalidInstanceID.NotFound. Terraform's AWS provider refreshes aws_instance
with three attribute reads per cycle, which on a 5-node cluster fails ~99% of
the time.

Move the daemon subscription into the fan-out block (no queue group) and
rewrite the gateway to mirror DescribeInstances: inbox + N replies + drop
NotFound. The aggregator returns the first parsed success, falls back to
NotFound only when every daemon confirms absence, and propagates deterministic
client errors (InvalidParameterValue, MissingParameter) when no daemon
succeeds.

Tests:
- New: MultipleNodes_OwnerWins, AllNodesNotFound, ClientErrorPropagates,
  NoResponders, SingleNode (rewritten without queue group).
- daemon_handlers_test.go: drop the `spinifex-workers` queue-group string from
  the ten DescribeInstanceAttribute subscriptions so the tests match the new
  production wiring.

* fix(ec2): DescribeInstanceTypes returns supported set, not capacity-gated

The no-filter DescribeInstanceTypes response was filtered to types with
at least one free slot. AWS-compatible callers (e.g. the Terraform AWS
provider's post-RunInstances metadata lookup) expect a stable supported
set: when a launch consumes the last free slot of its type, the next
DescribeInstanceTypes for that type must still return it, or the apply
fails with "reading EC2 Instance Type (X): empty result".

Split the API into two ResourceManager methods so capacity semantics
stay strict for the capacity=true filter (used for cluster aggregation)
while default callers get the supported answer:

- GetAvailableInstanceTypeInfos(showCapacity bool) — unchanged; gates on
  remaining schedulable CPU/memory and (for GPU types) free GPU pool
  slots. Used when capacity=true is requested.
- GetSupportedInstanceTypeInfos() — new; lists every loaded instance
  type once, regardless of current allocation or GPU pool state. Still
  skips system types ("sys.*") and entries with incomplete CPU/memory
  metadata.

The handler picks between the two based on the capacity filter. The
gateway aggregator (DescribeInstanceTypes.go) needs no change — it
already deduplicates by type name when capacity=false, so requesting a
specific name now resolves from whichever node supports it.

Tests:
- Daemon unit tests for the new method cover the three filter rules
  (no free slots, system/incomplete skip, GPU without manager).
- Handler tests assert the supported path is hit by default and the
  capacity-gated path is hit only when capacity=true.
- The NATS-driven integration test is split into two subtests: one
  proves the no-filter response is invariant under allocation, the
  other proves capacity=true still gates on remaining resources.

* fix: persist API device name in volume metadata on AttachVolume

aws_volume_attachment polls DescribeVolumes with
attachment.device=/dev/sd[f-p], the API-form name. Spinifex was
persisting the in-guest virtio path (/dev/vd*) via UpdateVolumeState
after AttachVolume, so the filter rejected every attached volume and
the post-attach wait loop failed with "couldn't find resource".

UpdateVolumeState now receives the API-form device name and the
daemon's AttachVolume response echoes DeviceName instead of
GuestDevice. BlockDeviceMappings continues to carry the guest path
(mulga-599 / PR #55) since UpdateGuestDeviceNames re-applies that
convention on every Launch/Start; only the volume-metadata path
diverges to the API form for the AWS-spec round-trip.

Adds fakeVolumeStateUpdater to manager_deps_test.go and a regression
test that asserts the API-form name flows through
UpdateVolumeState while BDM keeps the guest path.

Resolves mulga-siv-154.
2026-05-28 23:43:39 +10:00
2026-03-27 08:28:16 +10:00
2026-05-28 11:38:40 +10:00
2026-05-28 14:42:03 +10:00
2026-05-20 10:23:42 +10:00
2026-05-26 10:04:09 +10:00
2026-05-26 10:04:09 +10:00
2026-05-01 15:18:00 +10:00

Spinifex — AWS-Compatible Infrastructure Stack

Go License Docs

What is Spinifex? · Platform · Components · Architecture · Installation · Docs


Spinifex: An Open Source AWS-Compatible Stack for Bare-Metal, Edge, and On-Prem Deployments

Spinifex developed by Mulga Defense Corporation 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 Spinifex?

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:

  • Cloud-like infrastructure without the cloud
  • Minimal dependencies, full control
  • 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 Spinifex on a few servers in a rack, a field site, or anywhere centralized cloud services aren't feasible.

The Platform

The Mulga Platform — Hardware to Applications

From commodity hardware up to unmodified AWS tooling, every layer is replaceable and yours to own.

Core Components

Spinifex (Compute Service – EC2 Alternative)

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
  • Works with standard AWS tooling

Viperblock (Block Storage – EBS Alternative)

Viperblock is a high-performance, WAL-backed block storage service that replicates volumes across multiple nodes. It's built for reliability and speed, with support for snapshots, recovery, and direct connection to QEMU instances using NBD or virtio-blk.

  • Fast, durable virtual disks
  • Replication for resilience
  • Exposed over NBD or embedded in VMs
  • Supports high performance WAL logs using local NVMe drives to reduce IO traffic to S3.
  • In memory read/write block cache for blazing performance.

Predastore (Object Storage – S3-Compatible)

Predastore is a fully S3-compatible object storage system. It supports the AWS S3 API, including Signature V4 authentication, multipart uploads, and Terraform provisioning. Data is chunked and distributed across nodes using Reed-Solomon erasure coding, making it fault-tolerant and ideal for large-scale or low-bandwidth scenarios.

  • S3-compatible API and auth
  • Multipart uploads, streaming reads/writes
  • Data redundancy with Reed-Solomon encoding

Architecture at a Glance

Spinifex message-driven architecture — AWS Gateway, NATS bus, service daemons

Every AWS API call is authenticated at the gateway, published to a NATS subject, and answered by whichever daemon claims it. Daemons are stateless — scale horizontally by starting more. No etcd, no Kubernetes, no external control plane. Deep dive: docs/DESIGN.md.

Key Features

AWS-Compatible Interfaces – Provision infrastructure with awscli, Terraform, or SDKs you already use.

  • Designed for Control – Run on your own terms, whether that's in a datacenter, remote site, or sensitive environment.
  • Minimal Dependencies – Each service is standalone and avoids complex orchestration layers.
  • Works Offline – No reliance on centralized cloud services or external networks.
  • Open Source – Licensed under AGPL 3.0. Fork it, extend it, or deploy it as-is.

Installation

Installation requires an Ubuntu / Debian system. See the detailed documentation at docs.mulgadc.com for maintaining and installing Spinifex.

Bare Metal ISO

The recommended installation is a bootable x86 installer for bare-metal hardware.

curl -fLO https://iso.mulgadc.com/spinifex.iso

Follow the USB install guide to write the ISO to USB and install on your hardware. The install guide walks through the full process.

Single Node Install

The installation is straightforward to set up and running on a single node for testing purposes. Debian 13 is currently supported, additional Linux distributions are on the immediate roadmap.

Prerequisite: Linux bridge for networking.

Spinifex requires a Linux bridge configured on the host for VM networking. See the single-node install guide prerequisites for setup details.

curl -fsSL https://install.mulgadc.com | bash

sudo /usr/local/share/spinifex/setup-ovn.sh --management

sudo spx admin init --node node1 --nodes 1

sudo systemctl start spinifex.target

export AWS_PROFILE=spinifex

aws ec2 describe-instance-types

Development Setup

For a complete development environment see the Source Install documentation

Component Repositories

Spinifex coordinates these independent components:

Each component can be developed independently. See component-specific documentation for focused development guides.

Spinifex UI

Spinifex ships with a built-in web console — an optional alternative to the AWS CLI, SDKs, and Terraform. If you're familiar with the AWS Management Console, the Spinifex UI fills the same role: a browser-based view of your instances, volumes, buckets, VPCs, and IAM resources, without leaving your own network.

Spinifex web console — dashboard view

The console is served by each node on port 3000 over TLS, and becomes available as soon as spinifex.target is up:

open https://YOUR_NODE_IP:3000
  • Same API, different surface. Every action in the UI is the same AWS SigV4 call the CLI makes — so RBAC, audit trails, and IAM policies apply uniformly.
  • Single sign-on against your AWS credentials. Log in with the access keys from ~/.aws/credentials on the node where Spinifex is installed — no separate user database.
  • Self-hosted, works offline. The UI is embedded in the Spinifex binary and served from the node itself. No external CDN, no analytics calls, no cloud dependency.

For the full walkthrough — first-time TLS certificate trust, login, and feature tour — see Launching the Web UI in the cluster setup guide.

Development Philosophy

Built by Engineers, For Engineers

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:

  • Production AWS service development and operations
  • Large-scale infrastructure deployment and management
  • Edge computing and resource-constrained environments
  • Enterprise security and compliance requirements

AI-Assisted Development

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:

  • Code Generation: Boilerplate AWS API structures and handlers
  • Documentation: Comprehensive development guides and API documentation
  • Testing: Test case generation and validation scenarios
  • Refactoring: Large-scale code restructuring and optimization

What Remains Human-Driven:

  • Architecture Decisions: Core system design and scalability choices
  • Security Implementation: Authentication, encryption, and threat modeling
  • Performance Optimization: Real-world performance tuning and benchmarking
  • Production Operations: Deployment strategies and operational procedures

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

Spinifex is open source under the GNU Affero General Public License v3.0. You're free to use, modify, and deploy it anywhere you need reliable infrastructure without depending on centralized cloud platforms.

S
Description
Spinifex – Open source AWS-compatible platform for secure edge deployments. Run EC2, VPC, S3, and EBS-like services on bare metal with full control. Built for environments where running in the cloud isn’t an option. Whether you’re deploying to edge sites, private data-centers, or operating in low-connectivity or highly contested environments.
Readme AGPL-3.0 127 MiB
Languages
Go 86%
TypeScript 9.1%
Shell 4.4%
Python 0.2%
HCL 0.1%