Documentation
¶
Index ¶
- Constants
- func Add(mgr manager.Manager, runtimeConfig config.RuntimeConfig) error
- func DetectRuntimeSidecar(pod *corev1.Pod) bool
- func NewCondition(condType string, status metav1.ConditionStatus, reason, msg string) metav1.Condition
- func RemoveInstanceFromList(slice []string, strToRemove string) []string
- func StringInSlice(slice []string, str string) bool
- func TestCalculateExponentialBackoff(t *testing.T)
- func TestGetPodNames(t *testing.T)
- func TestIsPodHealthy(t *testing.T)
- func TestIsPodReadyForScheduling(t *testing.T)
- func TestIsRetriableError(t *testing.T)
- func TestRetryInfoManagement(t *testing.T)
- func TestScheduledPodsManagement(t *testing.T)
- type ModelAdapterReconciler
- type URLConfig
Constants ¶
View Source
const ( ModelIdentifierKey = constants.ModelLabelName ModelAdapterKey = "adapter.model.aibrix.ai/name" ModelAdapterFinalizer = "adapter.model.aibrix.ai/finalizer" ModelAdapterPodTemplateLabelKey = "adapter.model.aibrix.ai/enabled" ModelAdapterPodTemplateLabelValue = "true" // Retry configuration constants MaxLoadingRetries = 5 RetryBackoffSeconds = 5 PodReadinessTimeoutSecs = 60 HTTPTimeoutSeconds = 30 // Annotation keys for tracking retry state RetryCountAnnotationKey = "adapter.model.aibrix.ai/retry-count" LastRetryTimeAnnotationKey = "adapter.model.aibrix.ai/last-retry-time" PodReadinessCheckAnnotationKey = "adapter.model.aibrix.ai/pod-readiness-check-time" ScheduledPodsAnnotationKey = "adapter.model.aibrix.ai/scheduled-pods" // ModelAdapterInitializedReason is added in model adapter when it comes into the reconciliation loop. ModelAdapterInitializedReason = "ModelAdapterPending" // FailedServiceCreateReason is added in a model adapter when it cannot create a new service. FailedServiceCreateReason = "ServiceCreateError" // FailedEndpointSliceCreateReason is added in a model adapter when it cannot create a new replica set. FailedEndpointSliceCreateReason = "EndpointSliceCreateError" // ModelAdapterLoadingErrorReason is added in a model adapter when it cannot be loaded in an engine pod. ModelAdapterLoadingErrorReason = "ModelAdapterLoadingError" // ValidationFailedReason is added when model adapter object fails the validation ValidationFailedReason = "ValidationFailed" // StableInstanceFoundReason is added if there's stale pod and instance has been deleted successfully. StableInstanceFoundReason = "StableInstanceFound" // ConditionNotReason is added when there's no condition found in the cluster. ConditionNotReason = "ConditionNotFound" // PodNotReadyReason is added when a pod is not ready for adapter loading PodNotReadyReason = "PodNotReady" // MaxRetriesExceededReason is added when max retries are exceeded for a pod MaxRetriesExceededReason = "MaxRetriesExceeded" // ModelAdapterAvailable is added in a ModelAdapter when it has replicas available. ModelAdapterAvailable = "ModelAdapterAvailable" ModelAdapterUnavailable = "ModelAdapterUnavailable" // Inference Service path and ports DefaultInferenceEnginePort = "8000" DefaultDebugInferenceEnginePort = "30081" DefaultRuntimeAPIPort = "8080" ModelListPath = "/v1/models" ModelListRuntimeAPIPath = "/v1/models" LoadLoraAdapterPath = "/v1/load_lora_adapter" LoadLoraRuntimeAPIPath = "/v1/lora_adapter/load" UnloadLoraAdapterPath = "/v1/unload_lora_adapter" UnloadLoraRuntimeAPIPath = "/v1/lora_adapter/unload" // DefaultModelAdapterSchedulerPolicy is the default scheduler policy for ModelAdapter Controller. DefaultModelAdapterSchedulerPolicy = "leastAdapters" )
Variables ¶
This section is empty.
Functions ¶
func Add ¶
func Add(mgr manager.Manager, runtimeConfig config.RuntimeConfig) error
Add creates a new ModelAdapter Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller and Start it when the Manager is Started.
func DetectRuntimeSidecar ¶
DetectRuntimeSidecar checks if a pod has the aibrix-runtime sidecar container
func NewCondition ¶
func NewCondition(condType string, status metav1.ConditionStatus, reason, msg string) metav1.Condition
NewCondition creates a new condition.
func RemoveInstanceFromList ¶
RemoveInstanceFromList removes a string from a slice of strings
func StringInSlice ¶
func TestGetPodNames ¶
func TestIsPodHealthy ¶
func TestIsRetriableError ¶
func TestRetryInfoManagement ¶
Types ¶
type ModelAdapterReconciler ¶
type ModelAdapterReconciler struct {
client.Client
Scheme *runtime.Scheme
Recorder record.EventRecorder
// PodLister is able to list/get pods from a shared informer's cache store
PodLister corelisters.PodLister
// ServiceLister is able to list/get services from a shared informer's cache store
ServiceLister corelisters.ServiceLister
// EndpointSliceLister is able to list/get services from a shared informer's cache store
EndpointSliceLister discoverylisters.EndpointSliceLister
RuntimeConfig config.RuntimeConfig
// contains filtered or unexported fields
}
ModelAdapterReconciler reconciles a ModelAdapter object
func (*ModelAdapterReconciler) DoReconcile ¶
func (r *ModelAdapterReconciler) DoReconcile(ctx context.Context, req ctrl.Request, instance *modelv1alpha1.ModelAdapter) (ctrl.Result, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.