Documentation
¶
Overview ¶
Package firmware reads the firmware and host software versions that operators compare against a release bundle: GPU VBIOS, ConnectX-8 and BlueField-3 NIC firmware, the Grace host BIOS and the DOCA host package.
Every source is read without exec. A source that fails is skipped so it never hides the versions read from the other sources.
Index ¶
- Constants
- func Latest() []apiv1.MachineFirmware
- func Refresh(ctx context.Context, opts Options)
- func RefreshWithin(ctx context.Context, opts Options, timeout time.Duration) bool
- func RunPeriodic(ctx context.Context, opts Options, interval time.Duration)
- func Start(ctx context.Context, opts Options, interval time.Duration) <-chan struct{}
- func WaitFirst(ctx context.Context, ready <-chan struct{}, timeout time.Duration) bool
- type Options
Constants ¶
const DefaultCollectInterval = 4 * time.Hour
DefaultCollectInterval is how often a running GPUd re-reads firmware versions. A new version shows up only after a flash plus a reset or reboot, so a slow refresh is enough.
Variables ¶
This section is empty.
Functions ¶
func Latest ¶
func Latest() []apiv1.MachineFirmware
Latest returns a copy of the last collected entries, or nil before the first collection or when nothing was found.
func Refresh ¶
Refresh collects once and replaces the cached entries. The cache is kept when ctx is done before the collection finished.
A source or GPU that fails drops its entries until the next refresh. Its previous entries are not carried over: they would need their own read time inside an entry that groups instances read now.
func RefreshWithin ¶
RefreshWithin is Refresh for one-shot commands, bounded by timeout. NVML reads ignore ctx, so a hung GPU would otherwise block the command; such a read is left behind and its result is not published. It reports whether the collection finished in time.
func RunPeriodic ¶
RunPeriodic refreshes every interval until ctx is done. It does not collect immediately; call Refresh first for that.
func Start ¶
Start collects in the background now and then every interval until ctx is done. The returned channel is closed when the first collection finished.
Types ¶
type Options ¶
type Options struct {
// NVMLInstance reads the GPU VBIOS versions.
// Nil or a NoOp instance yields no GPU entries; the other sources still run.
NVMLInstance nvidianvml.Instance
// InfinibandClassRootDir overrides the InfiniBand class directory
// (default /sys/class/infiniband), matching the infiniband component.
InfinibandClassRootDir string
// contains filtered or unexported fields
}
Options selects the inputs of one collection.