meta

package
v0.0.0-...-b3661d0 Latest Latest
Warning

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

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

Documentation

Index

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"`
	Ingress             Ingress           `json:"ingress"`
	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 Env

type Env struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type InfoSource

type InfoSource string
const (
	DockerSource InfoSource = "Docker"
	K8sSource    InfoSource = "K8s"
)

type Ingress

type Ingress struct {
	Name        string            `json:"name"`
	Paths       []Path            `json:"paths"`
	Raw         Raw               `json:"raw"`
	Annotations map[string]string `json:"annotations"`
}

type KafkaConfig

type KafkaConfig struct {
	Brokers  []string
	Username string
	Password string
}

type ModelConfig

type ModelConfig struct {
	Llm     api.Llm `json:"llm"`
	Gpu     api.Gpu `json:"gpu"`
	Version string  `json:"version"`
}

type Path

type Path struct {
	Path    string  `json:"path"`
	Backend Backend `json:"backend"`
}

type Port

type Port struct {
	Number int32 `json:"number"`
}

type Raw

type Raw struct{}

type Resources

type Resources struct {
	GPU     string `json:"gpu"`
	GPUType string `json:"gpu_type"`
}

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 Service

type Service struct {
	Name  string `json:"name"`
	Ports []Port `json:"ports"`
	Raw   Raw    `json:"raw"`
}

type ServiceDetail

type ServiceDetail struct {
	Name string `json:"name"`
	Port Port   `json:"port"`
}

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 Strategy

type Strategy string

type TaskDetectHistoryRequest

type TaskDetectHistoryRequest struct {
	TaskName string `json:"task_name"`
}

type TaskDetectHistoryResponse

type TaskDetectHistoryResponse struct {
	Data []AnomalyRecommendResult `json:"data"`
}

type TaskInfo

type TaskInfo struct {
	Name   string `json:"name"`
	Status string `json:"status"`
}

type TaskSpec

type TaskSpec struct {
	Name                string            `json:"name"`
	Model               string            `json:"model"`
	Host                string            `json:"host"`
	Port                int               `json:"port"`
	Image               string            `json:"image"`
	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"`
	Namespace           string            `json:"namespace"`
	NodeSelector        map[string]string `json:"node_selector"`
	Ingress             Ingress           `json:"ingress"`
	Service             Service           `json:"service"`
	Resources           Resources         `json:"resources"`
	ScalingStrategy     ScalingStrategy   `json:"scaling_strategy"`
	Collector           CollectorConfig   `json:"collector"`
}

func (*TaskSpec) GetBackendConfig

func (t *TaskSpec) GetBackendConfig() BackendConfig

func (*TaskSpec) GetExporterServiceName

func (t *TaskSpec) GetExporterServiceName() string

func (*TaskSpec) GetModelConfig

func (t *TaskSpec) GetModelConfig() ModelConfig

func (*TaskSpec) GetName

func (t *TaskSpec) GetName() string

func (*TaskSpec) GetPreferGpuNum

func (t *TaskSpec) GetPreferGpuNum() int

func (*TaskSpec) GetReplica

func (t *TaskSpec) GetReplica() int

func (*TaskSpec) GetScalingStrategy

func (t *TaskSpec) GetScalingStrategy() ScalingStrategy

func (*TaskSpec) UnmarshalJSON

func (t *TaskSpec) UnmarshalJSON(data []byte) error

func (*TaskSpec) UpdateBackendConfig

func (t *TaskSpec) UpdateBackendConfig(result api.ConfigRecommendResult)

func (*TaskSpec) UpdateReplica

func (t *TaskSpec) UpdateReplica(replica int)

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 Volume

type Volume struct {
	MountPath string `json:"mountPath"`
	HostPath  string `json:"hostPath"`
}

Jump to

Keyboard shortcuts

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