state

package
v0.2.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractPrimaryModelSource

func ExtractPrimaryModelSource(sources []aimv1alpha1.AIMModelSource) *aimv1alpha1.AIMModelSource

ExtractPrimaryModelSource returns the first non-empty model source from the template status.

Types

type ServiceRoutingState

type ServiceRoutingState struct {
	Enabled     bool
	PathPrefix  string
	GatewayRef  *gatewayapiv1.ParentReference
	Annotations map[string]string
}

ServiceRoutingState carries routing configuration resolved for the service.

type ServiceState

type ServiceState struct {
	Name               string
	Namespace          string
	Metadata           metav1.ObjectMeta
	RuntimeName        string
	ModelID            string
	Env                []corev1.EnvVar
	Resources          *corev1.ResourceRequirements
	Replicas           *int32
	ImagePullSecrets   []corev1.LocalObjectReference
	ServiceAccountName string
	Template           TemplateState
	ModelSource        *aimv1alpha1.AIMModelSource
	Routing            ServiceRoutingState
}

ServiceState captures the resolved desired state for an AIMService across vendors.

func NewServiceState

func NewServiceState(service *aimv1alpha1.AIMService, template TemplateState, opts ServiceStateOptions) ServiceState

NewServiceState projects the AIMService and template data into a vendor-neutral structure.

type ServiceStateOptions

type ServiceStateOptions struct {
	RuntimeName string
	RoutePath   string
}

ServiceStateOptions exposes optional overrides when constructing the service view.

type TemplateState

type TemplateState struct {
	Name              string
	Namespace         string
	SpecCommon        aimv1alpha1.AIMServiceTemplateSpecCommon
	Image             string
	ImageResources    *corev1.ResourceRequirements
	ImagePullSecrets  []corev1.LocalObjectReference
	RuntimeConfigSpec aimv1alpha1.AIMRuntimeConfigSpec
	Status            *aimv1alpha1.AIMServiceTemplateStatus
	ModelSource       *aimv1alpha1.AIMModelSource
}

TemplateState captures the resolved data required to materialize runtimes and services from a template.

func NewTemplateState

func NewTemplateState(base TemplateState) TemplateState

NewTemplateState constructs a TemplateState from the provided base values. Callers populate the struct with template-derived data before invoking this helper.

func (TemplateState) ServiceAccountName

func (s TemplateState) ServiceAccountName() string

ServiceAccountName returns the resolved service account for resources derived from this template.

func (TemplateState) StatusMetric

func (s TemplateState) StatusMetric() *aimv1alpha1.AIMMetric

StatusMetric returns the metric discovered during template resolution, if available.

func (TemplateState) StatusPrecision

func (s TemplateState) StatusPrecision() *aimv1alpha1.AIMPrecision

StatusPrecision returns the precision discovered during template resolution, if available.

Jump to

Keyboard shortcuts

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