|
|
|
@@ -39,6 +39,11 @@ const ( |
|
|
|
IMG_VERSION_PREFIX = "version_" |
|
|
|
TASK_NAME_PREFIX = "trainJob" |
|
|
|
RESOURCE_POOL = "common-pool" |
|
|
|
HANWUJI = "hanwuji" |
|
|
|
SUIYUAN = "suiyuan" |
|
|
|
SAILINGSI = "sailingsi" |
|
|
|
MLU = "mlu" |
|
|
|
CAMBRICONMLU290 = 256 |
|
|
|
) |
|
|
|
|
|
|
|
func NewOctopusLink(ctx context.Context, svcCtx *svc.ServiceContext, name string, id int64) *OctopusLink { |
|
|
|
@@ -187,7 +192,7 @@ func (o *OctopusLink) QuerySpecs() (interface{}, error) { |
|
|
|
// octopus查询资源规格 |
|
|
|
req := &octopus.GetResourceSpecsReq{ |
|
|
|
Platform: o.platform, |
|
|
|
ResourcePool: "common-pool", |
|
|
|
ResourcePool: RESOURCE_POOL, |
|
|
|
} |
|
|
|
resp, err := o.svcCtx.OctopusRpc.GetResourceSpecs(o.ctx, req) |
|
|
|
if err != nil { |
|
|
|
@@ -198,6 +203,27 @@ func (o *OctopusLink) QuerySpecs() (interface{}, error) { |
|
|
|
} |
|
|
|
|
|
|
|
func (o *OctopusLink) GetResourceStats() (*collector.ResourceStats, error) { |
|
|
|
req := &octopus.GetResourceSpecsReq{ |
|
|
|
Platform: o.platform, |
|
|
|
ResourcePool: RESOURCE_POOL, |
|
|
|
} |
|
|
|
specResp, err := o.svcCtx.OctopusRpc.GetResourceSpecs(o.ctx, req) |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
if !specResp.Success { |
|
|
|
return nil, errors.New(specResp.Error.Message) |
|
|
|
} |
|
|
|
//_, err = o.svcCtx.OctopusRpc.GetUserBalance(o.ctx, req) |
|
|
|
//if err != nil { |
|
|
|
// return nil, err |
|
|
|
//} |
|
|
|
|
|
|
|
//resourceStat := collector.ResourceStats{} |
|
|
|
|
|
|
|
//for _, spec := range specResp.TrainResourceSpecs { |
|
|
|
//} |
|
|
|
|
|
|
|
return nil, nil |
|
|
|
} |
|
|
|
|
|
|
|
@@ -263,6 +289,7 @@ func (o *OctopusLink) GenerateSubmitParams(option *option.AiOption) error { |
|
|
|
} |
|
|
|
|
|
|
|
func (o *OctopusLink) generateResourceId(option *option.AiOption) error { |
|
|
|
|
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
|
|