Implement the full architectural plan: unified ingest.Service entry point for archive and Redfish payloads, modular redfishprofile package with composable profiles (generic, ami-family, msi, supermicro, dell, hgx-topology), score-based profile matching with fallback expansion mode, and profile-driven acquisition/analysis plans. Vendor-specific logic moved out of common executors and into profile hooks. GPU chassis lookup strategies and known storage recovery collections (IntelVROC/HA-RAID/MRVL) now live in ResolvedAnalysisPlan, populated by profiles at analysis time. Replay helpers read from the plan; no hardcoded path lists remain in generic code. Also splits redfish_replay.go into domain modules (gpu, storage, inventory, fru, profiles) and adds full fixture/matcher/directive test coverage including Dell, AMI, unknown-vendor fallback, and deterministic ordering. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
73 lines
2.6 KiB
Go
73 lines
2.6 KiB
Go
package redfishprofile
|
|
|
|
import "strings"
|
|
|
|
func msiProfile() Profile {
|
|
return staticProfile{
|
|
name: "msi",
|
|
priority: 20,
|
|
safeForFallback: true,
|
|
matchFn: func(s MatchSignals) int {
|
|
score := 0
|
|
if containsFold(s.SystemManufacturer, "micro-star") || containsFold(s.ChassisManufacturer, "micro-star") {
|
|
score += 80
|
|
}
|
|
if containsFold(s.SystemManufacturer, "msi") || containsFold(s.ChassisManufacturer, "msi") {
|
|
score += 40
|
|
}
|
|
for _, hint := range s.ResourceHints {
|
|
if strings.HasPrefix(hint, "/redfish/v1/Chassis/GPU") {
|
|
score += 10
|
|
break
|
|
}
|
|
}
|
|
return min(score, 100)
|
|
},
|
|
extendAcquisition: func(plan *AcquisitionPlan, _ MatchSignals) {
|
|
ensureSnapshotWorkers(plan, 6)
|
|
ensurePrefetchWorkers(plan, 8)
|
|
ensureETABaseline(plan, AcquisitionETABaseline{
|
|
DiscoverySeconds: 12,
|
|
SnapshotSeconds: 120,
|
|
PrefetchSeconds: 25,
|
|
CriticalPlanBSeconds: 35,
|
|
ProfilePlanBSeconds: 25,
|
|
})
|
|
ensureRatePolicy(plan, AcquisitionRatePolicy{
|
|
TargetP95LatencyMS: 1000,
|
|
ThrottleP95LatencyMS: 2200,
|
|
MinSnapshotWorkers: 2,
|
|
MinPrefetchWorkers: 2,
|
|
DisablePrefetchOnErrors: true,
|
|
})
|
|
ensureRecoveryPolicy(plan, AcquisitionRecoveryPolicy{
|
|
EnableProfilePlanB: true,
|
|
})
|
|
addPlanNote(plan, "msi gpu chassis probes enabled")
|
|
},
|
|
refineAcquisition: func(resolved *ResolvedAcquisitionPlan, discovered DiscoveredResources, _ MatchSignals) {
|
|
for _, chassisPath := range discovered.ChassisPaths {
|
|
if !strings.HasPrefix(chassisPath, "/redfish/v1/Chassis/GPU") {
|
|
continue
|
|
}
|
|
addPlanPaths(&resolved.SeedPaths, chassisPath)
|
|
addPlanPaths(&resolved.Plan.SeedPaths, chassisPath)
|
|
addPlanPaths(&resolved.CriticalPaths, joinPath(chassisPath, "/Sensors"))
|
|
addPlanPaths(&resolved.Plan.CriticalPaths, joinPath(chassisPath, "/Sensors"))
|
|
addPlanPaths(&resolved.Plan.PlanBPaths, joinPath(chassisPath, "/Sensors"))
|
|
}
|
|
},
|
|
applyAnalysisDirectives: func(d *AnalysisDirectives, _ MatchSignals) {
|
|
d.EnableGenericGraphicsControllerDedup = true
|
|
},
|
|
refineAnalysis: func(plan *ResolvedAnalysisPlan, snapshot map[string]interface{}, discovered DiscoveredResources, _ MatchSignals) {
|
|
if snapshotHasGPUProcessor(snapshot, discovered.SystemPaths) && snapshotHasPathPrefix(snapshot, "/redfish/v1/Chassis/GPU") {
|
|
plan.Directives.EnableProcessorGPUFallback = true
|
|
plan.Directives.EnableMSIProcessorGPUChassisLookup = true
|
|
addAnalysisLookupMode(plan, "msi-index")
|
|
addAnalysisNote(plan, "msi analysis enables processor-gpu fallback from discovered GPU chassis")
|
|
}
|
|
},
|
|
}
|
|
}
|