v1alpha3

package
v0.0.0-...-7219249 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package v1alpha3 contains API Schema definitions for the gmc v1alpha3 API group +kubebuilder:object:generate=true +groupName=gmc.opea.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "gmc.opea.io", Version: "v1alpha3"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type ConditionType

type ConditionType string
const (
	// Success indicates the required services in the GMConnector was ready
	ConnectorSuccess ConditionType = "Success"
	// Failed indicates the GMConnector failed to get required service ready
	ConnectorFailed ConditionType = "Failed"
)

Well-known condition types for GMConnector status.

type Executor

type Executor struct {
	// The node name for routing as the next step.
	// +optional
	NodeName string `json:"nodeName,omitempty"`
	// InternalService URL, mutually exclusive with ExternalService.
	// +optional
	InternalService GMCTarget `json:"internalService,omitempty"`
	// ExternalService URL, mutually exclusive with InternalService.
	// +optional
	ExternalService string `json:"externalService,omitempty"`
}

func (*Executor) DeepCopy

func (in *Executor) DeepCopy() *Executor

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Executor.

func (*Executor) DeepCopyInto

func (in *Executor) DeepCopyInto(out *Executor)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GMCTarget

type GMCTarget struct {
	ServiceName string `json:"serviceName,omitempty"`

	// +optional
	NameSpace string `json:"nameSpace,omitempty"`

	// +optional
	Config map[string]string `json:"config,omitempty"`

	// in the OPEA context, some service can automatically trigger another one
	// if this field is not empty, means the downstream service will be invoked
	// +optional
	IsDownstreamService bool `json:"isDownstreamService,omitempty"`
}

GMCTarget represents the structure to hold either a PredefinedType or a ServiceReference.

func (*GMCTarget) DeepCopy

func (in *GMCTarget) DeepCopy() *GMCTarget

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GMCTarget.

func (*GMCTarget) DeepCopyInto

func (in *GMCTarget) DeepCopyInto(out *GMCTarget)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GMConnector

type GMConnector struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   GMConnectorSpec   `json:"spec,omitempty"`
	Status GMConnectorStatus `json:"status,omitempty"`
}

+k8s:openapi-gen=true +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="URL",type="string",JSONPath=".status.accessUrl" +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.status" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:resource:path=gmconnectors,shortName=gmc,singular=gmconnectors GMConnector is the Schema for the gmconnectors API

func (*GMConnector) DeepCopy

func (in *GMConnector) DeepCopy() *GMConnector

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GMConnector.

func (*GMConnector) DeepCopyInto

func (in *GMConnector) DeepCopyInto(out *GMConnector)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GMConnector) DeepCopyObject

func (in *GMConnector) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*GMConnector) SetupWebhookWithManager

func (r *GMConnector) SetupWebhookWithManager(mgr ctrl.Manager) error

SetupWebhookWithManager will setup the manager to manage the webhooks

func (*GMConnector) ValidateCreate

func (r *GMConnector) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*GMConnector) ValidateDelete

func (r *GMConnector) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*GMConnector) ValidateUpdate

func (r *GMConnector) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type GMConnectorCondition

type GMConnectorCondition struct {
	// type of the condition. Known conditions are "Success", and "Failed".
	//
	// A "Success" indicating the required services in the GMConnector was ready.
	//
	// A "Failed" indicating the GMConnector failed to get required service ready.
	Type ConditionType `json:"type,omitempty"`
	// message contains a human readable message with details about the GMConnector state
	// +optional
	Message string `json:"message,omitempty"`
	// The reason for the condition's last transition.
	// +optional
	Reason string `json:"reason,omitempty" description:"one-word CamelCase reason for the condition's last transition"`
	// lastUpdateTime is the time of the last update to this condition
	// +optional
	LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
}

GMConnectorCondition describes a condition of a GMConnector object

func (*GMConnectorCondition) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GMConnectorCondition.

func (*GMConnectorCondition) DeepCopyInto

func (in *GMConnectorCondition) DeepCopyInto(out *GMConnectorCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GMConnectorList

type GMConnectorList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []GMConnector `json:"items"`
}

+kubebuilder:object:root=true GMConnectorList contains a list of GMConnector

func (*GMConnectorList) DeepCopy

func (in *GMConnectorList) DeepCopy() *GMConnectorList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GMConnectorList.

func (*GMConnectorList) DeepCopyInto

func (in *GMConnectorList) DeepCopyInto(out *GMConnectorList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GMConnectorList) DeepCopyObject

