You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

inference.go 1.4 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package inference
  2. import (
  3. "context"
  4. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/schedulers/option"
  5. "mime/multipart"
  6. )
  7. const (
  8. FORWARD_SLASH = "/"
  9. )
  10. type ICluster interface {
  11. GetClusterInferUrl(ctx context.Context, option *option.InferOption) (*ClusterInferUrl, error)
  12. GetInferDeployInstanceList(ctx context.Context) ([]*DeployInstance, error)
  13. StartInferDeployInstance(ctx context.Context, id string) bool
  14. StopInferDeployInstance(ctx context.Context, id string) bool
  15. GetInferDeployInstance(ctx context.Context, id string) (*DeployInstance, error)
  16. CreateInferDeployInstance(ctx context.Context, option *option.InferOption) (string, error)
  17. CheckModelExistence(ctx context.Context, modelName string, modelType string) bool
  18. InferResult
  19. }
  20. type InferResult interface {
  21. GetImageInferResult(ctx context.Context, url string, file multipart.File, fileName string) (string, error)
  22. }
  23. type IInference interface {
  24. CreateTask() (int64, error)
  25. InferTask(id int64) error
  26. }
  27. type Inference struct {
  28. In IInference
  29. }
  30. type ClusterInferUrl struct {
  31. ClusterName string
  32. ClusterType string
  33. InferUrls []*InferUrl
  34. }
  35. type InferUrl struct {
  36. Url string
  37. Card string
  38. }
  39. type DeployInstance struct {
  40. InstanceName string
  41. InstanceId string
  42. ModelName string
  43. ModelType string
  44. InferCard string
  45. InferUrl string
  46. ClusterName string
  47. ClusterType string
  48. Status string
  49. CreatedTime string
  50. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.