Browse Source

Merge pull request 'added getresourceusage' (#349) from tzwang/pcm-coordinator:master into master

pull/350/head
tzwang 11 months ago
parent
commit
6bc8969b36
5 changed files with 25 additions and 0 deletions
  1. +12
    -0
      internal/scheduler/service/collector/collector.go
  2. +4
    -0
      internal/storeLink/modelarts.go
  3. +4
    -0
      internal/storeLink/octopus.go
  4. +1
    -0
      internal/storeLink/openi.go
  5. +4
    -0
      internal/storeLink/shuguangai.go

+ 12
- 0
internal/scheduler/service/collector/collector.go View File

@@ -14,6 +14,18 @@ type AiCollector interface {
UploadAlgorithmCode(ctx context.Context, resourceType string, card string, taskType string, dataset string, algorithm string, code string) error
GetComputeCards(ctx context.Context) ([]string, error)
GetUserBalance(ctx context.Context) (float64, error)
GetResourceUsage(ctx context.Context) (*ResourceUsage, error)
}

type ResourceUsage struct {
ClusterId string
Resources []*Usage
}

type Usage struct {
Total float64
Type string
Available float64
}

type ResourceStats struct {


+ 4
- 0
internal/storeLink/modelarts.go View File

@@ -850,3 +850,7 @@ func (m *ModelArtsLink) CheckImageExist(ctx context.Context, option *option.Infe
}
return errors.New("failed to find Image ")
}

func (m *ModelArtsLink) GetResourceUsage(ctx context.Context) (*collector.ResourceUsage, error) {
return nil, nil
}

+ 4
- 0
internal/storeLink/octopus.go View File

@@ -1278,3 +1278,7 @@ func (o *OctopusLink) CheckModelExistence(ctx context.Context, name string, mtyp

return true
}

func (o *OctopusLink) GetResourceUsage(ctx context.Context) (*collector.ResourceUsage, error) {
return nil, nil
}

+ 1
- 0
internal/storeLink/openi.go View File

@@ -0,0 +1 @@
package storeLink

+ 4
- 0
internal/storeLink/shuguangai.go View File

@@ -999,3 +999,7 @@ func (s *ShuguangAi) CheckModelExistence(ctx context.Context, name string, mtype

return resp.Data.Exist
}

func (s *ShuguangAi) GetResourceUsage(ctx context.Context) (*collector.ResourceUsage, error) {
return nil, nil
}

Loading…
Cancel
Save