config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package config provides the gpud configuration data for the server.

Index

Constants

View Source
const (
	DefaultAPIVersion = "v1"
	DefaultGPUdPort   = 15132
)

Variables

View Source
var (
	DefaultRefreshPeriod = metav1.Duration{Duration: time.Minute}

	// keep the metrics only for the last 3 hours
	DefaultRetentionPeriod = metav1.Duration{Duration: 3 * time.Hour}

	// compact/vacuum is disruptive to existing queries (including reads)
	// but necessary to keep the state database from growing indefinitely
	// TODO: disabled for now, until we have a better way to detect the performance issue
	DefaultCompactPeriod = metav1.Duration{Duration: 0}
)
View Source
var ErrInvalidAutoUpdateExitCode = errors.New("auto_update_exit_code is only valid when auto_update is enabled")

Functions

func DefaultFifoFile

func DefaultFifoFile() (string, error)

func DefaultStateFile

func DefaultStateFile() (string, error)

Types

type Config

type Config struct {
	APIVersion string `json:"api_version"`

	// Address for the server to listen on.
	Address string `json:"address"`

	// State file that persists the latest status.
	// If empty, the states are not persisted to file.
	State string `json:"state"`

	// Amount of time to retain states/metrics for.
	// Once elapsed, old states/metrics are purged/compacted.
	RetentionPeriod metav1.Duration `json:"retention_period"`

	// Interval at which to compact the state database.
	CompactPeriod metav1.Duration `json:"compact_period"`

	// Set true to enable profiler.
	Pprof bool `json:"pprof"`

	// Set false to disable auto update
	EnableAutoUpdate bool `json:"enable_auto_update"`

	// Exit code to exit with when auto updating.
	// Only valid when the auto update is enabled.
	// Set -1 to disable the auto update by exit code.
	AutoUpdateExitCode int `json:"auto_update_exit_code"`

	// A list of nvidia tool command paths to overwrite the default paths.
	NvidiaToolOverwrites nvidia_common.ToolOverwrites `json:"nvidia_tool_overwrites"`

	// PluginSpecsFile is the file that contains the plugin specs.
	PluginSpecsFile string `json:"plugin_specs_file"`

	// Components specifies the components to enable.
	// Leave empty, "*", or "all" to enable all components.
	// Or prefix component names with "-" to disable them.
	Components []string `json:"components"`
	// contains filtered or unexported fields
}

Config provides gpud configuration data for the server

func DefaultConfig

func DefaultConfig(ctx context.Context, opts ...OpOption) (*Config, error)

func (*Config) ShouldDisable added in v0.5.0

func (config *Config) ShouldDisable(componentName string) bool

ShouldDisable returns true if the component should be disabled. If the disable component sets are not specified, it will return false, meaning it should not be disabled, instead enabled by default.

func (*Config) ShouldEnable added in v0.5.0

func (config *Config) ShouldEnable(componentName string) bool

ShouldEnable returns true if the component should be enabled. If the enable component sets are not specified, it will return true, meaning it should be enabled by default.

func (*Config) Validate

func (config *Config) Validate() error

type Op

type Op struct {
	nvidia_common.ToolOverwrites
}

func (*Op) ApplyOpts

func (op *Op) ApplyOpts(opts []OpOption) error

type OpOption

type OpOption func(*Op)

func WithIbstatCommand

func WithIbstatCommand(p string) OpOption

Specifies the ibstat binary path to overwrite the default path.

func WithIbstatusCommand added in v0.5.0

func WithIbstatusCommand(p string) OpOption

Specifies the ibstat binary path to overwrite the default path.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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