mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-11-02 09:13:33 +00:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e4055d4d89 | |||
| a7753557dc | |||
| fe97c45793 | |||
| 1713c711c4 | |||
| bab4e1e53c | |||
| 1a91d5de9e | |||
| e958e4a57b | |||
| a44fd01b85 | |||
| 72f2786360 | |||
| 8916904285 | |||
| 2630d29e13 | |||
| e7c0f0ebae | |||
| d79e537330 | |||
| fe349fb994 | |||
| 061ea49832 | |||
| f4af10713d |
@@ -1,4 +1,4 @@
|
||||
# spinifex-unit-version: 5
|
||||
# spinifex-unit-version: 6
|
||||
[Unit]
|
||||
Description=Spinifex Daemon (VM Orchestration)
|
||||
PartOf=spinifex.target
|
||||
@@ -15,6 +15,7 @@ Slice=spinifex-system.slice
|
||||
User=spinifex-daemon
|
||||
Group=spinifex
|
||||
ExecStartPre=/usr/local/bin/spx admin hostnet check
|
||||
ExecStartPre=-+/usr/local/bin/spx admin node-facts collect
|
||||
ExecStart=/usr/local/bin/spx service spinifex start
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
@@ -0,0 +1,211 @@
|
||||
package clusterv1
|
||||
|
||||
import "regexp"
|
||||
|
||||
const (
|
||||
// NodeFactsSubject fans out a request for each daemon's hardware and
|
||||
// cabling description. Its reply payload is NodeFacts.
|
||||
NodeFactsSubject = "spinifex.node.facts"
|
||||
|
||||
nodeNetTestPrefix = "spinifex.node.nettest."
|
||||
)
|
||||
|
||||
var nodeIDPattern = regexp.MustCompile(`^[A-Za-z0-9_-]{1,64}$`)
|
||||
|
||||
// ValidNodeID reports whether a node name is safe to place in a subject: no
|
||||
// NATS token separator or wildcard can get through.
|
||||
func ValidNodeID(node string) bool {
|
||||
return nodeIDPattern.MatchString(node)
|
||||
}
|
||||
|
||||
// NetTestServeSubject asks one node to start a one-shot throughput server.
|
||||
func NetTestServeSubject(node string) string {
|
||||
return nodeNetTestPrefix + node + ".serve"
|
||||
}
|
||||
|
||||
// NetTestRunSubject asks one node to run the client side of a throughput test.
|
||||
func NetTestRunSubject(node string) string {
|
||||
return nodeNetTestPrefix + node + ".run"
|
||||
}
|
||||
|
||||
// Planes a node's NICs can carry, named as the installer names them.
|
||||
const (
|
||||
PlaneWAN = "wan"
|
||||
PlaneLAN = "lan"
|
||||
PlaneVPC = "vpc"
|
||||
)
|
||||
|
||||
// NetTestPort is the TCP port reserved for node-to-node throughput tests.
|
||||
const NetTestPort = 5001
|
||||
|
||||
// NodeFacts describes one node's hardware, OS and cabling. Fields a host
|
||||
// cannot report are left empty, and Sources says why.
|
||||
type NodeFacts struct {
|
||||
Node string `json:"node"`
|
||||
CollectedAt string `json:"collected_at,omitempty"`
|
||||
FormFactor string `json:"form_factor"`
|
||||
Virt string `json:"virt,omitempty"`
|
||||
System SystemFacts `json:"system"`
|
||||
OS OSFacts `json:"os"`
|
||||
CPU CPUFacts `json:"cpu"`
|
||||
Memory MemoryFacts `json:"memory"`
|
||||
NICs []NICFacts `json:"nics"`
|
||||
Planes []PlaneFacts `json:"planes"`
|
||||
Sources map[string]string `json:"sources"`
|
||||
}
|
||||
|
||||
// SystemFacts is the machine's identity from DMI.
|
||||
type SystemFacts struct {
|
||||
Vendor string `json:"vendor,omitempty"`
|
||||
Product string `json:"product,omitempty"`
|
||||
Family string `json:"family,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
Serial string `json:"serial,omitempty"`
|
||||
UUID string `json:"uuid,omitempty"`
|
||||
ChassisType string `json:"chassis_type,omitempty"`
|
||||
ChassisAsset string `json:"chassis_asset,omitempty"`
|
||||
BoardVendor string `json:"board_vendor,omitempty"`
|
||||
BoardProduct string `json:"board_product,omitempty"`
|
||||
BoardSerial string `json:"board_serial,omitempty"`
|
||||
BIOSVendor string `json:"bios_vendor,omitempty"`
|
||||
BIOSVersion string `json:"bios_version,omitempty"`
|
||||
BIOSDate string `json:"bios_date,omitempty"`
|
||||
DeviceModel string `json:"device_model,omitempty"`
|
||||
}
|
||||
|
||||
// OSFacts names the running OS and Spinifex build.
|
||||
type OSFacts struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Kernel string `json:"kernel,omitempty"`
|
||||
Arch string `json:"arch,omitempty"`
|
||||
Version string `json:"spx_version,omitempty"`
|
||||
Commit string `json:"spx_commit,omitempty"`
|
||||
UptimeSeconds int64 `json:"uptime_seconds,omitempty"`
|
||||
Hostname string `json:"hostname,omitempty"`
|
||||
}
|
||||
|
||||
// CPUFacts summarises the sockets. Threads and Cores are totals. Features are
|
||||
// the flags worth naming; Flags is every flag the CPU reports.
|
||||
type CPUFacts struct {
|
||||
Model string `json:"model,omitempty"`
|
||||
Vendor string `json:"vendor,omitempty"`
|
||||
Sockets int `json:"sockets"`
|
||||
CoresPerSocket int `json:"cores_per_socket,omitempty"`
|
||||
Cores int `json:"cores"`
|
||||
Threads int `json:"threads"`
|
||||
MaxMHz int `json:"max_mhz,omitempty"`
|
||||
CurrentMHz int `json:"current_mhz,omitempty"`
|
||||
Virtualization string `json:"virtualization,omitempty"`
|
||||
Features []string `json:"features,omitempty"`
|
||||
Flags []string `json:"flags,omitempty"`
|
||||
}
|
||||
|
||||
// MemoryFacts groups identical DIMMs so a 32-slot board reads as one line.
|
||||
type MemoryFacts struct {
|
||||
TotalBytes uint64 `json:"total_bytes"`
|
||||
SlotsUsed int `json:"slots_used"`
|
||||
SlotsTotal int `json:"slots_total"`
|
||||
MaxCapacity string `json:"max_capacity,omitempty"`
|
||||
ECC string `json:"ecc,omitempty"`
|
||||
Groups []MemoryGroup `json:"groups"`
|
||||
OSTotalBytes uint64 `json:"os_total_bytes,omitempty"`
|
||||
OSAvailBytes uint64 `json:"os_available_bytes,omitempty"`
|
||||
HugePageBytes uint64 `json:"huge_page_bytes,omitempty"`
|
||||
}
|
||||
|
||||
// MemoryGroup is a set of DIMMs alike in every field shown. ConfiguredMTs
|
||||
// below SpeedMTs means the board runs them slower than rated.
|
||||
type MemoryGroup struct {
|
||||
Count int `json:"count"`
|
||||
SizeBytes uint64 `json:"size_bytes"`
|
||||
Type string `json:"type,omitempty"`
|
||||
TypeDetail string `json:"type_detail,omitempty"`
|
||||
FormFactor string `json:"form_factor,omitempty"`
|
||||
SpeedMTs int `json:"speed_mts,omitempty"`
|
||||
ConfiguredMTs int `json:"configured_mts,omitempty"`
|
||||
Manufacturer string `json:"manufacturer,omitempty"`
|
||||
PartNumber string `json:"part_number,omitempty"`
|
||||
Rank string `json:"rank,omitempty"`
|
||||
Serials []string `json:"serials,omitempty"`
|
||||
}
|
||||
|
||||
// NICFacts is one physical network interface and, where LLDP reports it, the
|
||||
// switch port it is cabled to.
|
||||
type NICFacts struct {
|
||||
Name string `json:"name"`
|
||||
MAC string `json:"mac,omitempty"`
|
||||
Driver string `json:"driver,omitempty"`
|
||||
Firmware string `json:"firmware,omitempty"`
|
||||
BusInfo string `json:"bus_info,omitempty"`
|
||||
Model string `json:"model,omitempty"`
|
||||
SpeedMbps int `json:"speed_mbps,omitempty"`
|
||||
MaxMbps int `json:"max_mbps,omitempty"`
|
||||
Duplex string `json:"duplex,omitempty"`
|
||||
Port string `json:"port,omitempty"`
|
||||
MTU int `json:"mtu,omitempty"`
|
||||
State string `json:"state"`
|
||||
Master string `json:"master,omitempty"`
|
||||
Planes []string `json:"planes,omitempty"`
|
||||
Neighbor *LLDPNeighbor `json:"neighbor,omitempty"`
|
||||
}
|
||||
|
||||
// LLDPNeighbor is what the switch on the other end of a NIC advertises.
|
||||
type LLDPNeighbor struct {
|
||||
ChassisID string `json:"chassis_id"`
|
||||
SystemName string `json:"system_name,omitempty"`
|
||||
SystemDescription string `json:"system_description,omitempty"`
|
||||
PortID string `json:"port_id,omitempty"`
|
||||
PortDescription string `json:"port_description,omitempty"`
|
||||
Capabilities []string `json:"capabilities,omitempty"`
|
||||
}
|
||||
|
||||
// PlaneFacts is the address a plane uses on this node and the NICs under it.
|
||||
type PlaneFacts struct {
|
||||
Plane string `json:"plane"`
|
||||
Bridge string `json:"bridge,omitempty"`
|
||||
Address string `json:"address,omitempty"`
|
||||
Prefix int `json:"prefix,omitempty"`
|
||||
NICs []string `json:"nics,omitempty"`
|
||||
MTU int `json:"mtu,omitempty"`
|
||||
}
|
||||
|
||||
// NetTestServeRequest starts a server bound to the node's address on Plane.
|
||||
type NetTestServeRequest struct {
|
||||
Plane string `json:"plane"`
|
||||
DurationSeconds int `json:"duration_seconds"`
|
||||
}
|
||||
|
||||
// NetTestServeResponse names the address the server listens on.
|
||||
type NetTestServeResponse struct {
|
||||
Address string `json:"address,omitempty"`
|
||||
Port int `json:"port,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
// NetTestRunRequest runs the client towards Address from the node's own
|
||||
// address on Plane.
|
||||
type NetTestRunRequest struct {
|
||||
Plane string `json:"plane"`
|
||||
Address string `json:"address"`
|
||||
Port int `json:"port"`
|
||||
DurationSeconds int `json:"duration_seconds"`
|
||||
Streams int `json:"streams"`
|
||||
}
|
||||
|
||||
// NetTestRunResponse is one direction of a pair's measurement.
|
||||
type NetTestRunResponse struct {
|
||||
SourceAddress string `json:"source_address,omitempty"`
|
||||
BitsPerSecond float64 `json:"bits_per_second"`
|
||||
Bytes int64 `json:"bytes"`
|
||||
Seconds float64 `json:"seconds"`
|
||||
Streams int `json:"streams"`
|
||||
StreamBPS []float64 `json:"stream_bps,omitempty"`
|
||||
RTTMinMillis float64 `json:"rtt_min_ms,omitempty"`
|
||||
RTTAvgMillis float64 `json:"rtt_avg_ms,omitempty"`
|
||||
RTTMaxMillis float64 `json:"rtt_max_ms,omitempty"`
|
||||
PacketLoss float64 `json:"packet_loss_percent,omitempty"`
|
||||
LinkMbps int `json:"link_mbps,omitempty"`
|
||||
MTU int `json:"mtu,omitempty"`
|
||||
Tool string `json:"tool,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package telemetryv1
|
||||
|
||||
import "regexp"
|
||||
|
||||
// Node live subjects mirror the instance ones, keyed by node name. Only the
|
||||
// super-admin account's gateway handler subscribes to them.
|
||||
const (
|
||||
nodeLiveWatchSubjectPrefix = "telemetry.watch.node."
|
||||
nodeLiveSampleSubjectPrefix = "telemetry.live.node."
|
||||
)
|
||||
|
||||
var liveNodePattern = regexp.MustCompile(`^[A-Za-z0-9_-]{1,64}$`)
|
||||
|
||||
// ValidLiveNode reports whether a node name is safe to place in a subject.
|
||||
func ValidLiveNode(node string) bool {
|
||||
return liveNodePattern.MatchString(node)
|
||||
}
|
||||
|
||||
// NodeLiveWatchSubject is where a viewer asks a node to keep sampling itself.
|
||||
// A request on it is answered with a NodeLiveRing.
|
||||
func NodeLiveWatchSubject(node string) string {
|
||||
return nodeLiveWatchSubjectPrefix + node
|
||||
}
|
||||
|
||||
// NodeLiveSampleSubject carries one NodeLiveSample per period while watched.
|
||||
func NodeLiveSampleSubject(node string) string {
|
||||
return nodeLiveSampleSubjectPrefix + node
|
||||
}
|
||||
|
||||
// NodeLiveRing answers a watch with the samples newer than its SinceMillis.
|
||||
type NodeLiveRing struct {
|
||||
Samples []NodeLiveSample `json:"samples"`
|
||||
}
|
||||
|
||||
// NodeLiveSample is one host measurement. Rates are per second over the
|
||||
// interval ending at TimeMillis.
|
||||
type NodeLiveSample struct {
|
||||
TimeMillis int64 `json:"t"`
|
||||
CPUPercent float64 `json:"cpu"`
|
||||
// MemoryUsedPercent is used memory less page cache, as free(1) reports it.
|
||||
MemoryUsedPercent float64 `json:"mem"`
|
||||
Load1 float64 `json:"load1"`
|
||||
// Planes holds the traffic of each plane's physical NICs, keyed wan, lan, vpc.
|
||||
Planes map[string]NodeLivePlane `json:"planes"`
|
||||
}
|
||||
|
||||
// NodeLivePlane is one plane's traffic from the host's side.
|
||||
type NodeLivePlane struct {
|
||||
NetworkIn float64 `json:"netIn"`
|
||||
NetworkOut float64 `json:"netOut"`
|
||||
PacketsIn float64 `json:"pktIn"`
|
||||
PacketsOut float64 `json:"pktOut"`
|
||||
}
|
||||
@@ -99,6 +99,7 @@ behavior in other words.
|
||||
| 4432 | Formation server | HTTPS | Cluster (bootstrap only) | Cluster join coordination; active only while a join token is valid. Binds the node's `--bind` (lan) address. See *Formation port lifecycle* below. | Short-lived bearer token + TLS¹ |
|
||||
| 4222 | spinifex-nats (client) | NATS + TLS | Cluster | Internal service bus for EC2/EBS/VPC/S3 handlers | Token + mutual TLS (cluster CA) |
|
||||
| 4248 | spinifex-nats (cluster) | NATS + TLS | Cluster | Inter-node NATS federation | Token + mutual TLS (cluster CA) |
|
||||
| 5001 | iperf2 (admin network test) | TCP | Cluster, any plane | Throughput test between two nodes, started only by the super-admin account. Listens on one plane address for the length of one test, then exits. Runs with no capabilities. | None — peer-scoped by firewall, and the client may only target its own plane subnet |
|
||||
| 5300 | northstar | DNS (UDP + TCP) | Cluster | Forward target for every node's per-instance DNS shim, dialled cross-node. Binds the wildcard by design. | None — restrict by firewall |
|
||||
| 6660 | predastore (blob node) | QUIC / UDP | Cluster | Erasure-coded object shard transport between hosts. Multi-node clusters only — see *Predastore ports* below. | TLS 1.3, server certificate verified against the cluster CA |
|
||||
| 7660 | predastore (meta node) | QUIC / UDP | Cluster | Raft consensus over global state — buckets and the object index — between hosts. Multi-node clusters only. | TLS 1.3, server certificate verified against the cluster CA |
|
||||
@@ -221,7 +222,7 @@ table inet spinifex_filter {
|
||||
|
||||
# Cluster, from peer nodes only. Replace with your nodes' lan-plane
|
||||
# addresses — a CIDR does not generalise to nodes on different subnets.
|
||||
ip saddr { 10.0.1.1, 10.0.1.2, 10.0.1.3 } tcp dport { 4222, 4248, 4432, 5300, 6641, 6642, 6643, 6644, 8660 } accept
|
||||
ip saddr { 10.0.1.1, 10.0.1.2, 10.0.1.3 } tcp dport { 4222, 4248, 4432, 5001, 5300, 6641, 6642, 6643, 6644, 8660 } accept
|
||||
ip saddr { 10.0.1.1, 10.0.1.2, 10.0.1.3 } udp dport { 5300, 6660, 7660 } accept
|
||||
|
||||
# Encap, from peer chassis only. Replace with your nodes' vpc-plane
|
||||
|
||||
+78
-21
@@ -24,7 +24,7 @@ All colours are OKLCH and come from mulgadc.com, so product and site match.
|
||||
| Token | Use |
|
||||
|---|---|
|
||||
| `background` | The app page. Warm off-white in light, ink `#14181D` in dark. |
|
||||
| `card`, `popover` | Raised surfaces. White in light, about `#1B2027` in dark. |
|
||||
| `card`, `popover` | Raised surfaces. White in light, about `#1B2027` in dark. `popover` is every floating surface: tooltips, popovers, menus and pickers. |
|
||||
| `muted`, `secondary`, `accent` | Hover rows, secondary buttons, quiet fills. |
|
||||
| `border` | Every divider and card edge. `#DCD8CE` in light, `oklch(1 0 0 / 8%)` in dark. |
|
||||
| `brand` | Brand orange `#EE4B12`, for the logo and decoration only. It fails text contrast, so it never carries text. |
|
||||
@@ -39,15 +39,22 @@ Each status has a solid token plus `-foreground` (text on a tinted background),
|
||||
|
||||
| Status | Hue | AWS states |
|
||||
|---|---|---|
|
||||
| `success` | green | running, available, completed, healthy |
|
||||
| `warning` | brand yellow `#F5B500` | pending, stopping, creating, modifying, deleting, draining |
|
||||
| `danger` | cool red, hue 17 | stopped, error, failed, unhealthy, unavailable |
|
||||
| `success` | green | settled and good: running, available, active, associated, attached, in-use, healthy, ok, main |
|
||||
| `warning` | brand yellow `#F5B500` | changing state and will settle: pending, stopping, creating, modifying, deleting, draining |
|
||||
| `caution` | orange, hue 58 | works but needs attention: degraded, impaired, insufficient-data |
|
||||
| `danger` | cool red, hue 17 | stopped, error, failed, update-failed, unhealthy, unavailable, blackhole |
|
||||
| `info` | blue | informational notes |
|
||||
| `neutral` | grey `#9AA1A8` | terminated (muted text), and any unmapped state |
|
||||
| `neutral` | grey `#9AA1A8` | gone or absent (terminated, deleted, no) in muted text, and any unmapped state |
|
||||
|
||||
`stopped` is danger because EC2 reads it that way, although RDS treats it as a resting state; splitting the map by service is its own change.
|
||||
|
||||
`StateBadge` (`src/components/state-badge.tsx`) is the only mapping from an AWS state to a tone, and it exposes the result as `data-tone` for tests.
|
||||
Its tones are `success`, `progress` (the yellow `warning` token), `caution`, `danger`, `muted` and `neutral`.
|
||||
A `progress` state carries the submit button's spinning loader, so a launching instance reads as work under way; `StatusBadge` does not, because its yellow can mean waiting on the user, as a zone's `pending nameservers` does.
|
||||
It shows every state lowercase with hyphens, as EC2 writes them, so EKS's `ACTIVE` reads `active` and Bedrock's `IN_PROGRESS` reads `in-progress`; the API value, filters and CLI panels keep AWS's case.
|
||||
A good or settled state is always green, never grey, and a status that is not an API state, such as a cluster's health, uses `StatusBadge` with a tone rather than a `Badge`.
|
||||
The orange of `caution` is kept clear of the primary accent's hue, which marks actions and never a status.
|
||||
`Badge`'s default variant is the brand primary and is never used for a status; a label that is not a status, such as `default v3` or `Leader`, uses a `secondary` or `outline` `Badge`.
|
||||
Every status badge measures above 4.8:1 against its tinted background in both themes.
|
||||
|
||||
**Danger is separated from the primary accent by hue alone in dark mode**: the two have the same lightness.
|
||||
@@ -67,18 +74,21 @@ Colour is never the only key: label every series.
|
||||
| UI text, tables and forms | Geist (`font-sans`) |
|
||||
| IDs, ARNs, IPs, CIDRs, code and eyebrow labels | JetBrains Mono (`font-mono`), with `tabular-nums` for figures |
|
||||
|
||||
| Step | Size | Use |
|
||||
|---|---|---|
|
||||
| `2xl` | 26px | page title (`PageHeading`) |
|
||||
| `xl` | 22px | section heading |
|
||||
| `lg` | 17px | |
|
||||
| `base` | 15px | |
|
||||
| `sm` | 14px | body and table default |
|
||||
| `xs` | 13px | badges, secondary text |
|
||||
| `2xs` | 12px | mono eyebrow labels |
|
||||
| Step | rem | At the default 16px browser font | Use |
|
||||
|---|---|---|---|
|
||||
| `2xl` | 1.625 | 28.6px | page title (`PageHeading`) |
|
||||
| `xl` | 1.375 | 24.2px | section heading |
|
||||
| `lg` | 1.0625 | 18.7px | |
|
||||
| `base` | 0.9375 | 16.5px | |
|
||||
| `sm` | 0.875 | 15.4px | body and table default |
|
||||
| `xs` | 0.8125 | 14.3px | badges, secondary text |
|
||||
| `2xs` | 0.75 | 13.2px | mono eyebrow labels |
|
||||
|
||||
The scale sits a step above Tailwind's defaults, as consoles such as Vultr's do, because 13px body text read as cramped on a wide screen.
|
||||
Code blocks are set at 12px (`--text-code-block`) so a long command still fits.
|
||||
The root font size is 110% (`html` in `src/styles.css`), so one rem is 17.6px at the browser default.
|
||||
Everything is sized in rem, so text, spacing and breakpoints scale together, as they would at 110% browser zoom, and a user's own font-size setting still applies.
|
||||
The scale sits above Tailwind's defaults, as consoles such as Vultr's do, because the console read as small on a wide screen at 100%.
|
||||
Code blocks are set at 0.75rem (`--text-code-block`) so a long command still fits.
|
||||
Size new things in rem through the type and spacing scales, never in px, or they will not scale with the rest.
|
||||
|
||||
### Primary and contrast
|
||||
|
||||
@@ -169,6 +179,22 @@ Every other list is a `DataTable`, and the test also fails when an allowed file
|
||||
| S13 | a component outside `ui/` renders a raw `<input>`, `<select>` or `<textarea>` |
|
||||
| S15 | a route imports the `ui/alert` primitive instead of using `ErrorBanner` |
|
||||
|
||||
Rules that ADR-0016 does not yet number are named by what they hold until their amendment is accepted:
|
||||
|
||||
| Rule | Fails when |
|
||||
|---|---|
|
||||
| status pills come from StateBadge or StatusBadge | a component outside `ui/` renders `<Badge>` with the default variant |
|
||||
| status pills come from StateBadge or StatusBadge | a file outside `state-badge.tsx` builds a `rounded-full` pill on a status colour |
|
||||
| floating surfaces follow the theme | a file fills with `bg-foreground` or `text-background`, or a tooltip, popover, hover card, menu, select or combobox is not on `bg-popover` and `text-popover-foreground` |
|
||||
| expanding a panel keeps its tab | a `fullPage` link does not pass `search={{ tab }}` |
|
||||
| resource tags are edited in place | `PanelTags` or `TagsEditor` comes back |
|
||||
| lists filter through one FilterBar | a component other than `FilterBar` imports `ui/toggle-group` |
|
||||
| a component handed a form reads errors through `useFormState` | a file typed with `UseFormReturn` reads `form.formState` |
|
||||
|
||||
The last one matters because the console builds with the React compiler and the unit tests run without it.
|
||||
With the compiler on, a child handed a react-hook-form object is cached on that object, whose identity never changes, so errors read from `form.formState` never draw and the submit looks dead.
|
||||
`useFormState({ control })` subscribes the child itself.
|
||||
|
||||
An exception is named in that rule's allowlist with its reason, and the test fails when an allowed file stops needing it.
|
||||
S11, S14 and S16 are held by review, since none has a shape in the source a test can read without false alarms.
|
||||
|
||||
@@ -177,7 +203,7 @@ S11, S14 and S16 are held by review, since none has a shape in the source a test
|
||||
`src/lib/nav.ts` is the one description of the console's navigation.
|
||||
The sidebar, the command palette and the breadcrumbs all read it, and `nav.test.ts` checks every destination against the generated route tree, so a renamed route fails a test rather than leaving a dead link.
|
||||
|
||||
- **Sidebar.** Groups take generic names rather than AWS's service marks: Compute, Databases, Authentication and Object Storage, not EC2, RDS, IAM and S3. Pages and the rest of the console keep the AWS names, and each group's `service` keeps its AWS name findable in the command palette, where typing it exactly ranks that group first. Each service group folds, and a folded group stays folded across reloads (`localStorage["spinifex-ui-nav-collapsed"]`). Navigating into a folded group unfolds it so the active item shows, and it can then be folded again, the current group included. On a phone the sidebar is a sheet, and any navigation closes it.
|
||||
- **Sidebar.** Groups take generic names rather than AWS's service marks: Compute, Databases, Authentication and Object Storage, not EC2, RDS, IAM and S3. Pages and the rest of the console keep the AWS names, and each group's `service` keeps its AWS name findable in the command palette, where typing it exactly ranks that group first. Each service group folds, and a folded group stays folded across reloads (`localStorage["spinifex-ui-nav-collapsed"]`). Navigating into a folded group unfolds it so the active item shows, and it can then be folded again, the current group included. Folding animates through the `nav` variant of `CollapsibleContent`, opening over 200ms and closing over 150ms, and switches at once under reduced motion. On a phone the sidebar is a sheet, and any navigation closes it.
|
||||
- **Command palette.** ⌘K or Ctrl K, or the Search button in the header. It lists every page the user can reach, every create flow (`create` on a nav item), and a theme toggle. It is navigation only, with no resource search yet.
|
||||
- **Breadcrumbs.** Service, then list page, then the resource or the create flow. A resource ID is set in mono. On a phone only the last crumb shows.
|
||||
- **Sign in.** The sign-in card sits over the shell on a light, barely blurred overlay rather than on a page of its own, so the console stays in view. The shell behind it is `inert`, which keeps pointer, keyboard and screen reader out of it until the user signs in.
|
||||
@@ -202,8 +228,13 @@ So columns drop out when a side panel narrows the list as well as on a small scr
|
||||
List pages keep their filter, state and sort in the URL, so a filtered view can be bookmarked, shared and survives a reload.
|
||||
EC2 Instances is the reference page (`ec2/(instances)/-components/instances-page.tsx`):
|
||||
|
||||
- The first column names the resource: the `Name` tag in the primary colour, with the ID in mono beneath it, opening its side panel.
|
||||
- The first column is the instance ID in mono, opening its side panel, and the second its `Name` tag.
|
||||
- A long value ends in an ellipsis and shows in full on hover (`TruncatedText`), so it never widens its column.
|
||||
- A time column shows a relative time, `33 min ago` or `8 months ago`, with the full timestamp on hover (`RelativeTime`).
|
||||
- A Tags column shows one tag key as a pill and `+N` for the rest, and hover lists every tag with its value (`TagPills`); it leaves out `Name`, which has its own column.
|
||||
- Below `md`, only the ID, Name and State columns remain.
|
||||
- Bulk actions appear above the table once a row is selected. Each action counts only the selected instances it applies to, so a mixed selection never sends a call that must fail, and Terminate asks first and lists every ID.
|
||||
- Search and state filters sit in one `FilterBar` (`src/components/filter-bar.tsx`) above the table: a search box, an optional set of choices with counts, and Clear filters while anything is filtered.
|
||||
- An empty account gets a call to action, and an empty filter result says the filters are why.
|
||||
|
||||
VPCs and Internet gateways follow the same pattern.
|
||||
@@ -219,6 +250,12 @@ Every list with a delete action has row checkboxes. Selecting a row shows `Selec
|
||||
- **The bulk delete and the panel's delete are the same function.** Where a single delete is several calls, such as removing dependants first, the sequence lives in one place and both use it.
|
||||
- The verb follows the AWS console: Release for an Elastic IP, Deregister for an image.
|
||||
|
||||
### Lists inside a panel
|
||||
|
||||
A list inside a panel tab, such as a hosted zone's records, is a `DataTable` with row checkboxes, and a click on a row opens it for editing in a `FormPanel`.
|
||||
Rows the user cannot change, such as a zone's own SOA and NS, are muted and cannot be selected (`isRowActionable`).
|
||||
A batch delete uses the service's batch call where it has one, so Route 53 removes the whole selection in one `ChangeResourceRecordSets`.
|
||||
|
||||
### Typed confirmation
|
||||
|
||||
A delete that cannot be walked back asks the user to type a word first, as the AWS console does before deleting a volume.
|
||||
@@ -264,13 +301,24 @@ Modelled on UniFi's console: a click on a row opens the resource in a panel besi
|
||||
- **URL.** The panel is search state on the list route: `selected=<id>`, `tab=overview|monitoring|settings`, and `create=true`. Defaults are stripped, so a closed panel leaves the plain list address. Opening or closing a panel pushes a history entry, so Back closes it; a tab or filter change replaces the entry.
|
||||
- **Layout.** From `lg` (1024px) the panel is fixed to the right edge, full height below the header, flush with no outer margin, and it slides in over the list. The list keeps its width and columns underneath, so nothing reflows when a panel opens, and a soft gradient on the panel's left edge reads as the panel lying on top. Below `lg` there is no room to share, so the panel replaces the list as a full page with a back arrow. `useWideLayout` decides, through `matchMedia`.
|
||||
- **`DetailPanel`.** A header with the resource's own page (left) and close (right), the title and its ID, a summary of state and quick actions, then icon tabs with tooltips. Escape closes it unless a dialog or menu is open over it. Closing slides the panel out over 150ms, or at once under reduced motion. Each tab, and a create form, sits in its own error boundary, so a failed query shows in the panel and the list keeps working.
|
||||
- **Contents.** `PanelSection` is a folding card, `PanelFields` and `PanelField` a label and value list, with `copy` for a one-click copy of IDs and addresses, and `PanelTags` the tag list. Create forms take an `onClose(id?)` prop: embedded, they hide their back link and heading, and a create selects the new resource.
|
||||
- **Contents.** `PanelSection` is a folding card, `PanelFields` and `PanelField` a label and value list, with `copy` for a one-click copy of IDs and addresses, and `InlineTags` the tag list. Create forms take an `onClose(id?)` prop: embedded, they hide their back link and heading, and a create selects the new resource.
|
||||
- **One component is both the panel and the page.** Each resource has a single details component (`InstanceDetails`, `VpcDetails`, `InternetGatewayDetails`) that takes `layout="auto" | "page"`. The list renders it as the panel; `/ec2/describe-instances/$id` and its kind render the same component as a page, as one centred column under a standard left-aligned heading, with state and actions on the right and text tabs. A feature added to the panel is on the page by construction, and the page ignores Escape and has a back arrow in place of close. Expanding the panel to its page keeps the tab, and query results such as fetched console output come along from the cache.
|
||||
- **A click on the list's background closes the panel**, as UniFi's does. A row selects another resource instead, and links, buttons and inputs keep their own behaviour. Selecting rows for a bulk action closes it too, so the bulk bar and the panel never compete.
|
||||
- **Actions.** State actions sit in the summary as a button group, and the rest go in an Actions menu, Unikraft style. Stop, Reboot and every destructive action confirm in a dialog.
|
||||
- **Loading.** A panel or page still loading shows `PanelSpinner`, a centred spinner on the background, not a grey skeleton block.
|
||||
- **`DetailCard`, `DetailRow` and `ListCard` are retired.** Every resource page uses the panel sections instead.
|
||||
|
||||
### Tags
|
||||
|
||||
`InlineTags` (`src/components/inline-tags.tsx`) shows a resource's tags in its panel and edits them in place.
|
||||
Each row has a pencil, which turns the key and value into inputs and becomes a tick to save, and a bin to remove the tag; `+ Add tag` appends a row being edited.
|
||||
Enter saves and Escape cancels the row without closing the panel.
|
||||
Every row saves on its own request through the service's own tagging call, and a failure shows beside its row.
|
||||
AWS has no rename, so changing a key puts the new key and then removes the old one, and a failure between the two leaves both rather than neither.
|
||||
Keys are 1 to 128 characters with no `aws:` prefix and no duplicates, and values up to 256.
|
||||
Without `onPut` and `onRemove` it is read-only, as for a system image or an AWS-managed policy.
|
||||
Panels use the per-service wrappers in `src/components/resource-tags.tsx` and the writers in `src/mutations/tags.ts` rather than wiring the calls themselves.
|
||||
|
||||
### Forms from a resource's panel
|
||||
|
||||
A form that acts on an open resource, such as attaching a volume, scaling a node group or adding a listener, opens in `FormPanel` (`src/components/form-panel.tsx`), never in a dialog.
|
||||
@@ -285,8 +333,16 @@ Every create flow opens in the side panel over its list, through `CreatePanel`,
|
||||
|
||||
- **URL.** `create=true` opens it, plus a list-local field where the flow needs context (`volume` for a snapshot, `instance` for an RDS snapshot, `launch=service|task` on ECS clusters). The old `create-*` addresses redirect to the list with the panel open, so links and bookmarks keep working.
|
||||
- **Form.** The fields come in the order AWS asks for them. Settings that are on or off are `Switch`es, and a multi-select picker (subnets, security groups) is a `SwitchList`, a boxed list with one switch per row. Checkboxes only select table rows.
|
||||
- **CLI.** Every create form ends with a `CliCommandPanel` showing the AWS CLI commands that send the same request, built from the form's live values and only the flags the console actually sends.
|
||||
- **Submit.** `FormActions` turns the submit button into a spinner with its pending label in place, and `FormLock`, a native `<fieldset disabled>`, disables every control above it until the request settles. Nothing above the form appears or moves, and the panel does not scroll.
|
||||
- **CLI.** Every create form ends with a `CliCommandPanel` showing the AWS CLI commands that send the same request, built from the form's live values and only the flags the console actually sends. The commands wrap to the panel's width and never scroll sideways; Copy takes the unwrapped text.
|
||||
- **Sections.** Related fields are grouped in `PanelSection` boxes, as the instance launch form groups Image, Instance, Network and Root volume.
|
||||
- **Nothing to pick, no field.** An optional picker with nothing usable to choose, such as Launch Template or Placement Group with none available, is left out of the form rather than shown holding only `none`.
|
||||
- **Advanced settings.** Settings most users leave at their defaults sit in a collapsed Advanced settings section, which opens by itself when a field inside it fails validation.
|
||||
- **Choices with a mark.** A few named products, such as database engines or distributions, are `ChoiceTile`s with the product's own mark from `src/assets/`, not a select. One that cannot be used stays visible and disabled, saying why.
|
||||
- **Durations and windows.** A duration is a select of presets with the AWS default first and named (`Auto (5 min)` for a record's TTL), keeping a custom value the API returned. A time window, such as an RDS backup or maintenance window, is a day, start time and length picker that refuses an overlap before submitting.
|
||||
- **Labels by type.** Where one field means different things by type, its label follows the type, as a record's value reads `IPv4 address` for A and `Mail server` for MX.
|
||||
- **Long pickers.** A `SwitchList` that can run long, such as security groups, scrolls inside its box rather than pushing the form down.
|
||||
- **Help.** A field's longer explanation goes in an (i) beside its label, through the `info` prop of `TextField` and `SelectField`, rather than in text under the field. Text under a field is for what the user must know before submitting.
|
||||
- **Submit.** `FormActions` cross-fades the submit label into a spinner with its pending label over 150ms, at one width, so the button never changes size, and `FormLock`, a native `<fieldset disabled>`, disables every control above it until the request settles. Nothing above the form appears or moves, and the panel does not scroll.
|
||||
- **Failure.** A refused request shows beside the button through `FormActions`'s `error`, and the form unlocks. The handler wraps only the mutation call in `try`, with an empty `catch` that returns, because react-hook-form rethrows whatever the handler throws and the error is already on screen from the mutation's state.
|
||||
- **Success.** `onClose(id)` closes the panel and selects the new resource, where the list has a panel to select it in.
|
||||
- **Appliance images.** A create that needs an ECS, EKS or RDS appliance image shows the missing-image callout inside its panel, never on the list, and only the step that needs the image is blocked.
|
||||
@@ -306,6 +362,7 @@ A gap of more than three sample periods breaks the line rather than drawing acro
|
||||
## Dates
|
||||
|
||||
`formatDateTime` writes the AWS console's form in the viewer's zone, `2026/06/04 02:00 GMT-5`, with a 24-hour clock and UTC as plain `GMT`.
|
||||
In a table the time is relative (`relativeTime` in `src/lib/relative-time.ts`), rounded down to the largest whole unit, and the full form shows on hover.
|
||||
|
||||
## Testing
|
||||
|
||||
|
||||
+4
-2
@@ -732,7 +732,8 @@ table inet spinifex_filter {
|
||||
# inventory and running instances to anyone who asks. 8660 is
|
||||
# predastore's unauthenticated /healthz and /readyz, which name the
|
||||
# peers a gate cannot reach, so it belongs here for the same reason.
|
||||
ip saddr $spinifex_peers tcp dport { 4222, 4248, 4432, 5300, 6641, 6642, 6643, 6644, 8660 } accept
|
||||
# 5001 is the admin network test, listening only while one runs.
|
||||
ip saddr $spinifex_peers tcp dport { 4222, 4248, 4432, 5001, 5300, 6641, 6642, 6643, 6644, 8660 } accept
|
||||
ip saddr $spinifex_peers udp dport { 5300, 6660, 7660 } accept
|
||||
|
||||
# Encap plane, peer-scoped: Geneve, IKE, NAT-T and ESP. Geneve is a
|
||||
@@ -1309,6 +1310,7 @@ qemu-utils gdisk ovmf qemu-efi-aarch64 less
|
||||
libvirt-daemon-system libvirt-clients
|
||||
pciutils
|
||||
jq curl iproute2 iputils-arping ethtool netcat-openbsd wget unzip xz-utils file
|
||||
dmidecode iperf
|
||||
ovn-central ovn-host openvswitch-switch openvswitch-ipsec strongswan-charon dhcpcd-base
|
||||
chrony nftables"
|
||||
|
||||
@@ -1318,7 +1320,7 @@ chrony nftables"
|
||||
OL_RUNTIME_PACKAGES="nbdkit nbdkit-basic-filters
|
||||
qemu-kvm qemu-img edk2-ovmf seabios-bin less
|
||||
pciutils
|
||||
jq curl iproute iputils ethtool nmap-ncat wget unzip xz file
|
||||
jq curl iproute iputils ethtool nmap-ncat wget unzip xz file dmidecode
|
||||
ovn25.03-central ovn25.03-host openvswitch3.5 openvswitch3.5-ipsec libreswan dhcpcd
|
||||
chrony nftables iptables-nft systemd-resolved"
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ func (s *VPCServiceImpl) CreateNetworkInterface(ctx context.Context, input *ec2.
|
||||
groupNames := make(map[string]string)
|
||||
s.fillSGNames(ctx, accountID, record.SecurityGroupIds, groupNames)
|
||||
return &ec2.CreateNetworkInterfaceOutput{
|
||||
NetworkInterface: s.eniRecordToEC2(&record, accountID, groupNames),
|
||||
NetworkInterface: s.eniRecordToEC2(&record, accountID, groupNames, s.vpcDNSHostnames(ctx, accountID, record.VpcId)),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ func (s *VPCServiceImpl) DescribeNetworkInterfaces(ctx context.Context, input *e
|
||||
}
|
||||
|
||||
s.fillSGNames(ctx, accountID, record.SecurityGroupIds, groupNames)
|
||||
enis = append(enis, s.eniRecordToEC2(&record, accountID, groupNames))
|
||||
enis = append(enis, s.eniRecordToEC2(&record, accountID, groupNames, s.vpcDNSHostnames(ctx, accountID, record.VpcId)))
|
||||
}
|
||||
|
||||
// If specific ENI IDs were requested but not found, return error
|
||||
@@ -1076,9 +1076,26 @@ func (s *VPCServiceImpl) fillSGNames(ctx context.Context, accountID string, ids
|
||||
}
|
||||
}
|
||||
|
||||
// vpcDNSHostnames reports whether the VPC has enableDnsHostnames on. An
|
||||
// unreadable VPC reads as off, so its interfaces go unnamed.
|
||||
func (s *VPCServiceImpl) vpcDNSHostnames(ctx context.Context, accountID, vpcID string) bool {
|
||||
entry, err := s.vpcKV.Get(ctx, kvutil.AccountKey(accountID, vpcID))
|
||||
if err != nil {
|
||||
slog.WarnContext(ctx, "vpcDNSHostnames: VPC read failed", "vpcId", vpcID, "err", err)
|
||||
return false
|
||||
}
|
||||
var rec VPCRecord
|
||||
if err := json.Unmarshal(entry.Value(), &rec); err != nil {
|
||||
slog.WarnContext(ctx, "vpcDNSHostnames: VPC unmarshal failed", "vpcId", vpcID, "err", err)
|
||||
return false
|
||||
}
|
||||
return rec.EnableDnsHostnames
|
||||
}
|
||||
|
||||
// eniRecordToEC2 converts an ENI record to an EC2 NetworkInterface, naming
|
||||
// each security group from groupNames.
|
||||
func (s *VPCServiceImpl) eniRecordToEC2(record *ENIRecord, accountID string, groupNames map[string]string) *ec2.NetworkInterface {
|
||||
// each security group from groupNames. AWS names the interface only while its
|
||||
// VPC has enableDnsHostnames on.
|
||||
func (s *VPCServiceImpl) eniRecordToEC2(record *ENIRecord, accountID string, groupNames map[string]string, dnsHostnames bool) *ec2.NetworkInterface {
|
||||
// ENIs with spinifex:managed-by tag are system-managed (e.g. by ELBv2)
|
||||
requesterManaged := record.Tags["spinifex:managed-by"] != ""
|
||||
|
||||
@@ -1116,7 +1133,7 @@ func (s *VPCServiceImpl) eniRecordToEC2(record *ENIRecord, accountID string, gro
|
||||
eni.Groups = groups
|
||||
}
|
||||
|
||||
if s.privateDNSName != nil && record.PrivateIpAddress != "" {
|
||||
if dnsHostnames && s.privateDNSName != nil && record.PrivateIpAddress != "" {
|
||||
if name := s.privateDNSName(record.PrivateIpAddress); name != "" {
|
||||
eni.PrivateDnsName = aws.String(name)
|
||||
eni.PrivateIpAddresses[0].PrivateDnsName = aws.String(name)
|
||||
|
||||
@@ -55,15 +55,11 @@ func TestNetworkInterface_NamesGroupsAndPrivateAddress(t *testing.T) {
|
||||
vpcId := createTestVPC(t, svc, "10.0.0.0/16")
|
||||
subnetId := createTestSubnet(t, svc, vpcId, "10.0.1.0/24")
|
||||
sgId := createTestSG(t, svc, vpcId, "web")
|
||||
setHostnames(t, svc, vpcId, true)
|
||||
|
||||
// Without a namer an interface carries no private name.
|
||||
unnamed := createTestENI(t, svc, subnetId)
|
||||
desc, err := svc.DescribeNetworkInterfaces(context.Background(), &ec2.DescribeNetworkInterfacesInput{
|
||||
NetworkInterfaceIds: []*string{aws.String(unnamed)},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, desc.NetworkInterfaces, 1)
|
||||
assert.Nil(t, desc.NetworkInterfaces[0].PrivateDnsName)
|
||||
assert.Nil(t, describeTestENI(t, svc, unnamed).PrivateDnsName)
|
||||
|
||||
svc.SetPrivateDNSNamer(func(ip string) string { return "name-of-" + ip })
|
||||
out, err := svc.CreateNetworkInterface(context.Background(), &ec2.CreateNetworkInterfaceInput{
|
||||
@@ -72,13 +68,8 @@ func TestNetworkInterface_NamesGroupsAndPrivateAddress(t *testing.T) {
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
|
||||
desc, err = svc.DescribeNetworkInterfaces(context.Background(), &ec2.DescribeNetworkInterfacesInput{
|
||||
NetworkInterfaceIds: []*string{out.NetworkInterface.NetworkInterfaceId},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, desc.NetworkInterfaces, 1)
|
||||
|
||||
for name, eni := range map[string]*ec2.NetworkInterface{"create": out.NetworkInterface, "describe": desc.NetworkInterfaces[0]} {
|
||||
desc := describeTestENI(t, svc, *out.NetworkInterface.NetworkInterfaceId)
|
||||
for name, eni := range map[string]*ec2.NetworkInterface{"create": out.NetworkInterface, "describe": desc} {
|
||||
want := "name-of-" + aws.StringValue(eni.PrivateIpAddress)
|
||||
assert.Equal(t, want, aws.StringValue(eni.PrivateDnsName), name)
|
||||
require.Len(t, eni.PrivateIpAddresses, 1, name)
|
||||
@@ -89,6 +80,58 @@ func TestNetworkInterface_NamesGroupsAndPrivateAddress(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNetworkInterface_PrivateDnsNameFollowsVpcDnsHostnames(t *testing.T) {
|
||||
t.Parallel()
|
||||
svc := setupTestVPCService(t)
|
||||
svc.SetPrivateDNSNamer(func(ip string) string { return "name-of-" + ip })
|
||||
vpcId := createTestVPC(t, svc, "10.0.0.0/16")
|
||||
subnetId := createTestSubnet(t, svc, vpcId, "10.0.1.0/24")
|
||||
|
||||
// A new VPC has enableDnsHostnames off, so its interfaces go unnamed.
|
||||
out, err := svc.CreateNetworkInterface(context.Background(), &ec2.CreateNetworkInterfaceInput{
|
||||
SubnetId: aws.String(subnetId),
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
eniId := *out.NetworkInterface.NetworkInterfaceId
|
||||
for name, eni := range map[string]*ec2.NetworkInterface{"create": out.NetworkInterface, "describe": describeTestENI(t, svc, eniId)} {
|
||||
assert.Nil(t, eni.PrivateDnsName, name)
|
||||
require.Len(t, eni.PrivateIpAddresses, 1, name)
|
||||
assert.Nil(t, eni.PrivateIpAddresses[0].PrivateDnsName, name)
|
||||
}
|
||||
|
||||
// Turning the flag on names the existing interface.
|
||||
setHostnames(t, svc, vpcId, true)
|
||||
eni := describeTestENI(t, svc, eniId)
|
||||
want := "name-of-" + aws.StringValue(eni.PrivateIpAddress)
|
||||
assert.Equal(t, want, aws.StringValue(eni.PrivateDnsName))
|
||||
assert.Equal(t, want, aws.StringValue(eni.PrivateIpAddresses[0].PrivateDnsName))
|
||||
|
||||
// And turning it off again drops the name.
|
||||
setHostnames(t, svc, vpcId, false)
|
||||
eni = describeTestENI(t, svc, eniId)
|
||||
assert.Nil(t, eni.PrivateDnsName)
|
||||
assert.Nil(t, eni.PrivateIpAddresses[0].PrivateDnsName)
|
||||
}
|
||||
|
||||
func setHostnames(t *testing.T, svc *VPCServiceImpl, vpcId string, on bool) {
|
||||
t.Helper()
|
||||
_, err := svc.ModifyVpcAttribute(context.Background(), &ec2.ModifyVpcAttributeInput{
|
||||
VpcId: aws.String(vpcId),
|
||||
EnableDnsHostnames: &ec2.AttributeBooleanValue{Value: aws.Bool(on)},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func describeTestENI(t *testing.T, svc *VPCServiceImpl, eniId string) *ec2.NetworkInterface {
|
||||
t.Helper()
|
||||
desc, err := svc.DescribeNetworkInterfaces(context.Background(), &ec2.DescribeNetworkInterfacesInput{
|
||||
NetworkInterfaceIds: []*string{aws.String(eniId)},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, desc.NetworkInterfaces, 1)
|
||||
return desc.NetworkInterfaces[0]
|
||||
}
|
||||
|
||||
func TestCreateNetworkInterface_SequentialIPs(t *testing.T) {
|
||||
t.Parallel()
|
||||
svc := setupTestVPCService(t)
|
||||
|
||||
@@ -288,7 +288,7 @@ func (s *Service) DescribeClusters(ctx context.Context, input *ecs.DescribeClust
|
||||
names = []string{defaultCluster}
|
||||
}
|
||||
includeSettings := slices.Contains(awsStringSlice(input.Include), ecs.ClusterFieldSettings)
|
||||
out := &ecs.DescribeClustersOutput{}
|
||||
out := &ecs.DescribeClustersOutput{Clusters: []*ecs.Cluster{}, Failures: []*ecs.Failure{}}
|
||||
for _, name := range names {
|
||||
name = ClusterShortName(name)
|
||||
var rec ClusterRecord
|
||||
@@ -458,7 +458,7 @@ func (s *Service) RegisterTaskDefinition(ctx context.Context, input *ecs.Registe
|
||||
if family == "" {
|
||||
return nil, errors.New(awserrors.ErrorECSInvalidParameter)
|
||||
}
|
||||
if err := validateContainerDefs(input.ContainerDefinitions); err != nil {
|
||||
if err := validateContainerDefs(input.ContainerDefinitions, aws.StringValue(input.Memory)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
warnUnsupportedLogDrivers(ctx, family, input.ContainerDefinitions)
|
||||
@@ -497,12 +497,23 @@ func (s *Service) RegisterTaskDefinition(ctx context.Context, input *ecs.Registe
|
||||
// The test here is per value, not per field: an empty list or a false/unset
|
||||
// flag requests nothing and is accepted, because there is nothing to enforce
|
||||
// or refuse. Only a value that asks for the restriction is rejected.
|
||||
func validateContainerDefs(defs []*ecs.ContainerDefinition) error {
|
||||
//
|
||||
// Ahead of those, AWS's own rules: every container needs an image, and without
|
||||
// a task-level memory every container needs memory or memoryReservation.
|
||||
func validateContainerDefs(defs []*ecs.ContainerDefinition, taskMemory string) error {
|
||||
for _, c := range defs {
|
||||
if c == nil {
|
||||
continue
|
||||
}
|
||||
name := aws.StringValue(c.Name)
|
||||
if aws.StringValue(c.Image) == "" {
|
||||
return awserrors.Errorf(awserrors.ErrorECSClientException,
|
||||
"Container.image should not be null or empty.")
|
||||
}
|
||||
if taskMemory == "" && c.Memory == nil && c.MemoryReservation == nil {
|
||||
return awserrors.Errorf(awserrors.ErrorECSClientException,
|
||||
"Invalid setting for container '%s'. At least one of 'memory' or 'memoryReservation' must be specified.", name)
|
||||
}
|
||||
if len(c.Secrets) > 0 {
|
||||
return errors.New(awserrors.ErrorECSInvalidParameter)
|
||||
}
|
||||
|
||||
@@ -812,6 +812,12 @@ func TestService_ListTasks_EmptyIsPresentNotAbsent(t *testing.T) {
|
||||
assert.Empty(t, out.TaskArns)
|
||||
}
|
||||
|
||||
func TestService_ListTasks_ClusterNotFound(t *testing.T) {
|
||||
svc, _ := newTestService(t)
|
||||
_, err := svc.ListTasks(context.Background(), &ecs.ListTasksInput{Cluster: aws.String("ghost")}, testAccountID)
|
||||
require.EqualError(t, err, awserrors.ErrorECSClusterNotFound)
|
||||
}
|
||||
|
||||
func TestService_ListContainerInstances_EmptyIsPresentNotAbsent(t *testing.T) {
|
||||
svc, _ := newTestService(t)
|
||||
_, err := svc.CreateCluster(context.Background(), &ecs.CreateClusterInput{ClusterName: aws.String("web")}, testAccountID)
|
||||
@@ -829,3 +835,21 @@ func TestAccountIDFromBucket(t *testing.T) {
|
||||
_, ok = accountIDFromBucket("some-other-bucket")
|
||||
assert.False(t, ok)
|
||||
}
|
||||
|
||||
func TestService_DescribeClusters_ListsAlwaysPresent(t *testing.T) {
|
||||
svc, _ := newTestService(t)
|
||||
_, err := svc.CreateCluster(context.Background(), &ecs.CreateClusterInput{ClusterName: aws.String("web")}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
|
||||
found, err := svc.DescribeClusters(context.Background(), &ecs.DescribeClustersInput{Clusters: []*string{aws.String("web")}}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, found.Clusters, 1)
|
||||
assert.NotNil(t, found.Failures)
|
||||
assert.Empty(t, found.Failures)
|
||||
|
||||
miss, err := svc.DescribeClusters(context.Background(), &ecs.DescribeClustersInput{Clusters: []*string{aws.String("nope")}}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, miss.Failures, 1)
|
||||
assert.NotNil(t, miss.Clusters)
|
||||
assert.Empty(t, miss.Clusters)
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ func TestService_CreateService_ProjectsNetworkConfigurationAndManagedTags(t *tes
|
||||
Family: aws.String("app"),
|
||||
NetworkMode: aws.String(NetworkModeAwsvpc),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
}},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
@@ -352,7 +352,7 @@ func TestService_UpdateService_ChangesNetworkConfiguration(t *testing.T) {
|
||||
Family: aws.String("app"),
|
||||
NetworkMode: aws.String(NetworkModeAwsvpc),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
}},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -16,6 +16,8 @@ import (
|
||||
// agent to reach anything other than PENDING.
|
||||
func seedTasks(t *testing.T, svc *ecsdomain.Service, cluster string, recs ...*ecsdomain.TaskRecord) {
|
||||
t.Helper()
|
||||
_, err := svc.CreateCluster(t.Context(), &ecs.CreateClusterInput{ClusterName: aws.String(cluster)}, ecsdomain.TestAccountID)
|
||||
require.NoError(t, err)
|
||||
kv, err := svc.Bucket(t.Context(), ecsdomain.TestAccountID)
|
||||
require.NoError(t, err)
|
||||
for _, r := range recs {
|
||||
|
||||
@@ -19,7 +19,7 @@ func TestRegisterTaskDefinition_RejectsSecrets(t *testing.T) {
|
||||
_, err := svc.RegisterTaskDefinition(context.Background(), &ecs.RegisterTaskDefinitionInput{
|
||||
Family: aws.String("app"),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
Secrets: []*ecs.Secret{{
|
||||
Name: aws.String("DB_PASSWORD"), ValueFrom: aws.String("arn:aws:ssm:::parameter/db"),
|
||||
}},
|
||||
@@ -37,7 +37,7 @@ func TestRegisterTaskDefinition_AcceptsUnsupportedLogDriver(t *testing.T) {
|
||||
_, err := svc.RegisterTaskDefinition(context.Background(), &ecs.RegisterTaskDefinitionInput{
|
||||
Family: aws.String("app"),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
LogConfiguration: &ecs.LogConfiguration{
|
||||
LogDriver: aws.String("awslogs"),
|
||||
Options: map[string]*string{"awslogs-group": aws.String("/ecs/app")},
|
||||
@@ -67,7 +67,7 @@ func TestRegisterTaskDefinition_EchoesRequiresCompatibilities(t *testing.T) {
|
||||
Family: aws.String("app"),
|
||||
RequiresCompatibilities: aws.StringSlice([]string{"EC2"}),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
}},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
@@ -91,7 +91,7 @@ func TestRegisterTaskDefinition_EchoesRuntimePlatform(t *testing.T) {
|
||||
OperatingSystemFamily: aws.String("LINUX"),
|
||||
},
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
}},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
@@ -113,7 +113,7 @@ func TestRegisterTaskDefinition_RuntimePlatformOmittedWhenUnset(t *testing.T) {
|
||||
_, err := svc.RegisterTaskDefinition(context.Background(), &ecs.RegisterTaskDefinitionInput{
|
||||
Family: aws.String("app"),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
}},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
@@ -253,7 +253,7 @@ func TestRegisterTaskDefinition_EchoesRuntimeFields(t *testing.T) {
|
||||
_, err := svc.RegisterTaskDefinition(context.Background(), &ecs.RegisterTaskDefinitionInput{
|
||||
Family: aws.String("app"),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
User: aws.String("1000:1000"),
|
||||
ReadonlyRootFilesystem: aws.Bool(true),
|
||||
Privileged: aws.Bool(false),
|
||||
@@ -310,7 +310,7 @@ func TestRegisterTaskDefinition_RuntimeFieldsOmittedWhenUnset(t *testing.T) {
|
||||
_, err := svc.RegisterTaskDefinition(context.Background(), &ecs.RegisterTaskDefinitionInput{
|
||||
Family: aws.String("app"),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
}},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
@@ -347,7 +347,7 @@ func TestRegisterTaskDefinition_EchoesEmptyCollections(t *testing.T) {
|
||||
_, err := svc.RegisterTaskDefinition(context.Background(), &ecs.RegisterTaskDefinitionInput{
|
||||
Family: aws.String("app"),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
Environment: []*ecs.KeyValuePair{},
|
||||
MountPoints: []*ecs.MountPoint{},
|
||||
VolumesFrom: []*ecs.VolumeFrom{},
|
||||
@@ -386,7 +386,7 @@ func TestRegisterTaskDefinition_FillsAWSDefaults(t *testing.T) {
|
||||
Family: aws.String("app"),
|
||||
NetworkMode: aws.String("awsvpc"),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
PortMappings: []*ecs.PortMapping{{ContainerPort: aws.Int64(80)}},
|
||||
}},
|
||||
}, testAccountID)
|
||||
@@ -420,7 +420,7 @@ func TestRegisterTaskDefinition_BridgeLeavesHostPortUnset(t *testing.T) {
|
||||
Family: aws.String("app"),
|
||||
NetworkMode: aws.String("bridge"),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
PortMappings: []*ecs.PortMapping{{ContainerPort: aws.Int64(53), Protocol: aws.String("udp")}},
|
||||
}},
|
||||
}, testAccountID)
|
||||
@@ -435,7 +435,7 @@ func TestRegisterTaskDefinition_AcceptsEmptyRuntimeFields(t *testing.T) {
|
||||
_, err := svc.RegisterTaskDefinition(context.Background(), &ecs.RegisterTaskDefinitionInput{
|
||||
Family: aws.String("app"),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
MountPoints: []*ecs.MountPoint{},
|
||||
VolumesFrom: []*ecs.VolumeFrom{},
|
||||
SystemControls: []*ecs.SystemControl{},
|
||||
@@ -455,7 +455,7 @@ func TestRegisterTaskDefinition_RejectsMountPoints(t *testing.T) {
|
||||
_, err := svc.RegisterTaskDefinition(context.Background(), &ecs.RegisterTaskDefinitionInput{
|
||||
Family: aws.String("app"),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
MountPoints: []*ecs.MountPoint{{
|
||||
SourceVolume: aws.String("data"), ContainerPath: aws.String("/data"),
|
||||
}},
|
||||
@@ -476,7 +476,7 @@ func TestRegisterTaskDefinition_RejectsVolumesFrom(t *testing.T) {
|
||||
_, err := svc.RegisterTaskDefinition(context.Background(), &ecs.RegisterTaskDefinitionInput{
|
||||
Family: aws.String("app"),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
VolumesFrom: []*ecs.VolumeFrom{{SourceContainer: aws.String("other")}},
|
||||
}},
|
||||
}, testAccountID)
|
||||
@@ -494,7 +494,7 @@ func TestRegisterTaskDefinition_RejectsLinuxParametersDevices(t *testing.T) {
|
||||
_, err := svc.RegisterTaskDefinition(context.Background(), &ecs.RegisterTaskDefinitionInput{
|
||||
Family: aws.String("app"),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
LinuxParameters: &ecs.LinuxParameters{
|
||||
Devices: []*ecs.Device{{HostPath: aws.String("/dev/fuse")}},
|
||||
},
|
||||
@@ -514,7 +514,7 @@ func TestRegisterTaskDefinition_RejectsInitProcessEnabled(t *testing.T) {
|
||||
_, err := svc.RegisterTaskDefinition(context.Background(), &ecs.RegisterTaskDefinitionInput{
|
||||
Family: aws.String("app"),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
LinuxParameters: &ecs.LinuxParameters{InitProcessEnabled: aws.Bool(true)},
|
||||
}},
|
||||
}, testAccountID)
|
||||
@@ -533,7 +533,7 @@ func TestRegisterTaskDefinition_RejectsSharedMemoryAndTmpfs(t *testing.T) {
|
||||
_, err := svc.RegisterTaskDefinition(context.Background(), &ecs.RegisterTaskDefinitionInput{
|
||||
Family: aws.String("shm"),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
LinuxParameters: &ecs.LinuxParameters{SharedMemorySize: aws.Int64(64)},
|
||||
}},
|
||||
}, testAccountID)
|
||||
@@ -545,7 +545,7 @@ func TestRegisterTaskDefinition_RejectsSharedMemoryAndTmpfs(t *testing.T) {
|
||||
_, err = svc.RegisterTaskDefinition(context.Background(), &ecs.RegisterTaskDefinitionInput{
|
||||
Family: aws.String("tmpfs"),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
LinuxParameters: &ecs.LinuxParameters{
|
||||
Tmpfs: []*ecs.Tmpfs{{ContainerPath: aws.String("/tmp"), Size: aws.Int64(64)}},
|
||||
},
|
||||
@@ -567,7 +567,7 @@ func TestRunTask_AssignCarriesRuntimeFields(t *testing.T) {
|
||||
_, err = svc.RegisterTaskDefinition(context.Background(), &ecs.RegisterTaskDefinitionInput{
|
||||
Family: aws.String("app"),
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{{
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true),
|
||||
Name: aws.String("app"), Image: aws.String("registry/app:1"), Essential: aws.Bool(true), Memory: aws.Int64(256),
|
||||
User: aws.String("1000"),
|
||||
ReadonlyRootFilesystem: aws.Bool(true),
|
||||
Privileged: aws.Bool(true),
|
||||
@@ -608,3 +608,42 @@ func TestRunTask_AssignCarriesRuntimeFields(t *testing.T) {
|
||||
assert.Equal(t, "net.core.somaxconn", ac.SystemControls[0].Namespace)
|
||||
assert.Equal(t, []string{"SYS_PTRACE"}, ac.CapAdd)
|
||||
}
|
||||
|
||||
// AWS rejects a container with no image before checking its memory, and
|
||||
// without task-level memory requires memory or memoryReservation per container.
|
||||
func TestRegisterTaskDefinition_RequiresImageAndMemory(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
taskMemory *string
|
||||
container *ecs.ContainerDefinition
|
||||
wantErr string
|
||||
}{
|
||||
{"no image or memory", nil, &ecs.ContainerDefinition{Name: aws.String("web")},
|
||||
"Container.image should not be null or empty."},
|
||||
{"empty image", aws.String("512"), &ecs.ContainerDefinition{Name: aws.String("web"), Image: aws.String("")},
|
||||
"Container.image should not be null or empty."},
|
||||
{"no memory", nil, &ecs.ContainerDefinition{Name: aws.String("web"), Image: aws.String("registry/web:1")},
|
||||
"Invalid setting for container 'web'. At least one of 'memory' or 'memoryReservation' must be specified."},
|
||||
{"memoryReservation only", nil, &ecs.ContainerDefinition{
|
||||
Name: aws.String("web"), Image: aws.String("registry/web:1"), MemoryReservation: aws.Int64(128)}, ""},
|
||||
{"task-level memory", aws.String("512"), &ecs.ContainerDefinition{
|
||||
Name: aws.String("web"), Image: aws.String("registry/web:1")}, ""},
|
||||
}
|
||||
for _, tc := range tests {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
svc, _ := newTestService(t)
|
||||
_, err := svc.RegisterTaskDefinition(context.Background(), &ecs.RegisterTaskDefinitionInput{
|
||||
Family: aws.String("app"), Memory: tc.taskMemory,
|
||||
ContainerDefinitions: []*ecs.ContainerDefinition{tc.container},
|
||||
}, testAccountID)
|
||||
if tc.wantErr == "" {
|
||||
require.NoError(t, err)
|
||||
return
|
||||
}
|
||||
code, msg, ok := awserrors.ResolveErrorDetail(err)
|
||||
require.True(t, ok)
|
||||
assert.Equal(t, awserrors.ErrorECSClientException, code)
|
||||
assert.Equal(t, tc.wantErr, msg)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,6 +303,14 @@ func (s *Service) ListTasks(ctx context.Context, input *ecs.ListTasksInput, acco
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var clusterRec ClusterRecord
|
||||
found, err := getJSON(ctx, kv, ClusterMetaKey(cluster), &clusterRec)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !found {
|
||||
return nil, errors.New(awserrors.ErrorECSClusterNotFound)
|
||||
}
|
||||
keys, err := keysWithPrefix(ctx, kv, TasksPrefix(cluster))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -3503,14 +3503,18 @@ func (s *ELBv2ServiceImpl) tgRecordToSDK(r *TargetGroupRecord, lbArns []string)
|
||||
HealthCheckEnabled: aws.Bool(r.HealthCheck.Enabled),
|
||||
HealthCheckProtocol: aws.String(r.HealthCheck.Protocol),
|
||||
HealthCheckPort: aws.String(r.HealthCheck.Port),
|
||||
HealthCheckPath: aws.String(r.HealthCheck.Path),
|
||||
HealthCheckIntervalSeconds: aws.Int64(r.HealthCheck.IntervalSeconds),
|
||||
HealthCheckTimeoutSeconds: aws.Int64(r.HealthCheck.TimeoutSeconds),
|
||||
HealthyThresholdCount: aws.Int64(r.HealthCheck.HealthyThreshold),
|
||||
UnhealthyThresholdCount: aws.Int64(r.HealthCheck.UnhealthyThreshold),
|
||||
Matcher: &elbv2.Matcher{
|
||||
HttpCode: aws.String(r.HealthCheck.Matcher),
|
||||
},
|
||||
}
|
||||
|
||||
// AWS omits both keys on TCP target groups, which have no path or matcher.
|
||||
if r.HealthCheck.Path != "" {
|
||||
tg.HealthCheckPath = aws.String(r.HealthCheck.Path)
|
||||
}
|
||||
if r.HealthCheck.Matcher != "" {
|
||||
tg.Matcher = &elbv2.Matcher{HttpCode: aws.String(r.HealthCheck.Matcher)}
|
||||
}
|
||||
|
||||
// Omitted for NLB (TCP/UDP/TLS) target groups, matching AWS, which returns
|
||||
|
||||
@@ -459,11 +459,12 @@ func TestCreateTargetGroup_TCPProtocol(t *testing.T) {
|
||||
assert.Equal(t, int64(5432), *tg.Port)
|
||||
// NLB health check defaults: TCP protocol, no path, no matcher.
|
||||
assert.Equal(t, "TCP", *tg.HealthCheckProtocol)
|
||||
assert.Empty(t, *tg.HealthCheckPath)
|
||||
assert.Empty(t, *tg.Matcher.HttpCode)
|
||||
assert.Nil(t, tg.HealthCheckPath)
|
||||
assert.Nil(t, tg.Matcher)
|
||||
assert.Equal(t, int64(30), *tg.HealthCheckIntervalSeconds)
|
||||
assert.Equal(t, int64(10), *tg.HealthCheckTimeoutSeconds)
|
||||
assert.Equal(t, int64(3), *tg.HealthyThresholdCount)
|
||||
assert.Equal(t, int64(3), *tg.UnhealthyThresholdCount)
|
||||
assert.Equal(t, int64(5), *tg.HealthyThresholdCount)
|
||||
assert.Equal(t, int64(2), *tg.UnhealthyThresholdCount)
|
||||
}
|
||||
|
||||
func TestCreateTargetGroup_NLBProtocols(t *testing.T) {
|
||||
|
||||
@@ -99,8 +99,8 @@ const (
|
||||
// Default health check values (NLB).
|
||||
DefaultNLBHealthCheckInterval = 30
|
||||
DefaultNLBHealthCheckTimeout = 10
|
||||
DefaultNLBHealthyThreshold = 3
|
||||
DefaultNLBUnhealthyThreshold = 3
|
||||
DefaultNLBHealthyThreshold = 5
|
||||
DefaultNLBUnhealthyThreshold = 2
|
||||
DefaultNLBHealthCheckProtocol = ProtocolTCP
|
||||
DefaultNLBHealthCheckPort = "traffic-port"
|
||||
|
||||
|
||||
@@ -1268,7 +1268,7 @@ var ErrorLookup = map[string]ErrorMessage{
|
||||
ErrorEKSResourceInUse: {HTTPCode: 409, Message: "A cluster with this name already exists in this account and Region. Delete the existing cluster, or choose a different name."},
|
||||
ErrorEKSResourceNotFound: {HTTPCode: 404, Message: "The specified cluster could not be found. You can view your available clusters with ListClusters. Amazon EKS clusters are Region specific."},
|
||||
ErrorECSClientException: {HTTPCode: 400, Message: "Unable to describe task definition."},
|
||||
ErrorECSClusterNotFound: {HTTPCode: 400, Message: "The specified cluster was not found. You can view your available clusters with ListClusters. Amazon ECS clusters are Region specific."},
|
||||
ErrorECSClusterNotFound: {HTTPCode: 400, Message: "Cluster not found."},
|
||||
ErrorECSInvalidParameter: {HTTPCode: 400, Message: "The specified parameter is not valid. Review the available parameters for the API request."},
|
||||
ErrorECSServiceNotFound: {HTTPCode: 400, Message: "The specified service was not found. You can view your available services with ListServices. Amazon ECS services are cluster specific and Region specific."},
|
||||
ErrorRetryableError: {HTTPCode: 400, Message: "A request submitted by an AWS service on your behalf could not be completed. The requesting service might automatically retry the request."},
|
||||
|
||||
@@ -106,10 +106,33 @@ func flushSupported(w http.ResponseWriter) bool {
|
||||
}
|
||||
|
||||
func streamInstanceMetrics(w http.ResponseWriter, r *http.Request, nc *nats.Conn, accountID, instanceID string, since int64) error {
|
||||
return streamLive(w, r, nc, liveSubjects{
|
||||
action: GetInstanceMetricsAction,
|
||||
sample: telemetryv1.LiveSampleSubject(accountID, instanceID),
|
||||
watch: telemetryv1.LiveWatchSubject(accountID, instanceID),
|
||||
absent: awserrors.ErrorInvalidInstanceIDNotFound,
|
||||
}, since, func(data []byte) ([]telemetryv1.LiveSample, error) {
|
||||
var ring telemetryv1.LiveRing
|
||||
err := json.Unmarshal(data, &ring)
|
||||
return ring.Samples, err
|
||||
}, func(s telemetryv1.LiveSample) int64 { return s.TimeMillis })
|
||||
}
|
||||
|
||||
// liveSubjects names one live source: where its samples are published, where
|
||||
// to ask for its ring, and the error for a source nobody answers for.
|
||||
type liveSubjects struct {
|
||||
action string
|
||||
sample string
|
||||
watch string
|
||||
absent string
|
||||
}
|
||||
|
||||
func streamLive[S any](w http.ResponseWriter, r *http.Request, nc *nats.Conn, src liveSubjects, since int64,
|
||||
decodeRing func([]byte) ([]S, error), stamp func(S) int64) error {
|
||||
samples := make(chan *nats.Msg, 64)
|
||||
sub, err := nc.ChanSubscribe(telemetryv1.LiveSampleSubject(accountID, instanceID), samples)
|
||||
sub, err := nc.ChanSubscribe(src.sample, samples)
|
||||
if err != nil {
|
||||
slog.ErrorContext(r.Context(), "GetInstanceMetrics: subscribe", "err", err)
|
||||
slog.ErrorContext(r.Context(), src.action+": subscribe", "err", err)
|
||||
return errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
defer func() { _ = sub.Unsubscribe() }()
|
||||
@@ -118,22 +141,21 @@ func streamInstanceMetrics(w http.ResponseWriter, r *http.Request, nc *nats.Conn
|
||||
if err != nil {
|
||||
return errors.New(awserrors.ErrorInternalError)
|
||||
}
|
||||
watchSubject := telemetryv1.LiveWatchSubject(accountID, instanceID)
|
||||
|
||||
// Subscribed first, then asked for the ring, so nothing falls between them.
|
||||
// No responder is an instance that is not running in this account, which
|
||||
// No responder is a source that is not running in this account, which
|
||||
// reads the same as one that does not exist.
|
||||
reply, err := nc.Request(watchSubject, watch, liveWatchTimeout)
|
||||
reply, err := nc.Request(src.watch, watch, liveWatchTimeout)
|
||||
if err != nil {
|
||||
if errors.Is(err, nats.ErrNoResponders) || errors.Is(err, nats.ErrTimeout) {
|
||||
return errors.New(awserrors.ErrorInvalidInstanceIDNotFound)
|
||||
return errors.New(src.absent)
|
||||
}
|
||||
slog.ErrorContext(r.Context(), "GetInstanceMetrics: watch request", "err", err)
|
||||
slog.ErrorContext(r.Context(), src.action+": watch request", "err", err)
|
||||
return errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
var ring telemetryv1.LiveRing
|
||||
if err := json.Unmarshal(reply.Data, &ring); err != nil {
|
||||
slog.ErrorContext(r.Context(), "GetInstanceMetrics: malformed ring", "err", err)
|
||||
ring, err := decodeRing(reply.Data)
|
||||
if err != nil {
|
||||
slog.ErrorContext(r.Context(), src.action+": malformed ring", "err", err)
|
||||
return errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
|
||||
@@ -146,22 +168,23 @@ func streamInstanceMetrics(w http.ResponseWriter, r *http.Request, nc *nats.Conn
|
||||
// From here the status is committed, so failures end the stream quietly and
|
||||
// the client reconnects.
|
||||
last := since
|
||||
send := func(s telemetryv1.LiveSample) bool {
|
||||
if s.TimeMillis <= last {
|
||||
send := func(s S) bool {
|
||||
t := stamp(s)
|
||||
if t <= last {
|
||||
return true
|
||||
}
|
||||
data, err := json.Marshal(s)
|
||||
if err != nil {
|
||||
return true
|
||||
}
|
||||
last = s.TimeMillis
|
||||
if _, err := fmt.Fprintf(w, "id: %d\nevent: sample\ndata: %s\n\n", s.TimeMillis, data); err != nil {
|
||||
last = t
|
||||
if _, err := fmt.Fprintf(w, "id: %d\nevent: sample\ndata: %s\n\n", t, data); err != nil {
|
||||
return false
|
||||
}
|
||||
return ctrl.Flush() == nil
|
||||
}
|
||||
|
||||
for _, s := range ring.Samples {
|
||||
for _, s := range ring {
|
||||
if !send(s) {
|
||||
return nil
|
||||
}
|
||||
@@ -184,17 +207,17 @@ func streamInstanceMetrics(w http.ResponseWriter, r *http.Request, nc *nats.Conn
|
||||
case <-end.C:
|
||||
return nil
|
||||
case <-renew.C:
|
||||
if err := nc.Publish(watchSubject, watch); err != nil {
|
||||
slog.DebugContext(r.Context(), "GetInstanceMetrics: renew watch", "err", err)
|
||||
if err := nc.Publish(src.watch, watch); err != nil {
|
||||
slog.DebugContext(r.Context(), src.action+": renew watch", "err", err)
|
||||
}
|
||||
case <-keepAlive.C:
|
||||
if _, err := fmt.Fprint(w, ": keep-alive\n\n"); err != nil || ctrl.Flush() != nil {
|
||||
return nil
|
||||
}
|
||||
case msg := <-samples:
|
||||
var s telemetryv1.LiveSample
|
||||
var s S
|
||||
if err := json.Unmarshal(msg.Data, &s); err != nil {
|
||||
slog.DebugContext(r.Context(), "GetInstanceMetrics: malformed sample", "err", err)
|
||||
slog.DebugContext(r.Context(), src.action+": malformed sample", "err", err)
|
||||
continue
|
||||
}
|
||||
if !send(s) {
|
||||
|
||||
@@ -0,0 +1,432 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"slices"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
clusterv1 "github.com/mulgadc/spinifex/contracts/cluster/v1"
|
||||
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
|
||||
natsmsg "github.com/mulgadc/spinifex/spinifex/foundation/messaging/nats"
|
||||
"github.com/mulgadc/spinifex/spinifex/foundation/state/kvstore"
|
||||
"github.com/nats-io/nats.go"
|
||||
"github.com/nats-io/nats.go/jetstream"
|
||||
)
|
||||
|
||||
// GetNodeFactsOutput is the response for GetNodeFacts.
|
||||
type GetNodeFactsOutput struct {
|
||||
Nodes []clusterv1.NodeFacts `json:"nodes"`
|
||||
}
|
||||
|
||||
// nodeFactsTimeout allows for a node rebuilding its facts, which reads every NIC.
|
||||
const nodeFactsTimeout = 7 * time.Second
|
||||
|
||||
// GetNodeFacts gathers every node's hardware and network facts.
|
||||
func GetNodeFacts(ctx context.Context, nc *nats.Conn, expectedNodes int) (*GetNodeFactsOutput, error) {
|
||||
frames, _, err := natsmsg.Gather(ctx, nc, clusterv1.NodeFactsSubject, []byte("{}"),
|
||||
natsmsg.GatherOpts{Timeout: nodeFactsTimeout, ExpectedNodes: expectedNodes})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out := &GetNodeFactsOutput{Nodes: make([]clusterv1.NodeFacts, 0, len(frames))}
|
||||
for _, frame := range frames {
|
||||
var f clusterv1.NodeFacts
|
||||
if json.Unmarshal(frame.Data, &f) == nil && f.Node != "" {
|
||||
out.Nodes = append(out.Nodes, f)
|
||||
}
|
||||
}
|
||||
slices.SortFunc(out.Nodes, func(a, b clusterv1.NodeFacts) int {
|
||||
switch {
|
||||
case a.Node < b.Node:
|
||||
return -1
|
||||
case a.Node > b.Node:
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
})
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Network test states.
|
||||
const (
|
||||
NetworkTestRunning = "running"
|
||||
NetworkTestComplete = "complete"
|
||||
NetworkTestFailed = "failed"
|
||||
NetworkTestPending = "pending"
|
||||
)
|
||||
|
||||
// Bounds on one network test, so an admin cannot tie the cluster's links up.
|
||||
const (
|
||||
defaultNetworkTestSeconds = 10
|
||||
defaultNetworkTestStreams = 4
|
||||
maxNetworkTestRuns = 24
|
||||
maxNetworkTestListed = 20
|
||||
networkTestRunSlack = 20 * time.Second
|
||||
networkTestServeTimeout = 5 * time.Second
|
||||
)
|
||||
|
||||
// NetworkTest is one admin-requested test: every ordered pair of nodes on a
|
||||
// plane, run one after another so no two share a link.
|
||||
type NetworkTest struct {
|
||||
TestID string `json:"testId"`
|
||||
Plane string `json:"plane"`
|
||||
Status string `json:"status"`
|
||||
DurationSeconds int `json:"durationSeconds"`
|
||||
Streams int `json:"streams"`
|
||||
StartedAt time.Time `json:"startedAt"`
|
||||
CompletedAt *time.Time `json:"completedAt,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
Runs []NetworkTestResult `json:"runs"`
|
||||
}
|
||||
|
||||
// NetworkTestResult is one direction between two nodes.
|
||||
type NetworkTestResult struct {
|
||||
clusterv1.NetTestRunResponse
|
||||
|
||||
From string `json:"from"`
|
||||
To string `json:"to"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
// NetworkTestStore holds tests and the one cluster-wide claim on running one.
|
||||
type NetworkTestStore interface {
|
||||
// Claim takes the cluster-wide slot for testID until the given time, and
|
||||
// reports ErrNetworkTestBusy while another unexpired claim holds it.
|
||||
Claim(ctx context.Context, testID string, until time.Time) error
|
||||
Release(ctx context.Context, testID string) error
|
||||
Put(ctx context.Context, t *NetworkTest) error
|
||||
Get(ctx context.Context, testID string) (*NetworkTest, error)
|
||||
List(ctx context.Context) ([]NetworkTest, error)
|
||||
}
|
||||
|
||||
// ErrNetworkTestBusy is a claim refused because another test is running.
|
||||
var ErrNetworkTestBusy = errors.New("a network test is already running")
|
||||
|
||||
const (
|
||||
networkTestBucket = "spinifex-network-tests"
|
||||
networkTestTTL = 7 * 24 * time.Hour
|
||||
networkTestClaimKey = "active"
|
||||
networkTestPrefix = "test."
|
||||
)
|
||||
|
||||
type networkTestClaim struct {
|
||||
TestID string `json:"testId"`
|
||||
Until time.Time `json:"until"`
|
||||
}
|
||||
|
||||
// KVNetworkTests is the NetworkTestStore over a JetStream KV bucket, shared
|
||||
// by every gateway so a test started through one is visible through all.
|
||||
type KVNetworkTests struct {
|
||||
tests *kvstore.Store[NetworkTest]
|
||||
claims *kvstore.Store[networkTestClaim]
|
||||
}
|
||||
|
||||
var _ NetworkTestStore = (*KVNetworkTests)(nil)
|
||||
|
||||
// NewKVNetworkTests constructs the store over the cluster's JetStream client.
|
||||
func NewKVNetworkTests(js jetstream.JetStream) *KVNetworkTests {
|
||||
b := kvstore.NewBucket(js, kvstore.Config{
|
||||
Name: networkTestBucket,
|
||||
History: 1,
|
||||
TTL: networkTestTTL,
|
||||
Missing: "network tests: no JetStream client configured",
|
||||
})
|
||||
return &KVNetworkTests{tests: kvstore.On[NetworkTest](b), claims: kvstore.On[networkTestClaim](b)}
|
||||
}
|
||||
|
||||
// Claim is a create-only write; an expired claim, left by a gateway that died
|
||||
// mid-test, is replaced under its revision so two takers cannot both win.
|
||||
func (s *KVNetworkTests) Claim(ctx context.Context, testID string, until time.Time) error {
|
||||
claim := &networkTestClaim{TestID: testID, Until: until}
|
||||
_, err := s.claims.Create(ctx, networkTestClaimKey, claim)
|
||||
if !errors.Is(err, kvstore.ErrExists) {
|
||||
return err
|
||||
}
|
||||
held, rev, err := s.claims.Get(ctx, networkTestClaimKey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if time.Now().Before(held.Until) {
|
||||
return ErrNetworkTestBusy
|
||||
}
|
||||
if _, err := s.claims.CompareAndSet(ctx, networkTestClaimKey, claim, rev); err != nil {
|
||||
if errors.Is(err, kvstore.ErrConflict) {
|
||||
return ErrNetworkTestBusy
|
||||
}
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Release drops the claim only if testID still holds it.
|
||||
func (s *KVNetworkTests) Release(ctx context.Context, testID string) error {
|
||||
held, rev, err := s.claims.Get(ctx, networkTestClaimKey)
|
||||
if errors.Is(err, kvstore.ErrNotFound) {
|
||||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if held.TestID != testID {
|
||||
return nil
|
||||
}
|
||||
return s.claims.CompareAndDelete(ctx, networkTestClaimKey, rev)
|
||||
}
|
||||
|
||||
func (s *KVNetworkTests) Put(ctx context.Context, t *NetworkTest) error {
|
||||
return s.tests.Set(ctx, networkTestPrefix+t.TestID, t)
|
||||
}
|
||||
|
||||
func (s *KVNetworkTests) Get(ctx context.Context, testID string) (*NetworkTest, error) {
|
||||
t, _, err := s.tests.Get(ctx, networkTestPrefix+testID)
|
||||
return t, err
|
||||
}
|
||||
|
||||
func (s *KVNetworkTests) List(ctx context.Context) ([]NetworkTest, error) {
|
||||
return s.tests.List(ctx, networkTestPrefix)
|
||||
}
|
||||
|
||||
// StartNetworkTest validates the request, claims the cluster-wide slot,
|
||||
// records the test and returns at once; the runs converge in the background.
|
||||
func (d Deps) StartNetworkTest(ctx context.Context, args map[string]string) (*NetworkTest, error) {
|
||||
if d.NetworkTests == nil || d.NATS == nil {
|
||||
return nil, errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
plane := args["Plane"]
|
||||
if plane != clusterv1.PlaneWAN && plane != clusterv1.PlaneLAN && plane != clusterv1.PlaneVPC {
|
||||
return nil, awserrors.Errorf(awserrors.ErrorInvalidParameterValue, "Plane must be wan, lan or vpc")
|
||||
}
|
||||
duration, err := intArg(args, "DurationSeconds", defaultNetworkTestSeconds, minNetTestSeconds, maxNetTestSeconds)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
streams, err := intArg(args, "Streams", defaultNetworkTestStreams, 1, maxNetTestStreams)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
runs, err := networkTestPairs(d.NodeIDs, args["Source"], args["Target"])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
test := &NetworkTest{
|
||||
TestID: newNetworkTestID(), Plane: plane, Status: NetworkTestRunning,
|
||||
DurationSeconds: duration, Streams: streams, StartedAt: time.Now().UTC(), Runs: runs,
|
||||
}
|
||||
perRun := time.Duration(duration)*time.Second + networkTestRunSlack + networkTestServeTimeout
|
||||
until := time.Now().Add(time.Duration(len(runs))*perRun + time.Minute)
|
||||
switch err := d.NetworkTests.Claim(ctx, test.TestID, until); {
|
||||
case errors.Is(err, ErrNetworkTestBusy):
|
||||
return nil, awserrors.Errorf(awserrors.ErrorIncorrectState, "%s", err.Error())
|
||||
case err != nil:
|
||||
slog.ErrorContext(ctx, "StartNetworkTest: claim", "err", err)
|
||||
return nil, errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
if err := d.NetworkTests.Put(ctx, test); err != nil {
|
||||
_ = d.NetworkTests.Release(ctx, test.TestID)
|
||||
slog.ErrorContext(ctx, "StartNetworkTest: record", "err", err)
|
||||
return nil, errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
slog.InfoContext(ctx, "network test started", "test_id", test.TestID, "plane", plane, "runs", len(runs))
|
||||
|
||||
started := *test
|
||||
started.Runs = slices.Clone(test.Runs)
|
||||
go d.runNetworkTest(context.WithoutCancel(ctx), test, perRun)
|
||||
return &started, nil
|
||||
}
|
||||
|
||||
// These mirror the daemon's limits, which refuse anything outside them.
|
||||
const (
|
||||
minNetTestSeconds = 5
|
||||
maxNetTestSeconds = 30
|
||||
maxNetTestStreams = 16
|
||||
)
|
||||
|
||||
func intArg(args map[string]string, name string, def, lo, hi int) (int, error) {
|
||||
raw := args[name]
|
||||
if raw == "" {
|
||||
return def, nil
|
||||
}
|
||||
v, err := strconv.Atoi(raw)
|
||||
if err != nil || v < lo || v > hi {
|
||||
return 0, awserrors.Errorf(awserrors.ErrorInvalidParameterValue, "%s must be between %d and %d", name, lo, hi)
|
||||
}
|
||||
return v, nil
|
||||
}
|
||||
|
||||
// networkTestPairs is both directions between source and target, or with no
|
||||
// target every ordered pair of nodes, the source's first.
|
||||
func networkTestPairs(nodes []string, source, target string) ([]NetworkTestResult, error) {
|
||||
known := func(n string) bool { return slices.Contains(nodes, n) }
|
||||
if source != "" && !known(source) {
|
||||
return nil, awserrors.Errorf(awserrors.ErrorInvalidParameterValue, "unknown Source node")
|
||||
}
|
||||
if target != "" && !known(target) {
|
||||
return nil, awserrors.Errorf(awserrors.ErrorInvalidParameterValue, "unknown Target node")
|
||||
}
|
||||
var runs []NetworkTestResult
|
||||
add := func(from, to string) {
|
||||
runs = append(runs, NetworkTestResult{From: from, To: to, Status: NetworkTestPending})
|
||||
}
|
||||
switch {
|
||||
case source != "" && target != "":
|
||||
if source == target {
|
||||
return nil, awserrors.Errorf(awserrors.ErrorInvalidParameterCombination, "Source and Target must differ")
|
||||
}
|
||||
add(source, target)
|
||||
add(target, source)
|
||||
case target != "":
|
||||
return nil, awserrors.Errorf(awserrors.ErrorMissingParameter, "Target needs a Source")
|
||||
default:
|
||||
order := slices.Clone(nodes)
|
||||
slices.Sort(order)
|
||||
if source != "" {
|
||||
order = append([]string{source}, slices.DeleteFunc(order, func(n string) bool { return n == source })...)
|
||||
}
|
||||
for _, from := range order {
|
||||
for _, to := range order {
|
||||
if from != to {
|
||||
add(from, to)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(runs) == 0 {
|
||||
return nil, awserrors.Errorf(awserrors.ErrorInvalidParameterValue, "a network test needs at least two nodes")
|
||||
}
|
||||
if len(runs) > maxNetworkTestRuns {
|
||||
return nil, awserrors.Errorf(awserrors.ErrorInvalidParameterValue, "too many nodes for a full mesh; name a Source and Target")
|
||||
}
|
||||
return runs, nil
|
||||
}
|
||||
|
||||
func newNetworkTestID() string {
|
||||
b := make([]byte, 8)
|
||||
_, _ = rand.Read(b)
|
||||
return "nt-" + hex.EncodeToString(b)
|
||||
}
|
||||
|
||||
// runNetworkTest drives each run in turn and writes the record after each,
|
||||
// so a poller sees results as they land.
|
||||
func (d Deps) runNetworkTest(parent context.Context, test *NetworkTest, perRun time.Duration) {
|
||||
ctx, cancel := context.WithTimeout(parent, time.Duration(len(test.Runs))*perRun+time.Minute)
|
||||
defer cancel()
|
||||
defer func() {
|
||||
if err := d.NetworkTests.Release(parent, test.TestID); err != nil {
|
||||
slog.Warn("network test: release claim", "test_id", test.TestID, "err", err)
|
||||
}
|
||||
}()
|
||||
|
||||
failed := 0
|
||||
for i := range test.Runs {
|
||||
run := &test.Runs[i]
|
||||
run.Status = NetworkTestRunning
|
||||
d.saveNetworkTest(ctx, test)
|
||||
res, err := d.runNetworkTestPair(ctx, test, run.From, run.To, perRun)
|
||||
run.NetTestRunResponse = res
|
||||
if err != nil {
|
||||
run.Status, run.Error = NetworkTestFailed, err.Error()
|
||||
failed++
|
||||
} else {
|
||||
run.Status = NetworkTestComplete
|
||||
}
|
||||
}
|
||||
now := time.Now().UTC()
|
||||
test.CompletedAt = &now
|
||||
test.Status = NetworkTestComplete
|
||||
if failed == len(test.Runs) {
|
||||
test.Status, test.Error = NetworkTestFailed, "every run failed"
|
||||
}
|
||||
// The run deadline may have passed, and the final status must still land.
|
||||
d.saveNetworkTest(parent, test)
|
||||
slog.Info("network test finished", "test_id", test.TestID, "status", test.Status, "failed_runs", failed)
|
||||
}
|
||||
|
||||
func (d Deps) saveNetworkTest(ctx context.Context, test *NetworkTest) {
|
||||
if err := d.NetworkTests.Put(ctx, test); err != nil {
|
||||
slog.Warn("network test: write record", "test_id", test.TestID, "err", err)
|
||||
}
|
||||
}
|
||||
|
||||
func (d Deps) runNetworkTestPair(ctx context.Context, test *NetworkTest, from, to string, perRun time.Duration) (clusterv1.NetTestRunResponse, error) {
|
||||
var res clusterv1.NetTestRunResponse
|
||||
serveReq, err := json.Marshal(clusterv1.NetTestServeRequest{Plane: test.Plane, DurationSeconds: test.DurationSeconds})
|
||||
if err != nil {
|
||||
return res, fmt.Errorf("encode serve request: %w", err)
|
||||
}
|
||||
sctx, scancel := context.WithTimeout(ctx, networkTestServeTimeout)
|
||||
defer scancel()
|
||||
msg, err := d.NATS.RequestWithContext(sctx, clusterv1.NetTestServeSubject(to), serveReq)
|
||||
if err != nil {
|
||||
return res, fmt.Errorf("%s did not start its server: %w", to, err)
|
||||
}
|
||||
var served clusterv1.NetTestServeResponse
|
||||
if err := json.Unmarshal(msg.Data, &served); err != nil {
|
||||
return res, fmt.Errorf("%s: malformed serve reply", to)
|
||||
}
|
||||
if served.Error != "" {
|
||||
return res, fmt.Errorf("%s: %s", to, served.Error)
|
||||
}
|
||||
|
||||
runReq, err := json.Marshal(clusterv1.NetTestRunRequest{
|
||||
Plane: test.Plane, Address: served.Address, Port: served.Port,
|
||||
DurationSeconds: test.DurationSeconds, Streams: test.Streams,
|
||||
})
|
||||
if err != nil {
|
||||
return res, fmt.Errorf("encode run request: %w", err)
|
||||
}
|
||||
rctx, cancel := context.WithTimeout(ctx, perRun)
|
||||
defer cancel()
|
||||
msg, err = d.NATS.RequestWithContext(rctx, clusterv1.NetTestRunSubject(from), runReq)
|
||||
if err != nil {
|
||||
return res, fmt.Errorf("%s did not report a result: %w", from, err)
|
||||
}
|
||||
if err := json.Unmarshal(msg.Data, &res); err != nil {
|
||||
return res, fmt.Errorf("%s: malformed result", from)
|
||||
}
|
||||
if res.Error != "" {
|
||||
return res, errors.New(res.Error)
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// DescribeNetworkTestsOutput is the response for DescribeNetworkTests.
|
||||
type DescribeNetworkTestsOutput struct {
|
||||
Tests []NetworkTest `json:"tests"`
|
||||
}
|
||||
|
||||
// DescribeNetworkTests returns one test by ID, or the most recent ones.
|
||||
func (d Deps) DescribeNetworkTests(ctx context.Context, args map[string]string) (*DescribeNetworkTestsOutput, error) {
|
||||
if d.NetworkTests == nil {
|
||||
return nil, errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
if id := args["TestId"]; id != "" {
|
||||
t, err := d.NetworkTests.Get(ctx, id)
|
||||
if errors.Is(err, kvstore.ErrNotFound) {
|
||||
return nil, awserrors.Errorf(awserrors.ErrorResourceNotFound, "no network test %s", id)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &DescribeNetworkTestsOutput{Tests: []NetworkTest{*t}}, nil
|
||||
}
|
||||
tests, err := d.NetworkTests.List(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
slices.SortFunc(tests, func(a, b NetworkTest) int { return b.StartedAt.Compare(a.StartedAt) })
|
||||
if len(tests) > maxNetworkTestListed {
|
||||
tests = tests[:maxNetworkTestListed]
|
||||
}
|
||||
if tests == nil {
|
||||
tests = []NetworkTest{}
|
||||
}
|
||||
return &DescribeNetworkTestsOutput{Tests: tests}, nil
|
||||
}
|
||||
@@ -0,0 +1,220 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/mulgadc/bluebottle/pkg/iampolicy"
|
||||
clusterv1 "github.com/mulgadc/spinifex/contracts/cluster/v1"
|
||||
"github.com/mulgadc/spinifex/internal/testkit"
|
||||
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
|
||||
awsidentifiers "github.com/mulgadc/spinifex/spinifex/foundation/aws/identifiers"
|
||||
"github.com/nats-io/nats.go"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestGetNodeMetricsAsksThePolicyBeforeAnythingElse(t *testing.T) {
|
||||
var asked []string
|
||||
deny := func(_, act string, _ []string, _ iampolicy.ConditionKeys) error {
|
||||
asked = append(asked, act)
|
||||
return errors.New(awserrors.ErrorAccessDenied)
|
||||
}
|
||||
_, err := serve(t, Deps{}, awsidentifiers.DefaultAccountID(), action(GetNodeMetricsAction, "NodeId", "node1"), deny)
|
||||
requireCode(t, err, awserrors.ErrorAccessDenied)
|
||||
assert.Equal(t, []string{GetNodeMetricsAction}, asked)
|
||||
}
|
||||
|
||||
func TestGetNodeMetricsRefusesANodeOutsideTheCluster(t *testing.T) {
|
||||
d := Deps{NodeIDs: []string{"node1", "node2"}}
|
||||
for _, node := range []string{"node9", "node1.>", "*"} {
|
||||
_, err := serve(t, d, awsidentifiers.DefaultAccountID(), action(GetNodeMetricsAction, "NodeId", node), nil)
|
||||
code, _ := awserrors.ResolveErrorCode(err)
|
||||
assert.Equal(t, awserrors.ErrorInvalidParameterValue, code, node)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNetworkTestPairs(t *testing.T) {
|
||||
nodes := []string{"c", "a", "b"}
|
||||
|
||||
pair, err := networkTestPairs(nodes, "a", "b")
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, [][2]string{{"a", "b"}, {"b", "a"}}, directions(pair))
|
||||
|
||||
mesh, err := networkTestPairs(nodes, "b", "")
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, [][2]string{{"b", "a"}, {"b", "c"}, {"a", "b"}, {"a", "c"}, {"c", "b"}, {"c", "a"}}, directions(mesh))
|
||||
|
||||
for _, c := range []struct{ source, target, code string }{
|
||||
{"a", "a", awserrors.ErrorInvalidParameterCombination},
|
||||
{"", "b", awserrors.ErrorMissingParameter},
|
||||
{"z", "", awserrors.ErrorInvalidParameterValue},
|
||||
{"a", "z", awserrors.ErrorInvalidParameterValue},
|
||||
} {
|
||||
_, err := networkTestPairs(nodes, c.source, c.target)
|
||||
code, _ := awserrors.ResolveErrorCode(err)
|
||||
assert.Equal(t, c.code, code, "%s -> %s", c.source, c.target)
|
||||
}
|
||||
|
||||
_, err = networkTestPairs([]string{"solo"}, "", "")
|
||||
assert.Error(t, err, "one node has nobody to test against")
|
||||
}
|
||||
|
||||
func directions(runs []NetworkTestResult) [][2]string {
|
||||
out := make([][2]string, len(runs))
|
||||
for i, r := range runs {
|
||||
out[i] = [2]string{r.From, r.To}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func TestStartNetworkTestValidatesBeforeClaiming(t *testing.T) {
|
||||
_, nc, js := testutil.StartTestJetStream(t)
|
||||
d := Deps{NATS: nc, NetworkTests: NewKVNetworkTests(js), NodeIDs: []string{"a", "b"}}
|
||||
for _, args := range []map[string]string{
|
||||
{"Plane": "mgmt"},
|
||||
{"Plane": "lan", "DurationSeconds": "600"},
|
||||
{"Plane": "lan", "Streams": "0"},
|
||||
{"Plane": "lan", "Source": "a", "Target": "a"},
|
||||
} {
|
||||
_, err := d.StartNetworkTest(context.Background(), args)
|
||||
assert.Error(t, err, "%v", args)
|
||||
}
|
||||
tests, err := d.NetworkTests.List(context.Background())
|
||||
require.NoError(t, err)
|
||||
assert.Empty(t, tests, "a refused request records nothing")
|
||||
}
|
||||
|
||||
func TestNetworkTestClaimIsClusterWide(t *testing.T) {
|
||||
_, _, js := testutil.StartTestJetStream(t)
|
||||
ctx := context.Background()
|
||||
first, second := NewKVNetworkTests(js), NewKVNetworkTests(js)
|
||||
|
||||
require.NoError(t, first.Claim(ctx, "nt-1", time.Now().Add(time.Minute)))
|
||||
assert.ErrorIs(t, second.Claim(ctx, "nt-2", time.Now().Add(time.Minute)), ErrNetworkTestBusy)
|
||||
|
||||
require.NoError(t, second.Release(ctx, "nt-2"), "releasing a claim it does not hold is a no-op")
|
||||
assert.ErrorIs(t, second.Claim(ctx, "nt-2", time.Now().Add(time.Minute)), ErrNetworkTestBusy)
|
||||
|
||||
require.NoError(t, first.Release(ctx, "nt-1"))
|
||||
require.NoError(t, second.Claim(ctx, "nt-2", time.Now().Add(-time.Second)))
|
||||
require.NoError(t, first.Claim(ctx, "nt-3", time.Now().Add(time.Minute)), "an expired claim is taken over")
|
||||
}
|
||||
|
||||
// fakeNode answers the serve and run halves as a daemon would, reporting a
|
||||
// fixed throughput, or failing the serve when broken.
|
||||
func fakeNode(t *testing.T, nc *nats.Conn, node, addr string, bps float64, broken bool) {
|
||||
t.Helper()
|
||||
serveSub, err := nc.Subscribe(clusterv1.NetTestServeSubject(node), func(m *nats.Msg) {
|
||||
resp := clusterv1.NetTestServeResponse{Address: addr, Port: clusterv1.NetTestPort}
|
||||
if broken {
|
||||
resp = clusterv1.NetTestServeResponse{Error: "iperf (version 2) is not installed on this node"}
|
||||
}
|
||||
data, _ := json.Marshal(resp)
|
||||
_ = m.Respond(data)
|
||||
})
|
||||
require.NoError(t, err)
|
||||
runSub, err := nc.Subscribe(clusterv1.NetTestRunSubject(node), func(m *nats.Msg) {
|
||||
var req clusterv1.NetTestRunRequest
|
||||
_ = json.Unmarshal(m.Data, &req)
|
||||
data, _ := json.Marshal(clusterv1.NetTestRunResponse{
|
||||
SourceAddress: addr, BitsPerSecond: bps, Streams: req.Streams, LinkMbps: 25000, Tool: "iperf2",
|
||||
})
|
||||
_ = m.Respond(data)
|
||||
})
|
||||
require.NoError(t, err)
|
||||
t.Cleanup(func() { _ = serveSub.Unsubscribe(); _ = runSub.Unsubscribe() })
|
||||
}
|
||||
|
||||
func TestNetworkTestRunsEveryDirectionAndRecordsEachResult(t *testing.T) {
|
||||
_, nc, js := testutil.StartTestJetStream(t)
|
||||
ctx := context.Background()
|
||||
d := Deps{NATS: nc, NetworkTests: NewKVNetworkTests(js), NodeIDs: []string{"a", "b", "c"}}
|
||||
fakeNode(t, nc, "a", "10.10.8.4", 23e9, false)
|
||||
fakeNode(t, nc, "b", "10.10.8.5", 22e9, false)
|
||||
fakeNode(t, nc, "c", "10.10.8.6", 0, true)
|
||||
|
||||
started, err := d.StartNetworkTest(ctx, map[string]string{"Plane": "lan", "DurationSeconds": "5", "Streams": "2"})
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, NetworkTestRunning, started.Status)
|
||||
assert.Len(t, started.Runs, 6)
|
||||
|
||||
_, err = d.StartNetworkTest(ctx, map[string]string{"Plane": "lan"})
|
||||
code, _ := awserrors.ResolveErrorCode(err)
|
||||
assert.Equal(t, awserrors.ErrorIncorrectState, code, "one test at a time across the cluster")
|
||||
|
||||
var done NetworkTest
|
||||
require.Eventually(t, func() bool {
|
||||
out, err := d.DescribeNetworkTests(ctx, map[string]string{"TestId": started.TestID})
|
||||
if err != nil || len(out.Tests) != 1 {
|
||||
return false
|
||||
}
|
||||
done = out.Tests[0]
|
||||
return done.Status != NetworkTestRunning
|
||||
}, 10*time.Second, 20*time.Millisecond)
|
||||
|
||||
assert.Equal(t, NetworkTestComplete, done.Status, "some runs succeeded")
|
||||
byDirection := map[[2]string]NetworkTestResult{}
|
||||
for _, r := range done.Runs {
|
||||
byDirection[[2]string{r.From, r.To}] = r
|
||||
}
|
||||
ab := byDirection[[2]string{"a", "b"}]
|
||||
assert.Equal(t, NetworkTestComplete, ab.Status)
|
||||
assert.InDelta(t, 23e9, ab.BitsPerSecond, 1)
|
||||
assert.Equal(t, 2, ab.Streams)
|
||||
assert.Equal(t, NetworkTestFailed, byDirection[[2]string{"a", "c"}].Status)
|
||||
assert.Contains(t, byDirection[[2]string{"a", "c"}].Error, "not installed")
|
||||
assert.Equal(t, NetworkTestComplete, byDirection[[2]string{"c", "a"}].Status, "c can still send")
|
||||
|
||||
again, err := d.StartNetworkTest(ctx, map[string]string{"Plane": "lan", "Source": "a", "Target": "b", "DurationSeconds": "5"})
|
||||
require.NoError(t, err, "the claim is released when the test ends")
|
||||
|
||||
list, err := d.DescribeNetworkTests(ctx, map[string]string{})
|
||||
require.NoError(t, err)
|
||||
require.Len(t, list.Tests, 2)
|
||||
assert.Equal(t, again.TestID, list.Tests[0].TestID, "newest first")
|
||||
|
||||
require.Eventually(t, func() bool {
|
||||
out, err := d.DescribeNetworkTests(ctx, map[string]string{"TestId": again.TestID})
|
||||
return err == nil && out.Tests[0].Status != NetworkTestRunning
|
||||
}, 10*time.Second, 20*time.Millisecond)
|
||||
}
|
||||
|
||||
func TestNetworkTestFailsARunWhoseServerNeverAnswers(t *testing.T) {
|
||||
_, nc, js := testutil.StartTestJetStream(t)
|
||||
ctx := context.Background()
|
||||
d := Deps{NATS: nc, NetworkTests: NewKVNetworkTests(js), NodeIDs: []string{"a", "b"}}
|
||||
fakeNode(t, nc, "a", "10.10.8.4", 23e9, false)
|
||||
silent, err := nc.Subscribe(clusterv1.NetTestServeSubject("b"), func(*nats.Msg) {})
|
||||
require.NoError(t, err)
|
||||
t.Cleanup(func() { _ = silent.Unsubscribe() })
|
||||
|
||||
started, err := d.StartNetworkTest(ctx, map[string]string{"Plane": "lan", "Source": "a", "Target": "b", "DurationSeconds": "5"})
|
||||
require.NoError(t, err)
|
||||
|
||||
var done NetworkTest
|
||||
require.Eventually(t, func() bool {
|
||||
out, err := d.DescribeNetworkTests(ctx, map[string]string{"TestId": started.TestID})
|
||||
if err != nil || len(out.Tests) != 1 {
|
||||
return false
|
||||
}
|
||||
done = out.Tests[0]
|
||||
return done.Status != NetworkTestRunning
|
||||
}, networkTestServeTimeout+3*time.Second, 50*time.Millisecond, "the serve request has its own deadline")
|
||||
|
||||
assert.Equal(t, NetworkTestFailed, done.Status)
|
||||
require.NotEmpty(t, done.Runs)
|
||||
assert.Equal(t, [2]string{"a", "b"}, [2]string{done.Runs[0].From, done.Runs[0].To})
|
||||
assert.Contains(t, done.Runs[0].Error, "b did not start its server")
|
||||
}
|
||||
|
||||
func TestDescribeNetworkTestsUnknownID(t *testing.T) {
|
||||
_, _, js := testutil.StartTestJetStream(t)
|
||||
d := Deps{NetworkTests: NewKVNetworkTests(js)}
|
||||
_, err := d.DescribeNetworkTests(context.Background(), map[string]string{"TestId": "nt-missing"})
|
||||
code, _ := awserrors.ResolveErrorCode(err)
|
||||
assert.Equal(t, awserrors.ErrorResourceNotFound, code)
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"slices"
|
||||
"strconv"
|
||||
|
||||
telemetryv1 "github.com/mulgadc/spinifex/contracts/telemetry/v1"
|
||||
"github.com/mulgadc/spinifex/spinifex/foundation/aws/errors"
|
||||
otelsetup "github.com/mulgadc/spinifex/spinifex/foundation/telemetry"
|
||||
"github.com/mulgadc/spinifex/spinifex/ingress/aws/dispatch"
|
||||
)
|
||||
|
||||
// GetNodeMetricsAction streams one node's host load. The dispatcher has
|
||||
// already passed the policy and super-admin gates before it runs.
|
||||
const GetNodeMetricsAction = "GetNodeMetrics"
|
||||
|
||||
func (d Deps) getNodeMetrics(w http.ResponseWriter, inv dispatch.Invocation, queryArgs map[string]string) error {
|
||||
r := inv.Request
|
||||
node := queryArgs["NodeId"]
|
||||
if node == "" {
|
||||
return errors.New(awserrors.ErrorMissingParameter)
|
||||
}
|
||||
if !telemetryv1.ValidLiveNode(node) || (len(d.NodeIDs) > 0 && !slices.Contains(d.NodeIDs, node)) {
|
||||
return awserrors.Errorf(awserrors.ErrorInvalidParameterValue, "unknown NodeId")
|
||||
}
|
||||
var since int64
|
||||
if raw := queryArgs["Since"]; raw != "" {
|
||||
parsed, err := strconv.ParseInt(raw, 10, 64)
|
||||
if err != nil || parsed < 0 {
|
||||
return errors.New(awserrors.ErrorInvalidParameterValue)
|
||||
}
|
||||
since = parsed
|
||||
}
|
||||
if d.NATS == nil {
|
||||
return errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
if !flushSupported(w) {
|
||||
slog.ErrorContext(r.Context(), "GetNodeMetrics: response writer cannot flush")
|
||||
return errors.New(awserrors.ErrorInternalError)
|
||||
}
|
||||
|
||||
release, ok, _ := liveStreams.acquire(inv.AccountID)
|
||||
if !ok {
|
||||
otelsetup.RecordLiveStream(r.Context(), otelsetup.LiveStreamRefusedTotal)
|
||||
return errors.New(awserrors.ErrorRequestLimitExceeded)
|
||||
}
|
||||
defer release()
|
||||
|
||||
return streamLive(w, r, d.NATS, liveSubjects{
|
||||
action: GetNodeMetricsAction,
|
||||
sample: telemetryv1.NodeLiveSampleSubject(node),
|
||||
watch: telemetryv1.NodeLiveWatchSubject(node),
|
||||
absent: awserrors.ErrorInvalidParameterValue,
|
||||
}, since, func(data []byte) ([]telemetryv1.NodeLiveSample, error) {
|
||||
var ring telemetryv1.NodeLiveRing
|
||||
err := json.Unmarshal(data, &ring)
|
||||
return ring.Samples, err
|
||||
}, func(s telemetryv1.NodeLiveSample) int64 { return s.TimeMillis })
|
||||
}
|
||||
@@ -63,22 +63,28 @@ type Deps struct {
|
||||
Region string
|
||||
SQSWorkerPolling func() bool
|
||||
SQSTenantAPIRegistered func() bool
|
||||
|
||||
// NetworkTests holds node-to-node throughput tests; nil refuses them.
|
||||
NetworkTests NetworkTestStore
|
||||
}
|
||||
|
||||
// adminActions are the actions only the super-admin account may call.
|
||||
var adminActions = map[string]bool{
|
||||
"GetVersion": true,
|
||||
"GetNodes": true,
|
||||
"GetVMs": true,
|
||||
"GetStorageStatus": true,
|
||||
"PromoteImage": true,
|
||||
"GrantModelAccess": true,
|
||||
"RevokeModelAccess": true,
|
||||
"ListModelAccess": true,
|
||||
"ListOchreCatalog": true,
|
||||
"EnsureSQSWorker": true,
|
||||
"EnableSQS": true,
|
||||
"DescribeSQS": true,
|
||||
"GetVersion": true,
|
||||
"GetNodes": true,
|
||||
"GetNodeFacts": true,
|
||||
"StartNetworkTest": true,
|
||||
"DescribeNetworkTests": true,
|
||||
"GetVMs": true,
|
||||
"GetStorageStatus": true,
|
||||
"PromoteImage": true,
|
||||
"GrantModelAccess": true,
|
||||
"RevokeModelAccess": true,
|
||||
"ListModelAccess": true,
|
||||
"ListOchreCatalog": true,
|
||||
"EnsureSQSWorker": true,
|
||||
"EnableSQS": true,
|
||||
"DescribeSQS": true,
|
||||
}
|
||||
|
||||
// AdminActionNames lists the actions only the super-admin account may call, sorted.
|
||||
@@ -88,7 +94,7 @@ func AdminActionNames() []string {
|
||||
|
||||
// ActionNames lists every action the registration dispatches, sorted.
|
||||
func ActionNames() []string {
|
||||
names := append(AdminActionNames(), GetInstanceMetricsAction, GetInstanceTypeCapacityAction)
|
||||
names := append(AdminActionNames(), GetInstanceMetricsAction, GetInstanceTypeCapacityAction, GetNodeMetricsAction)
|
||||
slices.Sort(names)
|
||||
return names
|
||||
}
|
||||
@@ -167,11 +173,16 @@ func (d Deps) dispatch(w http.ResponseWriter, inv dispatch.Invocation) error {
|
||||
return errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
|
||||
if adminActions[action] && accountID != awsidentifiers.DefaultAccountID() {
|
||||
if (adminActions[action] || action == GetNodeMetricsAction) && accountID != awsidentifiers.DefaultAccountID() {
|
||||
slog.InfoContext(r.Context(), "Spinifex dispatch: non-admin access denied", "action", action, "accountID", accountID)
|
||||
return errors.New(awserrors.ErrorAccessDenied)
|
||||
}
|
||||
|
||||
// Streams rather than returning one document, and only after both gates.
|
||||
if action == GetNodeMetricsAction {
|
||||
return d.getNodeMetrics(w, inv, args)
|
||||
}
|
||||
|
||||
output, err := d.run(r.Context(), action, args, accountID)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -201,6 +212,15 @@ func (d Deps) run(ctx context.Context, action string, args map[string]string, ac
|
||||
return nil, errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
return GetNodes(ctx, d.NATS, d.activeNodes(ctx))
|
||||
case "GetNodeFacts":
|
||||
if d.NATS == nil {
|
||||
return nil, errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
return GetNodeFacts(ctx, d.NATS, d.activeNodes(ctx))
|
||||
case "StartNetworkTest":
|
||||
return d.StartNetworkTest(ctx, args)
|
||||
case "DescribeNetworkTests":
|
||||
return d.DescribeNetworkTests(ctx, args)
|
||||
case GetInstanceTypeCapacityAction:
|
||||
if d.NATS == nil {
|
||||
return nil, errors.New(awserrors.ErrorServerInternal)
|
||||
|
||||
@@ -64,7 +64,7 @@ func TestRegistration_GetVersion_Admin(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRegistration_EveryActionDeniesNonAdminAccount(t *testing.T) {
|
||||
for _, name := range AdminActionNames() {
|
||||
for _, name := range append(AdminActionNames(), GetNodeMetricsAction) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
_, err := serve(t, Deps{}, "000000000002", action(name), nil)
|
||||
requireCode(t, err, awserrors.ErrorAccessDenied)
|
||||
@@ -243,7 +243,7 @@ func TestNewRegistration_DeclaresTheAdminActionsAsItsInventory(t *testing.T) {
|
||||
assert.Equal(t, ServiceName, reg.Service)
|
||||
assert.Equal(t, dispatch.ErrorEnvelopeXML, reg.Errors)
|
||||
assert.ElementsMatch(t, []string{
|
||||
"GetVersion", "GetNodes", "GetVMs", "GetStorageStatus", "PromoteImage",
|
||||
"GetVersion", "GetNodes", "GetNodeFacts", "GetNodeMetrics", "StartNetworkTest", "DescribeNetworkTests", "GetVMs", "GetStorageStatus", "PromoteImage",
|
||||
"GrantModelAccess", "RevokeModelAccess", "ListModelAccess", "ListOchreCatalog",
|
||||
"EnableSQS", "DescribeSQS",
|
||||
"EnsureSQSWorker",
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"github.com/mulgadc/spinifex/spinifex/runtime/host/nodefacts"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var adminNodeFactsCmd = &cobra.Command{
|
||||
Use: "node-facts",
|
||||
Short: "Record this node's hardware and cabling for the operator console",
|
||||
}
|
||||
|
||||
var adminNodeFactsCollectCmd = &cobra.Command{
|
||||
Use: "collect",
|
||||
Short: "Run the root-only hardware probes (run by spinifex-daemon.service as root)",
|
||||
Long: `Runs dmidecode, ethtool, udevadm, networkctl lldp and systemd-detect-virt, and
|
||||
writes their raw output to /etc/spinifex/node-facts/ readable by the spinifex group.
|
||||
The daemon parses the files on request. A probe that fails leaves no file, and the
|
||||
console shows that source as unavailable.`,
|
||||
Args: cobra.NoArgs,
|
||||
SilenceUsage: true,
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
return nodefacts.Collect(cmd.Context(), nodefacts.DefaultDir, "/sys")
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
adminCmd.AddCommand(adminNodeFactsCmd)
|
||||
adminNodeFactsCmd.AddCommand(adminNodeFactsCollectCmd)
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/mulgadc/spinifex/spinifex/domains/ec2/instance/state"
|
||||
"github.com/mulgadc/spinifex/spinifex/domains/network/external"
|
||||
"github.com/mulgadc/spinifex/spinifex/providers/ebs/viperblock"
|
||||
"github.com/mulgadc/spinifex/spinifex/runtime/daemon"
|
||||
"github.com/mulgadc/spinifex/spinifex/runtime/roles/awsgw"
|
||||
"github.com/mulgadc/spinifex/spinifex/runtime/roles/nats"
|
||||
"github.com/mulgadc/spinifex/spinifex/runtime/roles/northstar"
|
||||
@@ -535,6 +536,7 @@ var spinifexStartCmd = &cobra.Command{
|
||||
|
||||
defer initTelemetry("spinifex-daemon", false)()
|
||||
|
||||
daemon.SetBuildInfo(Version, Commit)
|
||||
svc, err := service.New("spinifex", clusterConfig)
|
||||
|
||||
if err != nil {
|
||||
|
||||
@@ -8,7 +8,7 @@ package systemd
|
||||
var Units = map[string]string{
|
||||
"regenerate-ssh-host-keys.service": "# spinifex-unit-version: 1\n[Unit]\nDescription=Regenerate SSH host keys\nConditionPathExists=!/etc/ssh/ssh_host_ed25519_key\nBefore=ssh.service\n\n[Service]\nType=oneshot\nExecStart=/usr/bin/ssh-keygen -A\nRemainAfterExit=yes\n# No ExecStop: the keygen process has already exited by the time this unit\n# is stopped, so there is nothing to signal.\nTimeoutStopSec=5\n\n[Install]\nWantedBy=multi-user.target\n",
|
||||
"spinifex-awsgw.service": "# spinifex-unit-version: 1\n[Unit]\nDescription=Spinifex AWS Gateway\nPartOf=spinifex.target\nAfter=spinifex-nats.service spinifex-daemon.service\nWants=spinifex-nats.service\n\n[Service]\nEnvironmentFile=-/etc/spinifex/telemetry.env\nType=simple\nSlice=spinifex-system.slice\nUser=spinifex-gw\nGroup=spinifex\nExecStartPre=/var/lib/spinifex/wait-for-nats.sh\nExecStart=/usr/local/bin/spx service awsgw start\nRestart=on-failure\nRestartSec=5\n# No SIGTERM handler in this process: it exits immediately on signal, so this\n# only bounds an unexpectedly wedged process before SIGKILL.\nTimeoutStopSec=10\n\nOOMScoreAdjust=-500\n# Per-service ceiling bounds a leak in this service alone rather than\n# tripping the slice-wide cap, which would pick an arbitrary victim.\nMemoryHigh=10%\nMemoryMax=20%\nEnvironment=SPINIFEX_CONFIG_PATH=/etc/spinifex/spinifex.toml\nEnvironment=SPINIFEX_BASE_DIR=/var/lib/spinifex/awsgw/\nEnvironment=SPINIFEX_AWSGW_TLS_CERT=/etc/spinifex/server.pem\nEnvironment=SPINIFEX_AWSGW_TLS_KEY=/etc/spinifex/server.key\n\n# Filesystem access\nNoNewPrivileges=yes\nProtectSystem=strict\nPrivateDevices=yes\nReadOnlyPaths=/etc/spinifex/spinifex.toml /etc/spinifex/master.key /etc/spinifex/server.pem /etc/spinifex/server.key /etc/spinifex/ca.pem\nReadWritePaths=/var/lib/spinifex/awsgw /var/log/spinifex\n\n# Hardening\nProtectHome=yes\nPrivateTmp=yes\nRestrictSUIDSGID=yes\nLockPersonality=yes\nRestrictRealtime=yes\nRestrictNamespaces=yes\nProtectClock=yes\nProtectKernelTunables=yes\nProtectKernelModules=yes\nProtectKernelLogs=yes\nProtectControlGroups=yes\nProtectProc=invisible\nSystemCallArchitectures=native\nMemoryDenyWriteExecute=yes\nRestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK\nCapabilityBoundingSet=\nProtectHostname=yes\nKeyringMode=private\nRemoveIPC=yes\nLimitCORE=0\nLimitNOFILE=65536\nLimitNPROC=4096\n\n[Install]\nWantedBy=spinifex.target\n",
|
||||
"spinifex-daemon.service": "# spinifex-unit-version: 5\n[Unit]\nDescription=Spinifex Daemon (VM Orchestration)\nPartOf=spinifex.target\nAfter=spinifex-nats.service spinifex-viperblock.service ovsdb-server.service ovs-vswitchd.service ovn-controller.service openvswitch-ipsec.service spinifex-hostnet.service\n# Wants (not Requires): boot without openvswitch-ipsec, survive OVS restarts via hostnet\nWants=openvswitch-ipsec.service spinifex-hostnet.service\n\n[Service]\nEnvironmentFile=-/etc/spinifex/telemetry.env\n# ZFS root: installer raises SPINIFEX_RESERVED_MEM_GB by the ARC ceiling the admission gate cannot see\nEnvironmentFile=-/etc/spinifex/host.env\nType=simple\nSlice=spinifex-system.slice\nUser=spinifex-daemon\nGroup=spinifex\nExecStartPre=/usr/local/bin/spx admin hostnet check\nExecStart=/usr/local/bin/spx service spinifex start\nRestart=on-failure\nRestartSec=5\n# KillMode=process: guest QEMU survives daemon restart; the new daemon reattaches (DDIL)\nKillMode=process\nTimeoutStopSec=15\n# RG-4: infra tier — reaped only after every guest\nOOMScoreAdjust=-500\n# Guest QEMU shares this cgroup: the ceiling tracks the slice budget, not daemon overhead\nMemoryHigh=75%\nMemoryMax=85%\nEnvironment=SPINIFEX_CONFIG_PATH=/etc/spinifex/spinifex.toml\nEnvironment=SPINIFEX_BASE_DIR=/var/lib/spinifex/spinifex/\nEnvironment=SPINIFEX_WAL_DIR=/var/lib/spinifex/spinifex/\n# Pin to host tmpfs: QEMU pidfiles/QMP sockets must survive PrivateTmp namespace churn (DDIL)\nEnvironment=XDG_RUNTIME_DIR=/run/spinifex\n\n# RG-9: daemon tier — privileged by necessity (GPU vfio). No CAP_NET_ADMIN here,\n# so unlike vpcd it still escalates ip/sysctl and NoNewPrivileges stays omitted.\nAmbientCapabilities=CAP_SYS_ADMIN CAP_DAC_OVERRIDE\nProtectSystem=full\nPrivateDevices=no\nDevicePolicy=closed\nDeviceAllow=/dev/kvm rw\nDeviceAllow=/dev/net/tun rw\nDeviceAllow=/dev/vhost-net rw\nDeviceAllow=char-vfio rw\nDeviceAllow=/dev/vfio/vfio rw\nReadOnlyPaths=/etc/spinifex/spinifex.toml /etc/spinifex/server.pem /etc/spinifex/server.key /etc/spinifex/ca.pem\n# /proc/sys/net/ipv4/conf: ProtectKernelTunables would keep the per-tap IMDS\n# rp_filter/accept_local read-only; /etc/spinifex/firewall: the root helper writes peers.nft.\nReadWritePaths=/var/lib/spinifex/spinifex /var/log/spinifex /run/spinifex /run/spinifex/nbd /proc/sys/net/ipv4/conf -/etc/spinifex/firewall\n\n# RG-9: hardening baseline\nProtectHome=yes\nPrivateTmp=yes\nRestrictSUIDSGID=yes\nLockPersonality=yes\nRestrictRealtime=yes\nRestrictNamespaces=yes\nProtectClock=yes\nProtectKernelTunables=yes\nProtectKernelModules=yes\nProtectKernelLogs=yes\nProtectControlGroups=yes\nProtectProc=invisible\nSystemCallArchitectures=native\nMemoryDenyWriteExecute=yes\nRestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK\nProtectHostname=yes\nKeyringMode=private\nRemoveIPC=yes\nLimitCORE=0\nLimitNOFILE=65536\nLimitNPROC=4096\n# LimitMEMLOCK=infinity: VFIO pins all guest RAM\nLimitMEMLOCK=infinity\n\n[Install]\nWantedBy=spinifex.target\n",
|
||||
"spinifex-daemon.service": "# spinifex-unit-version: 6\n[Unit]\nDescription=Spinifex Daemon (VM Orchestration)\nPartOf=spinifex.target\nAfter=spinifex-nats.service spinifex-viperblock.service ovsdb-server.service ovs-vswitchd.service ovn-controller.service openvswitch-ipsec.service spinifex-hostnet.service\n# Wants (not Requires): boot without openvswitch-ipsec, survive OVS restarts via hostnet\nWants=openvswitch-ipsec.service spinifex-hostnet.service\n\n[Service]\nEnvironmentFile=-/etc/spinifex/telemetry.env\n# ZFS root: installer raises SPINIFEX_RESERVED_MEM_GB by the ARC ceiling the admission gate cannot see\nEnvironmentFile=-/etc/spinifex/host.env\nType=simple\nSlice=spinifex-system.slice\nUser=spinifex-daemon\nGroup=spinifex\nExecStartPre=/usr/local/bin/spx admin hostnet check\nExecStartPre=-+/usr/local/bin/spx admin node-facts collect\nExecStart=/usr/local/bin/spx service spinifex start\nRestart=on-failure\nRestartSec=5\n# KillMode=process: guest QEMU survives daemon restart; the new daemon reattaches (DDIL)\nKillMode=process\nTimeoutStopSec=15\n# RG-4: infra tier — reaped only after every guest\nOOMScoreAdjust=-500\n# Guest QEMU shares this cgroup: the ceiling tracks the slice budget, not daemon overhead\nMemoryHigh=75%\nMemoryMax=85%\nEnvironment=SPINIFEX_CONFIG_PATH=/etc/spinifex/spinifex.toml\nEnvironment=SPINIFEX_BASE_DIR=/var/lib/spinifex/spinifex/\nEnvironment=SPINIFEX_WAL_DIR=/var/lib/spinifex/spinifex/\n# Pin to host tmpfs: QEMU pidfiles/QMP sockets must survive PrivateTmp namespace churn (DDIL)\nEnvironment=XDG_RUNTIME_DIR=/run/spinifex\n\n# RG-9: daemon tier — privileged by necessity (GPU vfio). No CAP_NET_ADMIN here,\n# so unlike vpcd it still escalates ip/sysctl and NoNewPrivileges stays omitted.\nAmbientCapabilities=CAP_SYS_ADMIN CAP_DAC_OVERRIDE\nProtectSystem=full\nPrivateDevices=no\nDevicePolicy=closed\nDeviceAllow=/dev/kvm rw\nDeviceAllow=/dev/net/tun rw\nDeviceAllow=/dev/vhost-net rw\nDeviceAllow=char-vfio rw\nDeviceAllow=/dev/vfio/vfio rw\nReadOnlyPaths=/etc/spinifex/spinifex.toml /etc/spinifex/server.pem /etc/spinifex/server.key /etc/spinifex/ca.pem\n# /proc/sys/net/ipv4/conf: ProtectKernelTunables would keep the per-tap IMDS\n# rp_filter/accept_local read-only; /etc/spinifex/firewall: the root helper writes peers.nft.\nReadWritePaths=/var/lib/spinifex/spinifex /var/log/spinifex /run/spinifex /run/spinifex/nbd /proc/sys/net/ipv4/conf -/etc/spinifex/firewall\n\n# RG-9: hardening baseline\nProtectHome=yes\nPrivateTmp=yes\nRestrictSUIDSGID=yes\nLockPersonality=yes\nRestrictRealtime=yes\nRestrictNamespaces=yes\nProtectClock=yes\nProtectKernelTunables=yes\nProtectKernelModules=yes\nProtectKernelLogs=yes\nProtectControlGroups=yes\nProtectProc=invisible\nSystemCallArchitectures=native\nMemoryDenyWriteExecute=yes\nRestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK\nProtectHostname=yes\nKeyringMode=private\nRemoveIPC=yes\nLimitCORE=0\nLimitNOFILE=65536\nLimitNPROC=4096\n# LimitMEMLOCK=infinity: VFIO pins all guest RAM\nLimitMEMLOCK=infinity\n\n[Install]\nWantedBy=spinifex.target\n",
|
||||
"spinifex-firewall.service": "# spinifex-unit-version: 2\n[Unit]\nDescription=Spinifex host firewall (nftables input policy)\nDocumentation=file:/etc/spinifex/firewall/spinifex.nft\nWants=network-pre.target\nBefore=network-pre.target shutdown.target\nDefaultDependencies=no\n\n[Service]\nType=oneshot\nRemainAfterExit=yes\nStandardInput=null\nProtectSystem=full\nProtectHome=true\n# Unconditional: connection tracking loads on every node, so a flow that opens\n# while the policy is not armed survives the arm. The policy itself still loads\n# only where the daemon has written a peer file.\nExecStart=/usr/local/lib/spinifex/spinifex-firewall-apply boot\nExecReload=/usr/local/lib/spinifex/spinifex-firewall-apply boot\nTimeoutStopSec=10s\n\n# No ExecStop: flushing on stop would take vpcd's MASQUERADE and per-EIP FORWARD\n# rules with it. Remove the policy deliberately with\n# `nft delete table inet spinifex_filter`.\n\n[Install]\nWantedBy=sysinit.target\n",
|
||||
"spinifex-guests.slice": "# spinifex-unit-version: 1\n[Unit]\nDescription=Spinifex guest VM tier\nBefore=slices.target\n\n[Slice]\n# RG-3: child of spinifex.slice (spinifex-guests -> spinifex), sibling of\n# spinifex-system. Parent for the per-instance spinifex-instance-<id>.slice\n# leaves (0002 RG-7). Inherits the spinifex.slice ceiling; no extra limit here.\n",
|
||||
"spinifex-hostnet.service": "# spinifex-unit-version: 2\n[Unit]\nDescription=Spinifex host network wiring (veth pairs, mgmt address, encap route)\n# PartOf/WantedBy ovs-vswitchd: re-applied whenever OVS starts; daemon and vpcd only Want it\nRequires=ovs-vswitchd.service\nAfter=ovs-vswitchd.service NetworkManager-wait-online.service\nPartOf=ovs-vswitchd.service\n# Stopping OVS stops ovn-controller through its Requires= chain and starting OVS\n# does not bring it back, so the start that re-applies hostnet restarts it too\nWants=ovn-controller.service\nBefore=spinifex.target\n\n[Service]\nType=oneshot\nRemainAfterExit=yes\nExecStart=/usr/local/bin/spx admin hostnet apply\n# Covers the 120s wait behind setup-ovn.sh plus the 60s wait for links\nTimeoutStartSec=240\nTimeoutStopSec=10\nProtectSystem=full\nProtectHome=yes\nPrivateTmp=yes\n\n[Install]\nWantedBy=spinifex.target ovs-vswitchd.service\n",
|
||||
|
||||
@@ -425,6 +425,7 @@ var unitBodyHashes = map[string]map[int]string{
|
||||
3: "8059fe13a678b8cb2a383ae75c069560cf39adece9a9394e17781998c711cd57",
|
||||
4: "f66e1240cc5655f6a13f3b56ca282c73e2fe289f2e51d0ce624d14b90f12f838",
|
||||
5: "d3d25d7eb0051ccf97f70838ddff763bade38bef934b8f85733e048151ac9319",
|
||||
6: "4db31f63c0b9b297a3ec33c34df99c2ec1424374d39f1752f1fd1dc4ec887316",
|
||||
},
|
||||
"spinifex-firewall.service": {
|
||||
1: "01d0a7a79f47eedca02aaab3ff97a0b6462d61b7834e16c7336a7b96034dc392",
|
||||
|
||||
@@ -363,11 +363,11 @@ func endpointReferencer(procRoot string, disc discoveredNbdkit) (pid int, found
|
||||
|
||||
// cmdlineReferencesEndpoint checks a NUL-separated /proc/<pid>/cmdline for
|
||||
// disc's endpoint. A socket mount's path appears verbatim in whichever
|
||||
// argument named it (an EFI -drive's file= or a -blockdev's server.path=). A
|
||||
// TCP mount's 127.0.0.1:<port> pair may appear joined in one argument (an EFI
|
||||
// pflash drive's nbd://host:port) or split across server.host=/server.port=
|
||||
// within one -blockdev argument. The match is by substring, so the boot
|
||||
// volume's file.server.path=/file.server.host=/file.server.port= also match.
|
||||
// argument named it (QEMU's nbd+unix:///?socket=<path> file= or its
|
||||
// server.path=<path> -blockdev option). A TCP mount's 127.0.0.1:<port> pair
|
||||
// may appear joined in one argument (a boot/EFI drive's nbd://host:port) or
|
||||
// split across server.host=/server.port= within the same comma-joined
|
||||
// -blockdev argument, so both shapes are checked.
|
||||
func cmdlineReferencesEndpoint(cmdline []byte, disc discoveredNbdkit) bool {
|
||||
args := bytes.Split(bytes.TrimRight(cmdline, "\x00"), []byte{0})
|
||||
|
||||
|
||||
@@ -415,7 +415,7 @@ func TestReapOrphanedNbdkit_LiveReferencer_LeftRunningAndLogged(t *testing.T) {
|
||||
// TestReapOrphanedNbdkit_TCPEndpointReferencedAcrossSplitBlockdevArgs proves
|
||||
// endpointReferencer recognizes a TCP endpoint even when QEMU's -blockdev
|
||||
// splits host and port into server.host=/server.port= within one argument,
|
||||
// not just the joined host:port form an EFI pflash drive uses.
|
||||
// not just the joined host:port form a boot/EFI drive uses.
|
||||
func TestReapOrphanedNbdkit_TCPEndpointReferencedAcrossSplitBlockdevArgs(t *testing.T) {
|
||||
pid := spawnLongRunningProcess(t)
|
||||
procRoot := t.TempDir()
|
||||
@@ -428,46 +428,6 @@ func TestReapOrphanedNbdkit_TCPEndpointReferencedAcrossSplitBlockdevArgs(t *test
|
||||
assert.Never(t, func() bool { return !hostprocess.ProcessAlive(pid) }, 50*time.Millisecond, 5*time.Millisecond, "a TCP endpoint split across server.host=/server.port= must still be recognized as referenced")
|
||||
}
|
||||
|
||||
// TestReapOrphanedNbdkit_BootBlockdevReferencer_LeftRunning pins the boot
|
||||
// volume's -blockdev, whose server options carry a file. prefix: a live
|
||||
// guest's root nbdkit named only that way must never be signalled.
|
||||
func TestReapOrphanedNbdkit_BootBlockdevReferencer_LeftRunning(t *testing.T) {
|
||||
socket := filepath.Join(t.TempDir(), "vol-boot-root.sock")
|
||||
tests := []struct {
|
||||
name string
|
||||
arg string
|
||||
disc func(pid int) discoveredNbdkit
|
||||
}{
|
||||
{
|
||||
name: "unix socket",
|
||||
arg: "driver=raw,node-name=os,cache.direct=on,file.driver=nbd,file.server.type=unix,file.server.path=" + socket + ",file.export=,file.reconnect-delay=30",
|
||||
disc: func(pid int) discoveredNbdkit {
|
||||
return discoveredNbdkit{PID: pid, Volume: "vol-boot-unix1", Socket: socket}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "tcp",
|
||||
arg: "driver=raw,node-name=os,cache.direct=on,file.driver=nbd,file.server.type=inet,file.server.host=127.0.0.1,file.server.port=10897,file.export=,file.reconnect-delay=30",
|
||||
disc: func(pid int) discoveredNbdkit {
|
||||
return discoveredNbdkit{PID: pid, Volume: "vol-boot-tcp1", Port: 10897}
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
pid := spawnLongRunningProcess(t)
|
||||
procRoot := t.TempDir()
|
||||
const referencerPID = 909092
|
||||
writeReferencerFixture(t, procRoot, referencerPID, tt.arg)
|
||||
|
||||
logs := captureLogs(t)
|
||||
assert.False(t, reapOrphanedNbdkit(procRoot, tt.disc(pid), reapReasonUnadoptable), "a boot volume's nbdkit must never be signalled")
|
||||
assert.Never(t, func() bool { return !hostprocess.ProcessAlive(pid) }, 50*time.Millisecond, 5*time.Millisecond, "a boot volume's nbdkit must never be signalled")
|
||||
assert.Contains(t, logs.String(), fmt.Sprintf("referencing_pid=%d", referencerPID))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// unreadableProcDir creates procRoot/<pid> with a cmdline file inside, then
|
||||
// strips all permissions from the directory itself, so os.ReadFile on the
|
||||
// cmdline path inside it fails with a permission error rather than
|
||||
|
||||
@@ -84,10 +84,6 @@ func buildDeviceMap(devices []qmp.BlockDevice) map[string]string {
|
||||
|
||||
name := dev.Device
|
||||
pciIndex := extractPCIIndex(dev.QDev)
|
||||
// A -blockdev boot node has no BlockBackend name; its node-name is "os".
|
||||
if name == "" && pciIndex >= 0 && dev.Inserted != nil {
|
||||
name = dev.Inserted.NodeName
|
||||
}
|
||||
|
||||
if pciIndex < 0 {
|
||||
// Hot-plugged device: extract name and port from QDev path.
|
||||
|
||||
@@ -127,23 +127,6 @@ func TestBuildDeviceMap(t *testing.T) {
|
||||
},
|
||||
wantLen: 4,
|
||||
},
|
||||
{
|
||||
// A -blockdev boot node leaves the BlockBackend unnamed, so the
|
||||
// entry is keyed by its node-name instead of "".
|
||||
name: "blockdev boot device is named by its node-name",
|
||||
devices: []qmp.BlockDevice{
|
||||
{Device: "", Inserted: &qmp.BlockInserted{NodeName: "os"}, QDev: "/machine/peripheral-anon/device[0]/virtio-backend"},
|
||||
{Device: "cloudinit", Inserted: &qmp.BlockInserted{NodeName: "#block123"}, QDev: "/machine/peripheral-anon/device[3]/virtio-backend"},
|
||||
{Device: "", Inserted: &qmp.BlockInserted{NodeName: "nbd-vol-abc"}, QDev: "/machine/peripheral/vdisk-vol-abc/virtio-backend"},
|
||||
},
|
||||
want: map[string]string{
|
||||
"os": "/dev/vda",
|
||||
"cloudinit": "/dev/vdb",
|
||||
"vdisk-vol-abc": "/dev/vdc",
|
||||
},
|
||||
absent: []string{"", "nbd-vol-abc"},
|
||||
wantLen: 3,
|
||||
},
|
||||
{
|
||||
// Boot devices returned out of order: lowest PCI index wins /dev/vda;
|
||||
// hot-plugged devices sort after boot devices.
|
||||
@@ -443,15 +426,3 @@ func TestLogGuestDeviceMap_LeavesBlockDeviceMappingsAlone(t *testing.T) {
|
||||
assert.Equal(t, "/dev/sdf", aws.StringValue(v.Instance.BlockDeviceMappings[1].DeviceName),
|
||||
"a data mapping must still name the device the caller asked for, not /dev/vdb")
|
||||
}
|
||||
|
||||
// TestBuildDeviceMap_UnnamedBootDeviceWithoutMedium covers an unnamed
|
||||
// boot-time BlockBackend that reports no inserted medium.
|
||||
func TestBuildDeviceMap_UnnamedBootDeviceWithoutMedium(t *testing.T) {
|
||||
devices := []qmp.BlockDevice{
|
||||
{Device: "", Inserted: nil, QDev: "/machine/peripheral-anon/device[0]/virtio-backend"},
|
||||
{Device: "cloudinit", Inserted: &qmp.BlockInserted{}, QDev: "/machine/peripheral-anon/device[3]/virtio-backend"},
|
||||
}
|
||||
var got map[string]string
|
||||
require.NotPanics(t, func() { got = buildDeviceMap(devices) })
|
||||
assert.Equal(t, "/dev/vdb", got["cloudinit"], "the unnamed device still holds its PCI slot")
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@ import (
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/mulgadc/spinifex/spinifex/runtime/compute/nbd"
|
||||
)
|
||||
|
||||
// IsMicrovm reports whether machineType is the QEMU microvm machine, with or
|
||||
@@ -164,14 +162,12 @@ type blkDeviceJSON struct {
|
||||
NumQueues int `json:"num-queues,omitempty"`
|
||||
BootIndex int `json:"bootindex,omitempty"`
|
||||
Mapping []iothreadVQMapping `json:"iothread-vq-mapping"`
|
||||
Werror string `json:"werror"`
|
||||
Rerror string `json:"rerror"`
|
||||
}
|
||||
|
||||
// BlkDeviceMapped returns a virtio-blk -device that spreads its virtqueues
|
||||
// across a pool of poolSize IOThreads, round-robin. Falls back to BlkDevice's
|
||||
// scalar iothread= form when poolSize <= 1, when there is one queue, or on an
|
||||
// MMIO machine.
|
||||
// scalar iothread= form when poolSize <= 1, so the common small-guest case is
|
||||
// byte-for-byte what it was before this existed.
|
||||
//
|
||||
// Every queue is mapped exactly once and the scalar iothread= property is
|
||||
// absent: QEMU treats the two as alternative assignments and rejects both.
|
||||
@@ -201,8 +197,6 @@ func BlkDeviceMapped(machineType, drive, iothreadBase string, queues, bootIdx, p
|
||||
NumQueues: queues,
|
||||
BootIndex: bootIdx,
|
||||
Mapping: mapping,
|
||||
Werror: "stop",
|
||||
Rerror: "stop",
|
||||
})
|
||||
if err != nil {
|
||||
return Device{}, fmt.Errorf("marshal virtio-blk iothread-vq-mapping: %w", err)
|
||||
@@ -210,9 +204,9 @@ func BlkDeviceMapped(machineType, drive, iothreadBase string, queues, bootIdx, p
|
||||
return Device{Value: string(b)}, nil
|
||||
}
|
||||
|
||||
// BlkDevice returns the virtio-blk device string for machineType, omitting an
|
||||
// empty iothread or zero queues; bootIdx is PCI-only. It sets werror/rerror=stop
|
||||
// (see VolumeBlkDeviceArgs), as a -blockdev node has no BlockBackend to hold it.
|
||||
// BlkDevice returns the appropriate QEMU virtio-blk device string for
|
||||
// machineType. iothread and queues are omitted when empty/zero. bootIdx is
|
||||
// only emitted for PCI machines (MMIO has no bootindex concept).
|
||||
func BlkDevice(machineType, drive, iothread string, queues int, bootIdx int) Device {
|
||||
var b strings.Builder
|
||||
if IsMMIO(machineType) {
|
||||
@@ -230,7 +224,6 @@ func BlkDevice(machineType, drive, iothread string, queues int, bootIdx int) Dev
|
||||
if !IsMMIO(machineType) && bootIdx > 0 {
|
||||
fmt.Fprintf(&b, ",bootindex=%d", bootIdx)
|
||||
}
|
||||
b.WriteString(",werror=stop,rerror=stop")
|
||||
return Device{Value: b.String()}
|
||||
}
|
||||
|
||||
@@ -289,9 +282,9 @@ func HotplugEBSBus(port int) string {
|
||||
// (rendered as a joined command-line string) so the two block-graph shapes
|
||||
// cannot diverge.
|
||||
//
|
||||
// werror=stop,rerror=stop pauses the VM and holds a failed request, so a
|
||||
// transient backend loss is resumed with cont instead of reaching the guest as
|
||||
// EIO. A -blockdev node has no BlockBackend to carry it, so the device sets it.
|
||||
// werror/rerror mirror the boot drive's on-error policy (see Drive.Werror):
|
||||
// a data volume has no -drive-backed BlockBackend to carry it, so the qdev
|
||||
// device itself sets werror=stop,rerror=stop.
|
||||
func VolumeBlkDeviceArgs(volumeID, nodeName, iothreadID, bus string) []string {
|
||||
return []string{
|
||||
fmt.Sprintf("id=%s", VolumeDeviceID(volumeID)),
|
||||
@@ -390,54 +383,11 @@ func (o NBDServerOpts) CommandLineArgs() []string {
|
||||
// monitor-owned node that blockdev-del can later remove (unlike -drive,
|
||||
// which only creates a BlockBackend with an auto-generated node-name).
|
||||
func VolumeBlockdev(nodeName string, server NBDServerOpts) Blockdev {
|
||||
opts := append([]string{"driver=nbd", fmt.Sprintf("node-name=%s", nodeName)}, nbdNodeOpts("", server)...)
|
||||
opts := append([]string{"driver=nbd", fmt.Sprintf("node-name=%s", nodeName)}, server.CommandLineArgs()...)
|
||||
opts = append(opts, "export=", fmt.Sprintf("reconnect-delay=%d", NBDReconnectDelaySeconds))
|
||||
return Blockdev{Value: strings.Join(opts, ",")}
|
||||
}
|
||||
|
||||
// nbdNodeOpts returns an nbd node's server, export and reconnect-delay options,
|
||||
// each prefixed with prefix: "" on the nbd node itself, "file." under raw.
|
||||
func nbdNodeOpts(prefix string, server NBDServerOpts) []string {
|
||||
var opts []string
|
||||
for _, arg := range server.CommandLineArgs() {
|
||||
opts = append(opts, prefix+arg)
|
||||
}
|
||||
return append(opts, prefix+"export=", fmt.Sprintf("%sreconnect-delay=%d", prefix, NBDReconnectDelaySeconds))
|
||||
}
|
||||
|
||||
// bootNodeName is the boot volume's block-node name, which its -device names
|
||||
// with drive=.
|
||||
const bootNodeName = "os"
|
||||
|
||||
// nbdServerOpts parses an NBD URI into the server options a blockdev takes.
|
||||
func nbdServerOpts(uri string) (NBDServerOpts, error) {
|
||||
serverType, socketPath, host, port, err := nbd.ParseNBDURI(uri)
|
||||
if err != nil {
|
||||
return NBDServerOpts{}, err
|
||||
}
|
||||
return NBDServerOpts{Type: serverType, Path: socketPath, Host: host, Port: port}, nil
|
||||
}
|
||||
|
||||
// bootNBDBlockdev renders the boot volume's -blockdev for an NBD export: a raw
|
||||
// node over an nbd node, the graph -drive format=raw,cache=none built, with the
|
||||
// same O_DIRECT setting and reconnect delay.
|
||||
func bootNBDBlockdev(nodeName string, server NBDServerOpts) Blockdev {
|
||||
opts := append([]string{"driver=raw", fmt.Sprintf("node-name=%s", nodeName), "cache.direct=on", "file.driver=nbd"}, nbdNodeOpts("file.", server)...)
|
||||
return Blockdev{Value: strings.Join(opts, ",")}
|
||||
}
|
||||
|
||||
// exportBlockdev renders v's -blockdev as nodeName: a host_device node for a
|
||||
// block export, otherwise the NBD node nbdBlockdev builds from its URI.
|
||||
func exportBlockdev(v EBSRequest, kind volumeExportKind, nodeName string, nbdBlockdev func(string, NBDServerOpts) Blockdev) (Blockdev, error) {
|
||||
if kind == volumeExportBlock {
|
||||
return VolumeHostDeviceBlockdev(nodeName, HostDeviceOpts{Path: v.BlockDevice, SizeBytes: v.BlockSizeBytes}), nil
|
||||
}
|
||||
server, err := nbdServerOpts(v.NBDURI)
|
||||
if err != nil {
|
||||
return Blockdev{}, fmt.Errorf("parse NBDURI for volume %s: %w", v.Name, err)
|
||||
}
|
||||
return nbdBlockdev(nodeName, server), nil
|
||||
}
|
||||
|
||||
// HostDeviceOpts is a host block device export. QEMU opens Path through the
|
||||
// host_device protocol driver with O_DIRECT and native AIO, and a raw format
|
||||
// node over it exposes only the first SizeBytes to the guest.
|
||||
@@ -463,7 +413,7 @@ func (o HostDeviceOpts) QMPArgs(nodeName string) map[string]any {
|
||||
}
|
||||
|
||||
// VolumeHostDeviceBlockdev renders the -blockdev equivalent of QMPArgs for a
|
||||
// volume backed by a host block device.
|
||||
// data volume backed by a host block device.
|
||||
func VolumeHostDeviceBlockdev(nodeName string, dev HostDeviceOpts) Blockdev {
|
||||
return Blockdev{Value: fmt.Sprintf(
|
||||
"driver=raw,node-name=%s,size=%d,file.driver=host_device,file.filename=%s,file.aio=native,file.cache.direct=on",
|
||||
|
||||
@@ -130,28 +130,28 @@ func TestNICQueues_ClampedWhenEnabled(t *testing.T) {
|
||||
|
||||
func TestBlkDevice_PCI(t *testing.T) {
|
||||
d := BlkDevice("q35", "os", "ioth-os", 4, 1)
|
||||
assert.Equal(t, "virtio-blk-pci,drive=os,iothread=ioth-os,num-queues=4,bootindex=1,werror=stop,rerror=stop", d.Value)
|
||||
assert.Equal(t, "virtio-blk-pci,drive=os,iothread=ioth-os,num-queues=4,bootindex=1", d.Value)
|
||||
}
|
||||
|
||||
func TestBlkDevice_PCI_NoBootIdx(t *testing.T) {
|
||||
d := BlkDevice("q35", "data", "ioth-data", 2, 0)
|
||||
assert.Equal(t, "virtio-blk-pci,drive=data,iothread=ioth-data,num-queues=2,werror=stop,rerror=stop", d.Value)
|
||||
assert.Equal(t, "virtio-blk-pci,drive=data,iothread=ioth-data,num-queues=2", d.Value)
|
||||
}
|
||||
|
||||
func TestBlkDevice_PCI_NoIOThread(t *testing.T) {
|
||||
d := BlkDevice("q35", "data", "", 0, 0)
|
||||
assert.Equal(t, "virtio-blk-pci,drive=data,werror=stop,rerror=stop", d.Value)
|
||||
assert.Equal(t, "virtio-blk-pci,drive=data", d.Value)
|
||||
}
|
||||
|
||||
func TestBlkDevice_MMIO(t *testing.T) {
|
||||
d := BlkDevice("microvm", "os", "ioth-os", 4, 1)
|
||||
// MMIO has no bootindex
|
||||
assert.Equal(t, "virtio-blk-device,drive=os,iothread=ioth-os,num-queues=4,werror=stop,rerror=stop", d.Value)
|
||||
assert.Equal(t, "virtio-blk-device,drive=os,iothread=ioth-os,num-queues=4", d.Value)
|
||||
}
|
||||
|
||||
func TestBlkDevice_MMIO_NoIOThread(t *testing.T) {
|
||||
d := BlkDevice("microvm,x-option-roms=off", "data", "", 0, 0)
|
||||
assert.Equal(t, "virtio-blk-device,drive=data,werror=stop,rerror=stop", d.Value)
|
||||
assert.Equal(t, "virtio-blk-device,drive=data", d.Value)
|
||||
}
|
||||
|
||||
func TestRngDevice_PCI(t *testing.T) {
|
||||
|
||||
@@ -315,7 +315,7 @@ func (m *Manager) startQEMU(instance *VM, appendConsole bool) error {
|
||||
m.initENIRequests(instance)
|
||||
|
||||
instance.EBSRequests.Mu.Lock()
|
||||
driveCfg, err := buildDiskBootDrives(instance.EBSRequests.Requests, spec.VCPUs, instance.Config.MachineType)
|
||||
driveCfg, err := buildDrives(instance.EBSRequests.Requests, spec.VCPUs, instance.Config.MachineType)
|
||||
instance.EBSRequests.Mu.Unlock()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -1398,24 +1398,16 @@ func directBootLaunchConfig(base Config, requests []EBSRequest, cpuCount int) (C
|
||||
return cfg, nil
|
||||
}
|
||||
|
||||
// buildDiskBootDrives is buildDrives for a guest that boots from a volume: a
|
||||
// request list with no boot volume is refused, as QEMU would start with
|
||||
// nothing to boot from and the guest would never come up.
|
||||
func buildDiskBootDrives(requests []EBSRequest, cpuCount int, machineType string) (driveConfig, error) {
|
||||
if !slices.ContainsFunc(requests, func(r EBSRequest) bool { return r.Boot }) {
|
||||
return driveConfig{}, errors.New("no boot volume among the instance's EBS requests")
|
||||
}
|
||||
return buildDrives(requests, cpuCount, machineType)
|
||||
}
|
||||
|
||||
// buildDrives converts EBS requests into QEMU drive/iothread/device/blockdev
|
||||
// configs. Returns an error if any volume has no valid export (see
|
||||
// classifyVolumeExport), or if the EBS hot-plug port pool is exhausted while
|
||||
// allocating one for a data volume.
|
||||
//
|
||||
// The boot volume is a -blockdev node named "os" under a bootindex=1 device
|
||||
// that carries werror/rerror; it is never detached, so it keeps fixed names.
|
||||
// EFI volumes emit pflash unit=1; Config.Execute adds the CODE blob (unit=0).
|
||||
// Boot volumes keep the existing anonymous if=none -drive shape exactly as
|
||||
// before — they are not detachable (see ErrVolumeNotDetachable), so the
|
||||
// anonymous-node problem this function otherwise fixes does not apply, and
|
||||
// changing the boot drive risks boot order. EFI volumes emit pflash unit=1;
|
||||
// the readonly CODE blob (unit=0) is added by Config.Execute.
|
||||
//
|
||||
// Every other (data) volume is given the same named node-name/device-id/
|
||||
// iothread-id shape AttachVolume's hot-plug path uses, via a -blockdev entry
|
||||
@@ -1440,29 +1432,41 @@ func buildDrives(requests []EBSRequest, cpuCount int, machineType string) (drive
|
||||
}
|
||||
|
||||
switch {
|
||||
case kind == volumeExportBlock && v.EFI:
|
||||
// The VARS store is a pflash -drive, which has no host_device form.
|
||||
return driveConfig{}, fmt.Errorf("volume %s: block device export is not supported for an EFI volume", v.Name)
|
||||
case kind == volumeExportBlock && (v.Boot || v.EFI):
|
||||
// Boot and EFI keep the legacy -drive shape, which has no
|
||||
// host_device form here; only data volumes take a block export.
|
||||
return driveConfig{}, fmt.Errorf("volume %s: block device export is only supported for data volumes", v.Name)
|
||||
|
||||
case v.Boot:
|
||||
blockdev, err := exportBlockdev(*v, kind, bootNodeName, bootNBDBlockdev)
|
||||
if err != nil {
|
||||
return driveConfig{}, err
|
||||
drive := Drive{
|
||||
File: v.NBDURI,
|
||||
Format: "raw",
|
||||
If: "none",
|
||||
Media: "disk",
|
||||
ID: "os",
|
||||
Cache: "none",
|
||||
|
||||
// Pause the VM and hold the failed request rather than
|
||||
// delivering EIO to the guest, which aborts its journal. A
|
||||
// transient backend loss is then recovered with cont.
|
||||
Werror: "stop",
|
||||
Rerror: "stop",
|
||||
ReconnectDelay: NBDReconnectDelaySeconds,
|
||||
}
|
||||
|
||||
// The boot disk's virtqueues are spread across a pool rather than
|
||||
// all served by one host thread. A pool of 1 keeps the scalar
|
||||
// iothread= form, which is every guest below 4 vCPUs.
|
||||
// all served by one host thread. A pool of 1 emits exactly the
|
||||
// command line this used to, which is every guest below 4 vCPUs.
|
||||
pool := BlkIOThreadPoolSize(cpuCount)
|
||||
for i := range pool {
|
||||
cfg.IOThreads = append(cfg.IOThreads, IOThread{ID: BlkIOThreadID("ioth-os", i, pool)})
|
||||
}
|
||||
dev, err := BlkDeviceMapped(machineType, bootNodeName, "ioth-os", cpuCount, 1, pool)
|
||||
dev, err := BlkDeviceMapped(machineType, drive.ID, "ioth-os", cpuCount, 1, pool)
|
||||
if err != nil {
|
||||
return driveConfig{}, fmt.Errorf("boot volume %s: %w", v.Name, err)
|
||||
}
|
||||
cfg.Blockdevs = append(cfg.Blockdevs, blockdev)
|
||||
cfg.Devices = append(cfg.Devices, dev)
|
||||
cfg.Drives = append(cfg.Drives, drive)
|
||||
|
||||
case v.EFI:
|
||||
cfg.Drives = append(cfg.Drives, Drive{
|
||||
@@ -1491,9 +1495,20 @@ func buildDrives(requests []EBSRequest, cpuCount int, machineType string) (drive
|
||||
nodeName := VolumeNodeName(v.Name)
|
||||
iothreadID := VolumeIOThreadID(v.Name)
|
||||
|
||||
blockdev, err := exportBlockdev(*v, kind, nodeName, VolumeBlockdev)
|
||||
if err != nil {
|
||||
return driveConfig{}, err
|
||||
var blockdev Blockdev
|
||||
if kind == volumeExportBlock {
|
||||
blockdev = VolumeHostDeviceBlockdev(nodeName, HostDeviceOpts{Path: v.BlockDevice, SizeBytes: v.BlockSizeBytes})
|
||||
} else {
|
||||
serverType, socketPath, nbdHost, nbdPort, err := nbd.ParseNBDURI(v.NBDURI)
|
||||
if err != nil {
|
||||
return driveConfig{}, fmt.Errorf("parse NBDURI for volume %s: %w", v.Name, err)
|
||||
}
|
||||
blockdev = VolumeBlockdev(nodeName, NBDServerOpts{
|
||||
Type: serverType,
|
||||
Path: socketPath,
|
||||
Host: nbdHost,
|
||||
Port: nbdPort,
|
||||
})
|
||||
}
|
||||
|
||||
cfg.IOThreads = append(cfg.IOThreads, IOThread{ID: iothreadID})
|
||||
|
||||
@@ -132,12 +132,12 @@ func TestBuildDrives(t *testing.T) {
|
||||
{Name: "vol-boot", NBDURI: "nbd:unix:/tmp/boot.sock", Boot: true},
|
||||
},
|
||||
cpuCount: 2,
|
||||
wantBlockdevs: []Blockdev{
|
||||
{Value: "driver=raw,node-name=os,cache.direct=on,file.driver=nbd,file.server.type=unix,file.server.path=/tmp/boot.sock,file.export=,file.reconnect-delay=30"},
|
||||
wantDrives: []Drive{
|
||||
{File: "nbd:unix:/tmp/boot.sock", Format: "raw", If: "none", Media: "disk", ID: "os", Cache: "none", Werror: "stop", Rerror: "stop", ReconnectDelay: NBDReconnectDelaySeconds},
|
||||
},
|
||||
wantIOThreads: []IOThread{{ID: "ioth-os"}},
|
||||
wantDevices: []Device{
|
||||
{Value: "virtio-blk-pci,drive=os,iothread=ioth-os,num-queues=2,bootindex=1,werror=stop,rerror=stop"},
|
||||
{Value: "virtio-blk-pci,drive=os,iothread=ioth-os,num-queues=2,bootindex=1"},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -148,12 +148,12 @@ func TestBuildDrives(t *testing.T) {
|
||||
{Name: "vol-boot", NBDURI: "nbd:unix:/tmp/boot.sock", Boot: true},
|
||||
},
|
||||
cpuCount: 4,
|
||||
wantBlockdevs: []Blockdev{
|
||||
{Value: "driver=raw,node-name=os,cache.direct=on,file.driver=nbd,file.server.type=unix,file.server.path=/tmp/boot.sock,file.export=,file.reconnect-delay=30"},
|
||||
wantDrives: []Drive{
|
||||
{File: "nbd:unix:/tmp/boot.sock", Format: "raw", If: "none", Media: "disk", ID: "os", Cache: "none", Werror: "stop", Rerror: "stop", ReconnectDelay: NBDReconnectDelaySeconds},
|
||||
},
|
||||
wantIOThreads: []IOThread{{ID: "ioth-os-0"}, {ID: "ioth-os-1"}},
|
||||
wantDevices: []Device{
|
||||
{Value: `{"driver":"virtio-blk-pci","drive":"os","num-queues":4,"bootindex":1,"iothread-vq-mapping":[{"iothread":"ioth-os-0","vqs":[0,2]},{"iothread":"ioth-os-1","vqs":[1,3]}],"werror":"stop","rerror":"stop"}`},
|
||||
{Value: `{"driver":"virtio-blk-pci","drive":"os","num-queues":4,"bootindex":1,"iothread-vq-mapping":[{"iothread":"ioth-os-0","vqs":[0,2]},{"iothread":"ioth-os-1","vqs":[1,3]}]}`},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -249,7 +249,7 @@ func TestBuildDrives(t *testing.T) {
|
||||
wantErr: "no free EBS hot-plug port for volume vol-overflow",
|
||||
},
|
||||
{
|
||||
name: "mixed boot + EFI + data: boot is a -blockdev node and EFI keeps the pflash -drive",
|
||||
name: "mixed boot + EFI + data: boot and EFI keep the legacy -drive shape",
|
||||
requests: []EBSRequest{
|
||||
{Name: "vol-boot", NBDURI: "nbd:unix:/tmp/boot.sock", Boot: true},
|
||||
{Name: "vol-efi", NBDURI: "nbd:unix:/tmp/efi.sock", EFI: true},
|
||||
@@ -260,6 +260,7 @@ func TestBuildDrives(t *testing.T) {
|
||||
// unaffected by the pool either way — they keep one IOThread each.
|
||||
cpuCount: 2,
|
||||
wantDrives: []Drive{
|
||||
{File: "nbd:unix:/tmp/boot.sock", Format: "raw", If: "none", Media: "disk", ID: "os", Cache: "none", Werror: "stop", Rerror: "stop", ReconnectDelay: NBDReconnectDelaySeconds},
|
||||
{File: "nbd:unix:/tmp/efi.sock", Format: "raw", If: "pflash", Unit: 1},
|
||||
},
|
||||
wantIOThreads: []IOThread{
|
||||
@@ -267,11 +268,10 @@ func TestBuildDrives(t *testing.T) {
|
||||
{ID: "ioth-vol-data-a"},
|
||||
},
|
||||
wantBlockdevs: []Blockdev{
|
||||
{Value: "driver=raw,node-name=os,cache.direct=on,file.driver=nbd,file.server.type=unix,file.server.path=/tmp/boot.sock,file.export=,file.reconnect-delay=30"},
|
||||
{Value: "driver=nbd,node-name=nbd-vol-data-a,server.type=unix,server.path=/tmp/data-a.sock,export=,reconnect-delay=30"},
|
||||
},
|
||||
wantDevices: []Device{
|
||||
{Value: "virtio-blk-pci,drive=os,iothread=ioth-os,num-queues=2,bootindex=1,werror=stop,rerror=stop"},
|
||||
{Value: "virtio-blk-pci,drive=os,iothread=ioth-os,num-queues=2,bootindex=1"},
|
||||
{Value: "virtio-blk-pci,id=vdisk-vol-data-a,drive=nbd-vol-data-a,iothread=ioth-vol-data-a,serial=voldataa,bus=hotplug-ebs3,werror=stop,rerror=stop"},
|
||||
},
|
||||
wantHotplugPorts: []int{0, 0, 3},
|
||||
@@ -348,72 +348,31 @@ func TestBuildDrives(t *testing.T) {
|
||||
{Name: "vol-boot", NBDURI: "nbd:unix:/tmp/boot.sock", Boot: true},
|
||||
{Name: "vol-blk", BlockDevice: "/dev/sdx", BlockSizeBytes: 1 << 20},
|
||||
},
|
||||
cpuCount: 2,
|
||||
cpuCount: 2,
|
||||
wantDrives: []Drive{
|
||||
{File: "nbd:unix:/tmp/boot.sock", Format: "raw", If: "none", Media: "disk", ID: "os", Cache: "none", Werror: "stop", Rerror: "stop", ReconnectDelay: NBDReconnectDelaySeconds},
|
||||
},
|
||||
wantIOThreads: []IOThread{{ID: "ioth-os"}, {ID: "ioth-vol-blk"}},
|
||||
wantBlockdevs: []Blockdev{
|
||||
{Value: "driver=raw,node-name=os,cache.direct=on,file.driver=nbd,file.server.type=unix,file.server.path=/tmp/boot.sock,file.export=,file.reconnect-delay=30"},
|
||||
{Value: "driver=raw,node-name=nbd-vol-blk,size=1048576,file.driver=host_device,file.filename=/dev/sdx,file.aio=native,file.cache.direct=on"},
|
||||
},
|
||||
wantDevices: []Device{
|
||||
{Value: "virtio-blk-pci,drive=os,iothread=ioth-os,num-queues=2,bootindex=1,werror=stop,rerror=stop"},
|
||||
{Value: "virtio-blk-pci,drive=os,iothread=ioth-os,num-queues=2,bootindex=1"},
|
||||
{Value: "virtio-blk-pci,id=vdisk-vol-blk,drive=nbd-vol-blk,iothread=ioth-vol-blk,serial=volblk,bus=hotplug-ebs1,werror=stop,rerror=stop"},
|
||||
},
|
||||
wantHotplugPorts: []int{0, 1},
|
||||
},
|
||||
{
|
||||
name: "block boot volume is a raw node over host_device named os under the bootindex device",
|
||||
requests: []EBSRequest{
|
||||
{Name: "vol-boot", BlockDevice: "/dev/sdx", BlockSizeBytes: 8 << 30, Boot: true},
|
||||
},
|
||||
cpuCount: 2,
|
||||
wantIOThreads: []IOThread{{ID: "ioth-os"}},
|
||||
wantBlockdevs: []Blockdev{
|
||||
{Value: "driver=raw,node-name=os,size=8589934592,file.driver=host_device,file.filename=/dev/sdx,file.aio=native,file.cache.direct=on"},
|
||||
},
|
||||
wantDevices: []Device{
|
||||
{Value: "virtio-blk-pci,drive=os,iothread=ioth-os,num-queues=2,bootindex=1,werror=stop,rerror=stop"},
|
||||
},
|
||||
wantHotplugPorts: []int{0},
|
||||
},
|
||||
{
|
||||
name: "block boot volume with four vCPUs keeps the mapped device and error policy",
|
||||
requests: []EBSRequest{
|
||||
{Name: "vol-boot", BlockDevice: "/dev/sdx", BlockSizeBytes: 8 << 30, Boot: true},
|
||||
},
|
||||
cpuCount: 4,
|
||||
wantIOThreads: []IOThread{{ID: "ioth-os-0"}, {ID: "ioth-os-1"}},
|
||||
wantBlockdevs: []Blockdev{
|
||||
{Value: "driver=raw,node-name=os,size=8589934592,file.driver=host_device,file.filename=/dev/sdx,file.aio=native,file.cache.direct=on"},
|
||||
},
|
||||
wantDevices: []Device{
|
||||
{Value: `{"driver":"virtio-blk-pci","drive":"os","num-queues":4,"bootindex":1,"iothread-vq-mapping":[{"iothread":"ioth-os-0","vqs":[0,2]},{"iothread":"ioth-os-1","vqs":[1,3]}],"werror":"stop","rerror":"stop"}`},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "NBD boot volume over TCP renders inet server options under file.",
|
||||
requests: []EBSRequest{
|
||||
{Name: "vol-boot", NBDURI: "nbd://127.0.0.1:44801", Boot: true},
|
||||
},
|
||||
cpuCount: 2,
|
||||
wantIOThreads: []IOThread{{ID: "ioth-os"}},
|
||||
wantBlockdevs: []Blockdev{
|
||||
{Value: "driver=raw,node-name=os,cache.direct=on,file.driver=nbd,file.server.type=inet,file.server.host=127.0.0.1,file.server.port=44801,file.export=,file.reconnect-delay=30"},
|
||||
},
|
||||
wantDevices: []Device{
|
||||
{Value: "virtio-blk-pci,drive=os,iothread=ioth-os,num-queues=2,bootindex=1,werror=stop,rerror=stop"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "unparseable NBD boot URI is rejected",
|
||||
requests: []EBSRequest{{Name: "vol-boot", NBDURI: "http://example/boot", Boot: true}},
|
||||
name: "block boot volume is rejected",
|
||||
requests: []EBSRequest{{Name: "vol-boot", BlockDevice: "/dev/sdx", BlockSizeBytes: 1 << 20, Boot: true}},
|
||||
cpuCount: 2,
|
||||
wantErr: "parse NBDURI for volume vol-boot",
|
||||
wantErr: "volume vol-boot: block device export is only supported for data volumes",
|
||||
},
|
||||
{
|
||||
name: "block EFI volume is rejected",
|
||||
requests: []EBSRequest{{Name: "vol-efi", BlockDevice: "/dev/sdx", BlockSizeBytes: 1 << 20, EFI: true}},
|
||||
cpuCount: 2,
|
||||
wantErr: "volume vol-efi: block device export is not supported for an EFI volume",
|
||||
wantErr: "volume vol-efi: block device export is only supported for data volumes",
|
||||
},
|
||||
{
|
||||
name: "both NBDURI and BlockDevice set is rejected",
|
||||
@@ -1150,7 +1109,6 @@ func TestStartQEMU_DiskBoot_MgmtTapCreated(t *testing.T) {
|
||||
InstanceType: "t3.nano",
|
||||
MgmtMAC: "02:aa:bb:cc:dd:ee",
|
||||
}
|
||||
instance.EBSRequests.Requests = []EBSRequest{{Name: "vol-root", NBDURI: "nbd:unix:/tmp/root.sock", Boot: true}}
|
||||
|
||||
err := m.startQEMU(instance, false)
|
||||
|
||||
@@ -2210,88 +2168,6 @@ func TestStartQEMU_DiskBoot_DataVolumeStaysOnThePCIPath(t *testing.T) {
|
||||
assert.Equal(t, 1, instance.EBSRequests.Requests[1].HotplugPort)
|
||||
}
|
||||
|
||||
// TestStartQEMU_DiskBoot_BootVolumeIsABlockdevNode launches a disk-boot guest
|
||||
// from each export kind and checks the boot volume reaches QEMU as the "os"
|
||||
// -blockdev node behind the bootindex=1 device, with no -drive left for it.
|
||||
func TestStartQEMU_DiskBoot_BootVolumeIsABlockdevNode(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
req func(t *testing.T) EBSRequest
|
||||
wantBlockdev func(req EBSRequest) string
|
||||
}{
|
||||
{
|
||||
name: "nbd export",
|
||||
req: func(t *testing.T) EBSRequest {
|
||||
return EBSRequest{Name: "vol-root", NBDURI: nbdListener(t), Boot: true}
|
||||
},
|
||||
wantBlockdev: func(req EBSRequest) string {
|
||||
hostPort := strings.TrimPrefix(req.NBDURI, "nbd://")
|
||||
host, port, _ := strings.Cut(hostPort, ":")
|
||||
return "driver=raw,node-name=os,cache.direct=on,file.driver=nbd,file.server.type=inet,file.server.host=" + host +
|
||||
",file.server.port=" + port + ",file.export=,file.reconnect-delay=30"
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "block export",
|
||||
req: func(t *testing.T) EBSRequest {
|
||||
dev := filepath.Join(t.TempDir(), "sdx")
|
||||
require.NoError(t, os.WriteFile(dev, nil, 0o600))
|
||||
return EBSRequest{Name: "vol-root", BlockDevice: dev, BlockSizeBytes: 8 << 30, Boot: true}
|
||||
},
|
||||
wantBlockdev: func(req EBSRequest) string {
|
||||
return "driver=raw,node-name=os,size=8589934592,file.driver=host_device,file.filename=" + req.BlockDevice +
|
||||
",file.aio=native,file.cache.direct=on"
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
m := directBootManager(t, &fakeNetworkPlumber{})
|
||||
launches := withFakeQEMU(t)
|
||||
|
||||
req := tt.req(t)
|
||||
instance := &VM{ID: "i-boot-blockdev", InstanceType: "t3.nano"}
|
||||
instance.EBSRequests.Requests = []EBSRequest{req}
|
||||
require.NoError(t, m.startQEMU(instance, false))
|
||||
|
||||
got := launches()
|
||||
require.Len(t, got, 1)
|
||||
assert.Equal(t, []string{tt.wantBlockdev(req)}, allArgValues(got[0], "-blockdev"))
|
||||
assert.Contains(t, allArgValues(got[0], "-device"), "virtio-blk-pci,drive=os,iothread=ioth-os,num-queues=1,bootindex=1,werror=stop,rerror=stop")
|
||||
for _, d := range allArgValues(got[0], "-drive") {
|
||||
assert.NotContains(t, d, "id=os", "the boot volume must not also be a -drive")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// TestStartQEMU_DiskBoot_NoBootVolumeIsNotLaunched covers a disk-boot guest
|
||||
// whose only volumes are data volumes: their -blockdev nodes would satisfy
|
||||
// Execute, but QEMU would have nothing to boot from.
|
||||
func TestStartQEMU_DiskBoot_NoBootVolumeIsNotLaunched(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
requests []EBSRequest
|
||||
}{
|
||||
{name: "data volume only", requests: []EBSRequest{{Name: "vol-data-a", NBDURI: "nbd:unix:/tmp/data-a.sock"}}},
|
||||
{name: "no volumes", requests: nil},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
m := directBootManager(t, &fakeNetworkPlumber{})
|
||||
launches := withFakeQEMU(t)
|
||||
|
||||
instance := &VM{ID: "i-no-boot", InstanceType: "t3.nano"}
|
||||
instance.EBSRequests.Requests = tt.requests
|
||||
err := m.startQEMU(instance, false)
|
||||
|
||||
require.Error(t, err)
|
||||
assert.Contains(t, err.Error(), "no boot volume among the instance's EBS requests")
|
||||
assert.Empty(t, launches(), "QEMU must not start")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func deviceValues(devs []Device) []string {
|
||||
out := make([]string, len(devs))
|
||||
for i, d := range devs {
|
||||
|
||||
@@ -371,8 +371,8 @@ type Device struct {
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
// Drive is one QEMU -drive entry, used for the pflash firmware drives (the
|
||||
// CODE blob and the EFI volume). Each set field becomes a key=value option.
|
||||
// Drive is one QEMU -drive entry, used for boot, EFI and pflash firmware
|
||||
// drives. Each set field becomes a key=value option.
|
||||
type Drive struct {
|
||||
File string `json:"file"`
|
||||
Format string `json:"format"`
|
||||
@@ -380,6 +380,15 @@ type Drive struct {
|
||||
Media string `json:"media"`
|
||||
ID string `json:"id"`
|
||||
Cache string `json:"cache,omitempty"`
|
||||
// Werror and Rerror set QEMU's block on-error policy. "stop" pauses the VM
|
||||
// and holds the failed request, so a transient backend loss is resumed with
|
||||
// cont instead of reaching the guest as EIO and corrupting its filesystem.
|
||||
Werror string `json:"werror,omitempty"`
|
||||
Rerror string `json:"rerror,omitempty"`
|
||||
// ReconnectDelay emits file.reconnect-delay, the seconds an NBD disconnect
|
||||
// pauses requests before failing them. The file. prefix is required: the
|
||||
// bare name reaches the format driver, which has no such option.
|
||||
ReconnectDelay int `json:"reconnect_delay,omitempty"`
|
||||
// Unit selects the pflash slot when If=="pflash": 0 is the CODE blob,
|
||||
// 1 is the per-VM VARS volume. Ignored for non-pflash drives.
|
||||
Unit int `json:"unit,omitempty"`
|
||||
@@ -396,9 +405,9 @@ type IOThread struct {
|
||||
// Blockdev is a QEMU -blockdev entry: the command-line equivalent of the
|
||||
// blockdev-add QMP command. Unlike a -drive with if=none, it produces a
|
||||
// monitor-owned node addressable by node-name, which is what makes
|
||||
// blockdev-del able to remove it later. Used for boot and data volumes, so a
|
||||
// cold-booted data volume has the same detachable block-graph shape as a
|
||||
// hot-attached one; EFI volumes keep the pflash -drive shape.
|
||||
// blockdev-del able to remove it later. Used for data (non-boot, non-EFI)
|
||||
// volumes so a cold-booted one has the same detachable block-graph shape as
|
||||
// a hot-attached one; boot/EFI volumes keep the legacy -drive shape.
|
||||
type Blockdev struct {
|
||||
Value string `json:"value"`
|
||||
}
|
||||
@@ -562,8 +571,8 @@ func (cfg *Config) Execute() (*exec.Cmd, error) {
|
||||
args = append(args, "-object", fmt.Sprintf("iothread,id=%s", iot.ID))
|
||||
}
|
||||
|
||||
if len(cfg.Drives) == 0 && len(cfg.Blockdevs) == 0 && cfg.KernelImage == "" {
|
||||
return nil, fmt.Errorf("at least one drive, blockdev or a kernel image is required")
|
||||
if len(cfg.Drives) == 0 && cfg.KernelImage == "" {
|
||||
return nil, fmt.Errorf("at least one drive or a kernel image is required")
|
||||
}
|
||||
|
||||
drives := cfg.Drives
|
||||
@@ -613,6 +622,18 @@ func (cfg *Config) Execute() (*exec.Cmd, error) {
|
||||
opts = append(opts, fmt.Sprintf("cache=%s", drive.Cache))
|
||||
}
|
||||
|
||||
if drive.Werror != "" {
|
||||
opts = append(opts, fmt.Sprintf("werror=%s", drive.Werror))
|
||||
}
|
||||
|
||||
if drive.Rerror != "" {
|
||||
opts = append(opts, fmt.Sprintf("rerror=%s", drive.Rerror))
|
||||
}
|
||||
|
||||
if drive.ReconnectDelay > 0 {
|
||||
opts = append(opts, fmt.Sprintf("file.reconnect-delay=%d", drive.ReconnectDelay))
|
||||
}
|
||||
|
||||
args = append(args, "-drive", strings.Join(opts, ","))
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ func TestExecute(t *testing.T) {
|
||||
|
||||
// Expect error, at least one drive or kernel image required
|
||||
assert.Error(t, err)
|
||||
assert.ErrorContains(t, err, "at least one drive, blockdev or a kernel image is required")
|
||||
assert.ErrorContains(t, err, "at least one drive or a kernel image is required")
|
||||
assert.Nil(t, cmd)
|
||||
|
||||
cfg.Drives = []Drive{
|
||||
@@ -347,14 +347,6 @@ func TestExecute_DriveAndKernelInvariant(t *testing.T) {
|
||||
assert.NotNil(t, cmd)
|
||||
})
|
||||
|
||||
t.Run("blockdevs-only is OK", func(t *testing.T) {
|
||||
cfg := base
|
||||
cfg.Blockdevs = []Blockdev{{Value: "driver=raw,node-name=os,file.driver=nbd,file.server.type=unix,file.server.path=/run/os.sock"}}
|
||||
cmd, err := cfg.Execute()
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, cmd)
|
||||
})
|
||||
|
||||
t.Run("kernel-only is OK", func(t *testing.T) {
|
||||
cfg := base
|
||||
cfg.KernelImage = "/boot/vmlinuz"
|
||||
@@ -367,7 +359,7 @@ func TestExecute_DriveAndKernelInvariant(t *testing.T) {
|
||||
cfg := base
|
||||
cmd, err := cfg.Execute()
|
||||
assert.Error(t, err)
|
||||
assert.ErrorContains(t, err, "at least one drive, blockdev or a kernel image")
|
||||
assert.ErrorContains(t, err, "at least one drive or a kernel image")
|
||||
assert.Nil(t, cmd)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
"github.com/mulgadc/spinifex/spinifex/runtime/compute/nbd"
|
||||
"github.com/mulgadc/spinifex/spinifex/runtime/compute/qmp"
|
||||
)
|
||||
|
||||
@@ -142,7 +143,7 @@ func (m *Manager) AttachVolume(ctx context.Context, id, volumeID, device string)
|
||||
if kind == volumeExportBlock {
|
||||
blockdevArgs = HostDeviceOpts{Path: ebsRequest.BlockDevice, SizeBytes: ebsRequest.BlockSizeBytes}.QMPArgs(nodeName)
|
||||
} else {
|
||||
server, err := nbdServerOpts(ebsRequest.NBDURI)
|
||||
serverType, socketPath, nbdHost, nbdPort, err := nbd.ParseNBDURI(ebsRequest.NBDURI)
|
||||
if err != nil {
|
||||
slog.ErrorContext(ctx, "AttachVolume: failed to parse NBDURI", "uri", ebsRequest.NBDURI, "err", err)
|
||||
_ = m.rollbackUnmount(ctx, instance.AccountID, ebsRequest)
|
||||
@@ -151,7 +152,7 @@ func (m *Manager) AttachVolume(ctx context.Context, id, volumeID, device string)
|
||||
blockdevArgs = map[string]any{
|
||||
"node-name": nodeName,
|
||||
"driver": "nbd",
|
||||
"server": server.QMPArg(),
|
||||
"server": NBDServerOpts{Type: serverType, Path: socketPath, Host: nbdHost, Port: nbdPort}.QMPArg(),
|
||||
"export": "",
|
||||
"read-only": false,
|
||||
"reconnect-delay": NBDReconnectDelaySeconds,
|
||||
|
||||
@@ -40,6 +40,7 @@ import (
|
||||
clusterv1 "github.com/mulgadc/spinifex/contracts/cluster/v1"
|
||||
"github.com/mulgadc/spinifex/contracts/ec2/v1"
|
||||
operatorv1 "github.com/mulgadc/spinifex/contracts/operator/v1"
|
||||
telemetryv1 "github.com/mulgadc/spinifex/contracts/telemetry/v1"
|
||||
viperblocklegacyv1 "github.com/mulgadc/spinifex/contracts/viperblockd/legacy/v1"
|
||||
"github.com/mulgadc/spinifex/spinifex/bootstrap/config"
|
||||
"github.com/mulgadc/spinifex/spinifex/bootstrap/preflight"
|
||||
@@ -169,6 +170,7 @@ type Daemon struct {
|
||||
spotInstanceService *ec2spotinstance.SpotInstanceServiceImpl
|
||||
vpcService *ec2vpc.VPCServiceImpl
|
||||
sqsWorker *sqsWorkerEnsurer
|
||||
insight *nodeInsight
|
||||
eipService ec2eip.EIPService
|
||||
elbv2Service *elbv2domain.ELBv2ServiceImpl
|
||||
eksService *ekscluster.EKSServiceImpl
|
||||
@@ -905,6 +907,10 @@ func (d *Daemon) subscribeAll() error {
|
||||
if d.sqsWorker == nil {
|
||||
d.sqsWorker = newSQSWorkerEnsurer(d.buildSQSWorkerLauncher)
|
||||
}
|
||||
if d.insight == nil {
|
||||
d.insight = newNodeInsight(d.node)
|
||||
d.insight.live = &nodeLiveSampler{insight: d.insight, nc: d.natsConn, subject: telemetryv1.NodeLiveSampleSubject(d.node)}
|
||||
}
|
||||
subs := []natsSub{
|
||||
// ec2.RunInstances is handled by dynamic per-instance-type subscriptions
|
||||
// managed by ResourceManager.initSubscriptions()
|
||||
@@ -1044,6 +1050,7 @@ func (d *Daemon) subscribeAll() error {
|
||||
{clusterv1.NodeHealthSubject(d.node), d.handleHealthCheck, ""},
|
||||
{clusterv1.NodesDiscoverSubject, d.handleNodeDiscover, ""},
|
||||
{clusterv1.NodeStatusSubject, d.handleNodeStatus, ""},
|
||||
{clusterv1.NodeFactsSubject, d.handleNodeFacts, ""},
|
||||
{clusterv1.NodeVMsSubject, d.handleNodeVMs, ""},
|
||||
{operatorv1.StorageConfigSubject, d.handleStorageConfig, ""},
|
||||
{"spinifex.image.promote", d.handleSpinifexPromoteImage, "spinifex-workers"},
|
||||
@@ -1057,6 +1064,13 @@ func (d *Daemon) subscribeAll() error {
|
||||
{"spinifex.cluster.shutdown.persist", d.handleShutdownPersist, ""},
|
||||
{"spinifex.cluster.shutdown.infra", d.handleShutdownInfra, ""},
|
||||
}
|
||||
if clusterv1.ValidNodeID(d.node) {
|
||||
subs = append(subs,
|
||||
natsSub{clusterv1.NetTestServeSubject(d.node), d.handleNetTestServe, ""},
|
||||
natsSub{clusterv1.NetTestRunSubject(d.node), d.handleNetTestRun, ""},
|
||||
natsSub{telemetryv1.NodeLiveWatchSubject(d.node), d.handleNodeLiveWatch, ""},
|
||||
)
|
||||
}
|
||||
|
||||
// ELBv2 operations require a resolved gateway URL.
|
||||
// Without a subscriber the gateway returns nats.ErrNoResponders → ServiceUnavailable.
|
||||
|
||||
@@ -0,0 +1,397 @@
|
||||
package daemon
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"log/slog"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
clusterv1 "github.com/mulgadc/spinifex/contracts/cluster/v1"
|
||||
telemetryv1 "github.com/mulgadc/spinifex/contracts/telemetry/v1"
|
||||
"github.com/mulgadc/spinifex/spinifex/runtime/host/nettest"
|
||||
"github.com/mulgadc/spinifex/spinifex/runtime/host/nodefacts"
|
||||
"github.com/nats-io/nats.go"
|
||||
)
|
||||
|
||||
// Build-time version and commit, set by the cmd package before the daemon starts.
|
||||
var (
|
||||
buildVersion = "dev"
|
||||
buildCommit = "unknown"
|
||||
)
|
||||
|
||||
// SetBuildInfo records the build-time version and commit the node reports.
|
||||
func SetBuildInfo(version, commit string) {
|
||||
buildVersion, buildCommit = version, commit
|
||||
}
|
||||
|
||||
// nodeFactsTTL bounds how often a request rebuilds the facts; a re-cabled
|
||||
// port shows within it.
|
||||
const nodeFactsTTL = 15 * time.Second
|
||||
|
||||
// nodeInsight serves the operator's view of this host: its facts, a live
|
||||
// sampler of its own load, and the two halves of a throughput test.
|
||||
type nodeInsight struct {
|
||||
node string
|
||||
env nodefacts.Env
|
||||
|
||||
mu sync.Mutex
|
||||
facts clusterv1.NodeFacts
|
||||
factsAt time.Time
|
||||
|
||||
live *nodeLiveSampler
|
||||
server nettest.Server
|
||||
// testing serialises the client side, so two tests never share a link.
|
||||
testing sync.Mutex
|
||||
}
|
||||
|
||||
func newNodeInsight(node string) *nodeInsight {
|
||||
return &nodeInsight{node: node, env: nodefacts.DefaultEnv(node, buildVersion, buildCommit)}
|
||||
}
|
||||
|
||||
func (n *nodeInsight) currentFacts(ctx context.Context) clusterv1.NodeFacts {
|
||||
n.mu.Lock()
|
||||
defer n.mu.Unlock()
|
||||
if time.Since(n.factsAt) < nodeFactsTTL {
|
||||
return n.facts
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
||||
defer cancel()
|
||||
n.facts = nodefacts.Build(ctx, n.env)
|
||||
n.factsAt = time.Now()
|
||||
return n.facts
|
||||
}
|
||||
|
||||
func (n *nodeInsight) planeAddress(ctx context.Context, plane string) string {
|
||||
addr, _ := n.planeSubnet(ctx, plane)
|
||||
return addr
|
||||
}
|
||||
|
||||
// planeSubnet is the node's address on plane and the subnet it sits in. A
|
||||
// client may only be pointed inside that subnet, never at an arbitrary host.
|
||||
func (n *nodeInsight) planeSubnet(ctx context.Context, plane string) (string, *net.IPNet) {
|
||||
for _, p := range n.currentFacts(ctx).Planes {
|
||||
if p.Plane != plane || p.Address == "" {
|
||||
continue
|
||||
}
|
||||
_, subnet, err := net.ParseCIDR(p.Address + "/" + strconv.Itoa(p.Prefix))
|
||||
if err != nil {
|
||||
return p.Address, nil
|
||||
}
|
||||
return p.Address, subnet
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func (n *nodeInsight) planeLink(ctx context.Context, plane string) (speed, mtu int) {
|
||||
f := n.currentFacts(ctx)
|
||||
for _, p := range f.Planes {
|
||||
if p.Plane != plane {
|
||||
continue
|
||||
}
|
||||
mtu = p.MTU
|
||||
for _, nic := range f.NICs {
|
||||
if slices.Contains(p.NICs, nic.Name) {
|
||||
speed = max(speed, nic.SpeedMbps)
|
||||
}
|
||||
}
|
||||
}
|
||||
return speed, mtu
|
||||
}
|
||||
|
||||
func (d *Daemon) handleNodeFacts(msg *nats.Msg) string {
|
||||
respondWithJSON(d.node, msg, d.insight.currentFacts(context.Background()))
|
||||
return outcomeSuccess
|
||||
}
|
||||
|
||||
func validPlane(plane string) bool {
|
||||
return plane == clusterv1.PlaneWAN || plane == clusterv1.PlaneLAN || plane == clusterv1.PlaneVPC
|
||||
}
|
||||
|
||||
func (d *Daemon) handleNetTestServe(msg *nats.Msg) string {
|
||||
var req clusterv1.NetTestServeRequest
|
||||
if err := json.Unmarshal(msg.Data, &req); err != nil || !validPlane(req.Plane) ||
|
||||
req.DurationSeconds < nettest.MinDuration || req.DurationSeconds > nettest.MaxDuration {
|
||||
respondWithJSON(d.node, msg, clusterv1.NetTestServeResponse{Error: "invalid request"})
|
||||
return outcomeError
|
||||
}
|
||||
addr := d.insight.planeAddress(context.Background(), req.Plane)
|
||||
if addr == "" {
|
||||
respondWithJSON(d.node, msg, clusterv1.NetTestServeResponse{Error: "this node has no address on the " + req.Plane + " plane"})
|
||||
return outcomeError
|
||||
}
|
||||
if err := d.insight.server.Serve(addr, req.DurationSeconds); err != nil {
|
||||
respondWithJSON(d.node, msg, clusterv1.NetTestServeResponse{Error: err.Error()})
|
||||
return outcomeError
|
||||
}
|
||||
respondWithJSON(d.node, msg, clusterv1.NetTestServeResponse{Address: addr, Port: clusterv1.NetTestPort})
|
||||
return outcomeSuccess
|
||||
}
|
||||
|
||||
// handleNetTestRun runs the client in its own goroutine: it takes the test's
|
||||
// duration, and the subscription must keep serving other requests meanwhile.
|
||||
func (d *Daemon) handleNetTestRun(msg *nats.Msg) string {
|
||||
var req clusterv1.NetTestRunRequest
|
||||
if err := json.Unmarshal(msg.Data, &req); err != nil || !validPlane(req.Plane) ||
|
||||
req.DurationSeconds < nettest.MinDuration || req.DurationSeconds > nettest.MaxDuration ||
|
||||
req.Streams < 1 || req.Streams > nettest.MaxStreams || req.Port != clusterv1.NetTestPort {
|
||||
respondWithJSON(d.node, msg, clusterv1.NetTestRunResponse{Error: "invalid request"})
|
||||
return outcomeError
|
||||
}
|
||||
go func() {
|
||||
ctx := context.Background()
|
||||
addr, subnet := d.insight.planeSubnet(ctx, req.Plane)
|
||||
if addr == "" {
|
||||
respondWithJSON(d.node, msg, clusterv1.NetTestRunResponse{Error: "this node has no address on the " + req.Plane + " plane"})
|
||||
return
|
||||
}
|
||||
if target := net.ParseIP(req.Address); subnet == nil || target == nil || !subnet.Contains(target) {
|
||||
respondWithJSON(d.node, msg, clusterv1.NetTestRunResponse{Error: "target is outside this node's " + req.Plane + " subnet"})
|
||||
return
|
||||
}
|
||||
if !d.insight.testing.TryLock() {
|
||||
respondWithJSON(d.node, msg, clusterv1.NetTestRunResponse{Error: "a test is already running from this node"})
|
||||
return
|
||||
}
|
||||
defer d.insight.testing.Unlock()
|
||||
|
||||
res, err := nettest.Run(ctx, req, addr)
|
||||
res.LinkMbps, res.MTU = d.insight.planeLink(ctx, req.Plane)
|
||||
if err != nil {
|
||||
res.Error = err.Error()
|
||||
slog.Info("node network test failed", "plane", req.Plane, "target", req.Address, "err", err)
|
||||
}
|
||||
respondWithJSON(d.node, msg, res)
|
||||
}()
|
||||
return outcomeSuccess
|
||||
}
|
||||
|
||||
// nodeLiveSampler samples this host every period while somebody watches, as
|
||||
// the instance sampler does, and drops its ring when the lease lapses.
|
||||
type nodeLiveSampler struct {
|
||||
insight *nodeInsight
|
||||
nc *nats.Conn
|
||||
subject string
|
||||
|
||||
mu sync.Mutex
|
||||
until time.Time
|
||||
running bool
|
||||
ring []telemetryv1.NodeLiveSample
|
||||
}
|
||||
|
||||
func (d *Daemon) handleNodeLiveWatch(msg *nats.Msg) string {
|
||||
var watch telemetryv1.LiveWatch
|
||||
if len(msg.Data) > 0 {
|
||||
if err := json.Unmarshal(msg.Data, &watch); err != nil {
|
||||
return outcomeError
|
||||
}
|
||||
}
|
||||
samples := d.insight.live.watch(watch.SinceMillis)
|
||||
if msg.Reply != "" {
|
||||
data, err := json.Marshal(telemetryv1.NodeLiveRing{Samples: samples})
|
||||
if err == nil {
|
||||
_ = msg.Respond(data)
|
||||
}
|
||||
}
|
||||
return outcomeSuccess
|
||||
}
|
||||
|
||||
func (l *nodeLiveSampler) watch(sinceMillis int64) []telemetryv1.NodeLiveSample {
|
||||
l.mu.Lock()
|
||||
defer l.mu.Unlock()
|
||||
l.until = time.Now().Add(telemetryv1.LiveWatchLeaseMillis * time.Millisecond)
|
||||
if !l.running {
|
||||
l.running = true
|
||||
go l.run()
|
||||
}
|
||||
out := make([]telemetryv1.NodeLiveSample, 0, len(l.ring))
|
||||
for _, s := range l.ring {
|
||||
if s.TimeMillis > sinceMillis {
|
||||
out = append(out, s)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func (l *nodeLiveSampler) lapsed() bool {
|
||||
l.mu.Lock()
|
||||
defer l.mu.Unlock()
|
||||
if time.Now().Before(l.until) {
|
||||
return false
|
||||
}
|
||||
l.running = false
|
||||
l.ring = nil
|
||||
return true
|
||||
}
|
||||
|
||||
func (l *nodeLiveSampler) record(s telemetryv1.NodeLiveSample) {
|
||||
l.mu.Lock()
|
||||
defer l.mu.Unlock()
|
||||
if len(l.ring) == telemetryv1.LiveRingSamples {
|
||||
l.ring = append(l.ring[:0], l.ring[1:]...)
|
||||
}
|
||||
l.ring = append(l.ring, s)
|
||||
}
|
||||
|
||||
func (l *nodeLiveSampler) run() {
|
||||
ticker := time.NewTicker(telemetryv1.LiveSamplePeriodMillis * time.Millisecond)
|
||||
defer ticker.Stop()
|
||||
var prev *hostCounters
|
||||
for range ticker.C {
|
||||
if l.lapsed() {
|
||||
return
|
||||
}
|
||||
cur := readHostCounters(l.insight.env.ProcRoot, l.insight.env.SysRoot, planeNICs(l.insight.currentFacts(context.Background())))
|
||||
if prev != nil {
|
||||
if s, ok := hostRates(prev, cur); ok {
|
||||
l.record(s)
|
||||
if data, err := json.Marshal(s); err == nil {
|
||||
_ = l.nc.Publish(l.subject, data)
|
||||
}
|
||||
}
|
||||
}
|
||||
prev = cur
|
||||
}
|
||||
}
|
||||
|
||||
// planeNICs keys each set of NICs by the planes it carries, so a NIC that
|
||||
// carries lan and vpc is counted once, as "lan+vpc".
|
||||
func planeNICs(f clusterv1.NodeFacts) map[string][]string {
|
||||
byNICs := map[string][]string{}
|
||||
nics := map[string][]string{}
|
||||
for _, p := range f.Planes {
|
||||
key := strings.Join(p.NICs, ",")
|
||||
if key == "" {
|
||||
key = "bridge:" + p.Bridge
|
||||
}
|
||||
byNICs[key] = append(byNICs[key], p.Plane)
|
||||
if _, ok := nics[key]; !ok {
|
||||
if len(p.NICs) == 0 {
|
||||
nics[key] = []string{p.Bridge}
|
||||
} else {
|
||||
nics[key] = p.NICs
|
||||
}
|
||||
}
|
||||
}
|
||||
out := map[string][]string{}
|
||||
for key, planes := range byNICs {
|
||||
out[strings.Join(planes, "+")] = nics[key]
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
type nicCounters struct{ rxBytes, txBytes, rxPackets, txPackets uint64 }
|
||||
|
||||
type hostCounters struct {
|
||||
at time.Time
|
||||
busy, idle uint64
|
||||
memPercent float64
|
||||
load1 float64
|
||||
planes map[string]nicCounters
|
||||
}
|
||||
|
||||
func readHostCounters(procRoot, sysRoot string, planes map[string][]string) *hostCounters {
|
||||
c := &hostCounters{at: time.Now(), planes: map[string]nicCounters{}}
|
||||
if data, err := os.ReadFile(filepath.Join(procRoot, "stat")); err == nil {
|
||||
line, _, _ := strings.Cut(string(data), "\n")
|
||||
fields := strings.Fields(line)
|
||||
for i, f := range fields[1:] {
|
||||
v, _ := strconv.ParseUint(f, 10, 64)
|
||||
// user nice system idle iowait irq softirq steal; guest time is
|
||||
// already counted in user.
|
||||
switch {
|
||||
case i == 3 || i == 4:
|
||||
c.idle += v
|
||||
case i < 8:
|
||||
c.busy += v
|
||||
}
|
||||
}
|
||||
}
|
||||
if data, err := os.ReadFile(filepath.Join(procRoot, "meminfo")); err == nil {
|
||||
var total, avail float64
|
||||
for line := range strings.SplitSeq(string(data), "\n") {
|
||||
key, value, _ := strings.Cut(line, ":")
|
||||
fields := strings.Fields(value)
|
||||
if len(fields) == 0 {
|
||||
continue
|
||||
}
|
||||
v, _ := strconv.ParseFloat(fields[0], 64)
|
||||
switch key {
|
||||
case "MemTotal":
|
||||
total = v
|
||||
case "MemAvailable":
|
||||
avail = v
|
||||
}
|
||||
}
|
||||
if total > 0 {
|
||||
c.memPercent = (total - avail) / total * 100
|
||||
}
|
||||
}
|
||||
if data, err := os.ReadFile(filepath.Join(procRoot, "loadavg")); err == nil {
|
||||
if fields := strings.Fields(string(data)); len(fields) > 0 {
|
||||
c.load1, _ = strconv.ParseFloat(fields[0], 64)
|
||||
}
|
||||
}
|
||||
for plane, nics := range planes {
|
||||
var sum nicCounters
|
||||
for _, nic := range nics {
|
||||
read := func(name string) uint64 {
|
||||
data, err := os.ReadFile(filepath.Join(sysRoot, "class", "net", nic, "statistics", name))
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
v, _ := strconv.ParseUint(strings.TrimSpace(string(data)), 10, 64)
|
||||
return v
|
||||
}
|
||||
sum.rxBytes += read("rx_bytes")
|
||||
sum.txBytes += read("tx_bytes")
|
||||
sum.rxPackets += read("rx_packets")
|
||||
sum.txPackets += read("tx_packets")
|
||||
}
|
||||
c.planes[plane] = sum
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
func hostRates(prev, cur *hostCounters) (telemetryv1.NodeLiveSample, bool) {
|
||||
elapsed := cur.at.Sub(prev.at).Seconds()
|
||||
if elapsed <= 0 || cur.busy < prev.busy || cur.idle < prev.idle {
|
||||
return telemetryv1.NodeLiveSample{}, false
|
||||
}
|
||||
s := telemetryv1.NodeLiveSample{
|
||||
TimeMillis: cur.at.UnixMilli(),
|
||||
MemoryUsedPercent: round2(cur.memPercent),
|
||||
Load1: cur.load1,
|
||||
Planes: map[string]telemetryv1.NodeLivePlane{},
|
||||
}
|
||||
if total := float64((cur.busy - prev.busy) + (cur.idle - prev.idle)); total > 0 {
|
||||
s.CPUPercent = round2(float64(cur.busy-prev.busy) / total * 100)
|
||||
}
|
||||
rate := func(a, b uint64) float64 {
|
||||
if b < a {
|
||||
return 0
|
||||
}
|
||||
return round2(float64(b-a) / elapsed)
|
||||
}
|
||||
for plane, c := range cur.planes {
|
||||
p, ok := prev.planes[plane]
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
s.Planes[plane] = telemetryv1.NodeLivePlane{
|
||||
NetworkIn: rate(p.rxBytes, c.rxBytes), NetworkOut: rate(p.txBytes, c.txBytes),
|
||||
PacketsIn: rate(p.rxPackets, c.rxPackets), PacketsOut: rate(p.txPackets, c.txPackets),
|
||||
}
|
||||
}
|
||||
return s, true
|
||||
}
|
||||
|
||||
func round2(v float64) float64 {
|
||||
return float64(int64(v*100+0.5)) / 100
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
//test:in-package — the handlers, the plane lookups and the live sampler are
|
||||
//unexported, and the fixture seeds the cached facts directly so no test reads
|
||||
//this host's hardware.
|
||||
|
||||
package daemon
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
clusterv1 "github.com/mulgadc/spinifex/contracts/cluster/v1"
|
||||
telemetryv1 "github.com/mulgadc/spinifex/contracts/telemetry/v1"
|
||||
testutil "github.com/mulgadc/spinifex/internal/testkit"
|
||||
"github.com/nats-io/nats.go"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func insightFacts() clusterv1.NodeFacts {
|
||||
return clusterv1.NodeFacts{
|
||||
NICs: []clusterv1.NICFacts{
|
||||
{Name: "eth0", SpeedMbps: 25000},
|
||||
{Name: "eth1", SpeedMbps: 10000},
|
||||
{Name: "eth2", SpeedMbps: 1000},
|
||||
},
|
||||
Planes: []clusterv1.PlaneFacts{
|
||||
{Plane: clusterv1.PlaneLAN, Bridge: "br-lan", Address: "10.10.8.1", Prefix: 24, NICs: []string{"eth0", "eth1"}, MTU: 9000},
|
||||
{Plane: clusterv1.PlaneVPC, Bridge: "br-lan", Address: "10.10.8.1", Prefix: 24, NICs: []string{"eth0", "eth1"}, MTU: 9000},
|
||||
{Plane: clusterv1.PlaneWAN, Bridge: "br-wan", NICs: []string{"eth2"}},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func insightDaemon(t *testing.T, facts clusterv1.NodeFacts) (*Daemon, *nats.Conn) {
|
||||
t.Helper()
|
||||
_, nc, _ := testutil.StartTestJetStream(t)
|
||||
insight := newNodeInsight("node1")
|
||||
insight.facts, insight.factsAt = facts, time.Now()
|
||||
return &Daemon{node: "node1", natsConn: nc, insight: insight}, nc
|
||||
}
|
||||
|
||||
func callHandler[T any](t *testing.T, nc *nats.Conn, handler func(*nats.Msg) string, req any) T {
|
||||
t.Helper()
|
||||
subject := nats.NewInbox()
|
||||
sub, err := nc.Subscribe(subject, func(msg *nats.Msg) { handler(msg) })
|
||||
require.NoError(t, err)
|
||||
t.Cleanup(func() { _ = sub.Unsubscribe() })
|
||||
|
||||
data, err := json.Marshal(req)
|
||||
require.NoError(t, err)
|
||||
reply, err := nc.Request(subject, data, 5*time.Second)
|
||||
require.NoError(t, err)
|
||||
|
||||
var out T
|
||||
require.NoError(t, json.Unmarshal(reply.Data, &out))
|
||||
return out
|
||||
}
|
||||
|
||||
func validRun() clusterv1.NetTestRunRequest {
|
||||
return clusterv1.NetTestRunRequest{
|
||||
Plane: clusterv1.PlaneLAN, Address: "10.10.8.2", Port: clusterv1.NetTestPort,
|
||||
DurationSeconds: 5, Streams: 4,
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandleNetTestRun_RefusesTargetOutsidePlaneSubnet(t *testing.T) {
|
||||
d, nc := insightDaemon(t, insightFacts())
|
||||
|
||||
for _, target := range []string{"10.10.9.2", "8.8.8.8", "127.0.0.1", "not-an-ip", ""} {
|
||||
req := validRun()
|
||||
req.Address = target
|
||||
res := callHandler[clusterv1.NetTestRunResponse](t, nc, d.handleNetTestRun, req)
|
||||
assert.Contains(t, res.Error, "outside this node's lan subnet", "target %q", target)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandleNetTestRun_RefusesInvalidRequests(t *testing.T) {
|
||||
d, nc := insightDaemon(t, insightFacts())
|
||||
|
||||
mutations := map[string]func(*clusterv1.NetTestRunRequest){
|
||||
"unknown plane": func(r *clusterv1.NetTestRunRequest) { r.Plane = "storage" },
|
||||
"short duration": func(r *clusterv1.NetTestRunRequest) { r.DurationSeconds = 1 },
|
||||
"long duration": func(r *clusterv1.NetTestRunRequest) { r.DurationSeconds = 600 },
|
||||
"no streams": func(r *clusterv1.NetTestRunRequest) { r.Streams = 0 },
|
||||
"many streams": func(r *clusterv1.NetTestRunRequest) { r.Streams = 99 },
|
||||
"other port": func(r *clusterv1.NetTestRunRequest) { r.Port = 22 },
|
||||
}
|
||||
for name, mutate := range mutations {
|
||||
req := validRun()
|
||||
mutate(&req)
|
||||
res := callHandler[clusterv1.NetTestRunResponse](t, nc, d.handleNetTestRun, req)
|
||||
assert.Equal(t, "invalid request", res.Error, name)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandleNetTestRun_RefusesPlaneWithoutAddress(t *testing.T) {
|
||||
d, nc := insightDaemon(t, insightFacts())
|
||||
|
||||
req := validRun()
|
||||
req.Plane = clusterv1.PlaneWAN
|
||||
res := callHandler[clusterv1.NetTestRunResponse](t, nc, d.handleNetTestRun, req)
|
||||
assert.Equal(t, "this node has no address on the wan plane", res.Error)
|
||||
}
|
||||
|
||||
func TestHandleNetTestRun_OneTestPerNode(t *testing.T) {
|
||||
d, nc := insightDaemon(t, insightFacts())
|
||||
d.insight.testing.Lock()
|
||||
defer d.insight.testing.Unlock()
|
||||
|
||||
res := callHandler[clusterv1.NetTestRunResponse](t, nc, d.handleNetTestRun, validRun())
|
||||
assert.Equal(t, "a test is already running from this node", res.Error)
|
||||
}
|
||||
|
||||
func TestHandleNetTestServe_RefusesBadRequests(t *testing.T) {
|
||||
d, nc := insightDaemon(t, insightFacts())
|
||||
|
||||
res := callHandler[clusterv1.NetTestServeResponse](t, nc, d.handleNetTestServe,
|
||||
clusterv1.NetTestServeRequest{Plane: clusterv1.PlaneLAN, DurationSeconds: 600})
|
||||
assert.Equal(t, "invalid request", res.Error)
|
||||
|
||||
res = callHandler[clusterv1.NetTestServeResponse](t, nc, d.handleNetTestServe,
|
||||
clusterv1.NetTestServeRequest{Plane: clusterv1.PlaneWAN, DurationSeconds: 5})
|
||||
assert.Equal(t, "this node has no address on the wan plane", res.Error)
|
||||
assert.Zero(t, res.Port)
|
||||
}
|
||||
|
||||
func TestHandleNodeFacts_ServesCachedFacts(t *testing.T) {
|
||||
d, nc := insightDaemon(t, insightFacts())
|
||||
|
||||
got := callHandler[clusterv1.NodeFacts](t, nc, d.handleNodeFacts, struct{}{})
|
||||
assert.Equal(t, insightFacts().Planes, got.Planes)
|
||||
}
|
||||
|
||||
func TestPlaneLink_FastestNICAndMTU(t *testing.T) {
|
||||
d, _ := insightDaemon(t, insightFacts())
|
||||
|
||||
speed, mtu := d.insight.planeLink(t.Context(), clusterv1.PlaneLAN)
|
||||
assert.Equal(t, 25000, speed)
|
||||
assert.Equal(t, 9000, mtu)
|
||||
|
||||
speed, mtu = d.insight.planeLink(t.Context(), "storage")
|
||||
assert.Zero(t, speed)
|
||||
assert.Zero(t, mtu)
|
||||
}
|
||||
|
||||
func TestPlaneNICs_SharedNICsCountedOnce(t *testing.T) {
|
||||
got := planeNICs(insightFacts())
|
||||
assert.Equal(t, map[string][]string{
|
||||
"lan+vpc": {"eth0", "eth1"},
|
||||
"wan": {"eth2"},
|
||||
}, got)
|
||||
|
||||
got = planeNICs(clusterv1.NodeFacts{Planes: []clusterv1.PlaneFacts{{Plane: clusterv1.PlaneWAN, Bridge: "br-wan"}}})
|
||||
assert.Equal(t, map[string][]string{"wan": {"br-wan"}}, got)
|
||||
}
|
||||
|
||||
func writeHostTree(t *testing.T, root string, stat, rx string) {
|
||||
t.Helper()
|
||||
proc := filepath.Join(root, "proc")
|
||||
stats := filepath.Join(root, "sys", "class", "net", "eth0", "statistics")
|
||||
require.NoError(t, os.MkdirAll(proc, 0o755))
|
||||
require.NoError(t, os.MkdirAll(stats, 0o755))
|
||||
files := map[string]string{
|
||||
filepath.Join(proc, "stat"): stat,
|
||||
filepath.Join(proc, "meminfo"): "MemTotal: 1000 kB\nMemFree: 100 kB\nMemAvailable: 250 kB\n",
|
||||
filepath.Join(proc, "loadavg"): "1.50 1.00 0.50 1/100 1\n",
|
||||
filepath.Join(stats, "rx_bytes"): rx,
|
||||
filepath.Join(stats, "tx_bytes"): "0\n",
|
||||
filepath.Join(stats, "rx_packets"): "0\n",
|
||||
filepath.Join(stats, "tx_packets"): "0\n",
|
||||
}
|
||||
for path, body := range files {
|
||||
require.NoError(t, os.WriteFile(path, []byte(body), 0o600))
|
||||
}
|
||||
}
|
||||
|
||||
func TestHostRates_FromProcAndSysCounters(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
planes := map[string][]string{"lan": {"eth0", "missing0"}}
|
||||
|
||||
writeHostTree(t, root, "cpu 100 0 100 700 100 0 0 0 0 0\ncpu0 1 1 1 1\n", "1000\n")
|
||||
prev := readHostCounters(filepath.Join(root, "proc"), filepath.Join(root, "sys"), planes)
|
||||
writeHostTree(t, root, "cpu 200 0 200 1300 200 0 0 0 0 0\n", "3000\n")
|
||||
cur := readHostCounters(filepath.Join(root, "proc"), filepath.Join(root, "sys"), planes)
|
||||
cur.at = prev.at.Add(2 * time.Second)
|
||||
|
||||
s, ok := hostRates(prev, cur)
|
||||
require.True(t, ok)
|
||||
assert.InDelta(t, 22.22, s.CPUPercent, 0.01)
|
||||
assert.InDelta(t, 75.0, s.MemoryUsedPercent, 0.01)
|
||||
assert.InDelta(t, 1.5, s.Load1, 0.001)
|
||||
assert.InDelta(t, 1000.0, s.Planes["lan"].NetworkIn, 0.01)
|
||||
|
||||
_, ok = hostRates(cur, prev)
|
||||
assert.False(t, ok, "counters going backwards are a reset, not a rate")
|
||||
}
|
||||
|
||||
func TestNodeLiveSampler_RingAndLease(t *testing.T) {
|
||||
l := &nodeLiveSampler{running: true}
|
||||
for i := range telemetryv1.LiveRingSamples + 5 {
|
||||
l.record(telemetryv1.NodeLiveSample{TimeMillis: int64(i)})
|
||||
}
|
||||
require.Len(t, l.ring, telemetryv1.LiveRingSamples)
|
||||
assert.Equal(t, int64(5), l.ring[0].TimeMillis)
|
||||
|
||||
l.until = time.Now().Add(time.Minute)
|
||||
got := l.watch(int64(telemetryv1.LiveRingSamples + 2))
|
||||
assert.Len(t, got, 2)
|
||||
assert.False(t, l.lapsed())
|
||||
|
||||
l.until = time.Now().Add(-time.Second)
|
||||
assert.True(t, l.lapsed())
|
||||
assert.Empty(t, l.ring)
|
||||
assert.False(t, l.running)
|
||||
}
|
||||
|
||||
func TestHandleNodeLiveWatch_ReturnsRing(t *testing.T) {
|
||||
d, nc := insightDaemon(t, insightFacts())
|
||||
d.insight.live = &nodeLiveSampler{insight: d.insight, nc: nc, subject: nats.NewInbox(), running: true}
|
||||
d.insight.live.record(telemetryv1.NodeLiveSample{TimeMillis: 10})
|
||||
d.insight.live.record(telemetryv1.NodeLiveSample{TimeMillis: 20})
|
||||
|
||||
ring := callHandler[telemetryv1.NodeLiveRing](t, nc, d.handleNodeLiveWatch, telemetryv1.LiveWatch{SinceMillis: 10})
|
||||
require.Len(t, ring.Samples, 1)
|
||||
assert.Equal(t, int64(20), ring.Samples[0].TimeMillis)
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
// Package nettest runs one direction of a node-to-node throughput test with
|
||||
// iperf2, bound to one plane's address on each end.
|
||||
package nettest
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
clusterv1 "github.com/mulgadc/spinifex/contracts/cluster/v1"
|
||||
)
|
||||
|
||||
// Limits on one direction of a test. A request outside them is refused.
|
||||
const (
|
||||
MinDuration = 5
|
||||
MaxDuration = 30
|
||||
MaxStreams = 16
|
||||
)
|
||||
|
||||
const (
|
||||
serverGrace = 15 * time.Second
|
||||
readyTimeout = 3 * time.Second
|
||||
pingCount = 10
|
||||
)
|
||||
|
||||
var (
|
||||
iperfPaths = []string{"/usr/bin/iperf", "/usr/local/bin/iperf"}
|
||||
setprivPaths = []string{"/usr/bin/setpriv", "/bin/setpriv"}
|
||||
pingPaths = []string{"/usr/bin/ping", "/bin/ping"}
|
||||
)
|
||||
|
||||
func findTool(paths []string) string {
|
||||
for _, p := range paths {
|
||||
if _, err := os.Stat(p); err == nil {
|
||||
return p
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// ErrNoIperf is returned on a node without iperf2 installed.
|
||||
var ErrNoIperf = errors.New("iperf (version 2) is not installed on this node")
|
||||
|
||||
// unprivileged wraps a command so it runs with no capabilities. The daemon's
|
||||
// ambient capabilities would otherwise pass to a network-facing listener.
|
||||
func unprivileged(ctx context.Context, name string, args ...string) (*exec.Cmd, error) {
|
||||
setpriv := findTool(setprivPaths)
|
||||
if setpriv == "" {
|
||||
return nil, errors.New("setpriv is not installed, refusing to run a listener with the daemon's capabilities")
|
||||
}
|
||||
full := append([]string{"--inh-caps=-all", "--ambient-caps=-all", "--no-new-privs", name}, args...)
|
||||
cmd := exec.CommandContext(ctx, setpriv, full...)
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
|
||||
cmd.Cancel = func() error { return syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL) }
|
||||
return cmd, nil
|
||||
}
|
||||
|
||||
// Server is one listener; only one runs on a node at a time.
|
||||
type Server struct {
|
||||
mu sync.Mutex
|
||||
stop context.CancelFunc
|
||||
}
|
||||
|
||||
// Serve starts a one-shot iperf server on bindIP that exits after the test
|
||||
// window, and returns once it accepts connections.
|
||||
func (s *Server) Serve(bindIP string, durationSeconds int) error {
|
||||
iperf := findTool(iperfPaths)
|
||||
if iperf == "" {
|
||||
return ErrNoIperf
|
||||
}
|
||||
if net.ParseIP(bindIP) == nil {
|
||||
return fmt.Errorf("invalid bind address %q", bindIP)
|
||||
}
|
||||
window := time.Duration(durationSeconds)*time.Second + serverGrace
|
||||
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if s.stop != nil {
|
||||
s.stop()
|
||||
s.stop = nil
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), window)
|
||||
cmd, err := unprivileged(ctx, iperf, "-s", "-B", bindIP, "-p", strconv.Itoa(clusterv1.NetTestPort),
|
||||
"-t", strconv.Itoa(int(window.Seconds())))
|
||||
if err != nil {
|
||||
cancel()
|
||||
return err
|
||||
}
|
||||
if err := cmd.Start(); err != nil {
|
||||
cancel()
|
||||
return fmt.Errorf("start iperf server: %w", err)
|
||||
}
|
||||
s.stop = cancel
|
||||
go func() {
|
||||
_ = cmd.Wait()
|
||||
cancel()
|
||||
}()
|
||||
|
||||
addr := net.JoinHostPort(bindIP, strconv.Itoa(clusterv1.NetTestPort))
|
||||
deadline := time.Now().Add(readyTimeout)
|
||||
for time.Now().Before(deadline) {
|
||||
conn, err := net.DialTimeout("tcp", addr, 200*time.Millisecond)
|
||||
if err == nil {
|
||||
_ = conn.Close()
|
||||
return nil
|
||||
}
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return errors.New("iperf server exited before it was ready")
|
||||
case <-time.After(100 * time.Millisecond):
|
||||
}
|
||||
}
|
||||
return errors.New("iperf server did not start listening")
|
||||
}
|
||||
|
||||
// Stop ends a running listener, if any.
|
||||
func (s *Server) Stop() {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if s.stop != nil {
|
||||
s.stop()
|
||||
s.stop = nil
|
||||
}
|
||||
}
|
||||
|
||||
// Run is the client side: it sends to address from bindIP for the duration
|
||||
// and measures the round trip with ping beforehand, so the two never overlap.
|
||||
func Run(ctx context.Context, req clusterv1.NetTestRunRequest, bindIP string) (clusterv1.NetTestRunResponse, error) {
|
||||
out := clusterv1.NetTestRunResponse{SourceAddress: bindIP, Streams: req.Streams, Tool: "iperf2"}
|
||||
iperf := findTool(iperfPaths)
|
||||
if iperf == "" {
|
||||
return out, ErrNoIperf
|
||||
}
|
||||
if net.ParseIP(req.Address) == nil || net.ParseIP(bindIP) == nil {
|
||||
return out, errors.New("invalid address")
|
||||
}
|
||||
|
||||
if ping := findTool(pingPaths); ping != "" {
|
||||
pctx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
||||
cmd, err := unprivileged(pctx, ping, "-n", "-q", "-c", strconv.Itoa(pingCount), "-i", "0.2", "-W", "1", "-I", bindIP, req.Address)
|
||||
if err == nil {
|
||||
if data, err := cmd.Output(); err == nil || len(data) > 0 {
|
||||
out.RTTMinMillis, out.RTTAvgMillis, out.RTTMaxMillis, out.PacketLoss = parsePing(string(data))
|
||||
}
|
||||
}
|
||||
cancel()
|
||||
}
|
||||
|
||||
cctx, cancel := context.WithTimeout(ctx, time.Duration(req.DurationSeconds)*time.Second+serverGrace)
|
||||
defer cancel()
|
||||
cmd, err := unprivileged(cctx, iperf, "-c", req.Address, "-B", bindIP, "-p", strconv.Itoa(req.Port),
|
||||
"-t", strconv.Itoa(req.DurationSeconds), "-P", strconv.Itoa(req.Streams), "-y", "C")
|
||||
if err != nil {
|
||||
return out, err
|
||||
}
|
||||
data, err := cmd.Output()
|
||||
if err != nil && len(data) == 0 {
|
||||
var exit *exec.ExitError
|
||||
if errors.As(err, &exit) && len(exit.Stderr) > 0 {
|
||||
return out, fmt.Errorf("iperf: %s", strings.TrimSpace(string(exit.Stderr)))
|
||||
}
|
||||
return out, fmt.Errorf("iperf: %w", err)
|
||||
}
|
||||
if err := parseIperfCSV(string(data), &out); err != nil {
|
||||
return out, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// parseIperfCSV reads iperf2's `-y C` report. With more than one stream the
|
||||
// line whose ID is -1 is the sum; with one, the only line is.
|
||||
func parseIperfCSV(text string, out *clusterv1.NetTestRunResponse) error {
|
||||
var sum, single []string
|
||||
streams := 0
|
||||
for line := range strings.SplitSeq(strings.TrimSpace(text), "\n") {
|
||||
f := strings.Split(strings.TrimSpace(line), ",")
|
||||
if len(f) < 9 {
|
||||
continue
|
||||
}
|
||||
if f[5] == "-1" {
|
||||
sum = f
|
||||
continue
|
||||
}
|
||||
streams++
|
||||
single = f
|
||||
if bps, err := strconv.ParseFloat(f[8], 64); err == nil {
|
||||
out.StreamBPS = append(out.StreamBPS, bps)
|
||||
}
|
||||
}
|
||||
row := sum
|
||||
if row == nil {
|
||||
row = single
|
||||
}
|
||||
if row == nil {
|
||||
return errors.New("iperf printed no report")
|
||||
}
|
||||
out.Streams = streams
|
||||
out.Bytes, _ = strconv.ParseInt(row[7], 10, 64)
|
||||
out.BitsPerSecond, _ = strconv.ParseFloat(row[8], 64)
|
||||
if start, end, ok := strings.Cut(row[6], "-"); ok {
|
||||
s, _ := strconv.ParseFloat(start, 64)
|
||||
e, _ := strconv.ParseFloat(end, 64)
|
||||
out.Seconds = e - s
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// parsePing reads "x% packet loss" and "rtt min/avg/max/mdev = a/b/c/d ms".
|
||||
func parsePing(text string) (minMs, avgMs, maxMs, loss float64) {
|
||||
for line := range strings.SplitSeq(text, "\n") {
|
||||
if i := strings.Index(line, "% packet loss"); i > 0 {
|
||||
fields := strings.Fields(line[:i])
|
||||
if len(fields) > 0 {
|
||||
loss, _ = strconv.ParseFloat(fields[len(fields)-1], 64)
|
||||
}
|
||||
}
|
||||
if _, values, ok := strings.Cut(line, "= "); ok && strings.Contains(line, "min/avg/max") {
|
||||
parts := strings.Split(strings.Fields(values)[0], "/")
|
||||
if len(parts) >= 3 {
|
||||
minMs, _ = strconv.ParseFloat(parts[0], 64)
|
||||
avgMs, _ = strconv.ParseFloat(parts[1], 64)
|
||||
maxMs, _ = strconv.ParseFloat(parts[2], 64)
|
||||
}
|
||||
}
|
||||
}
|
||||
return minMs, avgMs, maxMs, loss
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package nettest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
clusterv1 "github.com/mulgadc/spinifex/contracts/cluster/v1"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// Captured from iperf 2.2.1 with -P 3 -y C.
|
||||
const threeStreams = `20261102023725,127.0.0.1,36493,127.0.0.1,5099,1,0.0-2.0,1544421440,6124843671
|
||||
20261102023725,127.0.0.1,40019,127.0.0.1,5099,3,0.0-2.0,1603665984,6361182295
|
||||
20261102023725,127.0.0.1,35431,127.0.0.1,5099,2,0.0-2.0,1424490560,5647792895
|
||||
20261102023725,127.0.0.1,0,127.0.0.1,5099,-1,0.0-2.0,4572577984,18116331744
|
||||
`
|
||||
|
||||
func TestIperfCSVTakesTheSumLine(t *testing.T) {
|
||||
var out clusterv1.NetTestRunResponse
|
||||
require.NoError(t, parseIperfCSV(threeStreams, &out))
|
||||
|
||||
assert.InDelta(t, 18116331744, out.BitsPerSecond, 1)
|
||||
assert.Equal(t, int64(4572577984), out.Bytes)
|
||||
assert.InDelta(t, 2.0, out.Seconds, 0.001)
|
||||
assert.Equal(t, 3, out.Streams)
|
||||
assert.Len(t, out.StreamBPS, 3)
|
||||
}
|
||||
|
||||
func TestIperfCSVWithOneStreamHasNoSumLine(t *testing.T) {
|
||||
var out clusterv1.NetTestRunResponse
|
||||
require.NoError(t, parseIperfCSV("20261102023725,10.0.0.1,36493,10.0.0.2,5001,3,0.0-10.0,1180000000,943718400\n", &out))
|
||||
|
||||
assert.InDelta(t, 943718400, out.BitsPerSecond, 1)
|
||||
assert.Equal(t, 1, out.Streams)
|
||||
}
|
||||
|
||||
func TestIperfCSVRefusesAnEmptyReport(t *testing.T) {
|
||||
var out clusterv1.NetTestRunResponse
|
||||
assert.Error(t, parseIperfCSV("connect failed: Connection refused\n", &out))
|
||||
}
|
||||
|
||||
func TestPingSummary(t *testing.T) {
|
||||
minMs, avgMs, maxMs, loss := parsePing(`--- 10.2.0.3 ping statistics ---
|
||||
10 packets transmitted, 9 received, 10% packet loss, time 1803ms
|
||||
rtt min/avg/max/mdev = 0.041/0.063/0.120/0.021 ms
|
||||
`)
|
||||
assert.InDelta(t, 0.041, minMs, 1e-9)
|
||||
assert.InDelta(t, 0.063, avgMs, 1e-9)
|
||||
assert.InDelta(t, 0.120, maxMs, 1e-9)
|
||||
assert.InDelta(t, 10, loss, 1e-9)
|
||||
}
|
||||
@@ -0,0 +1,401 @@
|
||||
package nodefacts
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"cmp"
|
||||
"context"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
clusterv1 "github.com/mulgadc/spinifex/contracts/cluster/v1"
|
||||
)
|
||||
|
||||
// Env is where Build reads from. Tests point the roots at fixtures.
|
||||
type Env struct {
|
||||
Dir string
|
||||
SysRoot string
|
||||
ProcRoot string
|
||||
EtcRoot string
|
||||
Node string
|
||||
Version string
|
||||
Commit string
|
||||
// LiveLLDP reads neighbours now, so a re-cabled port shows without a
|
||||
// restart. Nil or an error falls back to what Collect saved.
|
||||
LiveLLDP func(context.Context) ([]byte, error)
|
||||
// Addrs returns an interface's IPv4 addresses with their prefix lengths.
|
||||
Addrs func(iface string) []net.IPNet
|
||||
}
|
||||
|
||||
// DefaultEnv reads the live host.
|
||||
func DefaultEnv(node, version, commit string) Env {
|
||||
return Env{
|
||||
Dir: DefaultDir, SysRoot: "/sys", ProcRoot: "/proc", EtcRoot: "/etc",
|
||||
Node: node, Version: version, Commit: commit,
|
||||
LiveLLDP: liveLLDP, Addrs: interfaceAddrs,
|
||||
}
|
||||
}
|
||||
|
||||
func liveLLDP(ctx context.Context) ([]byte, error) {
|
||||
ctl := findTool(networkctlPaths)
|
||||
if ctl == "" {
|
||||
return nil, errNoFile
|
||||
}
|
||||
return run(ctx, ctl, "lldp", "--json=short")
|
||||
}
|
||||
|
||||
func interfaceAddrs(name string) []net.IPNet {
|
||||
iface, err := net.InterfaceByName(name)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
addrs, err := iface.Addrs()
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
var out []net.IPNet
|
||||
for _, a := range addrs {
|
||||
if ipn, ok := a.(*net.IPNet); ok && ipn.IP.To4() != nil {
|
||||
out = append(out, *ipn)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// Source states reported in NodeFacts.Sources.
|
||||
const (
|
||||
sourceOK = "ok"
|
||||
sourceUnavailable = "unavailable"
|
||||
)
|
||||
|
||||
// Build assembles the facts from the collected probes and live sysfs.
|
||||
func Build(ctx context.Context, env Env) clusterv1.NodeFacts {
|
||||
f := clusterv1.NodeFacts{Node: env.Node, Sources: map[string]string{}}
|
||||
if data, err := readFacts(env.Dir, fileCollected); err == nil {
|
||||
f.CollectedAt = strings.TrimSpace(string(data))
|
||||
}
|
||||
|
||||
if data, err := readFacts(env.Dir, fileIdentity); err == nil {
|
||||
f.System = parseIdentity(string(data))
|
||||
f.Sources["dmi"] = sourceOK
|
||||
} else {
|
||||
f.Sources["dmi"] = sourceUnavailable
|
||||
}
|
||||
if data, err := os.ReadFile(filepath.Join(env.ProcRoot, "device-tree", "model")); err == nil {
|
||||
f.System.DeviceModel = strings.TrimRight(string(data), "\x00\n ")
|
||||
}
|
||||
if data, err := readFacts(env.Dir, fileVirt); err == nil {
|
||||
f.Virt = strings.TrimSpace(string(data))
|
||||
}
|
||||
f.FormFactor = formFactor(f.Virt, f.System)
|
||||
|
||||
if data, err := readFacts(env.Dir, fileProcessor); err == nil {
|
||||
f.CPU = parseProcessors(string(data))
|
||||
}
|
||||
addCPUInfo(&f.CPU, env.ProcRoot)
|
||||
|
||||
if data, err := readFacts(env.Dir, fileMemory); err == nil {
|
||||
f.Memory = parseMemory(string(data))
|
||||
}
|
||||
addMeminfo(&f.Memory, env.ProcRoot)
|
||||
|
||||
f.OS = osFacts(env)
|
||||
|
||||
neighbours, lldpState := lldpNeighbours(ctx, env)
|
||||
f.Sources["lldp"] = lldpState
|
||||
f.NICs = nicFacts(env, neighbours)
|
||||
f.Planes = planeFacts(env, f.NICs)
|
||||
for i := range f.NICs {
|
||||
for _, p := range f.Planes {
|
||||
if slices.Contains(p.NICs, f.NICs[i].Name) {
|
||||
f.NICs[i].Planes = append(f.NICs[i].Planes, p.Plane)
|
||||
}
|
||||
}
|
||||
}
|
||||
return f
|
||||
}
|
||||
|
||||
// formFactor decides the picture the console draws. A hypervisor wins over
|
||||
// whatever chassis the virtual firmware claims.
|
||||
func formFactor(virt string, s clusterv1.SystemFacts) string {
|
||||
model := strings.ToLower(s.DeviceModel)
|
||||
switch {
|
||||
case virt != "" && virt != "none":
|
||||
return "virtual-machine"
|
||||
case strings.Contains(model, "raspberry pi"):
|
||||
return "sbc"
|
||||
case strings.Contains(model, "jetson"):
|
||||
return "jetson"
|
||||
}
|
||||
switch strings.ToLower(s.ChassisType) {
|
||||
case "rack mount chassis", "blade", "blade enclosure", "multi-system", "main server chassis":
|
||||
return "rack-server"
|
||||
case "tower", "mini tower", "desktop", "low profile desktop", "space-saving", "all in one":
|
||||
return "tower"
|
||||
case "mini pc", "compact pci", "embedded pc", "sub chassis", "stick pc":
|
||||
return "sbc"
|
||||
}
|
||||
if model != "" {
|
||||
return "sbc"
|
||||
}
|
||||
return "unknown"
|
||||
}
|
||||
|
||||
// addCPUInfo fills what DMI cannot tell a VM, and the features worth naming.
|
||||
func addCPUInfo(c *clusterv1.CPUFacts, procRoot string) {
|
||||
data, err := os.ReadFile(filepath.Join(procRoot, "cpuinfo"))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var (
|
||||
model string
|
||||
flags []string
|
||||
threads int
|
||||
socket string
|
||||
sockets = map[string]bool{}
|
||||
cores = map[string]bool{}
|
||||
)
|
||||
sc := bufio.NewScanner(bytes.NewReader(data))
|
||||
sc.Buffer(make([]byte, 64*1024), 1024*1024)
|
||||
for sc.Scan() {
|
||||
key, value, ok := strings.Cut(sc.Text(), ":")
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
key, value = strings.TrimSpace(key), strings.TrimSpace(value)
|
||||
switch key {
|
||||
case "processor":
|
||||
threads++
|
||||
case "model name":
|
||||
model = value
|
||||
case "physical id":
|
||||
socket = value
|
||||
sockets[value] = true
|
||||
case "core id":
|
||||
cores[socket+"/"+value] = true
|
||||
case "flags", "Features": // ARM names the same list Features
|
||||
if flags == nil {
|
||||
flags = strings.Fields(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
if model != "" {
|
||||
c.Model = strings.Join(strings.Fields(model), " ")
|
||||
}
|
||||
if c.Threads == 0 {
|
||||
c.Threads = threads
|
||||
}
|
||||
if c.Sockets == 0 {
|
||||
c.Sockets = max(len(sockets), 1)
|
||||
}
|
||||
if c.Cores == 0 {
|
||||
c.Cores = cmp.Or(len(cores), threads)
|
||||
}
|
||||
switch {
|
||||
case slices.Contains(flags, "svm"):
|
||||
c.Virtualization = "AMD-V"
|
||||
case slices.Contains(flags, "vmx"):
|
||||
c.Virtualization = "VT-x"
|
||||
}
|
||||
c.Flags = flags
|
||||
for _, want := range []string{"avx512f", "avx2", "aes", "sev", "sme"} {
|
||||
if slices.Contains(flags, want) {
|
||||
c.Features = append(c.Features, want)
|
||||
}
|
||||
}
|
||||
if runtime.GOARCH == "arm64" && c.Model == "" {
|
||||
c.Model = "ARM64"
|
||||
}
|
||||
}
|
||||
|
||||
func addMeminfo(m *clusterv1.MemoryFacts, procRoot string) {
|
||||
data, err := os.ReadFile(filepath.Join(procRoot, "meminfo"))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
for line := range strings.SplitSeq(string(data), "\n") {
|
||||
key, value, ok := strings.Cut(line, ":")
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
kb, err := strconv.ParseUint(strings.Fields(value + " 0")[0], 10, 64)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "MemTotal":
|
||||
m.OSTotalBytes = kb << 10
|
||||
case "MemAvailable":
|
||||
m.OSAvailBytes = kb << 10
|
||||
case "Hugetlb":
|
||||
m.HugePageBytes = kb << 10
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func osFacts(env Env) clusterv1.OSFacts {
|
||||
o := clusterv1.OSFacts{Arch: runtime.GOARCH, Version: env.Version, Commit: env.Commit}
|
||||
if data, err := os.ReadFile(filepath.Join(env.EtcRoot, "os-release")); err == nil {
|
||||
for line := range strings.SplitSeq(string(data), "\n") {
|
||||
if v, ok := strings.CutPrefix(line, "PRETTY_NAME="); ok {
|
||||
o.Name = strings.Trim(v, `"`)
|
||||
}
|
||||
}
|
||||
}
|
||||
if data, err := os.ReadFile(filepath.Join(env.ProcRoot, "sys", "kernel", "osrelease")); err == nil {
|
||||
o.Kernel = strings.TrimSpace(string(data))
|
||||
}
|
||||
if data, err := os.ReadFile(filepath.Join(env.ProcRoot, "uptime")); err == nil {
|
||||
if fields := strings.Fields(string(data)); len(fields) > 0 {
|
||||
secs, _ := strconv.ParseFloat(fields[0], 64)
|
||||
o.UptimeSeconds = int64(secs)
|
||||
}
|
||||
}
|
||||
if data, err := os.ReadFile(filepath.Join(env.ProcRoot, "sys", "kernel", "hostname")); err == nil {
|
||||
o.Hostname = strings.TrimSpace(string(data))
|
||||
}
|
||||
return o
|
||||
}
|
||||
|
||||
// lldpNeighbours prefers a live read and falls back to the start-up probe.
|
||||
func lldpNeighbours(ctx context.Context, env Env) (map[string]clusterv1.LLDPNeighbor, string) {
|
||||
if env.LiveLLDP != nil {
|
||||
if data, err := env.LiveLLDP(ctx); err == nil {
|
||||
if n, err := parseLLDP(data); err == nil {
|
||||
return n, sourceOK
|
||||
}
|
||||
}
|
||||
}
|
||||
data, err := readFacts(env.Dir, fileLLDP)
|
||||
if err != nil {
|
||||
return nil, sourceUnavailable
|
||||
}
|
||||
n, err := parseLLDP(data)
|
||||
if err != nil {
|
||||
return nil, sourceUnavailable
|
||||
}
|
||||
return n, sourceOK
|
||||
}
|
||||
|
||||
func readSys(sysRoot, nic, name string) string {
|
||||
data, err := os.ReadFile(filepath.Join(sysRoot, "class", "net", nic, name))
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return strings.TrimSpace(string(data))
|
||||
}
|
||||
|
||||
func nicFacts(env Env, neighbours map[string]clusterv1.LLDPNeighbor) []clusterv1.NICFacts {
|
||||
var out []clusterv1.NICFacts
|
||||
for _, name := range physicalNICs(env.SysRoot) {
|
||||
n := clusterv1.NICFacts{
|
||||
Name: name,
|
||||
MAC: readSys(env.SysRoot, name, "address"),
|
||||
State: readSys(env.SysRoot, name, "operstate"),
|
||||
}
|
||||
n.MTU, _ = strconv.Atoi(readSys(env.SysRoot, name, "mtu"))
|
||||
if speed, err := strconv.Atoi(readSys(env.SysRoot, name, "speed")); err == nil && speed > 0 {
|
||||
n.SpeedMbps = speed
|
||||
}
|
||||
if target, err := os.Readlink(filepath.Join(env.SysRoot, "class", "net", name, "master")); err == nil {
|
||||
n.Master = filepath.Base(target)
|
||||
}
|
||||
if data, err := readFacts(env.Dir, nicPrefix+name+".txt"); err == nil {
|
||||
e := parseEthtool(string(data))
|
||||
n.Driver, n.Firmware, n.BusInfo, n.Duplex, n.Port = e.driver, e.firmware, e.busInfo, e.duplex, e.port
|
||||
n.MaxMbps = e.maxMbps
|
||||
if n.SpeedMbps == 0 {
|
||||
n.SpeedMbps = e.speedMbps
|
||||
}
|
||||
n.Model = parseUdevModel(string(data))
|
||||
if br := ovsBridge(string(data)); br != "" && (n.Master == "" || n.Master == "ovs-system") {
|
||||
n.Master = br
|
||||
}
|
||||
}
|
||||
if n.Driver == "" {
|
||||
if target, err := os.Readlink(filepath.Join(env.SysRoot, "class", "net", name, "device", "driver")); err == nil {
|
||||
n.Driver = filepath.Base(target)
|
||||
}
|
||||
}
|
||||
if nb, ok := neighbours[name]; ok {
|
||||
n.Neighbor = &nb
|
||||
}
|
||||
out = append(out, n)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func ovsBridge(text string) string {
|
||||
for line := range strings.SplitSeq(text, "\n") {
|
||||
if v, ok := strings.CutPrefix(strings.TrimSpace(line), "OVS_BRIDGE="); ok {
|
||||
return v
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// planeFacts finds each plane's bridge and address. A host without br-vpc
|
||||
// carries the overlay on whichever bridge holds the encap address.
|
||||
func planeFacts(env Env, nics []clusterv1.NICFacts) []clusterv1.PlaneFacts {
|
||||
addrs := env.Addrs
|
||||
if addrs == nil {
|
||||
addrs = func(string) []net.IPNet { return nil }
|
||||
}
|
||||
var encap string
|
||||
if data, err := readFacts(env.Dir, fileEncapIP); err == nil {
|
||||
encap = strings.TrimSpace(string(data))
|
||||
}
|
||||
|
||||
bridges := map[string]string{
|
||||
clusterv1.PlaneWAN: "br-wan",
|
||||
clusterv1.PlaneLAN: "br-lan",
|
||||
clusterv1.PlaneVPC: "br-vpc",
|
||||
}
|
||||
if encap != "" {
|
||||
if br := bridgeHolding(encap, addrs); br != "" {
|
||||
bridges[clusterv1.PlaneVPC] = br
|
||||
}
|
||||
}
|
||||
|
||||
var out []clusterv1.PlaneFacts
|
||||
for _, plane := range []string{clusterv1.PlaneWAN, clusterv1.PlaneLAN, clusterv1.PlaneVPC} {
|
||||
br := bridges[plane]
|
||||
if _, err := os.Stat(filepath.Join(env.SysRoot, "class", "net", br)); err != nil {
|
||||
continue
|
||||
}
|
||||
p := clusterv1.PlaneFacts{Plane: plane, Bridge: br}
|
||||
p.MTU, _ = strconv.Atoi(readSys(env.SysRoot, br, "mtu"))
|
||||
list := addrs(br)
|
||||
for _, a := range list {
|
||||
if plane == clusterv1.PlaneVPC && encap != "" && a.IP.String() != encap {
|
||||
continue
|
||||
}
|
||||
ones, _ := a.Mask.Size()
|
||||
p.Address, p.Prefix = a.IP.String(), ones
|
||||
break
|
||||
}
|
||||
for _, n := range nics {
|
||||
if n.Master == br {
|
||||
p.NICs = append(p.NICs, n.Name)
|
||||
}
|
||||
}
|
||||
out = append(out, p)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func bridgeHolding(ip string, addrs func(string) []net.IPNet) string {
|
||||
for _, br := range []string{"br-vpc", "br-lan", "br-wan"} {
|
||||
for _, a := range addrs(br) {
|
||||
if a.IP.String() == ip {
|
||||
return br
|
||||
}
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
// Package nodefacts describes a node's hardware, OS and cabling for the
|
||||
// operator console. The root-only probes run once at daemon start through
|
||||
// Collect; Build reads their output and adds what sysfs reports live.
|
||||
package nodefacts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"os"
|
||||
"os/exec"
|
||||
"os/user"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
// DefaultDir is where Collect writes and Build reads.
|
||||
const DefaultDir = "/etc/spinifex/node-facts"
|
||||
|
||||
const probeTimeout = 10 * time.Second
|
||||
|
||||
// Raw probe files under the facts directory.
|
||||
const (
|
||||
fileIdentity = "dmi-identity.txt"
|
||||
fileProcessor = "dmi-processor.txt"
|
||||
fileMemory = "dmi-memory.txt"
|
||||
fileVirt = "virt.txt"
|
||||
fileLLDP = "lldp.json"
|
||||
fileEncapIP = "ovn-encap-ip.txt"
|
||||
fileCollected = "collected-at.txt"
|
||||
nicPrefix = "nic-"
|
||||
)
|
||||
|
||||
// Tools are looked up by absolute path: /usr/sbin is not on a service's PATH.
|
||||
var (
|
||||
dmidecodePaths = []string{"/usr/sbin/dmidecode", "/sbin/dmidecode"}
|
||||
ethtoolPaths = []string{"/usr/sbin/ethtool", "/sbin/ethtool"}
|
||||
networkctlPaths = []string{"/usr/bin/networkctl", "/bin/networkctl"}
|
||||
ovsVsctlPaths = []string{"/usr/bin/ovs-vsctl", "/usr/sbin/ovs-vsctl"}
|
||||
udevadmPaths = []string{"/usr/bin/udevadm", "/bin/udevadm"}
|
||||
detectVirtPaths = []string{"/usr/bin/systemd-detect-virt", "/bin/systemd-detect-virt"}
|
||||
)
|
||||
|
||||
func findTool(paths []string) string {
|
||||
for _, p := range paths {
|
||||
if info, err := os.Stat(p); err == nil && info.Mode().IsRegular() {
|
||||
return p
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Collect runs the probes that need root and writes their raw output under
|
||||
// dir, readable by the spinifex group. A probe that fails leaves no file, so
|
||||
// Build reports that source as unavailable rather than stopping the daemon.
|
||||
func Collect(ctx context.Context, dir, sysRoot string) error {
|
||||
if err := os.MkdirAll(dir, 0o750); err != nil {
|
||||
return fmt.Errorf("create %s: %w", dir, err)
|
||||
}
|
||||
gid := spinifexGID()
|
||||
if gid >= 0 {
|
||||
_ = os.Chown(dir, 0, gid)
|
||||
}
|
||||
write := func(name string, data []byte) {
|
||||
if err := writeFile(dir, name, data, gid); err != nil {
|
||||
slog.Warn("node-facts: write failed", "file", name, "err", err)
|
||||
}
|
||||
}
|
||||
|
||||
if dmi := findTool(dmidecodePaths); dmi != "" {
|
||||
for name, args := range map[string][]string{
|
||||
fileIdentity: {"-t", "bios", "-t", "system", "-t", "chassis", "-t", "baseboard"},
|
||||
fileProcessor: {"-t", "processor"},
|
||||
fileMemory: {"-t", "memory"},
|
||||
} {
|
||||
if out, err := run(ctx, dmi, args...); err == nil {
|
||||
write(name, out)
|
||||
} else {
|
||||
slog.Info("node-facts: dmidecode unavailable", "type", name, "err", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if virt := findTool(detectVirtPaths); virt != "" {
|
||||
// Exits 1 on bare metal while printing "none", so the output counts.
|
||||
out, _ := run(ctx, virt)
|
||||
write(fileVirt, out)
|
||||
}
|
||||
|
||||
if ctl := findTool(networkctlPaths); ctl != "" {
|
||||
if out, err := run(ctx, ctl, "lldp", "--json=short"); err == nil {
|
||||
write(fileLLDP, out)
|
||||
}
|
||||
}
|
||||
|
||||
if vsctl := findTool(ovsVsctlPaths); vsctl != "" {
|
||||
if out, err := run(ctx, vsctl, "get", "Open_vSwitch", ".", "external_ids:ovn-encap-ip"); err == nil {
|
||||
write(fileEncapIP, []byte(strings.Trim(strings.TrimSpace(string(out)), `"`)))
|
||||
}
|
||||
}
|
||||
|
||||
ethtool, udevadm, vsctl := findTool(ethtoolPaths), findTool(udevadmPaths), findTool(ovsVsctlPaths)
|
||||
for _, nic := range physicalNICs(sysRoot) {
|
||||
var b strings.Builder
|
||||
if ethtool != "" {
|
||||
out, _ := run(ctx, ethtool, nic)
|
||||
b.Write(out)
|
||||
out, _ = run(ctx, ethtool, "-i", nic)
|
||||
b.Write(out)
|
||||
}
|
||||
if udevadm != "" {
|
||||
out, _ := run(ctx, udevadm, "info", "--query=property", "--path=/sys/class/net/"+nic)
|
||||
b.Write(out)
|
||||
}
|
||||
if vsctl != "" {
|
||||
if out, err := run(ctx, vsctl, "iface-to-br", nic); err == nil {
|
||||
fmt.Fprintf(&b, "OVS_BRIDGE=%s\n", strings.TrimSpace(string(out)))
|
||||
}
|
||||
}
|
||||
write(nicPrefix+nic+".txt", []byte(b.String()))
|
||||
}
|
||||
|
||||
write(fileCollected, []byte(time.Now().UTC().Format(time.RFC3339)))
|
||||
return nil
|
||||
}
|
||||
|
||||
func run(ctx context.Context, name string, args ...string) ([]byte, error) {
|
||||
ctx, cancel := context.WithTimeout(ctx, probeTimeout)
|
||||
defer cancel()
|
||||
out, err := exec.CommandContext(ctx, name, args...).Output()
|
||||
if err != nil && len(out) == 0 {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// writeFile replaces dir/name atomically. The files carry serial numbers, so
|
||||
// they are root-owned and readable only by the spinifex group.
|
||||
func writeFile(dir, name string, data []byte, gid int) error {
|
||||
tmp, err := os.CreateTemp(dir, "."+name+".*")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() { _ = os.Remove(tmp.Name()) }()
|
||||
if _, err := tmp.Write(data); err != nil {
|
||||
_ = tmp.Close()
|
||||
return err
|
||||
}
|
||||
if err := tmp.Chmod(0o640); err != nil {
|
||||
_ = tmp.Close()
|
||||
return err
|
||||
}
|
||||
if gid >= 0 {
|
||||
_ = tmp.Chown(0, gid)
|
||||
}
|
||||
if err := tmp.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
return os.Rename(tmp.Name(), filepath.Join(dir, name))
|
||||
}
|
||||
|
||||
func spinifexGID() int {
|
||||
g, err := user.LookupGroup("spinifex")
|
||||
if err != nil {
|
||||
return -1
|
||||
}
|
||||
gid, err := strconv.Atoi(g.Gid)
|
||||
if err != nil {
|
||||
return -1
|
||||
}
|
||||
return gid
|
||||
}
|
||||
|
||||
// physicalNICs lists interfaces backed by a device, which leaves out bridges,
|
||||
// taps, veths and VLANs.
|
||||
func physicalNICs(sysRoot string) []string {
|
||||
entries, err := os.ReadDir(filepath.Join(sysRoot, "class", "net"))
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
var out []string
|
||||
for _, e := range entries {
|
||||
base := filepath.Join(sysRoot, "class", "net", e.Name())
|
||||
if _, err := os.Stat(filepath.Join(base, "device")); err != nil {
|
||||
continue
|
||||
}
|
||||
// A VF or an SR-IOV representor still has a device; its phys_port_name
|
||||
// marks it, and it is not cabled to anything.
|
||||
if name, err := os.ReadFile(filepath.Join(base, "phys_port_name")); err == nil && strings.HasPrefix(strings.TrimSpace(string(name)), "pf") {
|
||||
continue
|
||||
}
|
||||
out = append(out, e.Name())
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
var errNoFile = errors.New("not collected")
|
||||
|
||||
func readFacts(dir, name string) ([]byte, error) {
|
||||
data, err := os.ReadFile(filepath.Join(dir, name))
|
||||
if errors.Is(err, os.ErrNotExist) {
|
||||
return nil, errNoFile
|
||||
}
|
||||
return data, err
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
package nodefacts
|
||||
|
||||
import (
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
clusterv1 "github.com/mulgadc/spinifex/contracts/cluster/v1"
|
||||
)
|
||||
|
||||
// dmiBlock is one structure from dmidecode's text output: its title line and
|
||||
// its "Key: value" fields. Indented list items are folded under their key.
|
||||
type dmiBlock struct {
|
||||
title string
|
||||
fields map[string]string
|
||||
lists map[string][]string
|
||||
}
|
||||
|
||||
func (b dmiBlock) get(key string) string {
|
||||
return cleanDMI(b.fields[key])
|
||||
}
|
||||
|
||||
// parseDMI splits dmidecode output into its structures, in order.
|
||||
func parseDMI(text string) []dmiBlock {
|
||||
var (
|
||||
blocks []dmiBlock
|
||||
cur *dmiBlock
|
||||
listKey string
|
||||
)
|
||||
flush := func() {
|
||||
if cur != nil {
|
||||
blocks = append(blocks, *cur)
|
||||
cur = nil
|
||||
}
|
||||
}
|
||||
for line := range strings.SplitSeq(text, "\n") {
|
||||
line = strings.TrimRight(line, " \r")
|
||||
switch {
|
||||
case line == "" || strings.HasPrefix(line, "Handle ") || strings.HasPrefix(line, "#"):
|
||||
flush()
|
||||
listKey = ""
|
||||
case !strings.HasPrefix(line, "\t"):
|
||||
if strings.HasPrefix(line, "SMBIOS ") || strings.HasPrefix(line, "Getting SMBIOS") {
|
||||
continue
|
||||
}
|
||||
flush()
|
||||
cur = &dmiBlock{title: line, fields: map[string]string{}, lists: map[string][]string{}}
|
||||
listKey = ""
|
||||
case cur == nil:
|
||||
case strings.HasPrefix(line, "\t\t"):
|
||||
if listKey != "" {
|
||||
cur.lists[listKey] = append(cur.lists[listKey], strings.TrimSpace(line))
|
||||
}
|
||||
default:
|
||||
key, value, _ := strings.Cut(strings.TrimSpace(line), ":")
|
||||
key, value = strings.TrimSpace(key), strings.TrimSpace(value)
|
||||
cur.fields[key] = value
|
||||
listKey = ""
|
||||
if value == "" {
|
||||
listKey = key
|
||||
}
|
||||
}
|
||||
}
|
||||
flush()
|
||||
return blocks
|
||||
}
|
||||
|
||||
func blocksTitled(blocks []dmiBlock, title string) []dmiBlock {
|
||||
var out []dmiBlock
|
||||
for _, b := range blocks {
|
||||
if b.title == title {
|
||||
out = append(out, b)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// placeholders are the values firmware writes when a field was never filled.
|
||||
var placeholders = map[string]bool{
|
||||
"": true, "unknown": true, "not specified": true, "not present": true, "none": true,
|
||||
"to be filled by o.e.m.": true, "default string": true, "system serial number": true,
|
||||
"system product name": true, "system manufacturer": true, "o.e.m.": true, "oem": true,
|
||||
"0123456789": true, "123456789": true, "no asset tag": true, "chassis serial number": true,
|
||||
"base board serial number": true, "not settable": true, "unknown unknown": true,
|
||||
"03000200-0400-0500-0006-000700080009": true,
|
||||
}
|
||||
|
||||
// cleanDMI trims a DMI value and drops the placeholders firmware ships with.
|
||||
func cleanDMI(v string) string {
|
||||
v = strings.TrimSpace(v)
|
||||
lower := strings.ToLower(v)
|
||||
if placeholders[lower] || strings.HasSuffix(lower, "_assettag") || strings.Trim(lower, "0") == "" {
|
||||
return ""
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
// parseIdentity reads the bios, system, chassis and baseboard structures.
|
||||
func parseIdentity(text string) clusterv1.SystemFacts {
|
||||
blocks := parseDMI(text)
|
||||
var s clusterv1.SystemFacts
|
||||
if b := blocksTitled(blocks, "BIOS Information"); len(b) > 0 {
|
||||
s.BIOSVendor, s.BIOSVersion, s.BIOSDate = b[0].get("Vendor"), b[0].get("Version"), b[0].get("Release Date")
|
||||
}
|
||||
if b := blocksTitled(blocks, "System Information"); len(b) > 0 {
|
||||
s.Vendor, s.Product, s.Family = b[0].get("Manufacturer"), b[0].get("Product Name"), b[0].get("Family")
|
||||
s.Version, s.Serial, s.UUID = b[0].get("Version"), b[0].get("Serial Number"), b[0].get("UUID")
|
||||
}
|
||||
if b := blocksTitled(blocks, "Chassis Information"); len(b) > 0 {
|
||||
s.ChassisType, s.ChassisAsset = b[0].get("Type"), b[0].get("Asset Tag")
|
||||
}
|
||||
if b := blocksTitled(blocks, "Base Board Information"); len(b) > 0 {
|
||||
s.BoardVendor, s.BoardProduct, s.BoardSerial = b[0].get("Manufacturer"), b[0].get("Product Name"), b[0].get("Serial Number")
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// parseProcessors summarises the populated sockets.
|
||||
func parseProcessors(text string) clusterv1.CPUFacts {
|
||||
var c clusterv1.CPUFacts
|
||||
for _, b := range blocksTitled(parseDMI(text), "Processor Information") {
|
||||
if !strings.HasPrefix(b.fields["Status"], "Populated") {
|
||||
continue
|
||||
}
|
||||
c.Sockets++
|
||||
if c.Model == "" {
|
||||
c.Model = strings.Join(strings.Fields(b.get("Version")), " ")
|
||||
c.Vendor = b.get("Manufacturer")
|
||||
}
|
||||
cores, _ := strconv.Atoi(b.fields["Core Count"])
|
||||
threads, _ := strconv.Atoi(b.fields["Thread Count"])
|
||||
c.Cores += cores
|
||||
c.Threads += threads
|
||||
c.CoresPerSocket = max(c.CoresPerSocket, cores)
|
||||
c.MaxMHz = max(c.MaxMHz, atoiPrefix(b.fields["Max Speed"]))
|
||||
c.CurrentMHz = max(c.CurrentMHz, atoiPrefix(b.fields["Current Speed"]))
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
// memoryKey is everything a DIMM is grouped by.
|
||||
type memoryKey struct {
|
||||
size uint64
|
||||
typ, detail, form, maker, part, rank string
|
||||
speed, configured int
|
||||
}
|
||||
|
||||
// parseMemory groups the populated DIMMs and counts the slots of every array.
|
||||
func parseMemory(text string) clusterv1.MemoryFacts {
|
||||
var m clusterv1.MemoryFacts
|
||||
blocks := parseDMI(text)
|
||||
for _, b := range blocksTitled(blocks, "Physical Memory Array") {
|
||||
if b.fields["Use"] != "System Memory" {
|
||||
continue
|
||||
}
|
||||
if m.MaxCapacity == "" {
|
||||
m.MaxCapacity = b.get("Maximum Capacity")
|
||||
}
|
||||
if m.ECC == "" {
|
||||
m.ECC = b.get("Error Correction Type")
|
||||
}
|
||||
}
|
||||
|
||||
groups := map[memoryKey]*clusterv1.MemoryGroup{}
|
||||
var order []memoryKey
|
||||
for _, b := range blocksTitled(blocks, "Memory Device") {
|
||||
m.SlotsTotal++
|
||||
size := parseSize(b.fields["Size"])
|
||||
if size == 0 {
|
||||
continue
|
||||
}
|
||||
m.SlotsUsed++
|
||||
m.TotalBytes += size
|
||||
k := memoryKey{
|
||||
size: size, typ: b.get("Type"), detail: b.get("Type Detail"), form: b.get("Form Factor"),
|
||||
maker: b.get("Manufacturer"), part: b.get("Part Number"), rank: b.get("Rank"),
|
||||
speed: atoiPrefix(b.fields["Speed"]), configured: atoiPrefix(b.fields["Configured Memory Speed"]),
|
||||
}
|
||||
g, ok := groups[k]
|
||||
if !ok {
|
||||
g = &clusterv1.MemoryGroup{
|
||||
SizeBytes: size, Type: k.typ, TypeDetail: k.detail, FormFactor: k.form,
|
||||
SpeedMTs: k.speed, ConfiguredMTs: k.configured, Manufacturer: k.maker,
|
||||
PartNumber: k.part, Rank: k.rank,
|
||||
}
|
||||
groups[k] = g
|
||||
order = append(order, k)
|
||||
}
|
||||
g.Count++
|
||||
if serial := b.get("Serial Number"); serial != "" {
|
||||
g.Serials = append(g.Serials, serial)
|
||||
}
|
||||
}
|
||||
for _, k := range order {
|
||||
m.Groups = append(m.Groups, *groups[k])
|
||||
}
|
||||
slices.SortStableFunc(m.Groups, func(a, b clusterv1.MemoryGroup) int { return b.Count - a.Count })
|
||||
return m
|
||||
}
|
||||
|
||||
// parseSize reads a DMI size such as "16 GB" or "4096 MB"; anything else,
|
||||
// including "No Module Installed", is zero.
|
||||
func parseSize(v string) uint64 {
|
||||
fields := strings.Fields(v)
|
||||
if len(fields) != 2 {
|
||||
return 0
|
||||
}
|
||||
n, err := strconv.ParseUint(fields[0], 10, 64)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
switch fields[1] {
|
||||
case "kB", "KB":
|
||||
return n << 10
|
||||
case "MB":
|
||||
return n << 20
|
||||
case "GB":
|
||||
return n << 30
|
||||
case "TB":
|
||||
return n << 40
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// atoiPrefix reads the leading integer of a value such as "3675 MHz".
|
||||
func atoiPrefix(v string) int {
|
||||
fields := strings.Fields(v)
|
||||
if len(fields) == 0 {
|
||||
return 0
|
||||
}
|
||||
n, _ := strconv.Atoi(fields[0])
|
||||
return n
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package nodefacts
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
clusterv1 "github.com/mulgadc/spinifex/contracts/cluster/v1"
|
||||
)
|
||||
|
||||
// ethtoolFacts is what `ethtool <if>` and `ethtool -i <if>` add to sysfs.
|
||||
type ethtoolFacts struct {
|
||||
speedMbps int
|
||||
maxMbps int
|
||||
duplex string
|
||||
port string
|
||||
driver string
|
||||
firmware string
|
||||
busInfo string
|
||||
}
|
||||
|
||||
var linkModeSpeed = regexp.MustCompile(`\b(\d+)base`)
|
||||
|
||||
// parseEthtool reads both outputs, concatenated in either order.
|
||||
func parseEthtool(text string) ethtoolFacts {
|
||||
var e ethtoolFacts
|
||||
inSupported := false
|
||||
for line := range strings.SplitSeq(text, "\n") {
|
||||
trimmed := strings.TrimSpace(line)
|
||||
key, value, hasColon := strings.Cut(trimmed, ":")
|
||||
value = strings.TrimSpace(value)
|
||||
if hasColon && !strings.Contains(key, "base") {
|
||||
inSupported = key == "Supported link modes"
|
||||
}
|
||||
if inSupported {
|
||||
for _, m := range linkModeSpeed.FindAllStringSubmatch(trimmed, -1) {
|
||||
if n, err := strconv.Atoi(m[1]); err == nil {
|
||||
e.maxMbps = max(e.maxMbps, n)
|
||||
}
|
||||
}
|
||||
}
|
||||
if !hasColon {
|
||||
continue
|
||||
}
|
||||
switch key {
|
||||
case "Speed":
|
||||
e.speedMbps = atoiPrefix(strings.TrimSuffix(value, "Mb/s"))
|
||||
case "Duplex":
|
||||
if value != "Unknown! (255)" {
|
||||
e.duplex = value
|
||||
}
|
||||
case "Port":
|
||||
if value != "Other" {
|
||||
e.port = value
|
||||
}
|
||||
case "driver":
|
||||
e.driver = value
|
||||
case "firmware-version":
|
||||
e.firmware = value
|
||||
case "bus-info":
|
||||
e.busInfo = value
|
||||
}
|
||||
}
|
||||
return e
|
||||
}
|
||||
|
||||
// parseUdevModel reads the hwdb vendor and model from `udevadm info` output.
|
||||
func parseUdevModel(text string) string {
|
||||
var vendor, model string
|
||||
for line := range strings.SplitSeq(text, "\n") {
|
||||
key, value, _ := strings.Cut(strings.TrimSpace(line), "=")
|
||||
switch key {
|
||||
case "ID_VENDOR_FROM_DATABASE":
|
||||
vendor = value
|
||||
case "ID_MODEL_FROM_DATABASE":
|
||||
model = value
|
||||
}
|
||||
}
|
||||
vendor = strings.TrimSuffix(strings.TrimSuffix(vendor, " Corporation"), " Technologies")
|
||||
switch {
|
||||
case model == "":
|
||||
return vendor
|
||||
case vendor == "":
|
||||
return model
|
||||
}
|
||||
return vendor + " " + model
|
||||
}
|
||||
|
||||
// lldpCapabilityNames are the IEEE 802.1AB system capability bits.
|
||||
var lldpCapabilityNames = []string{"other", "repeater", "bridge", "wlan-ap", "router", "telephone", "docsis", "station"}
|
||||
|
||||
type networkctlLLDP struct {
|
||||
Neighbors []struct {
|
||||
InterfaceName string `json:"InterfaceName"`
|
||||
Neighbors []struct {
|
||||
ChassisID string `json:"ChassisID"`
|
||||
PortID string `json:"PortID"`
|
||||
PortDescription string `json:"PortDescription"`
|
||||
SystemName string `json:"SystemName"`
|
||||
SystemDescription string `json:"SystemDescription"`
|
||||
EnabledCapabilities int `json:"EnabledCapabilities"`
|
||||
} `json:"Neighbors"`
|
||||
} `json:"Neighbors"`
|
||||
}
|
||||
|
||||
// parseLLDP reads `networkctl lldp --json=short` into the first neighbour of
|
||||
// each interface. A NIC sees one switch port, so a second is a hub or a loop.
|
||||
func parseLLDP(data []byte) (map[string]clusterv1.LLDPNeighbor, error) {
|
||||
var doc networkctlLLDP
|
||||
if err := json.Unmarshal(data, &doc); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out := map[string]clusterv1.LLDPNeighbor{}
|
||||
for _, iface := range doc.Neighbors {
|
||||
if len(iface.Neighbors) == 0 {
|
||||
continue
|
||||
}
|
||||
n := iface.Neighbors[0]
|
||||
var caps []string
|
||||
for i, name := range lldpCapabilityNames {
|
||||
if n.EnabledCapabilities&(1<<i) != 0 {
|
||||
caps = append(caps, name)
|
||||
}
|
||||
}
|
||||
out[iface.InterfaceName] = clusterv1.LLDPNeighbor{
|
||||
ChassisID: n.ChassisID, SystemName: n.SystemName, SystemDescription: n.SystemDescription,
|
||||
PortID: n.PortID, PortDescription: n.PortDescription, Capabilities: caps,
|
||||
}
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
package nodefacts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
clusterv1 "github.com/mulgadc/spinifex/contracts/cluster/v1"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// The fixtures are dmidecode, ethtool and networkctl output captured from
|
||||
// prod node1, dev-prod bottlebrush and a QEMU dev box, serials replaced.
|
||||
func fixture(t *testing.T, host, name string) string {
|
||||
t.Helper()
|
||||
data, err := os.ReadFile(filepath.Join("testdata", host, name))
|
||||
require.NoError(t, err)
|
||||
return string(data)
|
||||
}
|
||||
|
||||
func TestMemoryGroupsIdenticalDIMMsAndCountsEmptySlots(t *testing.T) {
|
||||
m := parseMemory(fixture(t, "bottlebrush", "dmi-memory.txt"))
|
||||
|
||||
assert.Equal(t, 32, m.SlotsTotal)
|
||||
assert.Equal(t, 16, m.SlotsUsed)
|
||||
assert.Equal(t, uint64(256)<<30, m.TotalBytes)
|
||||
assert.Equal(t, "8 TB", m.MaxCapacity)
|
||||
assert.Equal(t, "Multi-bit ECC", m.ECC)
|
||||
require.Len(t, m.Groups, 1)
|
||||
g := m.Groups[0]
|
||||
assert.Equal(t, 16, g.Count)
|
||||
assert.Equal(t, uint64(16)<<30, g.SizeBytes)
|
||||
assert.Equal(t, "DDR4", g.Type)
|
||||
assert.Equal(t, 2400, g.SpeedMTs)
|
||||
assert.Equal(t, 2400, g.ConfiguredMTs)
|
||||
assert.Equal(t, "SK Hynix", g.Manufacturer)
|
||||
assert.Equal(t, "HMA82GR7AFR8N-UH", g.PartNumber)
|
||||
assert.Len(t, g.Serials, 16)
|
||||
}
|
||||
|
||||
func TestMemorySplitsDIMMsThatDifferInAnyShownField(t *testing.T) {
|
||||
dimm := func(size, speed, part string) string {
|
||||
return "Memory Device\n\tSize: " + size + "\n\tType: DDR5\n\tSpeed: " + speed +
|
||||
"\n\tManufacturer: Samsung\n\tPart Number: " + part + "\n\tConfigured Memory Speed: 4800 MT/s\n\n"
|
||||
}
|
||||
m := parseMemory(dimm("32 GB", "5600 MT/s", "A") + dimm("32 GB", "5600 MT/s", "A") +
|
||||
dimm("64 GB", "5600 MT/s", "B") + "Memory Device\n\tSize: No Module Installed\n\n")
|
||||
|
||||
assert.Equal(t, 4, m.SlotsTotal)
|
||||
assert.Equal(t, 3, m.SlotsUsed)
|
||||
require.Len(t, m.Groups, 2)
|
||||
assert.Equal(t, 2, m.Groups[0].Count, "largest group first")
|
||||
assert.Equal(t, 5600, m.Groups[0].SpeedMTs)
|
||||
assert.Equal(t, 4800, m.Groups[0].ConfiguredMTs, "running below rated speed stays visible")
|
||||
assert.Equal(t, uint64(64)<<30, m.Groups[1].SizeBytes)
|
||||
}
|
||||
|
||||
func TestProcessorsSummariseEverySocket(t *testing.T) {
|
||||
c := parseProcessors(fixture(t, "node1", "dmi-processor.txt"))
|
||||
|
||||
assert.Equal(t, "AMD EPYC 7513 32-Core Processor", c.Model)
|
||||
assert.Equal(t, 2, c.Sockets)
|
||||
assert.Equal(t, 32, c.CoresPerSocket)
|
||||
assert.Equal(t, 64, c.Cores)
|
||||
assert.Equal(t, 128, c.Threads)
|
||||
assert.Equal(t, 3675, c.MaxMHz)
|
||||
}
|
||||
|
||||
func TestCPUInfoKeepsEveryFlagAndNamesTheNotableOnes(t *testing.T) {
|
||||
proc := t.TempDir()
|
||||
cpuinfo := "processor\t: 0\nmodel name\t: AMD EPYC 7713\nphysical id\t: 0\ncore id\t\t: 0\nflags\t\t: fpu sse2 svm avx2 aes sev\n\n" +
|
||||
"processor\t: 1\nphysical id\t: 0\ncore id\t\t: 0\nflags\t\t: fpu sse2 svm avx2 aes sev\n"
|
||||
require.NoError(t, os.WriteFile(filepath.Join(proc, "cpuinfo"), []byte(cpuinfo), 0o644))
|
||||
|
||||
var c clusterv1.CPUFacts
|
||||
addCPUInfo(&c, proc)
|
||||
|
||||
assert.Equal(t, []string{"fpu", "sse2", "svm", "avx2", "aes", "sev"}, c.Flags)
|
||||
assert.Equal(t, []string{"avx2", "aes", "sev"}, c.Features)
|
||||
assert.Equal(t, "AMD-V", c.Virtualization)
|
||||
assert.Equal(t, 2, c.Threads)
|
||||
assert.Equal(t, 1, c.Cores, "two threads of one core")
|
||||
}
|
||||
|
||||
func TestCPUInfoReadsARMFeaturesAndCountsCoresWithoutCoreIDs(t *testing.T) {
|
||||
proc := t.TempDir()
|
||||
cpuinfo := "processor\t: 0\nFeatures\t: fp asimd aes pmull sha2\n\n" +
|
||||
"processor\t: 1\nFeatures\t: fp asimd aes pmull sha2\n"
|
||||
require.NoError(t, os.WriteFile(filepath.Join(proc, "cpuinfo"), []byte(cpuinfo), 0o644))
|
||||
|
||||
var c clusterv1.CPUFacts
|
||||
addCPUInfo(&c, proc)
|
||||
|
||||
assert.Equal(t, []string{"fp", "asimd", "aes", "pmull", "sha2"}, c.Flags)
|
||||
assert.Equal(t, []string{"aes"}, c.Features)
|
||||
assert.Equal(t, 2, c.Cores, "with no core ids every thread is a core")
|
||||
}
|
||||
|
||||
func TestIdentityDropsFirmwarePlaceholders(t *testing.T) {
|
||||
s := parseIdentity(fixture(t, "node1", "dmi-identity.txt"))
|
||||
assert.Equal(t, "GIGABYTE", s.Vendor)
|
||||
assert.Equal(t, "H262-Z62-ZB", s.Product)
|
||||
assert.Equal(t, "Rack Mount Chassis", s.ChassisType)
|
||||
assert.Equal(t, "M30", s.BIOSVersion)
|
||||
assert.Equal(t, "06/23/2026", s.BIOSDate)
|
||||
|
||||
vm := parseIdentity(fixture(t, "devbox", "dmi-identity.txt"))
|
||||
assert.Equal(t, "SeaBIOS", vm.BIOSVendor)
|
||||
assert.Equal(t, "QEMU", vm.Vendor)
|
||||
assert.Empty(t, vm.Serial, "QEMU leaves the serial unset")
|
||||
|
||||
assert.Empty(t, cleanDMI("To Be Filled By O.E.M."))
|
||||
assert.Empty(t, cleanDMI("DIMM_P0_A0_AssetTag"))
|
||||
assert.Empty(t, cleanDMI("00000000"))
|
||||
}
|
||||
|
||||
func TestFormFactor(t *testing.T) {
|
||||
cases := []struct {
|
||||
name string
|
||||
virt string
|
||||
sys clusterv1.SystemFacts
|
||||
want string
|
||||
}{
|
||||
{"hypervisor wins over the chassis it fakes", "kvm", clusterv1.SystemFacts{ChassisType: "Rack Mount Chassis"}, "virtual-machine"},
|
||||
{"rack server", "none", clusterv1.SystemFacts{ChassisType: "Rack Mount Chassis"}, "rack-server"},
|
||||
{"tower", "none", clusterv1.SystemFacts{ChassisType: "Tower"}, "tower"},
|
||||
{"raspberry pi from the device tree", "none", clusterv1.SystemFacts{DeviceModel: "Raspberry Pi 5 Model B Rev 1.0"}, "sbc"},
|
||||
{"jetson from the device tree", "none", clusterv1.SystemFacts{DeviceModel: "NVIDIA Jetson AGX Orin Developer Kit"}, "jetson"},
|
||||
{"nothing to go on", "", clusterv1.SystemFacts{}, "unknown"},
|
||||
}
|
||||
for _, c := range cases {
|
||||
t.Run(c.name, func(t *testing.T) {
|
||||
assert.Equal(t, c.want, formFactor(c.virt, c.sys))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestEthtoolReadsLinkAndDriver(t *testing.T) {
|
||||
text := fixture(t, "bottlebrush", "nic-enp193s0f1np1.txt")
|
||||
e := parseEthtool(text)
|
||||
|
||||
assert.Equal(t, 25000, e.speedMbps)
|
||||
assert.Equal(t, 25000, e.maxMbps)
|
||||
assert.Equal(t, "Full", e.duplex)
|
||||
assert.Equal(t, "Direct Attach Copper", e.port)
|
||||
assert.Equal(t, "mlx5_core", e.driver)
|
||||
assert.Equal(t, "0000:c1:00.1", e.busInfo)
|
||||
assert.Contains(t, parseUdevModel(text), "BlueField-2")
|
||||
|
||||
copper := parseEthtool(fixture(t, "bottlebrush", "nic-eno1.txt"))
|
||||
assert.Equal(t, 1000, copper.maxMbps)
|
||||
assert.Equal(t, "Twisted Pair", copper.port)
|
||||
assert.Equal(t, "igb", copper.driver)
|
||||
}
|
||||
|
||||
func TestLLDPNamesTheSwitchPortPerNIC(t *testing.T) {
|
||||
n, err := parseLLDP([]byte(fixture(t, "node1", "lldp.json")))
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Contains(t, n, "eno1")
|
||||
assert.Equal(t, "MikroTik 1gbe", n["eno1"].SystemName)
|
||||
assert.Equal(t, "ether18", n["eno1"].PortID)
|
||||
assert.Equal(t, []string{"bridge", "router"}, n["eno1"].Capabilities)
|
||||
assert.Equal(t, n["enp33s0f0np0"].ChassisID, n["enp33s0f1np1"].ChassisID, "both 100G ports land on one switch")
|
||||
assert.Equal(t, "qsfp28-7-1", n["enp33s0f0np0"].PortID)
|
||||
}
|
||||
|
||||
// fakeHost lays out a sysfs tree with two NICs under bridges, as dev-prod has:
|
||||
// no br-vpc, so the overlay rides br-lan.
|
||||
func fakeHost(t *testing.T) Env {
|
||||
t.Helper()
|
||||
root := t.TempDir()
|
||||
sys := filepath.Join(root, "sys")
|
||||
nic := func(name, master, speed string) {
|
||||
dir := filepath.Join(sys, "class", "net", name)
|
||||
require.NoError(t, os.MkdirAll(filepath.Join(dir, "device"), 0o755))
|
||||
for file, value := range map[string]string{"speed": speed, "operstate": "up", "mtu": "9000", "address": "02:00:00:00:00:01"} {
|
||||
require.NoError(t, os.WriteFile(filepath.Join(dir, file), []byte(value+"\n"), 0o644))
|
||||
}
|
||||
require.NoError(t, os.Symlink("../"+master, filepath.Join(dir, "master")))
|
||||
}
|
||||
bridge := func(name string) {
|
||||
dir := filepath.Join(sys, "class", "net", name)
|
||||
require.NoError(t, os.MkdirAll(dir, 0o755))
|
||||
require.NoError(t, os.WriteFile(filepath.Join(dir, "mtu"), []byte("9000\n"), 0o644))
|
||||
}
|
||||
bridge("br-wan")
|
||||
bridge("br-lan")
|
||||
nic("eno1", "br-wan", "1000")
|
||||
nic("enp193s0f1np1", "br-lan", "25000")
|
||||
|
||||
dir := filepath.Join(root, "facts")
|
||||
require.NoError(t, os.MkdirAll(dir, 0o755))
|
||||
for name, src := range map[string]string{
|
||||
fileIdentity: "dmi-identity.txt", fileMemory: "dmi-memory.txt", fileProcessor: "dmi-processor.txt",
|
||||
"nic-enp193s0f1np1.txt": "nic-enp193s0f1np1.txt", "nic-eno1.txt": "nic-eno1.txt",
|
||||
} {
|
||||
require.NoError(t, os.WriteFile(filepath.Join(dir, name), []byte(fixture(t, "bottlebrush", src)), 0o644))
|
||||
}
|
||||
require.NoError(t, os.WriteFile(filepath.Join(dir, fileVirt), []byte("none\n"), 0o644))
|
||||
require.NoError(t, os.WriteFile(filepath.Join(dir, fileEncapIP), []byte("10.10.8.4"), 0o644))
|
||||
|
||||
addrs := map[string][]net.IPNet{
|
||||
"br-wan": {{IP: net.IPv4(192, 168, 1, 14), Mask: net.CIDRMask(23, 32)}},
|
||||
"br-lan": {{IP: net.IPv4(10, 10, 8, 4), Mask: net.CIDRMask(24, 32)}},
|
||||
}
|
||||
return Env{
|
||||
Dir: dir, SysRoot: sys, ProcRoot: filepath.Join(root, "proc"), EtcRoot: filepath.Join(root, "etc"),
|
||||
Node: "bottlebrush",
|
||||
LiveLLDP: func(context.Context) ([]byte, error) {
|
||||
return nil, errors.New("systemd-networkd is not running")
|
||||
},
|
||||
Addrs: func(name string) []net.IPNet { return addrs[name] },
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildMapsPlanesToNICsWhenTheOverlayRidesTheLANBridge(t *testing.T) {
|
||||
f := Build(context.Background(), fakeHost(t))
|
||||
|
||||
assert.Equal(t, "rack-server", f.FormFactor)
|
||||
assert.Equal(t, "R182-Z92-00", f.System.Product)
|
||||
assert.Equal(t, sourceUnavailable, f.Sources["lldp"], "no networkd and nothing collected")
|
||||
|
||||
planes := map[string]clusterv1.PlaneFacts{}
|
||||
for _, p := range f.Planes {
|
||||
planes[p.Plane] = p
|
||||
}
|
||||
assert.Equal(t, "192.168.1.14", planes["wan"].Address)
|
||||
assert.Equal(t, []string{"eno1"}, planes["wan"].NICs)
|
||||
assert.Equal(t, "br-lan", planes["vpc"].Bridge, "encap address is on br-lan")
|
||||
assert.Equal(t, "10.10.8.4", planes["vpc"].Address)
|
||||
assert.Equal(t, []string{"enp193s0f1np1"}, planes["lan"].NICs)
|
||||
|
||||
nics := map[string]clusterv1.NICFacts{}
|
||||
for _, n := range f.NICs {
|
||||
nics[n.Name] = n
|
||||
}
|
||||
assert.Equal(t, []string{"lan", "vpc"}, nics["enp193s0f1np1"].Planes)
|
||||
assert.Equal(t, 25000, nics["enp193s0f1np1"].SpeedMbps)
|
||||
assert.Equal(t, "mlx5_core", nics["enp193s0f1np1"].Driver)
|
||||
assert.Nil(t, nics["eno1"].Neighbor)
|
||||
}
|
||||
|
||||
func TestBuildFallsBackToTheCollectedLLDP(t *testing.T) {
|
||||
env := fakeHost(t)
|
||||
require.NoError(t, os.WriteFile(filepath.Join(env.Dir, fileLLDP),
|
||||
[]byte(`{"Neighbors":[{"InterfaceName":"eno1","Neighbors":[{"ChassisID":"aa:bb","PortID":"ether3","SystemName":"core","EnabledCapabilities":4}]}]}`), 0o644))
|
||||
|
||||
f := Build(context.Background(), env)
|
||||
|
||||
assert.Equal(t, sourceOK, f.Sources["lldp"])
|
||||
for _, n := range f.NICs {
|
||||
if n.Name == "eno1" {
|
||||
require.NotNil(t, n.Neighbor)
|
||||
assert.Equal(t, "ether3", n.Neighbor.PortID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestWriteFile_ReplacesAtomicallyGroupReadOnly(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
require.NoError(t, writeFile(dir, fileIdentity, []byte("first"), -1))
|
||||
require.NoError(t, writeFile(dir, fileIdentity, []byte("second"), -1))
|
||||
|
||||
data, err := readFacts(dir, fileIdentity)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "second", string(data))
|
||||
|
||||
info, err := os.Stat(filepath.Join(dir, fileIdentity))
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, os.FileMode(0o640), info.Mode().Perm(), "the facts carry serial numbers")
|
||||
|
||||
entries, err := os.ReadDir(dir)
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, entries, 1, "no temporary file is left behind")
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
# dmidecode 3.6
|
||||
Getting SMBIOS data from sysfs.
|
||||
SMBIOS 3.2.0 present.
|
||||
|
||||
Handle 0x0000, DMI type 0, 26 bytes
|
||||
BIOS Information
|
||||
Vendor: GIGABYTE
|
||||
Version: R23
|
||||
Release Date: 07/10/2021
|
||||
Address: 0xF0000
|
||||
Runtime Size: 64 kB
|
||||
ROM Size: 16 MB
|
||||
Characteristics:
|
||||
PCI is supported
|
||||
BIOS is upgradeable
|
||||
BIOS shadowing is allowed
|
||||
Boot from CD is supported
|
||||
Selectable boot is supported
|
||||
BIOS ROM is socketed
|
||||
EDD is supported
|
||||
5.25"/1.2 MB floppy services are supported (int 13h)
|
||||
3.5"/720 kB floppy services are supported (int 13h)
|
||||
3.5"/2.88 MB floppy services are supported (int 13h)
|
||||
Print screen service is supported (int 5h)
|
||||
Serial services are supported (int 14h)
|
||||
Printer services are supported (int 17h)
|
||||
ACPI is supported
|
||||
USB legacy is supported
|
||||
BIOS boot specification is supported
|
||||
Targeted content distribution is supported
|
||||
UEFI is supported
|
||||
BIOS Revision: 5.14
|
||||
|
||||
Handle 0x0001, DMI type 1, 27 bytes
|
||||
System Information
|
||||
Manufacturer: GIGABYTE
|
||||
Product Name: R182-Z92-00
|
||||
Version: 0100
|
||||
Serial Number: TEST-0001
|
||||
UUID: TEST-0002
|
||||
Wake-up Type: Power Switch
|
||||
SKU Number: 01234567890123456789AB
|
||||
Family: Server
|
||||
|
||||
Handle 0x0002, DMI type 2, 15 bytes
|
||||
Base Board Information
|
||||
Manufacturer: GIGABYTE
|
||||
Product Name: MZ92-FS0-00
|
||||
Version: 01010101
|
||||
Serial Number: TEST-0003
|
||||
Asset Tag: TEST-0004
|
||||
Features:
|
||||
Board is a hosting board
|
||||
Board is removable
|
||||
Board is replaceable
|
||||
Location In Chassis: 01234567890123456789AB
|
||||
Chassis Handle: 0x0003
|
||||
Type: Motherboard
|
||||
Contained Object Handles: 0
|
||||
|
||||
Handle 0x0003, DMI type 3, 22 bytes
|
||||
Chassis Information
|
||||
Manufacturer: GIGABYTE
|
||||
Type: Rack Mount Chassis
|
||||
Lock: Not Present
|
||||
Version: 01234567
|
||||
Serial Number: TEST-0005
|
||||
Asset Tag: TEST-0006
|
||||
Boot-up State: Safe
|
||||
Power Supply State: Safe
|
||||
Thermal State: Safe
|
||||
Security Status: None
|
||||
OEM Information: 0x00000000
|
||||
Height: Unspecified
|
||||
Number Of Power Cords: 1
|
||||
Contained Elements: 0
|
||||
SKU Number: 01234567890123456789AB
|
||||
|
||||
Handle 0x0030, DMI type 10, 10 bytes
|
||||
On Board Device 1 Information
|
||||
Type: Video
|
||||
Status: Enabled
|
||||
Description: AST2500
|
||||
On Board Device 2 Information
|
||||
Type: Ethernet
|
||||
Status: Enabled
|
||||
Description: Intel i350 Lan1
|
||||
On Board Device 3 Information
|
||||
Type: Ethernet
|
||||
Status: Enabled
|
||||
Description: Intel i350 Lan2
|
||||
|
||||
Handle 0x0031, DMI type 41, 11 bytes
|
||||
Onboard Device
|
||||
Reference Designation: Onboard VGA
|
||||
Type: Video
|
||||
Status: Enabled
|
||||
Type Instance: 1
|
||||
Bus Address: 0000:66:00.0
|
||||
|
||||
Handle 0x0032, DMI type 41, 11 bytes
|
||||
Onboard Device
|
||||
Reference Designation: Onboard LAN1
|
||||
Type: Ethernet
|
||||
Status: Enabled
|
||||
Type Instance: 1
|
||||
Bus Address: 0000:64:00.0
|
||||
|
||||
Handle 0x0033, DMI type 41, 11 bytes
|
||||
Onboard Device
|
||||
Reference Designation: Onboard LAN2
|
||||
Type: Ethernet
|
||||
Status: Enabled
|
||||
Type Instance: 2
|
||||
Bus Address: 0000:64:00.1
|
||||
|
||||
Handle 0x0043, DMI type 15, 73 bytes
|
||||
System Event Log
|
||||
Area Length: 0 bytes
|
||||
Header Start Offset: 0x0000
|
||||
Header Length: 16 bytes
|
||||
Data Start Offset: 0x0010
|
||||
Access Method: Memory-mapped physical 32-bit address
|
||||
Access Address: 0xFF4FB000
|
||||
Status: Valid, Not Full
|
||||
Change Token: 0x00000053
|
||||
Header Format: Type 1
|
||||
Supported Log Type Descriptors: 25
|
||||
Descriptor 1: Single-bit ECC memory error
|
||||
Data Format 1: Multiple-event handle
|
||||
Descriptor 2: Multi-bit ECC memory error
|
||||
Data Format 2: Multiple-event handle
|
||||
Descriptor 3: Parity memory error
|
||||
Data Format 3: None
|
||||
Descriptor 4: Bus timeout
|
||||
Data Format 4: None
|
||||
Descriptor 5: I/O channel block
|
||||
Data Format 5: None
|
||||
Descriptor 6: Software NMI
|
||||
Data Format 6: None
|
||||
Descriptor 7: POST memory resize
|
||||
Data Format 7: None
|
||||
Descriptor 8: POST error
|
||||
Data Format 8: POST results bitmap
|
||||
Descriptor 9: PCI parity error
|
||||
Data Format 9: Multiple-event handle
|
||||
Descriptor 10: PCI system error
|
||||
Data Format 10: Multiple-event handle
|
||||
Descriptor 11: CPU failure
|
||||
Data Format 11: None
|
||||
Descriptor 12: EISA failsafe timer timeout
|
||||
Data Format 12: None
|
||||
Descriptor 13: Correctable memory log disabled
|
||||
Data Format 13: None
|
||||
Descriptor 14: Logging disabled
|
||||
Data Format 14: None
|
||||
Descriptor 15: System limit exceeded
|
||||
Data Format 15: None
|
||||
Descriptor 16: Asynchronous hardware timer expired
|
||||
Data Format 16: None
|
||||
Descriptor 17: System configuration information
|
||||
Data Format 17: None
|
||||
Descriptor 18: Hard disk information
|
||||
Data Format 18: None
|
||||
Descriptor 19: System reconfigured
|
||||
Data Format 19: None
|
||||
Descriptor 20: Uncorrectable CPU-complex error
|
||||
Data Format 20: None
|
||||
Descriptor 21: Log area reset/cleared
|
||||
Data Format 21: None
|
||||
Descriptor 22: System boot
|
||||
Data Format 22: None
|
||||
Descriptor 23: End of log
|
||||
Data Format 23: None
|
||||
Descriptor 24: OEM-specific
|
||||
Data Format 24: OEM-specific
|
||||
Descriptor 25: OEM-specific
|
||||
Data Format 25: OEM-specific
|
||||
|
||||
Handle 0x00B5, DMI type 13, 22 bytes
|
||||
BIOS Language Information
|
||||
Language Description Format: Long
|
||||
Installable Languages: 1
|
||||
en|US|iso8859-1
|
||||
Currently Installed Language: en|US|iso8859-1
|
||||
|
||||
@@ -0,0 +1,797 @@
|
||||
# dmidecode 3.6
|
||||
Getting SMBIOS data from sysfs.
|
||||
SMBIOS 3.2.0 present.
|
||||
|
||||
Handle 0x0045, DMI type 16, 23 bytes
|
||||
Physical Memory Array
|
||||
Location: System Board Or Motherboard
|
||||
Use: System Memory
|
||||
Error Correction Type: Multi-bit ECC
|
||||
Maximum Capacity: 8 TB
|
||||
Error Information Handle: 0x0044
|
||||
Number Of Devices: 32
|
||||
|
||||
Handle 0x004D, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x004C
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P0_A0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x004F, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x004E
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P0_A1
|
||||
Bank Locator: BANK 1
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2400 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0001
|
||||
Asset Tag: TEST-0002
|
||||
Part Number: HMA82GR7AFR8N-UH
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2400 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0052, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0051
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P0_B0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x0054, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0053
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P0_B1
|
||||
Bank Locator: BANK 1
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2400 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0003
|
||||
Asset Tag: TEST-0004
|
||||
Part Number: HMA82GR7AFR8N-UH
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2400 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0057, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0056
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P0_C0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x0059, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0058
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P0_C1
|
||||
Bank Locator: BANK 1
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2400 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0005
|
||||
Asset Tag: TEST-0006
|
||||
Part Number: HMA82GR7AFR8N-UH
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2400 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x005C, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x005B
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P0_D0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x005E, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x005D
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P0_D1
|
||||
Bank Locator: BANK 1
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2400 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0007
|
||||
Asset Tag: TEST-0008
|
||||
Part Number: HMA82GR7AFR8N-UH
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2400 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0061, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0060
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P0_E0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x0063, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0062
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P0_E1
|
||||
Bank Locator: BANK 1
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2400 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0009
|
||||
Asset Tag: TEST-0010
|
||||
Part Number: HMA82GR7AFR8N-UH
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2400 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0066, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0065
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P0_F0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x0068, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0067
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P0_F1
|
||||
Bank Locator: BANK 1
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2400 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0011
|
||||
Asset Tag: TEST-0012
|
||||
Part Number: HMA82GR7AFR8N-UH
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2400 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x006B, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x006A
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P0_G0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x006D, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x006C
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P0_G1
|
||||
Bank Locator: BANK 1
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2400 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0013
|
||||
Asset Tag: TEST-0014
|
||||
Part Number: HMA82GR7AFR8N-UH
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2400 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0070, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x006F
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P0_H0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x0072, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0071
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P0_H1
|
||||
Bank Locator: BANK 1
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2400 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0015
|
||||
Asset Tag: TEST-0016
|
||||
Part Number: HMA82GR7AFR8N-UH
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2400 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0079, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0078
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P1_I0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x007B, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x007A
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P1_I1
|
||||
Bank Locator: BANK 1
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2400 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0017
|
||||
Asset Tag: TEST-0018
|
||||
Part Number: HMA82GR7AFR8N-UH
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2400 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x007E, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x007D
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P1_J0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x0080, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x007F
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P1_J1
|
||||
Bank Locator: BANK 1
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2400 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0019
|
||||
Asset Tag: TEST-0020
|
||||
Part Number: HMA82GR7AFR8N-UH
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2400 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0083, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0082
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P1_K0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x0085, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0084
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P1_K1
|
||||
Bank Locator: BANK 1
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2400 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0021
|
||||
Asset Tag: TEST-0022
|
||||
Part Number: HMA82GR7AFR8N-UH
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2400 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0088, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0087
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P1_L0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x008A, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0089
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P1_L1
|
||||
Bank Locator: BANK 1
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2400 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0023
|
||||
Asset Tag: TEST-0024
|
||||
Part Number: HMA82GR7AFR8N-UH
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2400 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x008D, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x008C
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P1_M0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x008F, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x008E
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P1_M1
|
||||
Bank Locator: BANK 1
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2400 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0025
|
||||
Asset Tag: TEST-0026
|
||||
Part Number: HMA82GR7AFR8N-UH
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2400 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0092, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0091
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P1_N0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x0094, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0093
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P1_N1
|
||||
Bank Locator: BANK 1
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2400 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0027
|
||||
Asset Tag: TEST-0028
|
||||
Part Number: HMA82GR7AFR8N-UH
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2400 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0097, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0096
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P1_O0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x0099, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x0098
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P1_O1
|
||||
Bank Locator: BANK 1
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2400 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0029
|
||||
Asset Tag: TEST-0030
|
||||
Part Number: HMA82GR7AFR8N-UH
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2400 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x009C, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x009B
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P1_P0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x009E, DMI type 17, 84 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0045
|
||||
Error Information Handle: 0x009D
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P1_P1
|
||||
Bank Locator: BANK 1
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2400 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0031
|
||||
Asset Tag: TEST-0032
|
||||
Part Number: HMA82GR7AFR8N-UH
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2400 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
# dmidecode 3.6
|
||||
Getting SMBIOS data from sysfs.
|
||||
SMBIOS 3.2.0 present.
|
||||
|
||||
Handle 0x004B, DMI type 4, 48 bytes
|
||||
Processor Information
|
||||
Socket Designation: P0
|
||||
Type: Central Processor
|
||||
Family: Zen
|
||||
Manufacturer: Advanced Micro Devices, Inc.
|
||||
ID: TEST-0001
|
||||
Signature: Family 23, Model 49, Stepping 0
|
||||
Flags:
|
||||
FPU (Floating-point unit on-chip)
|
||||
VME (Virtual mode extension)
|
||||
DE (Debugging extension)
|
||||
PSE (Page size extension)
|
||||
TSC (Time stamp counter)
|
||||
MSR (Model specific registers)
|
||||
PAE (Physical address extension)
|
||||
MCE (Machine check exception)
|
||||
CX8 (CMPXCHG8 instruction supported)
|
||||
APIC (On-chip APIC hardware supported)
|
||||
SEP (Fast system call)
|
||||
MTRR (Memory type range registers)
|
||||
PGE (Page global enable)
|
||||
MCA (Machine check architecture)
|
||||
CMOV (Conditional move instruction supported)
|
||||
PAT (Page attribute table)
|
||||
PSE-36 (36-bit page size extension)
|
||||
CLFSH (CLFLUSH instruction supported)
|
||||
MMX (MMX technology supported)
|
||||
FXSR (FXSAVE and FXSTOR instructions supported)
|
||||
SSE (Streaming SIMD extensions)
|
||||
SSE2 (Streaming SIMD extensions 2)
|
||||
HTT (Multi-threading)
|
||||
Version: AMD EPYC 7662 64-Core Processor
|
||||
Voltage: 1.1 V
|
||||
External Clock: 100 MHz
|
||||
Max Speed: 3300 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Socket SP3
|
||||
L1 Cache Handle: 0x0048
|
||||
L2 Cache Handle: 0x0049
|
||||
L3 Cache Handle: 0x004A
|
||||
Serial Number: Unknown
|
||||
Asset Tag: Unknown
|
||||
Part Number: Unknown
|
||||
Core Count: 64
|
||||
Core Enabled: 64
|
||||
Thread Count: 128
|
||||
Characteristics:
|
||||
64-bit capable
|
||||
Multi-Core
|
||||
Hardware Thread
|
||||
Execute Protection
|
||||
Enhanced Virtualization
|
||||
Power/Performance Control
|
||||
|
||||
Handle 0x0077, DMI type 4, 48 bytes
|
||||
Processor Information
|
||||
Socket Designation: P1
|
||||
Type: Central Processor
|
||||
Family: Zen
|
||||
Manufacturer: Advanced Micro Devices, Inc.
|
||||
ID: TEST-0004
|
||||
Signature: Family 23, Model 49, Stepping 0
|
||||
Flags:
|
||||
FPU (Floating-point unit on-chip)
|
||||
VME (Virtual mode extension)
|
||||
DE (Debugging extension)
|
||||
PSE (Page size extension)
|
||||
TSC (Time stamp counter)
|
||||
MSR (Model specific registers)
|
||||
PAE (Physical address extension)
|
||||
MCE (Machine check exception)
|
||||
CX8 (CMPXCHG8 instruction supported)
|
||||
APIC (On-chip APIC hardware supported)
|
||||
SEP (Fast system call)
|
||||
MTRR (Memory type range registers)
|
||||
PGE (Page global enable)
|
||||
MCA (Machine check architecture)
|
||||
CMOV (Conditional move instruction supported)
|
||||
PAT (Page attribute table)
|
||||
PSE-36 (36-bit page size extension)
|
||||
CLFSH (CLFLUSH instruction supported)
|
||||
MMX (MMX technology supported)
|
||||
FXSR (FXSAVE and FXSTOR instructions supported)
|
||||
SSE (Streaming SIMD extensions)
|
||||
SSE2 (Streaming SIMD extensions 2)
|
||||
HTT (Multi-threading)
|
||||
Version: AMD EPYC 7662 64-Core Processor
|
||||
Voltage: 1.1 V
|
||||
External Clock: 100 MHz
|
||||
Max Speed: 3300 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Socket SP3
|
||||
L1 Cache Handle: 0x0074
|
||||
L2 Cache Handle: 0x0075
|
||||
L3 Cache Handle: 0x0076
|
||||
Serial Number: Unknown
|
||||
Asset Tag: Unknown
|
||||
Part Number: Unknown
|
||||
Core Count: 64
|
||||
Core Enabled: 64
|
||||
Thread Count: 128
|
||||
Characteristics:
|
||||
64-bit capable
|
||||
Multi-Core
|
||||
Hardware Thread
|
||||
Execute Protection
|
||||
Enhanced Virtualization
|
||||
Power/Performance Control
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
Settings for eno1:
|
||||
Supported ports: [ TP ]
|
||||
Supported link modes: 10baseT/Half 10baseT/Full
|
||||
100baseT/Half 100baseT/Full
|
||||
1000baseT/Full
|
||||
Supported pause frame use: Symmetric
|
||||
Supports auto-negotiation: Yes
|
||||
Supported FEC modes: Not reported
|
||||
Advertised link modes: 10baseT/Half 10baseT/Full
|
||||
100baseT/Half 100baseT/Full
|
||||
1000baseT/Full
|
||||
Advertised pause frame use: Symmetric
|
||||
Advertised auto-negotiation: Yes
|
||||
Advertised FEC modes: Not reported
|
||||
Speed: 1000Mb/s
|
||||
Duplex: Full
|
||||
Auto-negotiation: on
|
||||
Port: Twisted Pair
|
||||
PHYAD: 1
|
||||
Transceiver: internal
|
||||
MDI-X: on (auto)
|
||||
Current message level: 0x00000007 (7)
|
||||
drv probe link
|
||||
Link detected: yes
|
||||
netlink error: Operation not permitted
|
||||
===
|
||||
driver: igb
|
||||
version: 6.12.73+deb13-amd64
|
||||
firmware-version: 1.63, 0x800009fa
|
||||
expansion-rom-version:
|
||||
bus-info: 0000:64:00.0
|
||||
supports-statistics: yes
|
||||
supports-test: yes
|
||||
supports-eeprom-access: yes
|
||||
supports-register-dump: yes
|
||||
supports-priv-flags: yes
|
||||
===
|
||||
ID_VENDOR_FROM_DATABASE=Intel Corporation
|
||||
ID_MODEL_FROM_DATABASE=I350 Gigabit Network Connection
|
||||
ID_NET_NAME_MAC=enx000000000001
|
||||
ID_NET_NAME_ONBOARD=eno1
|
||||
ID_NET_NAME_PATH=enp100s0f0
|
||||
ID_NET_NAME=eno1
|
||||
@@ -0,0 +1,59 @@
|
||||
Settings for enp193s0f1np1:
|
||||
Supported ports: [ Backplane ]
|
||||
Supported link modes: 1000baseT/Full
|
||||
10000baseT/Full
|
||||
1000baseKX/Full
|
||||
10000baseKR/Full
|
||||
10000baseR_FEC
|
||||
25000baseCR/Full
|
||||
25000baseKR/Full
|
||||
25000baseSR/Full
|
||||
1000baseX/Full
|
||||
10000baseCR/Full
|
||||
10000baseSR/Full
|
||||
10000baseLR/Full
|
||||
10000baseER/Full
|
||||
Supported pause frame use: Symmetric
|
||||
Supports auto-negotiation: Yes
|
||||
Supported FEC modes: None RS BASER
|
||||
Advertised link modes: 1000baseT/Full
|
||||
10000baseT/Full
|
||||
1000baseKX/Full
|
||||
10000baseKR/Full
|
||||
10000baseR_FEC
|
||||
25000baseCR/Full
|
||||
25000baseKR/Full
|
||||
25000baseSR/Full
|
||||
1000baseX/Full
|
||||
10000baseCR/Full
|
||||
10000baseSR/Full
|
||||
10000baseLR/Full
|
||||
10000baseER/Full
|
||||
Advertised pause frame use: Symmetric
|
||||
Advertised auto-negotiation: Yes
|
||||
Advertised FEC modes: None
|
||||
Speed: 25000Mb/s
|
||||
Duplex: Full
|
||||
Auto-negotiation: on
|
||||
Port: Direct Attach Copper
|
||||
PHYAD: 0
|
||||
Transceiver: internal
|
||||
Link detected: yes
|
||||
netlink error: Operation not permitted
|
||||
===
|
||||
driver: mlx5_core
|
||||
version: 6.12.73+deb13-amd64
|
||||
firmware-version: 24.47.1088 (MT_0000000541)
|
||||
expansion-rom-version:
|
||||
bus-info: 0000:c1:00.1
|
||||
supports-statistics: yes
|
||||
supports-test: yes
|
||||
supports-eeprom-access: no
|
||||
supports-register-dump: no
|
||||
supports-priv-flags: yes
|
||||
===
|
||||
ID_VENDOR_FROM_DATABASE=Mellanox Technologies
|
||||
ID_MODEL_FROM_DATABASE=MT42822 BlueField-2 integrated ConnectX-6 Dx network controller
|
||||
ID_NET_NAME_MAC=enx000000000002
|
||||
ID_NET_NAME_PATH=enp193s0f1np1
|
||||
ID_NET_NAME=enp193s0f1np1
|
||||
@@ -0,0 +1,50 @@
|
||||
# dmidecode 3.6
|
||||
Getting SMBIOS data from sysfs.
|
||||
SMBIOS 2.8 present.
|
||||
|
||||
Handle 0x0000, DMI type 0, 24 bytes
|
||||
BIOS Information
|
||||
Vendor: SeaBIOS
|
||||
Version: 1.16.3-debian-1.16.3-2
|
||||
Release Date: 04/01/2014
|
||||
Address: 0xE8000
|
||||
Runtime Size: 96 kB
|
||||
ROM Size: 64 kB
|
||||
Characteristics:
|
||||
BIOS characteristics not supported
|
||||
Targeted content distribution is supported
|
||||
BIOS Revision: 0.0
|
||||
|
||||
Handle 0x0100, DMI type 1, 27 bytes
|
||||
System Information
|
||||
Manufacturer: QEMU
|
||||
Product Name: Standard PC (i440FX + PIIX, 1996)
|
||||
Version: pc-i440fx-10.0
|
||||
Serial Number: Not Specified
|
||||
UUID: TEST-0002
|
||||
Wake-up Type: Power Switch
|
||||
SKU Number: Not Specified
|
||||
Family: Not Specified
|
||||
|
||||
Handle 0x0300, DMI type 3, 22 bytes
|
||||
Chassis Information
|
||||
Manufacturer: QEMU
|
||||
Type: Other
|
||||
Lock: Not Present
|
||||
Version: pc-i440fx-10.0
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Boot-up State: Safe
|
||||
Power Supply State: Safe
|
||||
Thermal State: Safe
|
||||
Security Status: Unknown
|
||||
OEM Information: 0x00000000
|
||||
Height: Unspecified
|
||||
Number Of Power Cords: Unspecified
|
||||
Contained Elements: 0
|
||||
SKU Number: Not Specified
|
||||
|
||||
Handle 0x2000, DMI type 32, 11 bytes
|
||||
System Boot Information
|
||||
Status: No errors detected
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
# dmidecode 3.6
|
||||
Getting SMBIOS data from sysfs.
|
||||
SMBIOS 2.8 present.
|
||||
|
||||
Handle 0x1000, DMI type 16, 23 bytes
|
||||
Physical Memory Array
|
||||
Location: Other
|
||||
Use: System Memory
|
||||
Error Correction Type: Multi-bit ECC
|
||||
Maximum Capacity: 32 GB
|
||||
Error Information Handle: Not Provided
|
||||
Number Of Devices: 1
|
||||
|
||||
Handle 0x1100, DMI type 17, 40 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x1000
|
||||
Error Information Handle: Not Provided
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: 32 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM 0
|
||||
Bank Locator: Not Specified
|
||||
Type: RAM
|
||||
Type Detail: Other
|
||||
Speed: Unknown
|
||||
Manufacturer: QEMU
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Rank: Unknown
|
||||
Configured Memory Speed: Unknown
|
||||
Minimum Voltage: Unknown
|
||||
Maximum Voltage: Unknown
|
||||
Configured Voltage: Unknown
|
||||
|
||||
@@ -0,0 +1,404 @@
|
||||
# dmidecode 3.6
|
||||
Getting SMBIOS data from sysfs.
|
||||
SMBIOS 2.8 present.
|
||||
|
||||
Handle 0x0400, DMI type 4, 42 bytes
|
||||
Processor Information
|
||||
Socket Designation: CPU 0
|
||||
Type: Central Processor
|
||||
Family: Other
|
||||
Manufacturer: QEMU
|
||||
ID: TEST-0001
|
||||
Version: pc-i440fx-10.0
|
||||
Voltage: Unknown
|
||||
External Clock: Unknown
|
||||
Max Speed: 2000 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Other
|
||||
L1 Cache Handle: Not Provided
|
||||
L2 Cache Handle: Not Provided
|
||||
L3 Cache Handle: Not Provided
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Core Count: 1
|
||||
Core Enabled: 1
|
||||
Thread Count: 1
|
||||
Characteristics: None
|
||||
|
||||
Handle 0x0401, DMI type 4, 42 bytes
|
||||
Processor Information
|
||||
Socket Designation: CPU 1
|
||||
Type: Central Processor
|
||||
Family: Other
|
||||
Manufacturer: QEMU
|
||||
ID: TEST-0004
|
||||
Version: pc-i440fx-10.0
|
||||
Voltage: Unknown
|
||||
External Clock: Unknown
|
||||
Max Speed: 2000 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Other
|
||||
L1 Cache Handle: Not Provided
|
||||
L2 Cache Handle: Not Provided
|
||||
L3 Cache Handle: Not Provided
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Core Count: 1
|
||||
Core Enabled: 1
|
||||
Thread Count: 1
|
||||
Characteristics: None
|
||||
|
||||
Handle 0x0402, DMI type 4, 42 bytes
|
||||
Processor Information
|
||||
Socket Designation: CPU 2
|
||||
Type: Central Processor
|
||||
Family: Other
|
||||
Manufacturer: QEMU
|
||||
ID: TEST-0007
|
||||
Version: pc-i440fx-10.0
|
||||
Voltage: Unknown
|
||||
External Clock: Unknown
|
||||
Max Speed: 2000 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Other
|
||||
L1 Cache Handle: Not Provided
|
||||
L2 Cache Handle: Not Provided
|
||||
L3 Cache Handle: Not Provided
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Core Count: 1
|
||||
Core Enabled: 1
|
||||
Thread Count: 1
|
||||
Characteristics: None
|
||||
|
||||
Handle 0x0403, DMI type 4, 42 bytes
|
||||
Processor Information
|
||||
Socket Designation: CPU 3
|
||||
Type: Central Processor
|
||||
Family: Other
|
||||
Manufacturer: QEMU
|
||||
ID: TEST-0010
|
||||
Version: pc-i440fx-10.0
|
||||
Voltage: Unknown
|
||||
External Clock: Unknown
|
||||
Max Speed: 2000 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Other
|
||||
L1 Cache Handle: Not Provided
|
||||
L2 Cache Handle: Not Provided
|
||||
L3 Cache Handle: Not Provided
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Core Count: 1
|
||||
Core Enabled: 1
|
||||
Thread Count: 1
|
||||
Characteristics: None
|
||||
|
||||
Handle 0x0404, DMI type 4, 42 bytes
|
||||
Processor Information
|
||||
Socket Designation: CPU 4
|
||||
Type: Central Processor
|
||||
Family: Other
|
||||
Manufacturer: QEMU
|
||||
ID: TEST-0013
|
||||
Version: pc-i440fx-10.0
|
||||
Voltage: Unknown
|
||||
External Clock: Unknown
|
||||
Max Speed: 2000 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Other
|
||||
L1 Cache Handle: Not Provided
|
||||
L2 Cache Handle: Not Provided
|
||||
L3 Cache Handle: Not Provided
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Core Count: 1
|
||||
Core Enabled: 1
|
||||
Thread Count: 1
|
||||
Characteristics: None
|
||||
|
||||
Handle 0x0405, DMI type 4, 42 bytes
|
||||
Processor Information
|
||||
Socket Designation: CPU 5
|
||||
Type: Central Processor
|
||||
Family: Other
|
||||
Manufacturer: QEMU
|
||||
ID: TEST-0016
|
||||
Version: pc-i440fx-10.0
|
||||
Voltage: Unknown
|
||||
External Clock: Unknown
|
||||
Max Speed: 2000 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Other
|
||||
L1 Cache Handle: Not Provided
|
||||
L2 Cache Handle: Not Provided
|
||||
L3 Cache Handle: Not Provided
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Core Count: 1
|
||||
Core Enabled: 1
|
||||
Thread Count: 1
|
||||
Characteristics: None
|
||||
|
||||
Handle 0x0406, DMI type 4, 42 bytes
|
||||
Processor Information
|
||||
Socket Designation: CPU 6
|
||||
Type: Central Processor
|
||||
Family: Other
|
||||
Manufacturer: QEMU
|
||||
ID: TEST-0019
|
||||
Version: pc-i440fx-10.0
|
||||
Voltage: Unknown
|
||||
External Clock: Unknown
|
||||
Max Speed: 2000 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Other
|
||||
L1 Cache Handle: Not Provided
|
||||
L2 Cache Handle: Not Provided
|
||||
L3 Cache Handle: Not Provided
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Core Count: 1
|
||||
Core Enabled: 1
|
||||
Thread Count: 1
|
||||
Characteristics: None
|
||||
|
||||
Handle 0x0407, DMI type 4, 42 bytes
|
||||
Processor Information
|
||||
Socket Designation: CPU 7
|
||||
Type: Central Processor
|
||||
Family: Other
|
||||
Manufacturer: QEMU
|
||||
ID: TEST-0022
|
||||
Version: pc-i440fx-10.0
|
||||
Voltage: Unknown
|
||||
External Clock: Unknown
|
||||
Max Speed: 2000 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Other
|
||||
L1 Cache Handle: Not Provided
|
||||
L2 Cache Handle: Not Provided
|
||||
L3 Cache Handle: Not Provided
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Core Count: 1
|
||||
Core Enabled: 1
|
||||
Thread Count: 1
|
||||
Characteristics: None
|
||||
|
||||
Handle 0x0408, DMI type 4, 42 bytes
|
||||
Processor Information
|
||||
Socket Designation: CPU 8
|
||||
Type: Central Processor
|
||||
Family: Other
|
||||
Manufacturer: QEMU
|
||||
ID: TEST-0025
|
||||
Version: pc-i440fx-10.0
|
||||
Voltage: Unknown
|
||||
External Clock: Unknown
|
||||
Max Speed: 2000 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Other
|
||||
L1 Cache Handle: Not Provided
|
||||
L2 Cache Handle: Not Provided
|
||||
L3 Cache Handle: Not Provided
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Core Count: 1
|
||||
Core Enabled: 1
|
||||
Thread Count: 1
|
||||
Characteristics: None
|
||||
|
||||
Handle 0x0409, DMI type 4, 42 bytes
|
||||
Processor Information
|
||||
Socket Designation: CPU 9
|
||||
Type: Central Processor
|
||||
Family: Other
|
||||
Manufacturer: QEMU
|
||||
ID: TEST-0028
|
||||
Version: pc-i440fx-10.0
|
||||
Voltage: Unknown
|
||||
External Clock: Unknown
|
||||
Max Speed: 2000 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Other
|
||||
L1 Cache Handle: Not Provided
|
||||
L2 Cache Handle: Not Provided
|
||||
L3 Cache Handle: Not Provided
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Core Count: 1
|
||||
Core Enabled: 1
|
||||
Thread Count: 1
|
||||
Characteristics: None
|
||||
|
||||
Handle 0x040A, DMI type 4, 42 bytes
|
||||
Processor Information
|
||||
Socket Designation: CPU a
|
||||
Type: Central Processor
|
||||
Family: Other
|
||||
Manufacturer: QEMU
|
||||
ID: TEST-0031
|
||||
Version: pc-i440fx-10.0
|
||||
Voltage: Unknown
|
||||
External Clock: Unknown
|
||||
Max Speed: 2000 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Other
|
||||
L1 Cache Handle: Not Provided
|
||||
L2 Cache Handle: Not Provided
|
||||
L3 Cache Handle: Not Provided
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Core Count: 1
|
||||
Core Enabled: 1
|
||||
Thread Count: 1
|
||||
Characteristics: None
|
||||
|
||||
Handle 0x040B, DMI type 4, 42 bytes
|
||||
Processor Information
|
||||
Socket Designation: CPU b
|
||||
Type: Central Processor
|
||||
Family: Other
|
||||
Manufacturer: QEMU
|
||||
ID: TEST-0034
|
||||
Version: pc-i440fx-10.0
|
||||
Voltage: Unknown
|
||||
External Clock: Unknown
|
||||
Max Speed: 2000 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Other
|
||||
L1 Cache Handle: Not Provided
|
||||
L2 Cache Handle: Not Provided
|
||||
L3 Cache Handle: Not Provided
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Core Count: 1
|
||||
Core Enabled: 1
|
||||
Thread Count: 1
|
||||
Characteristics: None
|
||||
|
||||
Handle 0x040C, DMI type 4, 42 bytes
|
||||
Processor Information
|
||||
Socket Designation: CPU c
|
||||
Type: Central Processor
|
||||
Family: Other
|
||||
Manufacturer: QEMU
|
||||
ID: TEST-0037
|
||||
Version: pc-i440fx-10.0
|
||||
Voltage: Unknown
|
||||
External Clock: Unknown
|
||||
Max Speed: 2000 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Other
|
||||
L1 Cache Handle: Not Provided
|
||||
L2 Cache Handle: Not Provided
|
||||
L3 Cache Handle: Not Provided
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Core Count: 1
|
||||
Core Enabled: 1
|
||||
Thread Count: 1
|
||||
Characteristics: None
|
||||
|
||||
Handle 0x040D, DMI type 4, 42 bytes
|
||||
Processor Information
|
||||
Socket Designation: CPU d
|
||||
Type: Central Processor
|
||||
Family: Other
|
||||
Manufacturer: QEMU
|
||||
ID: TEST-0040
|
||||
Version: pc-i440fx-10.0
|
||||
Voltage: Unknown
|
||||
External Clock: Unknown
|
||||
Max Speed: 2000 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Other
|
||||
L1 Cache Handle: Not Provided
|
||||
L2 Cache Handle: Not Provided
|
||||
L3 Cache Handle: Not Provided
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Core Count: 1
|
||||
Core Enabled: 1
|
||||
Thread Count: 1
|
||||
Characteristics: None
|
||||
|
||||
Handle 0x040E, DMI type 4, 42 bytes
|
||||
Processor Information
|
||||
Socket Designation: CPU e
|
||||
Type: Central Processor
|
||||
Family: Other
|
||||
Manufacturer: QEMU
|
||||
ID: TEST-0043
|
||||
Version: pc-i440fx-10.0
|
||||
Voltage: Unknown
|
||||
External Clock: Unknown
|
||||
Max Speed: 2000 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Other
|
||||
L1 Cache Handle: Not Provided
|
||||
L2 Cache Handle: Not Provided
|
||||
L3 Cache Handle: Not Provided
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Core Count: 1
|
||||
Core Enabled: 1
|
||||
Thread Count: 1
|
||||
Characteristics: None
|
||||
|
||||
Handle 0x040F, DMI type 4, 42 bytes
|
||||
Processor Information
|
||||
Socket Designation: CPU f
|
||||
Type: Central Processor
|
||||
Family: Other
|
||||
Manufacturer: QEMU
|
||||
ID: TEST-0046
|
||||
Version: pc-i440fx-10.0
|
||||
Voltage: Unknown
|
||||
External Clock: Unknown
|
||||
Max Speed: 2000 MHz
|
||||
Current Speed: 2000 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Other
|
||||
L1 Cache Handle: Not Provided
|
||||
L2 Cache Handle: Not Provided
|
||||
L3 Cache Handle: Not Provided
|
||||
Serial Number: Not Specified
|
||||
Asset Tag: Not Specified
|
||||
Part Number: Not Specified
|
||||
Core Count: 1
|
||||
Core Enabled: 1
|
||||
Thread Count: 1
|
||||
Characteristics: None
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
# dmidecode 3.6
|
||||
Getting SMBIOS data from sysfs.
|
||||
SMBIOS 3.3.0 present.
|
||||
|
||||
Handle 0x0000, DMI type 0, 26 bytes
|
||||
BIOS Information
|
||||
Vendor: GIGABYTE
|
||||
Version: M30
|
||||
Release Date: 06/23/2026
|
||||
Address: 0xF0000
|
||||
Runtime Size: 64 kB
|
||||
ROM Size: 16 MB
|
||||
Characteristics:
|
||||
PCI is supported
|
||||
BIOS is upgradeable
|
||||
BIOS shadowing is allowed
|
||||
Boot from CD is supported
|
||||
Selectable boot is supported
|
||||
BIOS ROM is socketed
|
||||
EDD is supported
|
||||
Japanese floppy for NEC 9800 1.2 MB is supported (int 13h)
|
||||
Japanese floppy for Toshiba 1.2 MB is supported (int 13h)
|
||||
5.25"/360 kB floppy services are supported (int 13h)
|
||||
5.25"/1.2 MB floppy services are supported (int 13h)
|
||||
3.5"/720 kB floppy services are supported (int 13h)
|
||||
3.5"/2.88 MB floppy services are supported (int 13h)
|
||||
Print screen service is supported (int 5h)
|
||||
Serial services are supported (int 14h)
|
||||
Printer services are supported (int 17h)
|
||||
CGA/mono video services are supported (int 10h)
|
||||
USB legacy is supported
|
||||
BIOS boot specification is supported
|
||||
Targeted content distribution is supported
|
||||
UEFI is supported
|
||||
BIOS Revision: 5.22
|
||||
|
||||
Handle 0x0001, DMI type 1, 27 bytes
|
||||
System Information
|
||||
Manufacturer: GIGABYTE
|
||||
Product Name: H262-Z62-ZB
|
||||
Version: 0100
|
||||
Serial Number: TEST-0001
|
||||
UUID: TEST-0002
|
||||
Wake-up Type: Power Switch
|
||||
SKU Number: 01234567890123456789AB
|
||||
Family: Server
|
||||
|
||||
Handle 0x0002, DMI type 2, 15 bytes
|
||||
Base Board Information
|
||||
Manufacturer: GIGABYTE
|
||||
Product Name: MZ62-HD0-ZB
|
||||
Version: 02000200
|
||||
Serial Number: TEST-0003
|
||||
Asset Tag: TEST-0004
|
||||
Features:
|
||||
Board is a hosting board
|
||||
Board is removable
|
||||
Board is replaceable
|
||||
Location In Chassis: 01234567890123456789AB
|
||||
Chassis Handle: 0x0003
|
||||
Type: Motherboard
|
||||
Contained Object Handles: 0
|
||||
|
||||
Handle 0x0003, DMI type 3, 22 bytes
|
||||
Chassis Information
|
||||
Manufacturer: GIGABYTE
|
||||
Type: Rack Mount Chassis
|
||||
Lock: Not Present
|
||||
Version: 01234567
|
||||
Serial Number: TEST-0005
|
||||
Asset Tag: TEST-0006
|
||||
Boot-up State: Safe
|
||||
Power Supply State: Safe
|
||||
Thermal State: Safe
|
||||
Security Status: None
|
||||
OEM Information: 0x00000000
|
||||
Height: Unspecified
|
||||
Number Of Power Cords: 1
|
||||
Contained Elements: 0
|
||||
SKU Number: 01234567890123456789AB
|
||||
|
||||
Handle 0x0023, DMI type 10, 10 bytes
|
||||
On Board Device 1 Information
|
||||
Type: Video
|
||||
Status: Enabled
|
||||
Description: AST2500
|
||||
On Board Device 2 Information
|
||||
Type: Ethernet
|
||||
Status: Enabled
|
||||
Description: Intel i350 Lan1
|
||||
On Board Device 3 Information
|
||||
Type: Ethernet
|
||||
Status: Enabled
|
||||
Description: Intel i350 Lan2
|
||||
|
||||
Handle 0x0024, DMI type 41, 11 bytes
|
||||
Onboard Device
|
||||
Reference Designation: Onboard VGA
|
||||
Type: Video
|
||||
Status: Enabled
|
||||
Type Instance: 1
|
||||
Bus Address: 0000:63:00.0
|
||||
|
||||
Handle 0x0025, DMI type 41, 11 bytes
|
||||
Onboard Device
|
||||
Reference Designation: Onboard LAN1
|
||||
Type: Ethernet
|
||||
Status: Enabled
|
||||
Type Instance: 1
|
||||
Bus Address: 0000:61:00.0
|
||||
|
||||
Handle 0x0026, DMI type 41, 11 bytes
|
||||
Onboard Device
|
||||
Reference Designation: Onboard LAN2
|
||||
Type: Ethernet
|
||||
Status: Enabled
|
||||
Type Instance: 2
|
||||
Bus Address: 0000:61:00.1
|
||||
|
||||
Handle 0x0037, DMI type 15, 73 bytes
|
||||
System Event Log
|
||||
Area Length: 0 bytes
|
||||
Header Start Offset: 0x0000
|
||||
Header Length: 16 bytes
|
||||
Data Start Offset: 0x0010
|
||||
Access Method: Memory-mapped physical 32-bit address
|
||||
Access Address: 0xFF536000
|
||||
Status: Valid, Not Full
|
||||
Change Token: 0x00000015
|
||||
Header Format: Type 1
|
||||
Supported Log Type Descriptors: 25
|
||||
Descriptor 1: Single-bit ECC memory error
|
||||
Data Format 1: Multiple-event handle
|
||||
Descriptor 2: Multi-bit ECC memory error
|
||||
Data Format 2: Multiple-event handle
|
||||
Descriptor 3: Parity memory error
|
||||
Data Format 3: None
|
||||
Descriptor 4: Bus timeout
|
||||
Data Format 4: None
|
||||
Descriptor 5: I/O channel block
|
||||
Data Format 5: None
|
||||
Descriptor 6: Software NMI
|
||||
Data Format 6: None
|
||||
Descriptor 7: POST memory resize
|
||||
Data Format 7: None
|
||||
Descriptor 8: POST error
|
||||
Data Format 8: POST results bitmap
|
||||
Descriptor 9: PCI parity error
|
||||
Data Format 9: Multiple-event handle
|
||||
Descriptor 10: PCI system error
|
||||
Data Format 10: Multiple-event handle
|
||||
Descriptor 11: CPU failure
|
||||
Data Format 11: None
|
||||
Descriptor 12: EISA failsafe timer timeout
|
||||
Data Format 12: None
|
||||
Descriptor 13: Correctable memory log disabled
|
||||
Data Format 13: None
|
||||
Descriptor 14: Logging disabled
|
||||
Data Format 14: None
|
||||
Descriptor 15: System limit exceeded
|
||||
Data Format 15: None
|
||||
Descriptor 16: Asynchronous hardware timer expired
|
||||
Data Format 16: None
|
||||
Descriptor 17: System configuration information
|
||||
Data Format 17: None
|
||||
Descriptor 18: Hard disk information
|
||||
Data Format 18: None
|
||||
Descriptor 19: System reconfigured
|
||||
Data Format 19: None
|
||||
Descriptor 20: Uncorrectable CPU-complex error
|
||||
Data Format 20: None
|
||||
Descriptor 21: Log area reset/cleared
|
||||
Data Format 21: None
|
||||
Descriptor 22: System boot
|
||||
Data Format 22: None
|
||||
Descriptor 23: End of log
|
||||
Data Format 23: None
|
||||
Descriptor 24: OEM-specific
|
||||
Data Format 24: OEM-specific
|
||||
Descriptor 25: OEM-specific
|
||||
Data Format 25: OEM-specific
|
||||
|
||||
Handle 0x0085, DMI type 13, 22 bytes
|
||||
BIOS Language Information
|
||||
Language Description Format: Long
|
||||
Installable Languages: 1
|
||||
en|US|iso8859-1
|
||||
Currently Installed Language: en|US|iso8859-1
|
||||
|
||||
@@ -0,0 +1,531 @@
|
||||
# dmidecode 3.6
|
||||
Getting SMBIOS data from sysfs.
|
||||
SMBIOS 3.3.0 present.
|
||||
|
||||
Handle 0x0039, DMI type 16, 23 bytes
|
||||
Physical Memory Array
|
||||
Location: System Board Or Motherboard
|
||||
Use: System Memory
|
||||
Error Correction Type: Multi-bit ECC
|
||||
Maximum Capacity: 4 TB
|
||||
Error Information Handle: 0x0038
|
||||
Number Of Devices: 16
|
||||
|
||||
Handle 0x0041, DMI type 17, 92 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0039
|
||||
Error Information Handle: 0x0040
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P0_A0
|
||||
Bank Locator: BANK 0
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2933 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0001
|
||||
Asset Tag: TEST-0002
|
||||
Part Number: HMA82GR7JJR8N-WM
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2933 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0044, DMI type 17, 92 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0039
|
||||
Error Information Handle: 0x0043
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P0_B0
|
||||
Bank Locator: BANK 0
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2933 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0003
|
||||
Asset Tag: TEST-0004
|
||||
Part Number: HMA82GR7JJR8N-WM
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2933 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0047, DMI type 17, 92 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0039
|
||||
Error Information Handle: 0x0046
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P0_C0
|
||||
Bank Locator: BANK 0
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2933 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0005
|
||||
Asset Tag: TEST-0006
|
||||
Part Number: HMA82GR7JJR8N-WM
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2933 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x004A, DMI type 17, 92 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0039
|
||||
Error Information Handle: 0x0049
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P0_D0
|
||||
Bank Locator: BANK 0
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2933 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0007
|
||||
Asset Tag: TEST-0008
|
||||
Part Number: HMA82GR7JJR8N-WM
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2933 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x004D, DMI type 17, 92 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0039
|
||||
Error Information Handle: 0x004C
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P0_E0
|
||||
Bank Locator: BANK 0
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2933 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0009
|
||||
Asset Tag: TEST-0010
|
||||
Part Number: HMA82GR7JJR8N-WM
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2933 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0050, DMI type 17, 92 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0039
|
||||
Error Information Handle: 0x004F
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P0_F0
|
||||
Bank Locator: BANK 0
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2933 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0011
|
||||
Asset Tag: TEST-0012
|
||||
Part Number: HMA82GR7JJR8N-WM
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2933 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0053, DMI type 17, 92 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0039
|
||||
Error Information Handle: 0x0052
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P0_G0
|
||||
Bank Locator: BANK 0
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2933 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0013
|
||||
Asset Tag: TEST-0014
|
||||
Part Number: HMA82GR7JJR8N-WM
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2933 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0056, DMI type 17, 92 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0039
|
||||
Error Information Handle: 0x0055
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P0_H0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x005C, DMI type 17, 92 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0039
|
||||
Error Information Handle: 0x005B
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P1_I0
|
||||
Bank Locator: BANK 0
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2933 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0015
|
||||
Asset Tag: TEST-0016
|
||||
Part Number: HMA82GR7JJR8N-WM
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2933 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x005F, DMI type 17, 92 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0039
|
||||
Error Information Handle: 0x005E
|
||||
Total Width: Unknown
|
||||
Data Width: Unknown
|
||||
Size: No Module Installed
|
||||
Form Factor: Unknown
|
||||
Set: None
|
||||
Locator: DIMM_P1_J0
|
||||
Bank Locator: BANK 0
|
||||
Type: Unknown
|
||||
Type Detail: Unknown
|
||||
|
||||
Handle 0x0061, DMI type 17, 92 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0039
|
||||
Error Information Handle: 0x0060
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P1_K0
|
||||
Bank Locator: BANK 0
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2933 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0017
|
||||
Asset Tag: TEST-0018
|
||||
Part Number: HMA82GR7JJR8N-WM
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2933 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0064, DMI type 17, 92 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0039
|
||||
Error Information Handle: 0x0063
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P1_L0
|
||||
Bank Locator: BANK 0
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2933 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0019
|
||||
Asset Tag: TEST-0020
|
||||
Part Number: HMA82GR7JJR8N-WM
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2933 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0067, DMI type 17, 92 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0039
|
||||
Error Information Handle: 0x0066
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P1_M0
|
||||
Bank Locator: BANK 0
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2933 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0021
|
||||
Asset Tag: TEST-0022
|
||||
Part Number: HMA82GR7JJR8N-WM
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2933 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x006A, DMI type 17, 92 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0039
|
||||
Error Information Handle: 0x0069
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P1_N0
|
||||
Bank Locator: BANK 0
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2933 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0023
|
||||
Asset Tag: TEST-0024
|
||||
Part Number: HMA82GR7JJR8N-WM
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2933 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x006D, DMI type 17, 92 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0039
|
||||
Error Information Handle: 0x006C
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P1_O0
|
||||
Bank Locator: BANK 0
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2933 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0025
|
||||
Asset Tag: TEST-0026
|
||||
Part Number: HMA82GR7JJR8N-WM
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2933 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
Handle 0x0070, DMI type 17, 92 bytes
|
||||
Memory Device
|
||||
Array Handle: 0x0039
|
||||
Error Information Handle: 0x006F
|
||||
Total Width: 72 bits
|
||||
Data Width: 64 bits
|
||||
Size: 16 GB
|
||||
Form Factor: DIMM
|
||||
Set: None
|
||||
Locator: DIMM_P1_P0
|
||||
Bank Locator: BANK 0
|
||||
Type: DDR4
|
||||
Type Detail: Synchronous Registered (Buffered)
|
||||
Speed: 2933 MT/s
|
||||
Manufacturer: SK Hynix
|
||||
Serial Number: TEST-0027
|
||||
Asset Tag: TEST-0028
|
||||
Part Number: HMA82GR7JJR8N-WM
|
||||
Rank: 2
|
||||
Configured Memory Speed: 2933 MT/s
|
||||
Minimum Voltage: 1.2 V
|
||||
Maximum Voltage: 1.2 V
|
||||
Configured Voltage: 1.2 V
|
||||
Memory Technology: DRAM
|
||||
Memory Operating Mode Capability: Volatile memory
|
||||
Firmware Version: Unknown
|
||||
Module Manufacturer ID: Bank 1, Hex 0xAD
|
||||
Module Product ID: Unknown
|
||||
Memory Subsystem Controller Manufacturer ID: Unknown
|
||||
Memory Subsystem Controller Product ID: Unknown
|
||||
Non-Volatile Size: None
|
||||
Volatile Size: 16 GB
|
||||
Cache Size: None
|
||||
Logical Size: None
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
# dmidecode 3.6
|
||||
Getting SMBIOS data from sysfs.
|
||||
SMBIOS 3.3.0 present.
|
||||
|
||||
Handle 0x003F, DMI type 4, 48 bytes
|
||||
Processor Information
|
||||
Socket Designation: P0
|
||||
Type: Central Processor
|
||||
Family: Zen
|
||||
Manufacturer: Advanced Micro Devices, Inc.
|
||||
ID: TEST-0001
|
||||
Signature: Family 25, Model 1, Stepping 1
|
||||
Flags:
|
||||
FPU (Floating-point unit on-chip)
|
||||
VME (Virtual mode extension)
|
||||
DE (Debugging extension)
|
||||
PSE (Page size extension)
|
||||
TSC (Time stamp counter)
|
||||
MSR (Model specific registers)
|
||||
PAE (Physical address extension)
|
||||
MCE (Machine check exception)
|
||||
CX8 (CMPXCHG8 instruction supported)
|
||||
APIC (On-chip APIC hardware supported)
|
||||
SEP (Fast system call)
|
||||
MTRR (Memory type range registers)
|
||||
PGE (Page global enable)
|
||||
MCA (Machine check architecture)
|
||||
CMOV (Conditional move instruction supported)
|
||||
PAT (Page attribute table)
|
||||
PSE-36 (36-bit page size extension)
|
||||
CLFSH (CLFLUSH instruction supported)
|
||||
MMX (MMX technology supported)
|
||||
FXSR (FXSAVE and FXSTOR instructions supported)
|
||||
SSE (Streaming SIMD extensions)
|
||||
SSE2 (Streaming SIMD extensions 2)
|
||||
HTT (Multi-threading)
|
||||
Version: AMD EPYC 7513 32-Core Processor
|
||||
Voltage: 1.1 V
|
||||
External Clock: 100 MHz
|
||||
Max Speed: 3675 MHz
|
||||
Current Speed: 2600 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Socket SP3
|
||||
L1 Cache Handle: 0x003C
|
||||
L2 Cache Handle: 0x003D
|
||||
L3 Cache Handle: 0x003E
|
||||
Serial Number: Unknown
|
||||
Asset Tag: Unknown
|
||||
Part Number: Unknown
|
||||
Core Count: 32
|
||||
Core Enabled: 32
|
||||
Thread Count: 64
|
||||
Characteristics:
|
||||
64-bit capable
|
||||
Multi-Core
|
||||
Hardware Thread
|
||||
Execute Protection
|
||||
Enhanced Virtualization
|
||||
Power/Performance Control
|
||||
|
||||
Handle 0x005A, DMI type 4, 48 bytes
|
||||
Processor Information
|
||||
Socket Designation: P1
|
||||
Type: Central Processor
|
||||
Family: Zen
|
||||
Manufacturer: Advanced Micro Devices, Inc.
|
||||
ID: TEST-0004
|
||||
Signature: Family 25, Model 1, Stepping 1
|
||||
Flags:
|
||||
FPU (Floating-point unit on-chip)
|
||||
VME (Virtual mode extension)
|
||||
DE (Debugging extension)
|
||||
PSE (Page size extension)
|
||||
TSC (Time stamp counter)
|
||||
MSR (Model specific registers)
|
||||
PAE (Physical address extension)
|
||||
MCE (Machine check exception)
|
||||
CX8 (CMPXCHG8 instruction supported)
|
||||
APIC (On-chip APIC hardware supported)
|
||||
SEP (Fast system call)
|
||||
MTRR (Memory type range registers)
|
||||
PGE (Page global enable)
|
||||
MCA (Machine check architecture)
|
||||
CMOV (Conditional move instruction supported)
|
||||
PAT (Page attribute table)
|
||||
PSE-36 (36-bit page size extension)
|
||||
CLFSH (CLFLUSH instruction supported)
|
||||
MMX (MMX technology supported)
|
||||
FXSR (FXSAVE and FXSTOR instructions supported)
|
||||
SSE (Streaming SIMD extensions)
|
||||
SSE2 (Streaming SIMD extensions 2)
|
||||
HTT (Multi-threading)
|
||||
Version: AMD EPYC 7513 32-Core Processor
|
||||
Voltage: 1.1 V
|
||||
External Clock: 100 MHz
|
||||
Max Speed: 3675 MHz
|
||||
Current Speed: 2600 MHz
|
||||
Status: Populated, Enabled
|
||||
Upgrade: Socket SP3
|
||||
L1 Cache Handle: 0x0057
|
||||
L2 Cache Handle: 0x0058
|
||||
L3 Cache Handle: 0x0059
|
||||
Serial Number: Unknown
|
||||
Asset Tag: Unknown
|
||||
Part Number: Unknown
|
||||
Core Count: 32
|
||||
Core Enabled: 32
|
||||
Thread Count: 64
|
||||
Characteristics:
|
||||
64-bit capable
|
||||
Multi-Core
|
||||
Hardware Thread
|
||||
Execute Protection
|
||||
Enhanced Virtualization
|
||||
Power/Performance Control
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"Neighbors":[{"InterfaceIndex":2,"InterfaceName":"eno1","InterfaceAlternativeNames":["enp97s0f0","enx74563c072e4f"],"Neighbors":[{"ChassisID":"04:f4:1c:ec:da:9e","RawChassisID":[4,4,244,28,236,218,158],"PortID":"ether18","RawPortID":[5,101,116,104,101,114,49,56],"PortDescription":"bridge/ether18","SystemName":"MikroTik 1gbe","SystemDescription":"MikroTik RouterOS 7.19.6 (stable) 2025-09-12 09:02:42 CRS326-24G-2S+","EnabledCapabilities":20}]},{"InterfaceIndex":19,"InterfaceName":"enp33s0f0np0","InterfaceAlternativeNames":["enxb8599fe8b142"],"Neighbors":[{"ChassisID":"d0:ea:11:a8:91:4c","RawChassisID":[4,208,234,17,168,145,76],"PortID":"qsfp28-7-1","RawPortID":[5,113,115,102,112,50,56,45,55,45,49],"PortDescription":"bridge/qsfp28-7-1","SystemName":"MikroTik 100gbe","SystemDescription":"MikroTik RouterOS 7.20.8 (long-term) 2026-01-30 09:17:54 CRS520-4XS-16XQ","EnabledCapabilities":20}]},{"InterfaceIndex":20,"InterfaceName":"enp33s0f1np1","InterfaceAlternativeNames":["enxb8599fe8b143"],"Neighbors":[{"ChassisID":"d0:ea:11:a8:91:4c","RawChassisID":[4,208,234,17,168,145,76],"PortID":"qsfp28-5-1","RawPortID":[5,113,115,102,112,50,56,45,53,45,49],"PortDescription":"bridge/qsfp28-5-1","SystemName":"MikroTik 100gbe","SystemDescription":"MikroTik RouterOS 7.20.8 (long-term) 2026-01-30 09:17:54 CRS520-4XS-16XQ","EnabledCapabilities":20}]}]}
|
||||
@@ -677,6 +677,7 @@ func launchService(config *config.ClusterConfig) error {
|
||||
Credentials: bedrockCredentials,
|
||||
Access: bedrockAccess,
|
||||
|
||||
NetworkTests: operatoradmin.NewKVNetworkTests(js),
|
||||
IAM: iamService,
|
||||
Quota: quotaSvc,
|
||||
BucketStore: objStore,
|
||||
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{Ft as e,Mt as t,Pt as n}from"./schemas-CKmbY8gV.js";import{s as r}from"./tabs-C7-u1MlW.js";function i(i){let{render:a,className:o,style:s,state:c=e,props:l=n,refs:u=n,metadata:d,stateAttributesMapping:f,tag:p=`div`,...m}=i,{compositeProps:h,compositeRef:g}=r({metadata:d});return t(p,i,{state:c,ref:[g,...u],props:[h,...l,m],stateAttributesMapping:f})}export{i as t};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{Ct as e,Et as t,Tt as n}from"./schemas-DCQXG11d.js";import{r}from"./CompositeRoot-CmHoR-Tk.js";function i(i){let{render:a,className:o,style:s,state:c=t,props:l=n,refs:u=n,metadata:d,stateAttributesMapping:f,tag:p=`div`,...m}=i,{compositeProps:h,compositeRef:g}=r({metadata:d});return e(p,i,{state:c,ref:[g,...u],props:[h,...l,m],stateAttributesMapping:f})}export{i as t};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Ct as t,Et as n,It as r,Lt as i,Q as a,Tt as o,Z as s,et as c,kt as l,tt as u}from"./schemas-DCQXG11d.js";import{$ as d,_ as f,a as p,d as m,i as h,l as g,m as _,n as v,p as y,r as b,s as x,t as S,u as C,v as w}from"./composite-DysENEse.js";import{i as T,n as E,r as D,t as O}from"./isElementDisabled-B7Ri5ug6.js";var k=e(i(),1);function A(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=a(),{ref:i,index:o}=E(e),s=n===o,c=k.useRef(null),u=l(i,c);return{compositeProps:{tabIndex:s?0:-1,onFocus(){r(o)},onMouseMove(){let e=c.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!s&&!n&&e.focus()}},compositeRef:u,index:o}}var j=`data-composite-item-active`;function M(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:s,onHighlightedIndexChange:x,rootRef:T,enableHomeAndEndKeys:E=!1,stopEventPropagation:D,disabledIndices:A,modifierKeys:j=o}=e,[M,F]=k.useState(0),I=r!=null,L=k.useRef(null),R=l(L,T),z=k.useRef([]),B=k.useRef(!1),V=k.useRef(null),H=s??M,U=u((e,t=!1)=>{if(V.current=z.current[e]??null,(x??F)(e),t){let t=z.current[e];C(L.current,t,a,n)}}),W=u(e=>{if(e.size===0)return;if(B.current){let e=z.current,t=e.indexOf(V.current);if(t===-1){let t=e[H];!t||w(e,H,A)?U(N(e,A)):V.current=t}else t!==H&&U(t);return}B.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)U(i);else if(w(t,H,A)){let e=m(t,{disabledIndices:A});f(t,e)||U(e)}C(L.current,r,a,n)});c(()=>{if(A==null||s!=null||!B.current)return;let e=z.current;if(w(e,H,A)){let t=m(e,{disabledIndices:A});f(e,t)||U(t)}},[A,s,H,z,U]);let G=u((e,t,n)=>i?i(e,t,n,z):n),K=u(e=>{let o=e.key===`Home`||e.key===`End`;if(!p.has(e.key)||!E&&o||P(e,j)||!L.current)return;let s=a===`rtl`,c=s?v:b,l=s?b:v,u=n===`vertical`?S:c,x=n===`vertical`?h:l,C=d(e.nativeEvent);if(C!=null&&g(C)&&!O(C)){let t=C.selectionStart,n=C.selectionEnd,r=C.value;if(t==null||e.shiftKey||t!==n||e.key!==x&&t<r.length||e.key!==u&&t>0)return}let w=H,T=_(z,A),k=y(z,A);r!=null&&(w=r({disabledIndices:A,elementsRef:z,event:e,highlightedIndex:H,loopFocus:t,maxIndex:k,minIndex:T,onLoop:G,orientation:n,rtl:s}));let M=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,N=n!==`vertical`&&e.key===l||n!==`horizontal`&&e.key===`ArrowUp`;E&&(e.key===`Home`?w=T:e.key===`End`&&(w=k)),w===H&&(M||N)&&(t&&w===k&&M?(w=T,i&&(w=i(e,H,w,z))):t&&w===T&&N?(w=k,i&&(w=i(e,H,w,z))):w=m(z.current,{startingIndex:w,decrement:N,disabledIndices:A})),w!==H&&!f(z.current,w)&&(D&&e.stopPropagation(),(I||o||M||N)&&e.preventDefault(),U(w,!0),queueMicrotask(()=>{z.current[w]?.focus()}))});return{props:{ref:R,onFocus(e){let t=L.current,n=d(e.nativeEvent);t&&n!=null&&g(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:K},highlightedIndex:H,onHighlightedIndexChange:U,elementsRef:z,onMapChange:W,relayKeyboardEvent:K}}function N(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!w(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function P(e,t){for(let n of x)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}var F=r();function I(e){let{render:r,className:i,style:a,refs:c=o,props:l=o,state:u=n,stateAttributesMapping:d,highlightedIndex:f,onHighlightedIndexChange:p,orientation:m,grid:h,loopFocus:g,onLoop:_,enableHomeAndEndKeys:v,onMapChange:y,stopEventPropagation:b=!0,rootRef:x,disabledIndices:S,modifierKeys:C,highlightItemOnHover:w=!1,tag:E=`div`,...O}=e,{props:A,highlightedIndex:j,onHighlightedIndexChange:N,elementsRef:P,onMapChange:I,relayKeyboardEvent:L}=M({grid:h,loopFocus:g,onLoop:_,orientation:m,highlightedIndex:f,onHighlightedIndexChange:p,rootRef:x,stopEventPropagation:b,enableHomeAndEndKeys:v,direction:T(),disabledIndices:S,modifierKeys:C}),R=t(E,e,{state:u,ref:c,props:[A,...l,O],stateAttributesMapping:d}),z=k.useMemo(()=>({highlightedIndex:j,onHighlightedIndexChange:N,highlightItemOnHover:w,relayKeyboardEvent:L}),[j,N,w,L]);return(0,F.jsx)(s.Provider,{value:z,children:(0,F.jsx)(D,{elementsRef:P,onMapChange:e=>{y?.(e),I(e)},children:R})})}export{j as n,A as r,I as t};
|
||||
-1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Gt as t,Kt as n}from"./schemas-CKmbY8gV.js";import{i as r,p as i,r as a}from"./matchContext-C_cBF5rG.js";import{n as o}from"./x-BuYxxvoG.js";import{t as s}from"./useSelector-BuHlvrXV.js";var c=e(n(),1),l=t(),u=()=>!0,d=()=>!1;function f({children:e,fallback:t=null}){return(0,l.jsx)(c.Fragment,{children:p()?e:t})}function p(e=!0){return c.useSyncExternalStore(m,u,e?d:u)}function m(){return()=>{}}function h(e){let t=r(),n=`not-found-${s(t.stores.location,e=>e.pathname)}-${s(t.stores.status)}`;return(0,l.jsx)(o,{getResetKey:()=>n,onCatch:(t,n)=>{if(i(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(i(t))return e.fallback?.(t);throw t},children:e.children})}function g(){return(0,l.jsx)(`p`,{children:`Not Found`})}function _(e,t,n){return t.options.notFoundComponent?(0,l.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,l.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,l.jsx)(g,{})}function v(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,l.jsx)(n,{}):null}var y=(e,t)=>e[0]===t[0]&&e[1]===t[1],b=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,x=c.memo(function({routeId:e}){let t=r(),n=t.stores.getMatchStore(e);return S(t,s(n))});function S(e,t){let n=e.routesById[t.routeId],r=v(e,n),s=n.options.errorComponent??e.options.defaultErrorComponent,u=n.options.onCatch??e.options.defaultOnCatch,d=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,p=t.ssr===!1||t.ssr===`data-only`,m=b(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||p)),g=(0,l.jsx)(C,{match:t});p&&(g=(0,l.jsx)(f,{fallback:r,children:g})),d&&(g=(0,l.jsx)(h,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return c.createElement(d,e)},children:g})),s&&(g=(0,l.jsx)(o,{getResetKey:()=>t,errorComponent:s,onCatch:(e,n)=>{if(i(e))throw e.routeId??=t.routeId,e;u?.(e,n)},children:g})),m&&(g=(0,l.jsx)(c.Suspense,{fallback:r,children:g}));let _=n.isRoot&&n.options.shellComponent;return _?(0,l.jsx)(a.Provider,{value:t.routeId,children:(0,l.jsxs)(_,{children:[g,null]})}):(0,l.jsxs)(a.Provider,{value:t.routeId,children:[g,null]})}var C=c.memo(function({match:e}){let t=r(),n=e.routeId,i=t.routesById[n],a=c.useMemo(()=>{let r=(i.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return r?JSON.stringify(r):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,i.options.remountDeps,t.options.defaultRemountDeps]),o=c.useMemo(()=>{let e=i.options.component??t.options.defaultComponent;return e?(0,l.jsx)(e,{},a):(0,l.jsx)(w,{})},[a,i.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!b(t,i,e.ssr))return o;if(t._tx)throw t._tx[5];return v(t,i)}if(e.status===`notFound`)return _(t,i,e.error);if(e.status===`error`)throw e.error;return o}),w=c.memo(function(){let e=r(),t=c.useContext(a),n,i,o;{let r=e.stores.getMatchStore(t);[n,i]=s(r,e=>[!!e._notFound,e.error],{compare:y}),o=s(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return _(e,e.routesById[t],i);if(!o)return null;let u=(0,l.jsx)(x,{routeId:o});return t===`__root__`?(0,l.jsx)(c.Suspense,{fallback:v(e),children:u}):u});export{p as i,w as n,v as r,x as t};
|
||||
@@ -0,0 +1 @@
|
||||
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{It as t,Lt as n}from"./schemas-DCQXG11d.js";import{d as r,r as i}from"./matchContext-CUAcfcYw.js";import{n as a}from"./x-mlA6pp-8.js";import{t as o}from"./useRouter-B_eSHXWd.js";import{t as s}from"./useSelector-CDb-n1FW.js";var c=e(n(),1),l=t(),u=()=>!0,d=()=>!1;function f({children:e,fallback:t=null}){return(0,l.jsx)(c.Fragment,{children:p()?e:t})}function p(e=!0){return c.useSyncExternalStore(m,u,e?d:u)}function m(){return()=>{}}function h(e){let t=o(),n=`not-found-${s(t.stores.location,e=>e.pathname)}-${s(t.stores.status)}`;return(0,l.jsx)(a,{getResetKey:()=>n,onCatch:(t,n)=>{if(r(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(r(t))return e.fallback?.(t);throw t},children:e.children})}function g(){return(0,l.jsx)(`p`,{children:`Not Found`})}function _(e,t,n){return t.options.notFoundComponent?(0,l.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,l.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,l.jsx)(g,{})}function v(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,l.jsx)(n,{}):null}var y=(e,t)=>e[0]===t[0]&&e[1]===t[1],b=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,x=c.memo(function({routeId:e}){let t=o(),n=t.stores.getMatchStore(e);return S(t,s(n))});function S(e,t){let n=e.routesById[t.routeId],o=v(e,n),s=n.options.errorComponent??e.options.defaultErrorComponent,u=n.options.onCatch??e.options.defaultOnCatch,d=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,p=t.ssr===!1||t.ssr===`data-only`,m=b(e,n,t.ssr)&&(n.options.wrapInSuspense??o??(n.options.errorComponent?.preload||p)),g=(0,l.jsx)(C,{match:t});p&&(g=(0,l.jsx)(f,{fallback:o,children:g})),d&&(g=(0,l.jsx)(h,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return c.createElement(d,e)},children:g})),s&&(g=(0,l.jsx)(a,{getResetKey:()=>t,errorComponent:s,onCatch:(e,n)=>{if(r(e))throw e.routeId??=t.routeId,e;u?.(e,n)},children:g})),m&&(g=(0,l.jsx)(c.Suspense,{fallback:o,children:g}));let _=n.isRoot&&n.options.shellComponent;return _?(0,l.jsx)(i.Provider,{value:t.routeId,children:(0,l.jsxs)(_,{children:[g,null]})}):(0,l.jsxs)(i.Provider,{value:t.routeId,children:[g,null]})}var C=c.memo(function({match:e}){let t=o(),n=e.routeId,r=t.routesById[n],i=c.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=c.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,l.jsx)(e,{},i):(0,l.jsx)(w,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!b(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return v(t,r)}if(e.status===`notFound`)return _(t,r,e.error);if(e.status===`error`)throw e.error;return a}),w=c.memo(function(){let e=o(),t=c.useContext(i),n,r,a;{let i=e.stores.getMatchStore(t);[n,r]=s(i,e=>[!!e._notFound,e.error],{compare:y}),a=s(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return _(e,e.routesById[t],r);if(!a)return null;let u=(0,l.jsx)(x,{routeId:a});return t===`__root__`?(0,l.jsx)(c.Suspense,{fallback:v(e),children:u}):u});export{p as i,w as n,v as r,x as t};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Gt as t,Kt as n}from"./schemas-CKmbY8gV.js";var r=e(n(),1),i=t(),a=r.createContext(void 0),o=e=>{let t=r.useContext(a);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},s=({client:e,children:t})=>(r.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,i.jsx)(a.Provider,{value:e,children:t}));export{o as n,s as t};
|
||||
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{It as t,Lt as n}from"./schemas-DCQXG11d.js";var r=e(n(),1),i=t(),a=r.createContext(void 0),o=e=>{let t=r.useContext(a);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},s=({client:e,children:t})=>(r.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,i.jsx)(a.Provider,{value:e,children:t}));export{o as n,s as t};
|
||||
-1
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,Lt as n}from"./schemas-DCQXG11d.js";var r=e(n(),1),i=r.createContext(void 0);function a(e){let n=r.useContext(i);if(n===void 0&&!e)throw Error(t(69));return n}export{a as t};
|
||||
@@ -1 +0,0 @@
|
||||
import{Gt as e,Vt as t,Y as n}from"./schemas-CKmbY8gV.js";import{t as r}from"./object-browser-D7yr9rgb.js";import{t as i}from"./_-CFb8JFvm.js";var a=t(),o=e();function s(){let e=(0,a.c)(10),{bucket:t,_splat:s}=i.useParams(),c=s??``,l;e[0]===c?l=e[1]:(l=n(c),e[0]=c,e[1]=l);let u=l,d=i.useSearch(),f=i.useNavigate(),p;e[2]===f?p=e[3]:(p=function(e){f({search:t=>({...t,...e}),replace:!(`selected`in e)})},e[2]=f,e[3]=p);let m=p,h=`${t}/${u}`,g;return e[4]!==t||e[5]!==u||e[6]!==m||e[7]!==d||e[8]!==h?(g=(0,o.jsx)(r,{bucket:t,folder:u,onSearchChange:m,search:d},h),e[4]=t,e[5]=u,e[6]=m,e[7]=d,e[8]=h,e[9]=g):g=e[9],g}export{s as component};
|
||||
@@ -1,2 +0,0 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_-7KkIsFVy.js","assets/schemas-CKmbY8gV.js","assets/rolldown-runtime-XKyaHtl9.js","assets/object-browser-D7yr9rgb.js","assets/QueryClientProvider-B3gFFx5-.js","assets/queryOptions-C3LOV3Yq.js","assets/useQuery-DgGWYOhJ.js","assets/lazyRouteComponent-BIOh5GOe.js","assets/matchContext-C_cBF5rG.js","assets/link-CoQQT1u0.js","assets/useSelector-BuHlvrXV.js","assets/data-table-D9AZRPew.js","assets/visuallyHidden-Di6ozTl7.js","assets/check-BURgRfkZ.js","assets/useRegisterFieldControl-BpMxH-yS.js","assets/useAriaLabelledBy-C1btqlkM.js","assets/useControlled-CliDS5IQ.js","assets/table-Br7RGWB8.js","assets/error-banner-6H_aBcIY.js","assets/chevron-right-BaqRZN6V.js","assets/upload-CUlCi7gE.js","assets/sliders-horizontal-B4nfPbkq.js","assets/detail-panel-BUy-SsXi.js","assets/x-BuYxxvoG.js","assets/chevron-down-CiWCIUx5.js","assets/copy-Clj54gC8.js","assets/loader-circle-BWw23_DY.js","assets/useScrollLock-tbqBjaVX.js","assets/useValueAsRef-DtjtqpoE.js","assets/ToolbarRootContext-CPQMf91l.js","assets/isElementDisabled-DwizONlP.js","assets/store-Dx1XhYcs.js","assets/collapsible-NKtgkvXc.js","assets/tabs-C7-u1MlW.js","assets/use-copy-to-clipboard-B2jqkkCP.js","assets/input-group-CdRkywl6.js","assets/field-D45t5nwl.js","assets/textarea-DjPTve3M.js","assets/trash-DU2S79Q3.js","assets/uploads-ypeWSAfE.js","assets/awsClient-Da_1PWK9.js","assets/auth-LWMosi88.js","assets/index.browser-BEm-79SP.js","assets/s3-GemFNNG4.js","assets/useMutation-0VvC4-D7.js","assets/s3-e8hHPZ7C.js","assets/page-heading-DOCwCs80.js","assets/resource-view-RaCpeI0k.js","assets/selection-bar-Bb4fd2ci.js","assets/use-row-selection-DGXO__u7.js","assets/bulk-delete-CdjUpmX4.js","assets/circle-x-YQRHw4rt.js","assets/alert-dialog-B2wM6M0p.js","assets/DialogTitle-BlGk2Olt.js","assets/confirm-phrase-HKyrGgCW.js","assets/resource-delete-dialog-DB-hXwnM.js","assets/delete-confirmation-dialog-khwGiTUy.js"])))=>i.map(i=>d[i]);
|
||||
import{Y as e,s as t}from"./schemas-CKmbY8gV.js";import{n,t as r}from"./lazyRouteComponent-BIOh5GOe.js";import{t as i}from"./searchMiddleware-CN1kfGOC.js";import{f as a,p as o}from"./detail-panel-BUy-SsXi.js";import{Mo as s}from"./awsClient-Da_1PWK9.js";import{t as c}from"./s3-e8hHPZ7C.js";var l=n(`/_auth/s3/ls/$bucket/$`)({validateSearch:t(o),search:{middlewares:[i(a)]},loader:async({context:t,params:n})=>{await t.queryClient.query({...c(n.bucket,e(n._splat??``)),staleTime:`static`})},head:({params:t})=>({meta:[{title:`${t.bucket}/${e(t._splat??``)} | Object Storage | Mulga`}]}),component:r(()=>s(()=>import(`./_-7KkIsFVy.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56])),`component`)});export{l as t};
|
||||
@@ -0,0 +1 @@
|
||||
import{B as e,It as t,Mt as n}from"./schemas-DCQXG11d.js";import{t as r}from"./object-browser-D2G7ChbT.js";import{t as i}from"./_-jsAX0S-n.js";var a=n(),o=t();function s(){let t=(0,a.c)(10),{bucket:n,_splat:s}=i.useParams(),c=s??``,l;t[0]===c?l=t[1]:(l=e(c),t[0]=c,t[1]=l);let u=l,d=i.useSearch(),f=i.useNavigate(),p;t[2]===f?p=t[3]:(p=function(e){f({search:t=>({...t,...e}),replace:!(`selected`in e)})},t[2]=f,t[3]=p);let m=p,h=`${n}/${u}`,g;return t[4]!==n||t[5]!==u||t[6]!==m||t[7]!==d||t[8]!==h?(g=(0,o.jsx)(r,{bucket:n,folder:u,onSearchChange:m,search:d},h),t[4]=n,t[5]=u,t[6]=m,t[7]=d,t[8]=h,t[9]=g):g=t[9],g}export{s as component};
|
||||
@@ -0,0 +1,2 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_-EgUy8iPZ.js","assets/schemas-DCQXG11d.js","assets/rolldown-runtime-XKyaHtl9.js","assets/object-browser-D2G7ChbT.js","assets/QueryClientProvider-BuG40HBe.js","assets/queryOptions-Cu2lvOFG.js","assets/useQuery-D6TojLgI.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/data-table-9n7xOy9s.js","assets/useSelector-CDb-n1FW.js","assets/visuallyHidden-BHQz5bmH.js","assets/check-DPoQ9cBn.js","assets/useRegisterFieldControl-DkI655of.js","assets/useAriaLabelledBy-DStQJVTn.js","assets/useTransitionStatus-Dn-09Anc.js","assets/useValueChanged-wii0yYWk.js","assets/useControlled-NIWPmeG5.js","assets/table-BLvCYTga.js","assets/useNavigate-cMdr_EJ0.js","assets/chevron-right-DZULbaNT.js","assets/upload-uiiRWdV_.js","assets/eye-yi4wz0yh.js","assets/input-group-TEGNx6dm.js","assets/useValueAsRef-uzS1fuI8.js","assets/field-iLG94M00.js","assets/textarea-BG1iGvVs.js","assets/sliders-horizontal-DsGbsnBU.js","assets/trash-BajuWzqn.js","assets/detail-panel-DLM1ExsZ.js","assets/x-mlA6pp-8.js","assets/info-tip-Cxa2GEOd.js","assets/useScrollLock-iGnmnC-h.js","assets/composite-DysENEse.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/isElementDisabled-B7Ri5ug6.js","assets/store-BVhNJayb.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/chevron-down-BgudX6bq.js","assets/copy-B9ICxw_u.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/tabs-9tHEWpNn.js","assets/CompositeRoot-CmHoR-Tk.js","assets/panel-search-LDLf8HCe.js","assets/error-banner-Cahg3Ix2.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/uploads-BF3vgNvM.js","assets/awsClient-BvDfQdL8.js","assets/auth-BS4WytAe.js","assets/fetch-http-handler-B--F8e2N.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/s3-Dw9Wbkov.js","assets/useMutation-lRi0DDcO.js","assets/s3-C7kuNeMZ.js","assets/page-heading-ZfrnK2wu.js","assets/resource-view-CPdFr_3k.js","assets/selection-bar-WnknBhRB.js","assets/use-row-selection-DB6L9NiD.js","assets/bulk-delete-CXIUB03J.js","assets/circle-x-C6c0uvb-.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js","assets/resource-delete-dialog-D3NYuO-k.js","assets/delete-confirmation-dialog-O7cqOW0Y.js"])))=>i.map(i=>d[i]);
|
||||
import{B as e,s as t}from"./schemas-DCQXG11d.js";import{n,t as r}from"./lazyRouteComponent-PMetaA3O.js";import{t as i}from"./searchMiddleware-Clk50hy1.js";import{U as a}from"./fetch-http-handler-B--F8e2N.js";import{t as o}from"./s3-C7kuNeMZ.js";import{r as s,t as c}from"./panel-search-LDLf8HCe.js";var l=n(`/_auth/s3/ls/$bucket/$`)({validateSearch:t(s),search:{middlewares:[i(c)]},loader:async({context:t,params:n})=>{await t.queryClient.query({...o(n.bucket,e(n._splat??``)),staleTime:`static`})},head:({params:t})=>({meta:[{title:`${t.bucket}/${e(t._splat??``)} | Object Storage | Mulga`}]}),component:r(()=>a(()=>import(`./_-EgUy8iPZ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67])),`component`)});export{l as t};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{Gt as e,Vt as t}from"./schemas-CKmbY8gV.js";import{t as n}from"./object-browser-D7yr9rgb.js";import{t as r}from"./_bucket-DJ9W9e9C.js";var i=t(),a=e();function o(){let e=(0,i.c)(6),{bucket:t}=r.useParams(),o=r.useSearch(),s=r.useNavigate(),c;e[0]===s?c=e[1]:(c=function(e){s({search:t=>({...t,...e}),replace:!(`selected`in e)})},e[0]=s,e[1]=c);let l=c,u;return e[2]!==t||e[3]!==l||e[4]!==o?(u=(0,a.jsx)(n,{bucket:t,folder:``,onSearchChange:l,search:o},t),e[2]=t,e[3]=l,e[4]=o,e[5]=u):u=e[5],u}export{o as component};
|
||||
import{It as e,Mt as t}from"./schemas-DCQXG11d.js";import{t as n}from"./object-browser-D2G7ChbT.js";import{t as r}from"./_bucket-aGUJujUa.js";var i=t(),a=e();function o(){let e=(0,i.c)(6),{bucket:t}=r.useParams(),o=r.useSearch(),s=r.useNavigate(),c;e[0]===s?c=e[1]:(c=function(e){s({search:t=>({...t,...e}),replace:!(`selected`in e)})},e[0]=s,e[1]=c);let l=c,u;return e[2]!==t||e[3]!==l||e[4]!==o?(u=(0,a.jsx)(n,{bucket:t,folder:``,onSearchChange:l,search:o},t),e[2]=t,e[3]=l,e[4]=o,e[5]=u):u=e[5],u}export{o as component};
|
||||
@@ -1,2 +0,0 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_bucket-ButZaAoi.js","assets/schemas-CKmbY8gV.js","assets/rolldown-runtime-XKyaHtl9.js","assets/object-browser-D7yr9rgb.js","assets/QueryClientProvider-B3gFFx5-.js","assets/queryOptions-C3LOV3Yq.js","assets/useQuery-DgGWYOhJ.js","assets/lazyRouteComponent-BIOh5GOe.js","assets/matchContext-C_cBF5rG.js","assets/link-CoQQT1u0.js","assets/useSelector-BuHlvrXV.js","assets/data-table-D9AZRPew.js","assets/visuallyHidden-Di6ozTl7.js","assets/check-BURgRfkZ.js","assets/useRegisterFieldControl-BpMxH-yS.js","assets/useAriaLabelledBy-C1btqlkM.js","assets/useControlled-CliDS5IQ.js","assets/table-Br7RGWB8.js","assets/error-banner-6H_aBcIY.js","assets/chevron-right-BaqRZN6V.js","assets/upload-CUlCi7gE.js","assets/sliders-horizontal-B4nfPbkq.js","assets/detail-panel-BUy-SsXi.js","assets/x-BuYxxvoG.js","assets/chevron-down-CiWCIUx5.js","assets/copy-Clj54gC8.js","assets/loader-circle-BWw23_DY.js","assets/useScrollLock-tbqBjaVX.js","assets/useValueAsRef-DtjtqpoE.js","assets/ToolbarRootContext-CPQMf91l.js","assets/isElementDisabled-DwizONlP.js","assets/store-Dx1XhYcs.js","assets/collapsible-NKtgkvXc.js","assets/tabs-C7-u1MlW.js","assets/use-copy-to-clipboard-B2jqkkCP.js","assets/input-group-CdRkywl6.js","assets/field-D45t5nwl.js","assets/textarea-DjPTve3M.js","assets/trash-DU2S79Q3.js","assets/uploads-ypeWSAfE.js","assets/awsClient-Da_1PWK9.js","assets/auth-LWMosi88.js","assets/index.browser-BEm-79SP.js","assets/s3-GemFNNG4.js","assets/useMutation-0VvC4-D7.js","assets/s3-e8hHPZ7C.js","assets/page-heading-DOCwCs80.js","assets/resource-view-RaCpeI0k.js","assets/selection-bar-Bb4fd2ci.js","assets/use-row-selection-DGXO__u7.js","assets/bulk-delete-CdjUpmX4.js","assets/circle-x-YQRHw4rt.js","assets/alert-dialog-B2wM6M0p.js","assets/DialogTitle-BlGk2Olt.js","assets/confirm-phrase-HKyrGgCW.js","assets/resource-delete-dialog-DB-hXwnM.js","assets/delete-confirmation-dialog-khwGiTUy.js"])))=>i.map(i=>d[i]);
|
||||
import{s as e}from"./schemas-CKmbY8gV.js";import{n as t,t as n}from"./lazyRouteComponent-BIOh5GOe.js";import{t as r}from"./searchMiddleware-CN1kfGOC.js";import{f as i,p as a}from"./detail-panel-BUy-SsXi.js";import{Mo as o}from"./awsClient-Da_1PWK9.js";import{t as s}from"./s3-e8hHPZ7C.js";var c=t(`/_auth/s3/ls/$bucket/`)({validateSearch:e(a),search:{middlewares:[r(i)]},loader:async({context:e,params:t})=>{await e.queryClient.query({...s(t.bucket,``),staleTime:`static`})},head:({params:e})=>({meta:[{title:`${e.bucket} | Object Storage | Mulga`}]}),component:n(()=>o(()=>import(`./_bucket-ButZaAoi.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56])),`component`)});export{c as t};
|
||||
@@ -0,0 +1,2 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_bucket-3kFDB96F.js","assets/schemas-DCQXG11d.js","assets/rolldown-runtime-XKyaHtl9.js","assets/object-browser-D2G7ChbT.js","assets/QueryClientProvider-BuG40HBe.js","assets/queryOptions-Cu2lvOFG.js","assets/useQuery-D6TojLgI.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/data-table-9n7xOy9s.js","assets/useSelector-CDb-n1FW.js","assets/visuallyHidden-BHQz5bmH.js","assets/check-DPoQ9cBn.js","assets/useRegisterFieldControl-DkI655of.js","assets/useAriaLabelledBy-DStQJVTn.js","assets/useTransitionStatus-Dn-09Anc.js","assets/useValueChanged-wii0yYWk.js","assets/useControlled-NIWPmeG5.js","assets/table-BLvCYTga.js","assets/useNavigate-cMdr_EJ0.js","assets/chevron-right-DZULbaNT.js","assets/upload-uiiRWdV_.js","assets/eye-yi4wz0yh.js","assets/input-group-TEGNx6dm.js","assets/useValueAsRef-uzS1fuI8.js","assets/field-iLG94M00.js","assets/textarea-BG1iGvVs.js","assets/sliders-horizontal-DsGbsnBU.js","assets/trash-BajuWzqn.js","assets/detail-panel-DLM1ExsZ.js","assets/x-mlA6pp-8.js","assets/info-tip-Cxa2GEOd.js","assets/useScrollLock-iGnmnC-h.js","assets/composite-DysENEse.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/isElementDisabled-B7Ri5ug6.js","assets/store-BVhNJayb.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/chevron-down-BgudX6bq.js","assets/copy-B9ICxw_u.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/tabs-9tHEWpNn.js","assets/CompositeRoot-CmHoR-Tk.js","assets/panel-search-LDLf8HCe.js","assets/error-banner-Cahg3Ix2.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/uploads-BF3vgNvM.js","assets/awsClient-BvDfQdL8.js","assets/auth-BS4WytAe.js","assets/fetch-http-handler-B--F8e2N.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/s3-Dw9Wbkov.js","assets/useMutation-lRi0DDcO.js","assets/s3-C7kuNeMZ.js","assets/page-heading-ZfrnK2wu.js","assets/resource-view-CPdFr_3k.js","assets/selection-bar-WnknBhRB.js","assets/use-row-selection-DB6L9NiD.js","assets/bulk-delete-CXIUB03J.js","assets/circle-x-C6c0uvb-.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js","assets/resource-delete-dialog-D3NYuO-k.js","assets/delete-confirmation-dialog-O7cqOW0Y.js"])))=>i.map(i=>d[i]);
|
||||
import{s as e}from"./schemas-DCQXG11d.js";import{n as t,t as n}from"./lazyRouteComponent-PMetaA3O.js";import{t as r}from"./searchMiddleware-Clk50hy1.js";import{U as i}from"./fetch-http-handler-B--F8e2N.js";import{t as a}from"./s3-C7kuNeMZ.js";import{r as o,t as s}from"./panel-search-LDLf8HCe.js";var c=t(`/_auth/s3/ls/$bucket/`)({validateSearch:e(o),search:{middlewares:[r(s)]},loader:async({context:e,params:t})=>{await e.queryClient.query({...a(t.bucket,``),staleTime:`static`})},head:({params:e})=>({meta:[{title:`${e.bucket} | Object Storage | Mulga`}]}),component:n(()=>i(()=>import(`./_bucket-3kFDB96F.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67])),`component`)});export{c as t};
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_clusterName-Bz2ox1A8.js","assets/schemas-CKmbY8gV.js","assets/rolldown-runtime-XKyaHtl9.js","assets/cluster-details-9mUgBIvg.js","assets/select-DEWJs_zZ.js","assets/visuallyHidden-Di6ozTl7.js","assets/check-BURgRfkZ.js","assets/chevron-down-CiWCIUx5.js","assets/useScrollLock-tbqBjaVX.js","assets/useValueAsRef-DtjtqpoE.js","assets/useRegisterFieldControl-BpMxH-yS.js","assets/useControlled-CliDS5IQ.js","assets/ToolbarRootContext-CPQMf91l.js","assets/isElementDisabled-DwizONlP.js","assets/clamp-D0kAXd-u.js","assets/QueryClientProvider-B3gFFx5-.js","assets/useMutation-0VvC4-D7.js","assets/queryOptions-C3LOV3Yq.js","assets/useQuery-DgGWYOhJ.js","assets/useSuspenseQuery-CfG96AGi.js","assets/link-CoQQT1u0.js","assets/matchContext-C_cBF5rG.js","assets/error-banner-6H_aBcIY.js","assets/circle-arrow-up-DPplcU0J.js","assets/sliders-horizontal-B4nfPbkq.js","assets/detail-panel-BUy-SsXi.js","assets/x-BuYxxvoG.js","assets/copy-Clj54gC8.js","assets/loader-circle-BWw23_DY.js","assets/store-Dx1XhYcs.js","assets/collapsible-NKtgkvXc.js","assets/tabs-C7-u1MlW.js","assets/use-copy-to-clipboard-B2jqkkCP.js","assets/maximize-2-N7ntOlKC.js","assets/plus-hsII00cK.js","assets/cli-command-panel-Bbgu_PHE.js","assets/trash-DU2S79Q3.js","assets/triangle-alert-DOQ-ERJ6.js","assets/field-D45t5nwl.js","assets/auth-LWMosi88.js","assets/awsClient-Da_1PWK9.js","assets/index.browser-BEm-79SP.js","assets/ec2-BL5MCjb2.js","assets/eks-Bewuh5MW.js","assets/iam-Cd60dYHn.js","assets/json-BYhzhOil.js","assets/delete-confirmation-dialog-khwGiTUy.js","assets/alert-dialog-B2wM6M0p.js","assets/DialogTitle-BlGk2Olt.js","assets/confirm-phrase-HKyrGgCW.js","assets/state-badge-60FZam9q.js","assets/subnet-calculator-DDrAb5xp.js","assets/form-lock-ETWruSvZ.js","assets/form-panel-FvMLLm-S.js","assets/gpu-instance-type-select-DJI4N_hg.js","assets/index.esm-BQMPsB0n.js","assets/zod-BWB4pUhT.js","assets/switch-list-5HWTHr5V.js","assets/switch-ARpklVus.js","assets/useAriaLabelledBy-C1btqlkM.js","assets/badge-Cq9eeDnq.js","assets/useRender-vkaUf9E1.js","assets/form-fields-Dz0ldQ7r.js","assets/json-editor-oM4Sz7Jd.js","assets/textarea-DjPTve3M.js"])))=>i.map(i=>d[i]);
|
||||
import{s as e}from"./schemas-CKmbY8gV.js";import{n as t,t as n}from"./lazyRouteComponent-BIOh5GOe.js";import{t as r}from"./searchMiddleware-CN1kfGOC.js";import{p as i}from"./detail-panel-BUy-SsXi.js";import{Mo as a}from"./awsClient-Da_1PWK9.js";import{s as o,t as s,u as c}from"./eks-Bewuh5MW.js";var l=t(`/_auth/eks/(clusters)/list-clusters/$clusterName`)({validateSearch:e({tab:i.tab}),search:{middlewares:[r({tab:`overview`})]},loader:async({context:e,params:t})=>{await Promise.all([e.queryClient.query({...o(t.clusterName),staleTime:`static`}),e.queryClient.query({...c(t.clusterName),staleTime:`static`}),e.queryClient.query({...s(t.clusterName),staleTime:`static`})])},head:({params:e})=>({meta:[{title:`${e.clusterName} | EKS | Mulga`}]}),component:n(()=>a(()=>import(`./_clusterName-Bz2ox1A8.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64])),`component`)});export{l as t};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{Gt as e,Vt as t}from"./schemas-CKmbY8gV.js";import{t as n}from"./cluster-details-9mUgBIvg.js";import{t as r}from"./_clusterName-BGH9f9jv.js";var i=t(),a=e();function o(){let e=(0,i.c)(8),{clusterName:t}=r.useParams(),{tab:o}=r.useSearch(),s=r.useNavigate(),c,l;e[0]===s?(c=e[1],l=e[2]):(c=()=>{s({to:`/eks/list-clusters`})},l=e=>{s({search:{tab:e},replace:!0})},e[0]=s,e[1]=c,e[2]=l);let u;return e[3]!==t||e[4]!==c||e[5]!==l||e[6]!==o?(u=(0,a.jsx)(n,{clusterName:t,layout:`page`,onClose:c,onTabChange:l,tab:o}),e[3]=t,e[4]=c,e[5]=l,e[6]=o,e[7]=u):u=e[7],u}export{o as component};
|
||||
import{It as e,Mt as t}from"./schemas-DCQXG11d.js";import{t as n}from"./cluster-details-1bW7KNv3.js";import{t as r}from"./_clusterName-b030G2HU.js";var i=t(),a=e();function o(){let e=(0,i.c)(8),{clusterName:t}=r.useParams(),{tab:o}=r.useSearch(),s=r.useNavigate(),c,l;e[0]===s?(c=e[1],l=e[2]):(c=()=>{s({to:`/eks/list-clusters`})},l=e=>{s({search:{tab:e},replace:!0})},e[0]=s,e[1]=c,e[2]=l);let u;return e[3]!==t||e[4]!==c||e[5]!==l||e[6]!==o?(u=(0,a.jsx)(n,{clusterName:t,layout:`page`,onClose:c,onTabChange:l,tab:o}),e[3]=t,e[4]=c,e[5]=l,e[6]=o,e[7]=u):u=e[7],u}export{o as component};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_clusterName-IhxHlZV4.js","assets/schemas-DCQXG11d.js","assets/rolldown-runtime-XKyaHtl9.js","assets/useSuspenseQuery--dusmE-Q.js","assets/queryOptions-Cu2lvOFG.js","assets/QueryClientProvider-BuG40HBe.js","assets/ecs-D2Xj5Fk-.js","assets/awsClient-BvDfQdL8.js","assets/auth-BS4WytAe.js","assets/fetch-http-handler-B--F8e2N.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/commandBuilder-Bb9dqTZ7.js","assets/back-link-B8ejy5Fm.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/info-tip-Cxa2GEOd.js","assets/visuallyHidden-BHQz5bmH.js","assets/useScrollLock-iGnmnC-h.js","assets/useValueAsRef-uzS1fuI8.js","assets/useTransitionStatus-Dn-09Anc.js","assets/composite-DysENEse.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/useValueChanged-wii0yYWk.js","assets/isElementDisabled-B7Ri5ug6.js","assets/store-BVhNJayb.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/cluster-details-B8veXcs_.js","assets/select-UwOVJofC.js","assets/check-DPoQ9cBn.js","assets/chevron-down-BgudX6bq.js","assets/useRegisterFieldControl-DkI655of.js","assets/useControlled-NIWPmeG5.js","assets/clamp-D0kAXd-u.js","assets/useQuery-D6TojLgI.js","assets/eye-yi4wz0yh.js","assets/maximize-2-BAlKoEj8.js","assets/play-qJowxtRp.js","assets/plus-BK_7eO_G.js","assets/server-D03m5B1l.js","assets/sliders-horizontal-DsGbsnBU.js","assets/cli-command-panel-Do14gxB9.js","assets/copy-B9ICxw_u.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/trash-BajuWzqn.js","assets/field-iLG94M00.js","assets/detail-panel-DLM1ExsZ.js","assets/x-mlA6pp-8.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/tabs-9tHEWpNn.js","assets/CompositeRoot-CmHoR-Tk.js","assets/panel-search-LDLf8HCe.js","assets/error-banner-Cahg3Ix2.js","assets/ec2-C2FdJaHg.js","assets/commandBuilder-D7SsohHF.js","assets/ecs-iecx1cKL.js","assets/useMutation-lRi0DDcO.js","assets/signed-fetch-BqrfDScu.js","assets/delete-confirmation-dialog-O7cqOW0Y.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js","assets/state-badge-CQPRxt3J.js","assets/resource-tags-CGeRAZrb.js","assets/tags-BVcAJWuE.js","assets/commandBuilder-CfqGUk7K.js","assets/commandBuilder-CV-6DENN.js","assets/inline-tags-nfRc9elZ.js","assets/pencil-DLzYMCIc.js","assets/form-lock-D8Cu0Sfu.js","assets/form-panel-CtjudV7b.js","assets/gpu-instance-type-select-DsB5oPSo.js","assets/system-managed-Dk7ySh_E.js","assets/panel-list-ChJfng6E.js","assets/system-image-required-BJr-Ejzz.js","assets/rotate-cw-DhHI5fTM.js","assets/triangle-alert-Ckml5FoO.js","assets/stop-task-dialog-C0_MtdlP.js"])))=>i.map(i=>d[i]);
|
||||
import{s as e}from"./schemas-DCQXG11d.js";import{n as t,t as n}from"./lazyRouteComponent-PMetaA3O.js";import{t as r}from"./searchMiddleware-Clk50hy1.js";import{U as i}from"./fetch-http-handler-B--F8e2N.js";import{i as a,s as o,t as s}from"./ecs-D2Xj5Fk-.js";import{r as c}from"./panel-search-LDLf8HCe.js";var l=t(`/_auth/ecs/(clusters)/list-clusters/$clusterName`)({validateSearch:e({tab:c.tab}),search:{middlewares:[r({tab:`overview`})]},loader:async({context:e,params:t})=>{await Promise.all([e.queryClient.query({...s(t.clusterName),staleTime:`static`}),e.queryClient.query({...a(t.clusterName),staleTime:`static`}),e.queryClient.query({...o(t.clusterName),staleTime:`static`})])},head:({params:e})=>({meta:[{title:`${e.clusterName} | ECS | Mulga`}]}),component:n(()=>i(()=>import(`./_clusterName-IhxHlZV4.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79])),`component`)});export{l as t};
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_clusterName-PGXuLpFG.js","assets/schemas-CKmbY8gV.js","assets/rolldown-runtime-XKyaHtl9.js","assets/useSuspenseQuery-CfG96AGi.js","assets/queryOptions-C3LOV3Yq.js","assets/QueryClientProvider-B3gFFx5-.js","assets/ecs-B4PUYbCf.js","assets/awsClient-Da_1PWK9.js","assets/auth-LWMosi88.js","assets/index.browser-BEm-79SP.js","assets/back-link-CxXZw47s.js","assets/link-CoQQT1u0.js","assets/matchContext-C_cBF5rG.js","assets/error-banner-6H_aBcIY.js","assets/visuallyHidden-Di6ozTl7.js","assets/cluster-details-CBeOlQb_.js","assets/select-DEWJs_zZ.js","assets/check-BURgRfkZ.js","assets/chevron-down-CiWCIUx5.js","assets/useScrollLock-tbqBjaVX.js","assets/useValueAsRef-DtjtqpoE.js","assets/useRegisterFieldControl-BpMxH-yS.js","assets/useControlled-CliDS5IQ.js","assets/ToolbarRootContext-CPQMf91l.js","assets/isElementDisabled-DwizONlP.js","assets/clamp-D0kAXd-u.js","assets/useQuery-DgGWYOhJ.js","assets/sliders-horizontal-B4nfPbkq.js","assets/detail-panel-BUy-SsXi.js","assets/x-BuYxxvoG.js","assets/copy-Clj54gC8.js","assets/loader-circle-BWw23_DY.js","assets/store-Dx1XhYcs.js","assets/collapsible-NKtgkvXc.js","assets/tabs-C7-u1MlW.js","assets/use-copy-to-clipboard-B2jqkkCP.js","assets/maximize-2-N7ntOlKC.js","assets/play-DKnIFJgX.js","assets/plus-hsII00cK.js","assets/server-HG9g5czd.js","assets/cli-command-panel-Bbgu_PHE.js","assets/trash-DU2S79Q3.js","assets/field-D45t5nwl.js","assets/ec2-BL5MCjb2.js","assets/ecs-Du4d90q-.js","assets/useMutation-0VvC4-D7.js","assets/signed-fetch-DutYaOyQ.js","assets/delete-confirmation-dialog-khwGiTUy.js","assets/alert-dialog-B2wM6M0p.js","assets/DialogTitle-BlGk2Olt.js","assets/confirm-phrase-HKyrGgCW.js","assets/state-badge-60FZam9q.js","assets/form-lock-ETWruSvZ.js","assets/form-panel-FvMLLm-S.js","assets/gpu-instance-type-select-DJI4N_hg.js","assets/system-managed-Dk7ySh_E.js","assets/panel-list-BXltOhHx.js","assets/system-image-required-CWswR3An.js","assets/rotate-cw-D7aE4Xve.js","assets/triangle-alert-DOQ-ERJ6.js","assets/stop-task-dialog-Y2qFyyMV.js"])))=>i.map(i=>d[i]);
|
||||
import{s as e}from"./schemas-CKmbY8gV.js";import{n as t,t as n}from"./lazyRouteComponent-BIOh5GOe.js";import{t as r}from"./searchMiddleware-CN1kfGOC.js";import{p as i}from"./detail-panel-BUy-SsXi.js";import{Mo as a}from"./awsClient-Da_1PWK9.js";import{i as o,s,t as c}from"./ecs-B4PUYbCf.js";var l=t(`/_auth/ecs/(clusters)/list-clusters/$clusterName`)({validateSearch:e({tab:i.tab}),search:{middlewares:[r({tab:`overview`})]},loader:async({context:e,params:t})=>{await Promise.all([e.queryClient.query({...c(t.clusterName),staleTime:`static`}),e.queryClient.query({...o(t.clusterName),staleTime:`static`}),e.queryClient.query({...s(t.clusterName),staleTime:`static`})])},head:({params:e})=>({meta:[{title:`${e.clusterName} | ECS | Mulga`}]}),component:n(()=>a(()=>import(`./_clusterName-PGXuLpFG.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60])),`component`)});export{l as t};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{Gt as e,Vt as t}from"./schemas-CKmbY8gV.js";import{t as n}from"./useSuspenseQuery-CfG96AGi.js";import{t as r}from"./ecs-B4PUYbCf.js";import{t as i}from"./_clusterName-DPQe-y79.js";import{t as a}from"./back-link-CxXZw47s.js";import{t as o}from"./cluster-details-CBeOlQb_.js";var s=t(),c=e();function l(){let e=(0,s.c)(11),{clusterName:t}=i.useParams(),{tab:l}=i.useSearch(),u=i.useNavigate(),d;e[0]===t?d=e[1]:(d=r(t),e[0]=t,e[1]=d);let{data:f}=n(d);if(!f){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a,{to:`/ecs/list-clusters`,children:`Back to clusters`}),(0,c.jsx)(`p`,{className:`text-muted-foreground`,children:`Cluster not found.`})]}),e[2]=t):t=e[2],t}let p,m;e[3]===u?(p=e[4],m=e[5]):(p=()=>{u({to:`/ecs/list-clusters`})},m=e=>{u({search:{tab:e},replace:!0})},e[3]=u,e[4]=p,e[5]=m);let h;return e[6]!==f||e[7]!==p||e[8]!==m||e[9]!==l?(h=(0,c.jsx)(o,{cluster:f,layout:`page`,onClose:p,onTabChange:m,tab:l}),e[6]=f,e[7]=p,e[8]=m,e[9]=l,e[10]=h):h=e[10],h}export{l as component};
|
||||
import{It as e,Mt as t}from"./schemas-DCQXG11d.js";import{t as n}from"./useSuspenseQuery--dusmE-Q.js";import{t as r}from"./ecs-D2Xj5Fk-.js";import{t as i}from"./_clusterName-CF57bBZp.js";import{t as a}from"./back-link-B8ejy5Fm.js";import{t as o}from"./cluster-details-B8veXcs_.js";var s=t(),c=e();function l(){let e=(0,s.c)(11),{clusterName:t}=i.useParams(),{tab:l}=i.useSearch(),u=i.useNavigate(),d;e[0]===t?d=e[1]:(d=r(t),e[0]=t,e[1]=d);let{data:f}=n(d);if(!f){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a,{to:`/ecs/list-clusters`,children:`Back to clusters`}),(0,c.jsx)(`p`,{className:`text-muted-foreground`,children:`Cluster not found.`})]}),e[2]=t):t=e[2],t}let p,m;e[3]===u?(p=e[4],m=e[5]):(p=()=>{u({to:`/ecs/list-clusters`})},m=e=>{u({search:{tab:e},replace:!0})},e[3]=u,e[4]=p,e[5]=m);let h;return e[6]!==f||e[7]!==p||e[8]!==m||e[9]!==l?(h=(0,c.jsx)(o,{cluster:f,layout:`page`,onClose:p,onTabChange:m,tab:l}),e[6]=f,e[7]=p,e[8]=m,e[9]=l,e[10]=h):h=e[10],h}export{l as component};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_clusterName-BYyd5uEn.js","assets/schemas-DCQXG11d.js","assets/rolldown-runtime-XKyaHtl9.js","assets/cluster-details-1bW7KNv3.js","assets/select-UwOVJofC.js","assets/visuallyHidden-BHQz5bmH.js","assets/check-DPoQ9cBn.js","assets/chevron-down-BgudX6bq.js","assets/useScrollLock-iGnmnC-h.js","assets/useValueAsRef-uzS1fuI8.js","assets/useTransitionStatus-Dn-09Anc.js","assets/composite-DysENEse.js","assets/useRegisterFieldControl-DkI655of.js","assets/useValueChanged-wii0yYWk.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/isElementDisabled-B7Ri5ug6.js","assets/useControlled-NIWPmeG5.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/clamp-D0kAXd-u.js","assets/QueryClientProvider-BuG40HBe.js","assets/useMutation-lRi0DDcO.js","assets/queryOptions-Cu2lvOFG.js","assets/useQuery-D6TojLgI.js","assets/useSuspenseQuery--dusmE-Q.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/circle-arrow-up-CFARPO9V.js","assets/eye-yi4wz0yh.js","assets/maximize-2-BAlKoEj8.js","assets/plus-BK_7eO_G.js","assets/sliders-horizontal-DsGbsnBU.js","assets/cli-command-panel-Do14gxB9.js","assets/copy-B9ICxw_u.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/trash-BajuWzqn.js","assets/triangle-alert-Ckml5FoO.js","assets/field-iLG94M00.js","assets/detail-panel-DLM1ExsZ.js","assets/x-mlA6pp-8.js","assets/info-tip-Cxa2GEOd.js","assets/store-BVhNJayb.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/tabs-9tHEWpNn.js","assets/CompositeRoot-CmHoR-Tk.js","assets/panel-search-LDLf8HCe.js","assets/error-banner-Cahg3Ix2.js","assets/auth-BS4WytAe.js","assets/awsClient-BvDfQdL8.js","assets/fetch-http-handler-B--F8e2N.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/tags-BVcAJWuE.js","assets/commandBuilder-D7SsohHF.js","assets/commandBuilder-Bb9dqTZ7.js","assets/commandBuilder-CfqGUk7K.js","assets/commandBuilder-CV-6DENN.js","assets/ec2-C2FdJaHg.js","assets/eks-ard8HOD6.js","assets/iam-INCULz7q.js","assets/json-DSPw_Fae.js","assets/delete-confirmation-dialog-O7cqOW0Y.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js","assets/state-badge-CQPRxt3J.js","assets/subnet-calculator-DDrAb5xp.js","assets/resource-tags-CGeRAZrb.js","assets/inline-tags-nfRc9elZ.js","assets/pencil-DLzYMCIc.js","assets/form-lock-D8Cu0Sfu.js","assets/form-panel-CtjudV7b.js","assets/gpu-instance-type-select-DsB5oPSo.js","assets/index.esm-C31mnnYl.js","assets/zod-nOHMBkds.js","assets/form-fields-CcTBfvl9.js","assets/switch-list-X53OOONN.js","assets/switch-CFqwHFZR.js","assets/useAriaLabelledBy-DStQJVTn.js","assets/badge-DmU0agld.js","assets/useRender-B8US0bW6.js","assets/json-editor-Ch9m2EYE.js","assets/textarea-BG1iGvVs.js"])))=>i.map(i=>d[i]);
|
||||
import{s as e}from"./schemas-DCQXG11d.js";import{n as t,t as n}from"./lazyRouteComponent-PMetaA3O.js";import{t as r}from"./searchMiddleware-Clk50hy1.js";import{U as i}from"./fetch-http-handler-B--F8e2N.js";import{s as a,t as o,u as s}from"./eks-ard8HOD6.js";import{r as c}from"./panel-search-LDLf8HCe.js";var l=t(`/_auth/eks/(clusters)/list-clusters/$clusterName`)({validateSearch:e({tab:c.tab}),search:{middlewares:[r({tab:`overview`})]},loader:async({context:e,params:t})=>{await Promise.all([e.queryClient.query({...a(t.clusterName),staleTime:`static`}),e.queryClient.query({...s(t.clusterName),staleTime:`static`}),e.queryClient.query({...o(t.clusterName),staleTime:`static`})])},head:({params:e})=>({meta:[{title:`${e.clusterName} | EKS | Mulga`}]}),component:n(()=>i(()=>import(`./_clusterName-BYyd5uEn.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83])),`component`)});export{l as t};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{Gt as e,Vt as t}from"./schemas-CKmbY8gV.js";import{t as n}from"./useSuspenseQuery-CfG96AGi.js";import{t as r}from"./group-details-ChGGYn39.js";import{s as i}from"./iam-Cd60dYHn.js";import{t as a}from"./_groupName-DVuTQKjk.js";import{t as o}from"./back-link-CxXZw47s.js";var s=t(),c=e();function l(){let e=(0,s.c)(11),{groupName:t}=a.useParams(),{tab:l}=a.useSearch(),u=a.useNavigate(),d;e[0]===t?d=e[1]:(d=i(t),e[0]=t,e[1]=d);let{data:f}=n(d),p=f.Group;if(!p){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(o,{to:`/iam/list-groups`,children:`Back to groups`}),(0,c.jsx)(`p`,{className:`text-muted-foreground`,children:`Group not found.`})]}),e[2]=t):t=e[2],t}let m,h;e[3]===u?(m=e[4],h=e[5]):(m=()=>{u({to:`/iam/list-groups`})},h=e=>{u({search:{tab:e},replace:!0})},e[3]=u,e[4]=m,e[5]=h);let g;return e[6]!==p||e[7]!==m||e[8]!==h||e[9]!==l?(g=(0,c.jsx)(r,{layout:`page`,onClose:m,onTabChange:h,group:p,tab:l}),e[6]=p,e[7]=m,e[8]=h,e[9]=l,e[10]=g):g=e[10],g}export{l as component};
|
||||
import{It as e,Mt as t}from"./schemas-DCQXG11d.js";import{t as n}from"./useSuspenseQuery--dusmE-Q.js";import{t as r}from"./group-details-DqBJW31W.js";import{s as i}from"./iam-INCULz7q.js";import{t as a}from"./_groupName-DVWrDQpm.js";import{t as o}from"./back-link-B8ejy5Fm.js";var s=t(),c=e();function l(){let e=(0,s.c)(11),{groupName:t}=a.useParams(),{tab:l}=a.useSearch(),u=a.useNavigate(),d;e[0]===t?d=e[1]:(d=i(t),e[0]=t,e[1]=d);let{data:f}=n(d),p=f.Group;if(!p){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(o,{to:`/iam/list-groups`,children:`Back to groups`}),(0,c.jsx)(`p`,{className:`text-muted-foreground`,children:`Group not found.`})]}),e[2]=t):t=e[2],t}let m,h;e[3]===u?(m=e[4],h=e[5]):(m=()=>{u({to:`/iam/list-groups`})},h=e=>{u({search:{tab:e},replace:!0})},e[3]=u,e[4]=m,e[5]=h);let g;return e[6]!==p||e[7]!==m||e[8]!==h||e[9]!==l?(g=(0,c.jsx)(r,{layout:`page`,onClose:m,onTabChange:h,group:p,tab:l}),e[6]=p,e[7]=m,e[8]=h,e[9]=l,e[10]=g):g=e[10],g}export{l as component};
|
||||
@@ -0,0 +1,2 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_groupName-BqIKUK6U.js","assets/schemas-DCQXG11d.js","assets/rolldown-runtime-XKyaHtl9.js","assets/useSuspenseQuery--dusmE-Q.js","assets/queryOptions-Cu2lvOFG.js","assets/QueryClientProvider-BuG40HBe.js","assets/group-details-DqBJW31W.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/visuallyHidden-BHQz5bmH.js","assets/eye-yi4wz0yh.js","assets/maximize-2-BAlKoEj8.js","assets/sliders-horizontal-DsGbsnBU.js","assets/trash-BajuWzqn.js","assets/useValueAsRef-uzS1fuI8.js","assets/useTransitionStatus-Dn-09Anc.js","assets/detail-panel-DLM1ExsZ.js","assets/x-mlA6pp-8.js","assets/info-tip-Cxa2GEOd.js","assets/useScrollLock-iGnmnC-h.js","assets/composite-DysENEse.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/useValueChanged-wii0yYWk.js","assets/isElementDisabled-B7Ri5ug6.js","assets/store-BVhNJayb.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/check-DPoQ9cBn.js","assets/chevron-down-BgudX6bq.js","assets/copy-B9ICxw_u.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/useControlled-NIWPmeG5.js","assets/tabs-9tHEWpNn.js","assets/CompositeRoot-CmHoR-Tk.js","assets/panel-search-LDLf8HCe.js","assets/error-banner-Cahg3Ix2.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/iam-Dxu_EThi.js","assets/useMutation-lRi0DDcO.js","assets/awsClient-BvDfQdL8.js","assets/auth-BS4WytAe.js","assets/fetch-http-handler-B--F8e2N.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/commandBuilder-CfqGUk7K.js","assets/iam-INCULz7q.js","assets/json-DSPw_Fae.js","assets/delete-confirmation-dialog-O7cqOW0Y.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js","assets/field-iLG94M00.js","assets/useRegisterFieldControl-DkI655of.js","assets/resource-delete-dialog-D3NYuO-k.js","assets/iam-items-Ww3TvSwm.js","assets/inline-policies-panel-1LW88q6-.js","assets/useQuery-D6TojLgI.js","assets/plus-BK_7eO_G.js","assets/unlink-BigvXWQp.js","assets/json-editor-Ch9m2EYE.js","assets/textarea-BG1iGvVs.js","assets/iam-BG-N60hp.js","assets/delete-prerequisites-BjEJirR1.js","assets/back-link-B8ejy5Fm.js"])))=>i.map(i=>d[i]);
|
||||
import{s as e}from"./schemas-DCQXG11d.js";import{n as t,t as n}from"./lazyRouteComponent-PMetaA3O.js";import{t as r}from"./searchMiddleware-Clk50hy1.js";import{U as i}from"./fetch-http-handler-B--F8e2N.js";import{C as a,a as o,n as s,p as c,s as l}from"./iam-INCULz7q.js";import{r as u}from"./panel-search-LDLf8HCe.js";var d=t(`/_auth/iam/(groups)/list-groups/$groupName`)({validateSearch:e({tab:u.tab}),search:{middlewares:[r({tab:`overview`})]},loader:async({context:e,params:t})=>{await Promise.all([e.queryClient.query({...l(t.groupName),staleTime:`static`}),e.queryClient.query({...s(t.groupName),staleTime:`static`}),e.queryClient.query({...c,staleTime:`static`}),e.queryClient.query({...a,staleTime:`static`}),e.queryClient.query({...o(t.groupName),staleTime:`static`})])},head:({params:e})=>({meta:[{title:`${e.groupName} | IAM | Mulga`}]}),component:n(()=>i(()=>import(`./_groupName-BqIKUK6U.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64])),`component`)});export{d as t};
|
||||
@@ -1,2 +0,0 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_groupName-C66wYsWg.js","assets/schemas-CKmbY8gV.js","assets/rolldown-runtime-XKyaHtl9.js","assets/useSuspenseQuery-CfG96AGi.js","assets/queryOptions-C3LOV3Yq.js","assets/QueryClientProvider-B3gFFx5-.js","assets/group-details-ChGGYn39.js","assets/link-CoQQT1u0.js","assets/matchContext-C_cBF5rG.js","assets/visuallyHidden-Di6ozTl7.js","assets/error-banner-6H_aBcIY.js","assets/sliders-horizontal-B4nfPbkq.js","assets/detail-panel-BUy-SsXi.js","assets/x-BuYxxvoG.js","assets/check-BURgRfkZ.js","assets/chevron-down-CiWCIUx5.js","assets/copy-Clj54gC8.js","assets/loader-circle-BWw23_DY.js","assets/useScrollLock-tbqBjaVX.js","assets/useValueAsRef-DtjtqpoE.js","assets/ToolbarRootContext-CPQMf91l.js","assets/useControlled-CliDS5IQ.js","assets/isElementDisabled-DwizONlP.js","assets/store-Dx1XhYcs.js","assets/collapsible-NKtgkvXc.js","assets/tabs-C7-u1MlW.js","assets/use-copy-to-clipboard-B2jqkkCP.js","assets/maximize-2-N7ntOlKC.js","assets/trash-DU2S79Q3.js","assets/iam-Cd60dYHn.js","assets/awsClient-Da_1PWK9.js","assets/auth-LWMosi88.js","assets/index.browser-BEm-79SP.js","assets/json-BYhzhOil.js","assets/iam-CFV88tQE.js","assets/useMutation-0VvC4-D7.js","assets/delete-confirmation-dialog-khwGiTUy.js","assets/alert-dialog-B2wM6M0p.js","assets/DialogTitle-BlGk2Olt.js","assets/confirm-phrase-HKyrGgCW.js","assets/field-D45t5nwl.js","assets/useRegisterFieldControl-BpMxH-yS.js","assets/resource-delete-dialog-DB-hXwnM.js","assets/iam-items-DjjGc2aQ.js","assets/inline-policies-panel-CJ3DhTvu.js","assets/useQuery-DgGWYOhJ.js","assets/plus-hsII00cK.js","assets/unlink-DlScwunQ.js","assets/json-editor-oM4Sz7Jd.js","assets/textarea-DjPTve3M.js","assets/iam-CX9BBMw8.js","assets/delete-prerequisites-BjEJirR1.js","assets/back-link-CxXZw47s.js"])))=>i.map(i=>d[i]);
|
||||
import{s as e}from"./schemas-CKmbY8gV.js";import{n as t,t as n}from"./lazyRouteComponent-BIOh5GOe.js";import{t as r}from"./searchMiddleware-CN1kfGOC.js";import{p as i}from"./detail-panel-BUy-SsXi.js";import{Mo as a}from"./awsClient-Da_1PWK9.js";import{C as o,a as s,n as c,p as l,s as u}from"./iam-Cd60dYHn.js";var d=t(`/_auth/iam/(groups)/list-groups/$groupName`)({validateSearch:e({tab:i.tab}),search:{middlewares:[r({tab:`overview`})]},loader:async({context:e,params:t})=>{await Promise.all([e.queryClient.query({...u(t.groupName),staleTime:`static`}),e.queryClient.query({...c(t.groupName),staleTime:`static`}),e.queryClient.query({...l,staleTime:`static`}),e.queryClient.query({...o,staleTime:`static`}),e.queryClient.query({...s(t.groupName),staleTime:`static`})])},head:({params:e})=>({meta:[{title:`${e.groupName} | IAM | Mulga`}]}),component:n(()=>a(()=>import(`./_groupName-C66wYsWg.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52])),`component`)});export{d as t};
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_guardrailId.edit-Bp3DUXUQ.js","assets/schemas-CKmbY8gV.js","assets/rolldown-runtime-XKyaHtl9.js","assets/useSuspenseQuery-CfG96AGi.js","assets/queryOptions-C3LOV3Yq.js","assets/QueryClientProvider-B3gFFx5-.js","assets/bedrock-BHkZEt0C.js","assets/awsClient-Da_1PWK9.js","assets/auth-LWMosi88.js","assets/index.browser-BEm-79SP.js","assets/bedrock-Dq3b2Oie.js","assets/useMutation-0VvC4-D7.js","assets/tags-Dow4PoR3.js","assets/guardrail-form-page-DPf-GoPw.js","assets/lazyRouteComponent-BIOh5GOe.js","assets/matchContext-C_cBF5rG.js","assets/link-CoQQT1u0.js","assets/useSelector-BuHlvrXV.js","assets/plus-hsII00cK.js","assets/visuallyHidden-Di6ozTl7.js","assets/cli-command-panel-Bbgu_PHE.js","assets/check-BURgRfkZ.js","assets/chevron-down-CiWCIUx5.js","assets/copy-Clj54gC8.js","assets/useValueAsRef-DtjtqpoE.js","assets/use-copy-to-clipboard-B2jqkkCP.js","assets/trash-DU2S79Q3.js","assets/field-D45t5nwl.js","assets/useRegisterFieldControl-BpMxH-yS.js","assets/useControlled-CliDS5IQ.js","assets/switch-ARpklVus.js","assets/useAriaLabelledBy-C1btqlkM.js","assets/textarea-DjPTve3M.js","assets/page-heading-DOCwCs80.js","assets/form-lock-ETWruSvZ.js","assets/error-banner-6H_aBcIY.js","assets/loader-circle-BWw23_DY.js","assets/index.esm-BQMPsB0n.js","assets/zod-BWB4pUhT.js","assets/back-link-CxXZw47s.js","assets/form-fields-Dz0ldQ7r.js","assets/select-DEWJs_zZ.js","assets/useScrollLock-tbqBjaVX.js","assets/ToolbarRootContext-CPQMf91l.js","assets/isElementDisabled-DwizONlP.js","assets/clamp-D0kAXd-u.js","assets/tags-field-array-DXxufWBT.js"])))=>i.map(i=>d[i]);
|
||||
import{n as e,t}from"./lazyRouteComponent-BIOh5GOe.js";import{Mo as n}from"./awsClient-Da_1PWK9.js";import{n as r}from"./bedrock-BHkZEt0C.js";var i=e(`/_auth/bedrock/(guardrails)/list-guardrails/$guardrailId/edit`)({loader:async({context:e,params:t})=>{await e.queryClient.query({...r(t.guardrailId),staleTime:`static`})},head:({params:e})=>({meta:[{title:`Edit ${e.guardrailId} | Guardrail | Mulga`}]}),component:t(()=>n(()=>import(`./_guardrailId.edit-Bp3DUXUQ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46])),`component`)});export{i as t};
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{Gt as e,Vt as t}from"./schemas-CKmbY8gV.js";import{t as n}from"./useSuspenseQuery-CfG96AGi.js";import{n as r}from"./bedrock-BHkZEt0C.js";import{p as i}from"./bedrock-Dq3b2Oie.js";import{t as a}from"./_guardrailId.edit-BF4NMzEE.js";import{t as o}from"./guardrail-form-page-DPf-GoPw.js";var s=t(),c=e();function l(){let e=(0,s.c)(7),{guardrailId:t}=a.useParams(),l;e[0]===t?l=e[1]:(l=r(t),e[0]=t,e[1]=l);let{data:u}=n(l),d;e[2]===u?d=e[3]:(d=i(u),e[2]=u,e[3]=d);let f;return e[4]!==t||e[5]!==d?(f=(0,c.jsx)(o,{defaultValues:d,guardrailId:t,mode:`edit`}),e[4]=t,e[5]=d,e[6]=f):f=e[6],f}export{l as component};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_guardrailId.edit-CJtFqFm8.js","assets/schemas-DCQXG11d.js","assets/rolldown-runtime-XKyaHtl9.js","assets/useSuspenseQuery--dusmE-Q.js","assets/queryOptions-Cu2lvOFG.js","assets/QueryClientProvider-BuG40HBe.js","assets/bedrock-BuO1n8fj.js","assets/awsClient-BvDfQdL8.js","assets/auth-BS4WytAe.js","assets/fetch-http-handler-B--F8e2N.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/bedrock-cODWxxpg.js","assets/useMutation-lRi0DDcO.js","assets/tags-Ki2a29eH.js","assets/guardrail-form-page-B0tEFLJ6.js","assets/useNavigate-cMdr_EJ0.js","assets/useRouter-B_eSHXWd.js","assets/plus-BK_7eO_G.js","assets/visuallyHidden-BHQz5bmH.js","assets/cli-command-panel-Do14gxB9.js","assets/check-DPoQ9cBn.js","assets/chevron-down-BgudX6bq.js","assets/copy-B9ICxw_u.js","assets/useValueAsRef-uzS1fuI8.js","assets/useTransitionStatus-Dn-09Anc.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/trash-BajuWzqn.js","assets/field-iLG94M00.js","assets/useRegisterFieldControl-DkI655of.js","assets/useValueChanged-wii0yYWk.js","assets/switch-CFqwHFZR.js","assets/useAriaLabelledBy-DStQJVTn.js","assets/useControlled-NIWPmeG5.js","assets/textarea-BG1iGvVs.js","assets/page-heading-ZfrnK2wu.js","assets/form-lock-D8Cu0Sfu.js","assets/loader-circle-C7EgoGp_.js","assets/error-banner-Cahg3Ix2.js","assets/index.esm-C31mnnYl.js","assets/zod-nOHMBkds.js","assets/form-fields-CcTBfvl9.js","assets/select-UwOVJofC.js","assets/useScrollLock-iGnmnC-h.js","assets/composite-DysENEse.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/isElementDisabled-B7Ri5ug6.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/clamp-D0kAXd-u.js","assets/info-tip-Cxa2GEOd.js","assets/store-BVhNJayb.js","assets/back-link-B8ejy5Fm.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/tags-field-array-Drjjg7Rv.js"])))=>i.map(i=>d[i]);
|
||||
import{n as e,t}from"./lazyRouteComponent-PMetaA3O.js";import{U as n}from"./fetch-http-handler-B--F8e2N.js";import{n as r}from"./bedrock-BuO1n8fj.js";var i=e(`/_auth/bedrock/(guardrails)/list-guardrails/$guardrailId/edit`)({loader:async({context:e,params:t})=>{await e.queryClient.query({...r(t.guardrailId),staleTime:`static`})},head:({params:e})=>({meta:[{title:`Edit ${e.guardrailId} | Guardrail | Mulga`}]}),component:t(()=>n(()=>import(`./_guardrailId.edit-CJtFqFm8.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54])),`component`)});export{i as t};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{It as e,Mt as t}from"./schemas-DCQXG11d.js";import{t as n}from"./useSuspenseQuery--dusmE-Q.js";import{n as r}from"./bedrock-BuO1n8fj.js";import{p as i}from"./bedrock-cODWxxpg.js";import{t as a}from"./_guardrailId.edit-CAKBZE4w.js";import{t as o}from"./guardrail-form-page-B0tEFLJ6.js";var s=t(),c=e();function l(){let e=(0,s.c)(7),{guardrailId:t}=a.useParams(),l;e[0]===t?l=e[1]:(l=r(t),e[0]=t,e[1]=l);let{data:u}=n(l),d;e[2]===u?d=e[3]:(d=i(u),e[2]=u,e[3]=d);let f;return e[4]!==t||e[5]!==d?(f=(0,c.jsx)(o,{defaultValues:d,guardrailId:t,mode:`edit`}),e[4]=t,e[5]=d,e[6]=f):f=e[6],f}export{l as component};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{Gt as e,Vt as t}from"./schemas-CKmbY8gV.js";import{t as n}from"./useSuspenseQuery-CfG96AGi.js";import{n as r}from"./bedrock-BHkZEt0C.js";import{t as i}from"./guardrail-details-BY0N3gH5.js";import{t as a}from"./_guardrailId.index-qL3pS22-.js";var o=t(),s=e();function c(){let e=(0,o.c)(14),{guardrailId:t}=a.useParams(),{tab:c}=a.useSearch(),l=a.useNavigate(),u;e[0]===t?u=e[1]:(u=r(t),e[0]=t,e[1]=u);let{data:d}=n(u),f;e[2]!==d.name||e[3]!==d.status||e[4]!==t?(f={id:t,name:d.name,status:d.status},e[2]=d.name,e[3]=d.status,e[4]=t,e[5]=f):f=e[5];let p,m;e[6]===l?(p=e[7],m=e[8]):(p=()=>{l({to:`/bedrock/list-guardrails`})},m=e=>{l({search:{tab:e},replace:!0})},e[6]=l,e[7]=p,e[8]=m);let h;return e[9]!==f||e[10]!==p||e[11]!==m||e[12]!==c?(h=(0,s.jsx)(i,{guardrail:f,layout:`page`,onClose:p,onTabChange:m,tab:c}),e[9]=f,e[10]=p,e[11]=m,e[12]=c,e[13]=h):h=e[13],h}export{c as component};
|
||||
import{It as e,Mt as t}from"./schemas-DCQXG11d.js";import{t as n}from"./useSuspenseQuery--dusmE-Q.js";import{n as r}from"./bedrock-BuO1n8fj.js";import{t as i}from"./guardrail-details--ycYzrGj.js";import{t as a}from"./_guardrailId.index-CTsTb5EI.js";var o=t(),s=e();function c(){let e=(0,o.c)(14),{guardrailId:t}=a.useParams(),{tab:c}=a.useSearch(),l=a.useNavigate(),u;e[0]===t?u=e[1]:(u=r(t),e[0]=t,e[1]=u);let{data:d}=n(u),f;e[2]!==d.name||e[3]!==d.status||e[4]!==t?(f={id:t,name:d.name,status:d.status},e[2]=d.name,e[3]=d.status,e[4]=t,e[5]=f):f=e[5];let p,m;e[6]===l?(p=e[7],m=e[8]):(p=()=>{l({to:`/bedrock/list-guardrails`})},m=e=>{l({search:{tab:e},replace:!0})},e[6]=l,e[7]=p,e[8]=m);let h;return e[9]!==f||e[10]!==p||e[11]!==m||e[12]!==c?(h=(0,s.jsx)(i,{guardrail:f,layout:`page`,onClose:p,onTabChange:m,tab:c}),e[9]=f,e[10]=p,e[11]=m,e[12]=c,e[13]=h):h=e[13],h}export{c as component};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_guardrailId.index-B5Q5DXUE.js","assets/schemas-DCQXG11d.js","assets/rolldown-runtime-XKyaHtl9.js","assets/useSuspenseQuery--dusmE-Q.js","assets/queryOptions-Cu2lvOFG.js","assets/QueryClientProvider-BuG40HBe.js","assets/bedrock-BuO1n8fj.js","assets/awsClient-BvDfQdL8.js","assets/auth-BS4WytAe.js","assets/fetch-http-handler-B--F8e2N.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/guardrail-details--ycYzrGj.js","assets/useMutation-lRi0DDcO.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/eye-yi4wz0yh.js","assets/visuallyHidden-BHQz5bmH.js","assets/maximize-2-BAlKoEj8.js","assets/pencil-DLzYMCIc.js","assets/sliders-horizontal-DsGbsnBU.js","assets/trash-BajuWzqn.js","assets/useValueAsRef-uzS1fuI8.js","assets/useTransitionStatus-Dn-09Anc.js","assets/field-iLG94M00.js","assets/useRegisterFieldControl-DkI655of.js","assets/useValueChanged-wii0yYWk.js","assets/detail-panel-DLM1ExsZ.js","assets/x-mlA6pp-8.js","assets/info-tip-Cxa2GEOd.js","assets/useScrollLock-iGnmnC-h.js","assets/composite-DysENEse.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/isElementDisabled-B7Ri5ug6.js","assets/store-BVhNJayb.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/check-DPoQ9cBn.js","assets/chevron-down-BgudX6bq.js","assets/copy-B9ICxw_u.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/useControlled-NIWPmeG5.js","assets/tabs-9tHEWpNn.js","assets/CompositeRoot-CmHoR-Tk.js","assets/panel-search-LDLf8HCe.js","assets/error-banner-Cahg3Ix2.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/bedrock-cODWxxpg.js","assets/tags-Ki2a29eH.js","assets/commandBuilder-ClDzvnte.js","assets/textarea-BG1iGvVs.js","assets/state-badge-CQPRxt3J.js","assets/resource-delete-dialog-D3NYuO-k.js","assets/delete-confirmation-dialog-O7cqOW0Y.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js"])))=>i.map(i=>d[i]);
|
||||
import{s as e}from"./schemas-DCQXG11d.js";import{n as t,t as n}from"./lazyRouteComponent-PMetaA3O.js";import{t as r}from"./searchMiddleware-Clk50hy1.js";import{U as i}from"./fetch-http-handler-B--F8e2N.js";import{n as a,r as o}from"./bedrock-BuO1n8fj.js";import{r as s}from"./panel-search-LDLf8HCe.js";var c=t(`/_auth/bedrock/(guardrails)/list-guardrails/$guardrailId/`)({validateSearch:e({tab:s.tab}),search:{middlewares:[r({tab:`overview`})]},loader:async({context:e,params:t})=>{await Promise.all([e.queryClient.query({...a(t.guardrailId),staleTime:`static`}),e.queryClient.query({...o(t.guardrailId),staleTime:`static`})])},head:({params:e})=>({meta:[{title:`${e.guardrailId} | Guardrail | Mulga`}]}),component:n(()=>i(()=>import(`./_guardrailId.index-B5Q5DXUE.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57])),`component`)});export{c as t};
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_guardrailId.index-CrD1q_4U.js","assets/schemas-CKmbY8gV.js","assets/rolldown-runtime-XKyaHtl9.js","assets/useSuspenseQuery-CfG96AGi.js","assets/queryOptions-C3LOV3Yq.js","assets/QueryClientProvider-B3gFFx5-.js","assets/bedrock-BHkZEt0C.js","assets/awsClient-Da_1PWK9.js","assets/auth-LWMosi88.js","assets/index.browser-BEm-79SP.js","assets/guardrail-details-BY0N3gH5.js","assets/useMutation-0VvC4-D7.js","assets/link-CoQQT1u0.js","assets/matchContext-C_cBF5rG.js","assets/sliders-horizontal-B4nfPbkq.js","assets/visuallyHidden-Di6ozTl7.js","assets/detail-panel-BUy-SsXi.js","assets/x-BuYxxvoG.js","assets/error-banner-6H_aBcIY.js","assets/check-BURgRfkZ.js","assets/chevron-down-CiWCIUx5.js","assets/copy-Clj54gC8.js","assets/loader-circle-BWw23_DY.js","assets/useScrollLock-tbqBjaVX.js","assets/useValueAsRef-DtjtqpoE.js","assets/ToolbarRootContext-CPQMf91l.js","assets/useControlled-CliDS5IQ.js","assets/isElementDisabled-DwizONlP.js","assets/store-Dx1XhYcs.js","assets/collapsible-NKtgkvXc.js","assets/tabs-C7-u1MlW.js","assets/use-copy-to-clipboard-B2jqkkCP.js","assets/maximize-2-N7ntOlKC.js","assets/pencil-Es1j7lo2.js","assets/trash-DU2S79Q3.js","assets/field-D45t5nwl.js","assets/useRegisterFieldControl-BpMxH-yS.js","assets/bedrock-Dq3b2Oie.js","assets/tags-Dow4PoR3.js","assets/commandBuilder-BhiwXyoE.js","assets/textarea-DjPTve3M.js","assets/state-badge-60FZam9q.js","assets/resource-delete-dialog-DB-hXwnM.js","assets/delete-confirmation-dialog-khwGiTUy.js","assets/alert-dialog-B2wM6M0p.js","assets/DialogTitle-BlGk2Olt.js","assets/confirm-phrase-HKyrGgCW.js"])))=>i.map(i=>d[i]);
|
||||
import{s as e}from"./schemas-CKmbY8gV.js";import{n as t,t as n}from"./lazyRouteComponent-BIOh5GOe.js";import{t as r}from"./searchMiddleware-CN1kfGOC.js";import{p as i}from"./detail-panel-BUy-SsXi.js";import{Mo as a}from"./awsClient-Da_1PWK9.js";import{n as o,r as s}from"./bedrock-BHkZEt0C.js";var c=t(`/_auth/bedrock/(guardrails)/list-guardrails/$guardrailId/`)({validateSearch:e({tab:i.tab}),search:{middlewares:[r({tab:`overview`})]},loader:async({context:e,params:t})=>{await Promise.all([e.queryClient.query({...o(t.guardrailId),staleTime:`static`}),e.queryClient.query({...s(t.guardrailId),staleTime:`static`})])},head:({params:e})=>({meta:[{title:`${e.guardrailId} | Guardrail | Mulga`}]}),component:n(()=>a(()=>import(`./_guardrailId.index-CrD1q_4U.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46])),`component`)});export{c as t};
|
||||
@@ -0,0 +1,2 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_id-sT96k6cW.js","assets/schemas-DCQXG11d.js","assets/rolldown-runtime-XKyaHtl9.js","assets/useQuery-D6TojLgI.js","assets/queryOptions-Cu2lvOFG.js","assets/QueryClientProvider-BuG40HBe.js","assets/useSuspenseQuery--dusmE-Q.js","assets/ec2-C2FdJaHg.js","assets/awsClient-BvDfQdL8.js","assets/auth-BS4WytAe.js","assets/fetch-http-handler-B--F8e2N.js","assets/toUtf8.browser-RsrLknAJ.js","assets/index.browser-D7GVEViY.js","assets/commandBuilder-D7SsohHF.js","assets/back-link-B8ejy5Fm.js","assets/link-BX-1BPor.js","assets/matchContext-CUAcfcYw.js","assets/useRouter-B_eSHXWd.js","assets/info-tip-Cxa2GEOd.js","assets/visuallyHidden-BHQz5bmH.js","assets/useScrollLock-iGnmnC-h.js","assets/useValueAsRef-uzS1fuI8.js","assets/useTransitionStatus-Dn-09Anc.js","assets/composite-DysENEse.js","assets/useAnchoredPopupScrollLock-CoHshdlQ.js","assets/useValueChanged-wii0yYWk.js","assets/isElementDisabled-B7Ri5ug6.js","assets/store-BVhNJayb.js","assets/ToolbarRootContext-iMMgkc2r.js","assets/internet-gateway-details-Dx-SRdDD.js","assets/select-UwOVJofC.js","assets/check-DPoQ9cBn.js","assets/chevron-down-BgudX6bq.js","assets/useRegisterFieldControl-DkI655of.js","assets/useControlled-NIWPmeG5.js","assets/clamp-D0kAXd-u.js","assets/eye-yi4wz0yh.js","assets/link-2-C2tj8Xu3.js","assets/maximize-2-BAlKoEj8.js","assets/sliders-horizontal-DsGbsnBU.js","assets/trash-BajuWzqn.js","assets/unlink-BigvXWQp.js","assets/detail-panel-DLM1ExsZ.js","assets/x-mlA6pp-8.js","assets/copy-B9ICxw_u.js","assets/loader-circle-C7EgoGp_.js","assets/collapsible-DddM174D.js","assets/tabs-9tHEWpNn.js","assets/CompositeRoot-CmHoR-Tk.js","assets/panel-search-LDLf8HCe.js","assets/error-banner-Cahg3Ix2.js","assets/use-copy-to-clipboard-D-PxomFK.js","assets/ec2-7jxCkIMu.js","assets/useMutation-lRi0DDcO.js","assets/subnet-calculator-DDrAb5xp.js","assets/tags-Ki2a29eH.js","assets/delete-confirmation-dialog-O7cqOW0Y.js","assets/alert-dialog-D9jG-rkO.js","assets/DialogTitle-nAIOTphJ.js","assets/confirm-phrase-C4Dux-0Y.js","assets/field-iLG94M00.js","assets/state-badge-CQPRxt3J.js","assets/resource-tags-CGeRAZrb.js","assets/tags-BVcAJWuE.js","assets/commandBuilder-Bb9dqTZ7.js","assets/commandBuilder-CfqGUk7K.js","assets/commandBuilder-CV-6DENN.js","assets/inline-tags-nfRc9elZ.js","assets/pencil-DLzYMCIc.js","assets/plus-BK_7eO_G.js","assets/resource-delete-dialog-D3NYuO-k.js"])))=>i.map(i=>d[i]);
|
||||
import{s as e}from"./schemas-DCQXG11d.js";import{n as t,t as n}from"./lazyRouteComponent-PMetaA3O.js";import{t as r}from"./searchMiddleware-Clk50hy1.js";import{U as i}from"./fetch-http-handler-B--F8e2N.js";import{N as a,d as o}from"./ec2-C2FdJaHg.js";import{r as s}from"./panel-search-LDLf8HCe.js";var c=t(`/_auth/ec2/(internet-gateways)/describe-internet-gateways/$id`)({validateSearch:e({tab:s.tab}),search:{middlewares:[r({tab:`overview`})]},loader:async({context:e,params:t})=>{await Promise.all([e.queryClient.query({...o(t.id),staleTime:`static`}),e.queryClient.query({...a,staleTime:`static`})])},head:({params:e})=>({meta:[{title:`${e.id} | Internet Gateway | Mulga`}]}),component:n(()=>i(()=>import(`./_id-sT96k6cW.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70])),`component`)});export{c as t};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{Gt as e,Vt as t}from"./schemas-CKmbY8gV.js";import{t as n}from"./useSuspenseQuery-CfG96AGi.js";import{S as r}from"./ec2-BL5MCjb2.js";import{t as i}from"./_id-OG5RbAYy.js";import{t as a}from"./back-link-CxXZw47s.js";import{t as o}from"./route-table-details-xQ8-QGIx.js";var s=t(),c=e();function l(){let e=(0,s.c)(11),{id:t}=i.useParams(),{tab:l}=i.useSearch(),u=i.useNavigate(),d;e[0]===t?d=e[1]:(d=r(t),e[0]=t,e[1]=d);let{data:f}=n(d),p=f.RouteTables?.[0];if(!p?.RouteTableId){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a,{to:`/ec2/describe-route-tables`,children:`Back to route tables`}),(0,c.jsx)(`p`,{className:`text-muted-foreground`,children:`Route table not found.`})]}),e[2]=t):t=e[2],t}let m,h;e[3]===u?(m=e[4],h=e[5]):(m=()=>{u({to:`/ec2/describe-route-tables`})},h=e=>{u({search:{tab:e},replace:!0})},e[3]=u,e[4]=m,e[5]=h);let g;return e[6]!==p||e[7]!==m||e[8]!==h||e[9]!==l?(g=(0,c.jsx)(o,{layout:`page`,onClose:m,onTabChange:h,rtb:p,tab:l}),e[6]=p,e[7]=m,e[8]=h,e[9]=l,e[10]=g):g=e[10],g}export{l as component};
|
||||
import{It as e,Mt as t}from"./schemas-DCQXG11d.js";import{t as n}from"./useSuspenseQuery--dusmE-Q.js";import{S as r}from"./ec2-C2FdJaHg.js";import{t as i}from"./_id-n454kA14.js";import{t as a}from"./back-link-B8ejy5Fm.js";import{t as o}from"./route-table-details-DKNB9Zbj.js";var s=t(),c=e();function l(){let e=(0,s.c)(11),{id:t}=i.useParams(),{tab:l}=i.useSearch(),u=i.useNavigate(),d;e[0]===t?d=e[1]:(d=r(t),e[0]=t,e[1]=d);let{data:f}=n(d),p=f.RouteTables?.[0];if(!p?.RouteTableId){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a,{to:`/ec2/describe-route-tables`,children:`Back to route tables`}),(0,c.jsx)(`p`,{className:`text-muted-foreground`,children:`Route table not found.`})]}),e[2]=t):t=e[2],t}let m,h;e[3]===u?(m=e[4],h=e[5]):(m=()=>{u({to:`/ec2/describe-route-tables`})},h=e=>{u({search:{tab:e},replace:!0})},e[3]=u,e[4]=m,e[5]=h);let g;return e[6]!==p||e[7]!==m||e[8]!==h||e[9]!==l?(g=(0,c.jsx)(o,{layout:`page`,onClose:m,onTabChange:h,rtb:p,tab:l}),e[6]=p,e[7]=m,e[8]=h,e[9]=l,e[10]=g):g=e[10],g}export{l as component};
|
||||
@@ -1,2 +0,0 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_id-BNgCQABg.js","assets/schemas-CKmbY8gV.js","assets/rolldown-runtime-XKyaHtl9.js","assets/useSuspenseQuery-CfG96AGi.js","assets/queryOptions-C3LOV3Yq.js","assets/QueryClientProvider-B3gFFx5-.js","assets/ec2-BL5MCjb2.js","assets/auth-LWMosi88.js","assets/awsClient-Da_1PWK9.js","assets/index.browser-BEm-79SP.js","assets/back-link-CxXZw47s.js","assets/link-CoQQT1u0.js","assets/matchContext-C_cBF5rG.js","assets/error-banner-6H_aBcIY.js","assets/visuallyHidden-Di6ozTl7.js","assets/subnet-details-B_L_v-M0.js","assets/sliders-horizontal-B4nfPbkq.js","assets/detail-panel-BUy-SsXi.js","assets/x-BuYxxvoG.js","assets/check-BURgRfkZ.js","assets/chevron-down-CiWCIUx5.js","assets/copy-Clj54gC8.js","assets/loader-circle-BWw23_DY.js","assets/useScrollLock-tbqBjaVX.js","assets/useValueAsRef-DtjtqpoE.js","assets/ToolbarRootContext-CPQMf91l.js","assets/useControlled-CliDS5IQ.js","assets/isElementDisabled-DwizONlP.js","assets/store-Dx1XhYcs.js","assets/collapsible-NKtgkvXc.js","assets/tabs-C7-u1MlW.js","assets/use-copy-to-clipboard-B2jqkkCP.js","assets/maximize-2-N7ntOlKC.js","assets/trash-DU2S79Q3.js","assets/ec2-DUS7SFT_.js","assets/useMutation-0VvC4-D7.js","assets/subnet-calculator-DDrAb5xp.js","assets/tags-Dow4PoR3.js","assets/state-badge-60FZam9q.js","assets/resource-delete-dialog-DB-hXwnM.js","assets/delete-confirmation-dialog-khwGiTUy.js","assets/alert-dialog-B2wM6M0p.js","assets/DialogTitle-BlGk2Olt.js","assets/confirm-phrase-HKyrGgCW.js","assets/field-D45t5nwl.js","assets/useRegisterFieldControl-BpMxH-yS.js"])))=>i.map(i=>d[i]);
|
||||
import{s as e}from"./schemas-CKmbY8gV.js";import{n as t,t as n}from"./lazyRouteComponent-BIOh5GOe.js";import{t as r}from"./searchMiddleware-CN1kfGOC.js";import{p as i}from"./detail-panel-BUy-SsXi.js";import{Mo as a}from"./awsClient-Da_1PWK9.js";import{O as o}from"./ec2-BL5MCjb2.js";var s=t(`/_auth/ec2/(subnet)/describe-subnets/$id`)({validateSearch:e({tab:i.tab}),search:{middlewares:[r({tab:`overview`})]},loader:async({context:e,params:t})=>{await e.queryClient.query({...o(t.id),staleTime:`static`})},head:({params:e})=>({meta:[{title:`${e.id} | Subnet | Mulga`}]}),component:n(()=>a(()=>import(`./_id-BNgCQABg.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),`component`)});export{s as t};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user