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.

collector.go 2.5 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package collector
  2. import (
  3. "context"
  4. )
  5. type AiCollector interface {
  6. GetResourceStats(ctx context.Context) (*ResourceStats, error)
  7. GetDatasetsSpecs(ctx context.Context) ([]*DatasetsSpecs, error)
  8. GetAlgorithms(ctx context.Context) ([]*Algorithm, error)
  9. GetTrainingTaskLog(ctx context.Context, taskId string, instanceNum string) (string, error)
  10. GetTrainingTask(ctx context.Context, taskId string) (*Task, error)
  11. DownloadAlgorithmCode(ctx context.Context, resourceType string, card string, taskType string, dataset string, algorithm string) (string, error)
  12. UploadAlgorithmCode(ctx context.Context, resourceType string, card string, taskType string, dataset string, algorithm string, code string) error
  13. GetComputeCards(ctx context.Context) ([]string, error)
  14. GetUserBalance(ctx context.Context) (float64, error)
  15. GetResourceSpecs(ctx context.Context, resrcType string) (*ResourceSpec, error)
  16. }
  17. type ResourceSpec struct {
  18. ClusterId string `json:"clusterID"`
  19. ClusterType string `json:"clusterType"`
  20. Region string `json:"region"`
  21. Resources []interface{} `json:"resources"`
  22. Msg string `json:"msg"`
  23. }
  24. type ClusterResource struct {
  25. Resource *Usage `json:"resource"`
  26. BaseResources []*Usage `json:"baseResources,omitempty"`
  27. }
  28. type UnitValue struct {
  29. Unit string `json:"unit"`
  30. Value interface{} `json:"value"`
  31. }
  32. type Usage struct {
  33. Total *UnitValue `json:"total"`
  34. Type string `json:"type"`
  35. Name string `json:"name,omitempty"`
  36. Available *UnitValue `json:"available,omitempty"`
  37. }
  38. //type Balance struct {
  39. // Total UnitValue `json:"total"`
  40. // Type string `json:"type"`
  41. //}
  42. //
  43. //type Rate struct {
  44. // Price interface{} `json:"price"`
  45. // Type string `json:"type"`
  46. //}
  47. type ResourceStats struct {
  48. ClusterId string
  49. Name string
  50. CpuCoreAvail int64
  51. CpuCoreTotal int64
  52. MemAvail float64
  53. MemTotal float64
  54. DiskAvail float64
  55. DiskTotal float64
  56. GpuAvail int64
  57. GpuTotal int64
  58. CardsAvail []*Card
  59. CpuCoreHours float64
  60. Balance float64
  61. TaskCompleted int64
  62. }
  63. type Card struct {
  64. Platform string
  65. Type string
  66. Name string
  67. TOpsAtFp16 float64
  68. CardHours float64
  69. CardNum int32
  70. }
  71. type DatasetsSpecs struct {
  72. Name string
  73. Size string
  74. }
  75. type Algorithm struct {
  76. Name string
  77. Platform string
  78. TaskType string
  79. }
  80. type Task struct {
  81. Id string
  82. Start string
  83. End string
  84. Status string
  85. }

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.