Documentation
¶
Overview ¶
Package config provides the gpud configuration data for the server.
Index ¶
- Constants
- Variables
- func DefaultConfigFile() (string, error)
- func DefaultContainerdComponent(ctx context.Context) (any, bool)
- func DefaultDmesgComponent() (any, bool)
- func DefaultDockerContainerComponent(ctx context.Context) (any, bool)
- func DefaultFifoFile() (string, error)
- func DefaultK8sPodComponent(ctx context.Context) (any, bool)
- func DefaultStateFile() (string, error)
- type Config
- type Op
- type OpOption
- type Web
Constants ¶
View Source
const ( DefaultAPIVersion = "v1" DefaultGPUdPort = 15132 )
Variables ¶
Functions ¶
func DefaultConfigFile ¶
func DefaultContainerdComponent ¶ added in v0.0.4
func DefaultDmesgComponent ¶ added in v0.0.4
func DefaultDockerContainerComponent ¶ added in v0.0.4
func DefaultFifoFile ¶
func DefaultK8sPodComponent ¶ added in v0.0.4
func DefaultStateFile ¶
Types ¶
type Config ¶
type Config struct {
APIVersion string `json:"api_version"`
// Basic server annotations (e.g., machine id, host name, etc.).
Annotations map[string]string `json:"annotations,omitempty"`
// Address for the server to listen on.
Address string `json:"address"`
// Component specific configurations.
Components map[string]any `json:"components,omitempty"`
// 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 refresh selected components.
// Disables refresh if not set.
RefreshComponentsInterval metav1.Duration `json:"refresh_components_interval"`
// Set true to enable profiler.
Pprof bool `json:"pprof"`
// Configures the local web configuration.
Web *Web `json:"web,omitempty"`
// Set false to disable auto update
EnableAutoUpdate bool `json:"enable_auto_update"`
}
Config provides gpud configuration data for the server
func LoadConfigYAML ¶
func ParseConfigYAML ¶
type Web ¶
type Web struct {
// Enable the web interface.
Enable bool `json:"enable"`
// Enable the admin interface.
Admin bool `json:"admin"`
// RefreshPeriod is the time period to refresh metrics.
RefreshPeriod metav1.Duration `json:"refresh_period"`
// SincePeriod is the time period to start displaying metrics from.
SincePeriod metav1.Duration `json:"since_period"`
}
Configures the local web configuration.
Click to show internal directories.
Click to hide internal directories.