diff --git a/docs/PACKAGE_BOUNDARY_MIGRATION.md b/docs/PACKAGE_BOUNDARY_MIGRATION.md index 570d9ea25..14d5246eb 100644 --- a/docs/PACKAGE_BOUNDARY_MIGRATION.md +++ b/docs/PACKAGE_BOUNDARY_MIGRATION.md @@ -189,6 +189,7 @@ while the branch is in flight; they do not describe the umbrella repository's | `78fd017e0` | `spinifex/types/telemetry.go` (`GuestTelemetryMeta`) | `contracts/telemetry/v1/guest_meta.go` | QMP collector sidecar JSON is a versioned file contract between VM runtime and telemetry role; `guest_meta_test.go` pins its filename and payload. | | `4b35a2a33` | `spinifex/types/node.go` (`NodeVMsResponse`, `VMInfo`, `VMGPUInfo`) | `contracts/cluster/v1/node_vms.go` | VM inventory is a versioned cluster fan-out payload used by SPX CLI and EKS host lookup; `node_vms_test.go` pins its subject and JSON shape. | | `08bd335f0` | `spinifex/types/node.go` (`NodeStatusResponse`, capacity and GPU inventory) | `contracts/cluster/v1/status.go` | Node status is a versioned fan-out observation contract for operator inspection and EC2/EKS scheduling consumers; `status_test.go` pins its subject and JSON shape. | +| `f4cb550c9` | `spinifex/types/ebs.go` (GP3 policy constants) | `spinifex/domains/ec2/ebs/policy/gp3.go` | The supported GP3 product envelope is EC2 EBS domain policy, not generic runtime or Viperblockd wire state; `gp3_test.go` pins the deployed values. | The EC2 contract row is intentionally different from the directory moves: it creates a compatibility boundary. `ec2.cmd.*` retains its deployed one-token NATS diff --git a/spinifex/services/viperblockd/conformance_test.go b/spinifex/services/viperblockd/conformance_test.go index 17a86ec30..90577f43c 100644 --- a/spinifex/services/viperblockd/conformance_test.go +++ b/spinifex/services/viperblockd/conformance_test.go @@ -74,7 +74,7 @@ func inProcessProvider(t *testing.T) (func(t *testing.T) ebsprovider.EBSProvider cfg.AccessKey = fixture.AccessKey cfg.SecretKey = fixture.SecretKey cfg.PluginPath = pluginPath - cfg.NBDTransport = types.NBDTransportTCP + cfg.NBDTransport = NBDTransportTCP cfg.NodeName = name // The lease owner is derived from NodeName, and setupTestConfig built // the store before this function could set it. Rebuild it, or both diff --git a/spinifex/services/viperblockd/nbd_transport.go b/spinifex/services/viperblockd/nbd_transport.go new file mode 100644 index 000000000..c76b30a20 --- /dev/null +++ b/spinifex/services/viperblockd/nbd_transport.go @@ -0,0 +1,11 @@ +package viperblockd + +// NBDTransport controls how Viperblockd exports a mounted volume. +type NBDTransport string + +const ( + // NBDTransportSocket uses Unix domain sockets (faster, local only). + NBDTransportSocket NBDTransport = "socket" + // NBDTransportTCP uses TCP connections (required for remote/DPU scenarios). + NBDTransportTCP NBDTransport = "tcp" +) diff --git a/spinifex/services/viperblockd/nbd_transport_test.go b/spinifex/services/viperblockd/nbd_transport_test.go new file mode 100644 index 000000000..e1451f24c --- /dev/null +++ b/spinifex/services/viperblockd/nbd_transport_test.go @@ -0,0 +1,9 @@ +package viperblockd + +import "testing" + +func TestNBDTransportValues(t *testing.T) { + if NBDTransportSocket != "socket" || NBDTransportTCP != "tcp" { + t.Fatal("unexpected NBD transport values") + } +} diff --git a/spinifex/services/viperblockd/provider_handlers.go b/spinifex/services/viperblockd/provider_handlers.go index e2a8bff6e..592a65682 100644 --- a/spinifex/services/viperblockd/provider_handlers.go +++ b/spinifex/services/viperblockd/provider_handlers.go @@ -1408,7 +1408,7 @@ func mountVolume(ctx context.Context, cfg *Config, nc *nats.Conn, volumeName str mountSpan.SetAttributes(attribute.Int64("volume.size_bytes", safecast.Uint64ToInt64(vb.GetVolumeSize()))) - useTCP := cfg.NBDTransport == types.NBDTransportTCP + useTCP := cfg.NBDTransport == NBDTransportTCP var nbdURI string var nbdSocket string diff --git a/spinifex/services/viperblockd/viperblockd.go b/spinifex/services/viperblockd/viperblockd.go index 1fd8c1169..514a7a033 100644 --- a/spinifex/services/viperblockd/viperblockd.go +++ b/spinifex/services/viperblockd/viperblockd.go @@ -149,7 +149,7 @@ type Config struct { // NBDTransport controls the transport type: "socket" (default) or "tcp" // Socket is faster for local connections, TCP required for remote/DPU scenarios - NBDTransport types.NBDTransport + NBDTransport NBDTransport // ShardWAL enables sharded WAL for mounted volumes (default false) ShardWAL bool diff --git a/spinifex/types/ebs.go b/spinifex/types/ebs.go index 804928a75..937851b2a 100644 --- a/spinifex/types/ebs.go +++ b/spinifex/types/ebs.go @@ -24,16 +24,6 @@ type EBSRequest struct { HotplugPort int `json:"HotplugPort,omitempty"` } -// NBDTransport defines the transport type for NBD connections. -type NBDTransport string - -const ( - // NBDTransportSocket uses Unix domain sockets (faster, local only). - NBDTransportSocket NBDTransport = "socket" - // NBDTransportTCP uses TCP connections (required for remote/DPU scenarios). - NBDTransportTCP NBDTransport = "tcp" -) - type EBSMountResponse struct { URI string `json:"URI"` Mounted bool `json:"Mounted"`