Documentation
¶
Index ¶
- Variables
- func AddModelAcceleratorProfileToSystemData(sd *infernoConfig.SystemData, modelName string, ...) (err error)
- func AddServerInfoToSystemData(sd *infernoConfig.SystemData, ...) (err error)
- func CheckValue(x float64) bool
- func CreateOptimizedAlloc(name string, namespace string, ...) (*llmdVariantAutoscalingV1alpha1.OptimizedAlloc, error)
- func CreatePrometheusClientConfig(config *interfaces.PrometheusConfig) (*api.Config, error)
- func CreatePrometheusTransport(config *interfaces.PrometheusConfig) (http.RoundTripper, error)
- func CreateSystemData(acceleratorCm map[string]map[string]string, serviceClassCm map[string]string) *infernoConfig.SystemData
- func CreateTLSConfig(promConfig *interfaces.PrometheusConfig) (*tls.Config, error)
- func FindModelSLO(cmData map[string]string, targetModel string) (*interfaces.ServiceClassEntry, string, error)
- func FullName(name string, namespace string) string
- func GetConfigMapWithBackoff(ctx context.Context, c client.Client, name, namespace string, ...) error
- func GetConfigValue(data map[string]string, key, def string) string
- func GetDeploymentWithBackoff(ctx context.Context, c client.Client, name, namespace string, ...) error
- func GetResourceWithBackoff[T client.Object](ctx context.Context, c client.Client, objKey client.ObjectKey, obj T, ...) error
- func GetVariantAutoscalingWithBackoff(ctx context.Context, c client.Client, name, namespace string, ...) error
- func GetZapLevelFromEnv() zapcore.Level
- func MarshalStructToJsonString(t any) string
- func ParsePrometheusConfigFromEnv() *interfaces.PrometheusConfig
- func Ptr[T any](v T) *T
- func UpdateStatusWithBackoff[T client.Object](ctx context.Context, c client.Client, obj T, backoff wait.Backoff, ...) error
- func ValidatePrometheusAPI(ctx context.Context, promAPI promv1.API) error
- func ValidatePrometheusAPIWithBackoff(ctx context.Context, promAPI promv1.API, backoff wait.Backoff) error
- func ValidateTLSConfig(promConfig *interfaces.PrometheusConfig) error
Constants ¶
This section is empty.
Variables ¶
var ( // Standard backoff for most operations StandardBackoff = wait.Backoff{ Duration: 100 * time.Millisecond, Factor: 2.0, Jitter: 0.1, Steps: 5, } // Slow backoff for operations that need more time ReconcileBackoff = wait.Backoff{ Duration: 500 * time.Millisecond, Factor: 2.0, Steps: 5, } // Prometheus validation backoff with longer intervals // TODO: investigate why Prometheus needs longer backoff durations PrometheusBackoff = wait.Backoff{ Duration: 5 * time.Second, Factor: 2.0, Jitter: 0.1, Steps: 6, } )
Global backoff configurations
Functions ¶
func AddModelAcceleratorProfileToSystemData ¶
func AddModelAcceleratorProfileToSystemData( sd *infernoConfig.SystemData, modelName string, modelAcceleratorProfile *llmdVariantAutoscalingV1alpha1.AcceleratorProfile) (err error)
add model accelerator pair profile data to inferno system data
func AddServerInfoToSystemData ¶
func AddServerInfoToSystemData( sd *infernoConfig.SystemData, va *llmdVariantAutoscalingV1alpha1.VariantAutoscaling, className string) (err error)
Add server specs to inferno system data
func CheckValue ¶
Helper to check if a value is valid (not NaN or infinite)
func CreateOptimizedAlloc ¶
func CreateOptimizedAlloc(name string, namespace string, allocationSolution *infernoConfig.AllocationSolution) (*llmdVariantAutoscalingV1alpha1.OptimizedAlloc, error)
Adapter from inferno alloc solution to optimized alloc
func CreatePrometheusClientConfig ¶
func CreatePrometheusClientConfig(config *interfaces.PrometheusConfig) (*api.Config, error)
CreatePrometheusClientConfig creates a complete Prometheus client configuration with HTTPS support. Supports both direct bearer tokens and token files for flexible authentication.
func CreatePrometheusTransport ¶
func CreatePrometheusTransport(config *interfaces.PrometheusConfig) (http.RoundTripper, error)
CreatePrometheusTransport creates a custom HTTPS transport for Prometheus client with TLS support. TLS is always enabled for HTTPS-only support with configurable certificate validation.
func CreateSystemData ¶
func CreateSystemData( acceleratorCm map[string]map[string]string, serviceClassCm map[string]string) *infernoConfig.SystemData
Adapter to create wva system data types from config maps. Note: WVA operates in unlimited mode, so capacity data is not used.
func CreateTLSConfig ¶
func CreateTLSConfig(promConfig *interfaces.PrometheusConfig) (*tls.Config, error)
CreateTLSConfig creates a TLS configuration from PrometheusConfig. TLS is always enabled for HTTPS-only support. The configuration supports: - Server certificate validation via CA certificate - Mutual TLS authentication via client certificates - Insecure certificate verification (development/testing only)
func FindModelSLO ¶
func FindModelSLO(cmData map[string]string, targetModel string) (*interfaces.ServiceClassEntry, string, error)
Helper to find SLOs for a model variant
func GetConfigMapWithBackoff ¶
func GetConfigValue ¶
GetConfigValue retrieves a value from a ConfigMap with a default fallback
func GetDeploymentWithBackoff ¶
func GetDeploymentWithBackoff(ctx context.Context, c client.Client, name, namespace string, deploy *appsv1.Deployment) error
Helper functions for common resource types with standard backoff
func GetResourceWithBackoff ¶
func GetResourceWithBackoff[T client.Object](ctx context.Context, c client.Client, objKey client.ObjectKey, obj T, backoff wait.Backoff, resourceType string) error
GetResourceWithBackoff performs a Get operation with exponential backoff retry logic
func GetVariantAutoscalingWithBackoff ¶
func GetVariantAutoscalingWithBackoff(ctx context.Context, c client.Client, name, namespace string, va *llmdVariantAutoscalingV1alpha1.VariantAutoscaling) error
func GetZapLevelFromEnv ¶
func ParsePrometheusConfigFromEnv ¶
func ParsePrometheusConfigFromEnv() *interfaces.PrometheusConfig
ParsePrometheusConfigFromEnv parses Prometheus configuration from environment variables. Supports both direct values and file paths for flexible deployment scenarios.
func UpdateStatusWithBackoff ¶
func UpdateStatusWithBackoff[T client.Object](ctx context.Context, c client.Client, obj T, backoff wait.Backoff, resourceType string) error
UpdateStatusWithBackoff performs a Status Update operation with exponential backoff retry logic
func ValidatePrometheusAPI ¶
ValidatePrometheusAPI validates Prometheus API connectivity using standard Prometheus backoff
func ValidatePrometheusAPIWithBackoff ¶
func ValidatePrometheusAPIWithBackoff(ctx context.Context, promAPI promv1.API, backoff wait.Backoff) error
ValidatePrometheusAPIWithBackoff validates Prometheus API connectivity with retry logic
func ValidateTLSConfig ¶
func ValidateTLSConfig(promConfig *interfaces.PrometheusConfig) error
ValidateTLSConfig validates TLS configuration. Ensures HTTPS is used and certificate files exist when verification is enabled. Note: This function assumes promConfig is not nil - nil checks should be performed at a higher level.
Types ¶
This section is empty.