machineinfo

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package machineinfo provides a shim layer over gpud's machine-info package to customize version information for Fleet Intelligence.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProvider

func GetProvider(publicIP string) *providers.Info

GetProvider is a passthrough to gpud's GetProvider function

func PopulatePrivateIPFromMachineInfo

func PopulatePrivateIPFromMachineInfo(providerInfo *providers.Info, machineInfo *MachineInfo)

PopulatePrivateIPFromMachineInfo populates the provider's private IP from machine info if it's not already set. It uses the first private IPv4 address found.

Types

type MachineInfo

type MachineInfo struct {
	// FleetintVersion represents the current version of Fleet Intelligence agent
	FleetintVersion string `json:"fleetintVersion,omitempty"`
	// GPUDriverVersion represents the current version of GPU driver installed
	GPUDriverVersion string `json:"gpuDriverVersion,omitempty"`
	// CUDAVersion represents the current version of cuda library.
	CUDAVersion string `json:"cudaVersion,omitempty"`
	// ContainerRuntime Version reported by the node through runtime remote API (e.g. containerd://1.4.2).
	ContainerRuntimeVersion string `json:"containerRuntimeVersion,omitempty"`
	// Kernel Version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64).
	KernelVersion string `json:"kernelVersion,omitempty"`
	// OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)).
	OSImage string `json:"osImage,omitempty"`
	// The Operating System reported by the node
	OperatingSystem string `json:"operatingSystem,omitempty"`
	// SystemUUID comes from https://github.com/google/cadvisor/blob/master/utils/sysfs/sysfs.go#L442
	SystemUUID string `json:"systemUUID,omitempty"`
	// MachineID is collected by GPUd. It comes from /etc/machine-id or /var/lib/dbus/machine-id
	MachineID string `json:"machineID,omitempty"`
	// BootID is collected by GPUd.
	BootID string `json:"bootID,omitempty"`
	// Hostname is the current host of machine
	Hostname string `json:"hostname,omitempty"`
	// Uptime represents when the machine up
	Uptime metav1.Time `json:"uptime,omitempty"`

	// CPUInfo is the CPU info of the machine.
	CPUInfo *apiv1.MachineCPUInfo `json:"cpuInfo,omitempty"`
	// MemoryInfo is the memory info of the machine.
	MemoryInfo *apiv1.MachineMemoryInfo `json:"memoryInfo,omitempty"`
	// GPUInfo is the GPU info of the machine.
	GPUInfo *apiv1.MachineGPUInfo `json:"gpuInfo,omitempty"`
	// DiskInfo is the Disk info of the machine.
	DiskInfo *apiv1.MachineDiskInfo `json:"diskInfo,omitempty"`
	// NICInfo is the network info of the machine.
	NICInfo *apiv1.MachineNICInfo `json:"nicInfo,omitempty"`
}

MachineInfo is a custom struct that replaces GPUdVersion with FleetintVersion

func GetMachineInfo

func GetMachineInfo(nvmlInstance nvidianvml.Instance, opts ...MachineInfoOption) (*MachineInfo, error)

GetMachineInfo retrieves machine info and customizes it for Fleet Intelligence. Pass WithDCGMGPUIndexes to override NVML GPU indices with DCGM device IDs.

func (*MachineInfo) RenderTable

func (i *MachineInfo) RenderTable(wr io.Writer)

RenderTable renders the machine info table with Fleet Intelligence branding

type MachineInfoOption added in v1.1.0

type MachineInfoOption func(*machineInfoOpts)

MachineInfoOption configures GetMachineInfo behavior.

func WithDCGMGPUIndexes added in v1.1.0

func WithDCGMGPUIndexes(m map[string]string) MachineInfoOption

WithDCGMGPUIndexes supplies a UUID→DCGM-device-ID mapping so that MachineInfo.GPUIndex matches the "gpu" label emitted by DCGM metrics.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL