controller

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MPL-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CPUResourceName              = "cpu"
	MemoryResourceName           = "memory"
	StorageResourceName          = "storage"
	EphemeralStorageResourceName = "ephemeral-storage"
)
View Source
const (
	MetadataContextSize      = "ai.contrib.fluxcd.io/context-size"
	MetadataFamily           = "ai.contrib.fluxcd.io/family"
	MetadataFormat           = "ai.contrib.fluxcd.io/format"
	MetadataMemoryRequired   = "ai.contrib.fluxcd.io/memory-required"
	MetadataModelDescription = "ai.contrib.fluxcd.io/model-description"
	MetadataModelLevel       = "ai.contrib.fluxcd.io/model-level"
	MetadataPromptTemplate   = "ai.contrib.fluxcd.io/prompt-template"
	MetadataQuantization     = "ai.contrib.fluxcd.io/quantization"
	MetadataSizeOnDisk       = "ai.contrib.fluxcd.io/size-on-disk"
	MetadataStopWords        = "ai.contrib.fluxcd.io/stop-words"
)
View Source
const (
	SizeOnDiskSafetyFactor = 1.20
	MemorySafetyFactor     = 1.00
)
View Source
const (
	EnvVarContextSize      = "LM_CTRL_CONTEXT_SIZE"
	EnvVarFamily           = "LM_CTRL_FAMILY"
	EnvVarFormat           = "LM_CTRL_FORMAT"
	EnvVarModelDescription = "LM_CTRL_MODEL_DESCRIPTION"
	EnvVarModelLevel       = "LM_CTRL_MODEL_LEVEL"
	EnvVarModelName        = "LM_CTRL_MODEL_NAME"
	EnvVarPromptTemplate   = "LM_CTRL_PROMPT_TEMPLATE"
	EnvVarQuantization     = "LM_CTRL_QUANTIZATION"
	EnvVarStopWords        = "LM_CTRL_STOP_WORDS"
)
View Source
const LanguageModelConfigMapSuffix = "-lmcm"

Variables

This section is empty.

Functions

func GenerateConfigMap

func GenerateConfigMap(lm *aiv1a1.LanguageModel) (*corev1.ConfigMap, error)

func HasChanged

func HasChanged(action ssa.Action) bool

HasChanged evaluates the given action and returns true if the action type matches a resource mutation or deletion.

Types

type LanguageModelReconciler

type LanguageModelReconciler struct {
	client.Client
	Scheme *runtime.Scheme

	kuberecorder.EventRecorder
	runtimeCtrl.Metrics

	ControllerName string

	StatusPoller          *polling.StatusPoller
	PollingOpts           polling.Options
	DefaultServiceAccount string
	KubeConfigOpts        runtimeClient.KubeConfigOptions
	ConcurrentSSA         int
	NoCrossNamespaceRefs  bool

	FailFast bool
	// contains filtered or unexported fields
}

LanguageModelReconciler reconciles a LanguageModel object

func (*LanguageModelReconciler) Reconcile

func (r *LanguageModelReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, retErr error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the LanguageModel object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/pkg/reconcile

func (*LanguageModelReconciler) SetupWithManager

SetupWithManager sets up the controller with the Manager.

type LanguageModelReconcilerOptions

type LanguageModelReconcilerOptions struct {
	HTTPRetry   int
	RateLimiter ratelimiter.RateLimiter
}

LanguageModelReconcilerOptions contains options for the LanguageModelReconciler.

type SourceRevisionChangePredicate

type SourceRevisionChangePredicate struct {
	predicate.Funcs
}

func (SourceRevisionChangePredicate) Update

Jump to

Keyboard shortcuts

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