func (in *GMConnectorList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type GMConnectorSpec

type GMConnectorSpec struct {
	Nodes        map[string]Router `json:"nodes"`
	RouterConfig RouterConfig      `json:"routerConfig"`
}

GMConnectorSpec defines the desired state of GMConnector

func (*GMConnectorSpec) DeepCopy

func (in *GMConnectorSpec) DeepCopy() *GMConnectorSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GMConnectorSpec.

func (*GMConnectorSpec) DeepCopyInto

func (in *GMConnectorSpec) DeepCopyInto(out *GMConnectorSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GMConnectorStatus

type GMConnectorStatus struct {
	// conditions applied to the GMConnector. Known conditions are "Success", and "Failed".
	// +optional
	Condition GMConnectorCondition `json:"condition,omitempty"`

	// Conditions for GMConnector
	Status string `json:"status,omitempty"`

	// AccessURL of the entrypoint for the GMConnector
	// +optional
	AccessURL string `json:"accessUrl,omitempty"`

	// Annotations is additional Status fields for the Resource to save some
	// additional State as well as convey more information to the user. This is
	// roughly akin to Annotations on any k8s resource, just the reconciler conveying
	// richer information outwards.
	Annotations map[string]string `json:"annotations,omitempty"`
}

GMConnectorStatus defines the observed state of GMConnector. +k8s:openapi-gen=true

func (*GMConnectorStatus) DeepCopy

func (in *GMConnectorStatus) DeepCopy() *GMConnectorStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GMConnectorStatus.

func (*GMConnectorStatus) DeepCopyInto

func (in *GMConnectorStatus) DeepCopyInto(out *GMConnectorStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Router

type Router struct {
	// RouterType
	//
	// - `Sequence:` chain multiple steps with input/output from previous step
	//
	// - `Ensemble:` routes the request to multiple destinations and then merge the responses
	//
	// - `Switch:` routes the request to one of the steps based on condition
	//
	RouterType RouterType `json:"routerType"`

	// Steps defines destinations for the current router node
	// +optional
	Steps []Step `json:"steps,omitempty"`
}

func (*Router) DeepCopy

func (in *Router) DeepCopy() *Router

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Router.

func (*Router) DeepCopyInto

func (in *Router) DeepCopyInto(out *Router)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RouterConfig

type RouterConfig struct {
	Name        string `json:"name"`
	ServiceName string `json:"serviceName"`
	// +optional
	NameSpace string `json:"nameSpace"`
	// +optional
	Config map[string]string `json:"config"`
}

func (*RouterConfig) DeepCopy

func (in *RouterConfig) DeepCopy() *RouterConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouterConfig.

func (*RouterConfig) DeepCopyInto

func (in *RouterConfig) DeepCopyInto(out *RouterConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RouterType

type RouterType string

RouterType constant for routing types +k8s:openapi-gen=true +kubebuilder:validation:Enum=Sequence;Ensemble;Switch

const (
	// Sequence Default type only route to subsequent destination
	Sequence RouterType = "Sequence"

	// Ensemble router routes the requests to multiple destinations and then merge the responses
	Ensemble RouterType = "Ensemble"

	// Switch routes the request to the destination based on certain condition
	Switch RouterType = "Switch"
)

GMCRouterType Enum

type Step

type Step struct {
	// Unique name for the step within this node
	StepName string `json:"name,omitempty"`

	// Node or service used to process this step
	Executor `json:",inline"`

	// request data sent to the next route with input/output from the previous step
	// $request
	// $response.predictions
	// +optional
	Data string `json:"data,omitempty"`

	// routing based on the condition
	// +optional
	Condition string `json:"condition,omitempty"`

	// to decide whether a step is a hard or a soft dependency in the Graph
	// +optional
	Dependency StepDependencyType `json:"dependency,omitempty"`

	// this is not for the users to set
	// when the service is ready, save the URL here for router to call
	// +optional
	ServiceURL string `json:"serviceUrl,omitempty"`
}

Step defines the target of the current step with condition, weights and data. +k8s:openapi-gen=true

func (*Step) DeepCopy

func (in *Step) DeepCopy() *Step

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Step.

func (*Step) DeepCopyInto

func (in *Step) DeepCopyInto(out *Step)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StepDependencyType

type StepDependencyType string

StepDependencyType constant for step dependency +k8s:openapi-gen=true +kubebuilder:validation:Enum=Soft;Hard

const (
	// Soft
	Soft StepDependencyType = "Soft"

	// Hard
	Hard StepDependencyType = "Hard"
)

StepDependency Enum

type StepNameType

type StepNameType string

StepNameType constant for step +k8s:openapi-gen=true +kubebuilder:validation:Enum=Soft;Hard

const (
	// Emebdding
	Embedding StepNameType = "Embedding"
	// Tei-Embedding
	TeiEmbedding StepNameType = "TeiEmbedding"
	// VectorDB
	VectorDB StepNameType = "VectorDB"
	// Retriever
	Retriever StepNameType = "Retriever"
	// Reranking
	Reranking StepNameType = "Reranking"
	// Tei-Reranking
	TeiReranking StepNameType = "TeiReranking"
	// Tgi
	Tgi StepNameType = "Tgi"
	// Llm
	Llm StepNameType = "Llm"
)

StepDependency Enum

Jump to

Keyboard shortcuts

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