pcm-coordinator/internal/scheduler/service/inference/inference.go

53 lines
1.2 KiB
Go

package inference
import (
"context"
"gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/schedulers/option"
"mime/multipart"
)
const (
FORWARD_SLASH = "/"
)
type ICluster interface {
GetClusterInferUrl(ctx context.Context, option *option.InferOption) (*ClusterInferUrl, error)
GetInferResult(ctx context.Context, url string, file multipart.File, fileName string) (string, error)
GetInferDeployInstanceList(ctx context.Context) ([]*DeployInstance, error)
StartInferDeployInstance(ctx context.Context, id string) bool
StopInferDeployInstance(ctx context.Context, id string) bool
GetInferDeployInstance(ctx context.Context, id string) (*DeployInstance, error)
}
type IInference interface {
CreateTask() (int64, error)
InferTask(id int64) error
}
type Inference struct {
In IInference
}
type ClusterInferUrl struct {
ClusterName string
ClusterType string
InferUrls []*InferUrl
}
type InferUrl struct {
Url string
Card string
}
type DeployInstance struct {
InstanceName string
InstanceId string
ModelName string
ModelType string
InferCard string
ClusterName string
ClusterType string
Status string
CreatedTime string
}