|
|
|
@@ -108,7 +108,7 @@ func (o *OctopusLink) QueryImageList() (interface{}, error) { |
|
|
|
return resp, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (o *OctopusLink) SubmitTask(imageId string, cmd string, envs []string, params []string, resourceId string, aiType string) (interface{}, error) { |
|
|
|
func (o *OctopusLink) SubmitTask(imageId string, cmd string, envs []string, params []string, resourceId string, datasetsId string, algorithmId string, aiType string) (interface{}, error) { |
|
|
|
// octopus提交任务 |
|
|
|
|
|
|
|
// python参数 |
|
|
|
@@ -227,7 +227,7 @@ func (o *OctopusLink) Execute(option *option.AiOption) (interface{}, error) { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
task, err := o.SubmitTask(option.ImageId, option.Cmd, option.Envs, option.Params, option.ResourceId, option.TaskType) |
|
|
|
task, err := o.SubmitTask(option.ImageId, option.Cmd, option.Envs, option.Params, option.ResourceId, option.DatasetsId, option.AlgorithmId, option.TaskType) |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
@@ -239,6 +239,10 @@ func (o *OctopusLink) GenerateSubmitParams(option *option.AiOption) error { |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
err = o.generateDatasetsId(option) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
err = o.generateImageId(option) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
@@ -259,10 +263,34 @@ func (o *OctopusLink) GenerateSubmitParams(option *option.AiOption) error { |
|
|
|
} |
|
|
|
|
|
|
|
func (o *OctopusLink) generateResourceId(option *option.AiOption) error { |
|
|
|
|
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
|
func (o *OctopusLink) generateDatasetsId(option *option.AiOption) error { |
|
|
|
if option.DatasetsName == "" { |
|
|
|
return errors.New("DatasetsName not set") |
|
|
|
} |
|
|
|
req := &octopus.GetMyDatasetListReq{ |
|
|
|
Platform: o.platform, |
|
|
|
PageIndex: o.pageIndex, |
|
|
|
PageSize: o.pageSize, |
|
|
|
} |
|
|
|
resp, err := o.svcCtx.OctopusRpc.GetMyDatasetList(o.ctx, req) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
if !resp.Success { |
|
|
|
return errors.New("failed to get DatasetsId") |
|
|
|
} |
|
|
|
for _, dataset := range resp.Payload.Datasets { |
|
|
|
if dataset.Name == option.DatasetsName { |
|
|
|
option.DatasetsId = dataset.Id |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
return errors.New("failed to get DatasetsId") |
|
|
|
} |
|
|
|
|
|
|
|
func (o *OctopusLink) generateImageId(option *option.AiOption) error { |
|
|
|
|
|
|
|
return nil |
|
|
|
|