Documentation
¶
Index ¶
- Constants
- type AnomalyRecommendResult
- type Backend
- type BackendConfig
- type CollectorConfig
- type ConfigMap
- type DeployRequest
- type DetectTask
- type DetectTaskSpecResponse
- type Env
- type InfoSource
- type KafkaConfig
- type ModelConfig
- type Path
- type Port
- type Raw
- type Resources
- type RuntimeInfo
- type ScalingStrategy
- type Service
- type ServiceDetail
- type SglangBackendConfig
- type Strategy
- type TaskDetectHistoryRequest
- type TaskDetectHistoryResponse
- type TaskInfo
- type TaskSpec
- func (t *TaskSpec) GetBackendConfig() BackendConfig
- func (t *TaskSpec) GetExporterServiceName() string
- func (t *TaskSpec) GetModelConfig() ModelConfig
- func (t *TaskSpec) GetName() string
- func (t *TaskSpec) GetPreferGpuNum() int
- func (t *TaskSpec) GetReplica() int
- func (t *TaskSpec) GetScalingStrategy() ScalingStrategy
- func (t *TaskSpec) UnmarshalJSON(data []byte) error
- func (t *TaskSpec) UpdateBackendConfig(result api.ConfigRecommendResult)
- func (t *TaskSpec) UpdateReplica(replica int)
- type TaskSpecInterface
- type TaskStatus
- type VllmBackendConfig
- type Volume
- type VolumeMount
Constants ¶
View Source
const ( StrategyManual = "manual" StrategyAuto = "auto" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnomalyRecommendResult ¶
type AnomalyRecommendResult struct {
Timestamp int64 `json:"timestamp"`
IsAnomaly bool `json:"isAnomaly"`
ConfigRecommendResult api.ConfigRecommendResult `json:"configRecommendResult"`
CurrentConfig api.ConfigRecommendResult `json:"currentConfig"`
}
type Backend ¶
type Backend struct {
Service ServiceDetail `json:"service"`
}
type BackendConfig ¶
type BackendConfig interface {
Update(recommendResult api.ConfigRecommendResult)
}
type CollectorConfig ¶
type CollectorConfig struct {
Enable bool
ClusterId string
Kafka KafkaConfig
CustomMetricsAdd map[string]string
}
type DeployRequest ¶
type DeployRequest struct {
Name string
Model string
Host string
Port int
Backend string
Image string
ExporterEndpoint string `json:"exporter_endpoint"`
ExporterServiceName string `json:"exporter_service_name"`
ModelConfig ModelConfig
BackendConfig map[string]interface{}
BackendExtraConfig map[string]string `json:"backend_extra_config"`
Replica int `json:"replica"`
Envs []Env `json:"envs"`
Volumes []Volume `json:"volumes"`
Namespace string `json:"namespace"`
NodeSelector map[string]string `json:"node_selector"`
Service Service `json:"service"`
Resources Resources `json:"resources"`
ScalingStrategy ScalingStrategy `json:"scaling_strategy"`
Collector CollectorConfig `json:"collector"`
}
type DetectTask ¶
type DetectTask struct {
TaskSpec TaskSpecInterface
Status TaskStatus
}
type DetectTaskSpecResponse ¶
type DetectTaskSpecResponse struct {
TaskSpec TaskSpec `json:"task_spec"`
Status string `json:"status"`
ContainerInfos RuntimeInfo `json:"container_infos"`
}
type InfoSource ¶
type InfoSource string
const ( DockerSource InfoSource = "Docker" K8sSource InfoSource = "K8s" )
type KafkaConfig ¶
type ModelConfig ¶
type RuntimeInfo ¶
type RuntimeInfo struct {
Source InfoSource `json:"source"`
Deployment *v1.Deployment `json:"deployment,omitempty"`
PodList *v2.PodList `json:"podList,omitempty"`
Containers *[]types.ContainerJSON `json:"containers,omitempty"`
}
type ScalingStrategy ¶
type ScalingStrategy struct {
// +optional
Strategy string `json:"strategy,omitempty"`
}
type ServiceDetail ¶
type SglangBackendConfig ¶
type SglangBackendConfig struct {
TensorParallelSize int `json:"tensor_parallel_size"`
MemFractionStatic float32 `json:"mem_fraction_static"`
TrustRemoteCode bool `json:"trust_remote_code"`
}
func (*SglangBackendConfig) Update ¶
func (v *SglangBackendConfig) Update(recommendResult api.ConfigRecommendResult)
type TaskDetectHistoryRequest ¶
type TaskDetectHistoryRequest struct {
TaskName string `json:"task_name"`
}
type TaskDetectHistoryResponse ¶
type TaskDetectHistoryResponse struct {
Data []AnomalyRecommendResult `json:"data"`
}
type TaskSpec ¶
type TaskSpec struct {
Name string `json:"name"`
Annotations map[string]string `json:"annotations"`
Model string `json:"model"`
Host string `json:"host"`
Port int `json:"port"`
Image string `json:"image"`
ImagePullSecrets []string `json:"image_pull_secrets"`
Backend string `json:"backend"`
ExporterEndpoint string `json:"exporter_endpoint"`
ExporterServiceName string `json:"exporter_service_name"`
ModelConfig ModelConfig `json:"model_config"`
BackendConfig BackendConfig `json:"backend_config"`
BackendExtraConfig map[string]string `json:"backend_extra_config"`
Command []string `json:"command"`
Args []string `json:"args"`
Replica int `json:"replica"`
Envs []Env `json:"envs"`
Gpus string `json:"gpus"`
Volumes []Volume `json:"volumes"`
VolumeMounts []VolumeMount `json:"volume_mounts"`
Namespace string `json:"namespace"`
NodeSelector map[string]string `json:"node_selector"`
Service Service `json:"service"`
Resources Resources `json:"resources"`
ScalingStrategy ScalingStrategy `json:"scaling_strategy"`
Collector CollectorConfig `json:"collector"`
ConfigMaps []ConfigMap `json:"config_maps"`
}
func (*TaskSpec) GetBackendConfig ¶
func (t *TaskSpec) GetBackendConfig() BackendConfig
func (*TaskSpec) GetExporterServiceName ¶
func (*TaskSpec) GetModelConfig ¶
func (t *TaskSpec) GetModelConfig() ModelConfig
func (*TaskSpec) GetPreferGpuNum ¶
func (*TaskSpec) GetReplica ¶
func (*TaskSpec) GetScalingStrategy ¶
func (t *TaskSpec) GetScalingStrategy() ScalingStrategy
func (*TaskSpec) UnmarshalJSON ¶
func (*TaskSpec) UpdateBackendConfig ¶
func (t *TaskSpec) UpdateBackendConfig(result api.ConfigRecommendResult)
func (*TaskSpec) UpdateReplica ¶
type TaskSpecInterface ¶
type TaskSpecInterface interface {
UpdateBackendConfig(result api.ConfigRecommendResult)
GetModelConfig() ModelConfig
GetBackendConfig() BackendConfig
GetReplica() int
UpdateReplica(replica int)
GetName() string
GetExporterServiceName() string
GetPreferGpuNum() int
GetScalingStrategy() ScalingStrategy
}
type TaskStatus ¶
type TaskStatus string
const ( TaskStatusCreated TaskStatus = "created" TaskStatusScheduling TaskStatus = "scheduling" TaskStatusRunning TaskStatus = "running" TaskStatusError TaskStatus = "error" TaskStatusFinished TaskStatus = "finished" )
type VllmBackendConfig ¶
type VllmBackendConfig struct {
MaxNumSeqs int `json:"max_num_seqs"`
TensorParallelSize int `json:"tensor_parallel_size"`
GpuMemoryUtilization float32 `json:"gpu_memory_utilization"`
VllmMode string `json:"vllm_mode"`
TrustRemoteCode bool `json:"trust_remote_code"`
}
func (*VllmBackendConfig) Update ¶
func (v *VllmBackendConfig) Update(recommendResult api.ConfigRecommendResult)
type VolumeMount ¶
Click to show internal directories.
Click to hide internal directories.