core端创建算法查询算法
This commit is contained in:
parent
988d143d71
commit
27b6fa60f3
|
@ -1036,73 +1036,90 @@ type (
|
|||
|
||||
type (
|
||||
CreateTrainingJobReq { //创建训练任务入参
|
||||
Kind string `json:"kind"`
|
||||
Metadatas MetadataS `json:"metadata"`
|
||||
Algorithms Algorithms `json:"algorithm"`
|
||||
Specs Specs `json:"spec"`
|
||||
ProjectId string `json:"projectId"`
|
||||
Kind string `json:"kind,optional"`
|
||||
Metadatas MetadataS `json:"metadata,optional"`
|
||||
AlgorithmsCtRq AlgorithmsCtRq `json:"algorithm,optional"`
|
||||
SpecsCtRq SpecsCtRq `json:"spec,optional"`
|
||||
ProjectId string `json:"project_id,optional"`
|
||||
}
|
||||
|
||||
CreateTrainingJobResp { //创建训练任务出参
|
||||
Kind string `json:"kind"`
|
||||
Metadatas MetadataS `json:"metadata"`
|
||||
Status Status `json:"status"`
|
||||
Specs Specs `json:"spec"`
|
||||
Algorithms Algorithms `json:"algorithm"`
|
||||
Kind string `json:"kind"`
|
||||
Metadatas MetadataS `json:"metadata"`
|
||||
Status Status `json:"status"`
|
||||
SpecCtRp SpecCtRp `json:"spec"`
|
||||
Algorithms AlgorithmsCtRq `json:"algorithm"`
|
||||
}
|
||||
MetadataS {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
WorkspaceId string `json:"workspaceId"`
|
||||
Id string `json:"id,optional"`
|
||||
Name string `json:"name,optional"`
|
||||
Description string `json:"description,optional"`
|
||||
WorkspaceId string `json:"workspace_id,optional"`
|
||||
}
|
||||
|
||||
EngineCreateTraining {
|
||||
EngineId string `json:"engineId"`
|
||||
EngineName string `json:"engineName"`
|
||||
EngineVersion string `json:"engineVersion"`
|
||||
EngineId string `json:"engine_id,optional"`
|
||||
EngineName string `json:"engine_name,optional"`
|
||||
EngineVersion string `json:"engine_version,optional"`
|
||||
}
|
||||
|
||||
ConstraintCreateTraining {
|
||||
Type string `json:"type"`
|
||||
Editable bool `json:"editable"`
|
||||
Required bool `json:"required"`
|
||||
Sensitive bool `json:"sensitive"`
|
||||
ValidType string `json:"validType"`
|
||||
Type string `json:"type,optional"`
|
||||
Editable bool `json:"editable,optional"`
|
||||
Required bool `json:"required,optional"`
|
||||
Sensitive bool `json:"sensitive,optional"`
|
||||
ValidType string `json:"valid_type,optional"`
|
||||
}
|
||||
|
||||
ParametersTrainJob {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Value string `json:"value"`
|
||||
ConstraintCreateTraining ConstraintCreateTraining `json:"constraint"`
|
||||
Name string `json:"name,optional"`
|
||||
Description string `json:"description,optional"`
|
||||
Value string `json:"value,optional"`
|
||||
ConstraintCreateTraining ConstraintCreateTraining `json:"constraint,optional"`
|
||||
}
|
||||
|
||||
PoliciesCreateTraining {
|
||||
}
|
||||
|
||||
Algorithms {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
CodeDir string `json:"codeDir"`
|
||||
BootFile string `json:"bootFile"`
|
||||
EngineCreateTraining EngineCreateTraining `json:"engine"`
|
||||
ParametersTrainJob []ParametersTrainJob `json:"parameters"`
|
||||
PoliciesCreateTraining PoliciesCreateTraining `json:"policies"`
|
||||
AlgorithmsCtRq {
|
||||
Id string `json:"id,optional"`
|
||||
Name string `json:"name,optional"`
|
||||
CodeDir string `json:"code_dir,optional"`
|
||||
BootFile string `json:"boot_file,optional"`
|
||||
EngineCreateTraining EngineCreateTraining `json:"engine,optional"`
|
||||
ParametersTrainJob []ParametersTrainJob `json:"parameters,optional"`
|
||||
PoliciesCreateTraining PoliciesCreateTraining `json:"policies,optional"`
|
||||
}
|
||||
|
||||
ResourceCreateTraining {
|
||||
FlavorId string `json:"flavorId"`
|
||||
NodeCount int32 `json:"nodeCount"`
|
||||
FlavorId string `json:"flavor_id,optional"`
|
||||
NodeCount int32 `json:"node_count,optional"`
|
||||
}
|
||||
|
||||
LogExportPathCreateTrainingJob {
|
||||
}
|
||||
|
||||
Specs {
|
||||
ResourceCreateTraining ResourceCreateTraining `json:"resource"`
|
||||
LogExportPathCreateTrainingJob LogExportPathCreateTrainingJob `json:"logExportPath"`
|
||||
IsHostedLog bool `json:"isHostedLog"`
|
||||
SpecsCtRq {
|
||||
ResourceCreateTraining ResourceCreateTraining `json:"resource,optional"`
|
||||
LogExportPathCreateTrainingJob LogExportPathCreateTrainingJob `json:"logExportPath,optional"`
|
||||
IsHostedLog bool `json:"isHostedLog,optional"`
|
||||
}
|
||||
SpecCtRp {
|
||||
Resource *Resource `json:"resource,optional"`
|
||||
Volumes []*Volumes `json:"volumes,optional"`
|
||||
LogExportPath *LogExportPath `json:"log_export_path,optional"`
|
||||
}
|
||||
LogExportPath {
|
||||
ObsUrl string `json:"obs_url,optional"`
|
||||
HostPath string `json:"host_path,optional"`
|
||||
}
|
||||
Volumes {
|
||||
Nfs *Nfs `json:"nfs,optional"`
|
||||
}
|
||||
Nfs {
|
||||
NfsServerPath string `json:"nfs_server_path,optional"`
|
||||
LocalPath string `json:"local_path,optional"`
|
||||
ReadOnly bool `json:"read_only,optional"`
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ func NewCreateTrainingJobLogic(ctx context.Context, svcCtx *svc.ServiceContext)
|
|||
func (l *CreateTrainingJobLogic) CreateTrainingJob(req *types.CreateTrainingJobReq) (resp *types.CreateTrainingJobResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
modelartsReq := &modelarts.CreateTrainingJobReq{}
|
||||
err = copier.CopyWithOption(modelartsReq, req, copier.Option{IgnoreEmpty: true, DeepCopy: true})
|
||||
err = copier.CopyWithOption(modelartsReq, req, copier.Option{IgnoreEmpty: false, DeepCopy: true})
|
||||
CreateTrainingJobResp, err := l.svcCtx.ModelArtsRpc.CreateTrainingJob(l.ctx, modelartsReq)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get db TrainingJob list"), "Failed to get db TrainingJob list err : %v ,req:%+v", err, req)
|
||||
|
|
|
@ -453,9 +453,9 @@ message Task_statuses{
|
|||
//创建训练任务入参
|
||||
message CreateTrainingJobReq {
|
||||
string kind = 1; // @gotags: copier:"Kind"
|
||||
MetadataS metadatas = 2; // @gotags: copier:"Metadatas"
|
||||
Algorithms algorithms = 3; // @gotags: copier:"Algorithms"
|
||||
Specs specs = 4; // @gotags: copier:"Specs"
|
||||
MetadataS metadata = 2; // @gotags: copier:"Metadatas"
|
||||
Algorithms algorithm = 3; // @gotags: copier:"AlgorithmsCtRq"
|
||||
Specs spec = 4; // @gotags: copier:"SpecsCtRq"
|
||||
string project_id =5; // @gotags: copier:"ProjectId"
|
||||
}
|
||||
//创建训练任务出参
|
||||
|
@ -480,31 +480,31 @@ message EngineCreateTraining {
|
|||
}
|
||||
|
||||
message ConstraintCreateTraining {
|
||||
string type = 1;
|
||||
bool editable = 2;
|
||||
bool required = 3;
|
||||
bool sensitive = 4;
|
||||
string valid_type = 5;
|
||||
string type = 1; // @gotags: copier:"Type"
|
||||
bool editable = 2; // @gotags: copier:"Editable"
|
||||
bool required = 3; // @gotags: copier:"Required"
|
||||
bool sensitive = 4; // @gotags: copier:"Sensitive"
|
||||
string valid_type = 5; // @gotags: copier:"ValidType"
|
||||
}
|
||||
|
||||
message ParametersTrainJob {
|
||||
string name = 1;
|
||||
string description = 2;
|
||||
string value = 3;
|
||||
ConstraintCreateTraining constraint = 4;
|
||||
string name = 1; // @gotags: copier:"Name"
|
||||
string description = 2; // @gotags: copier:"Description"
|
||||
string value = 3; // @gotags: copier:"Value"
|
||||
ConstraintCreateTraining constraint = 4; // @gotags: copier:"ConstraintCreateTraining"
|
||||
}
|
||||
|
||||
message PoliciesCreateTraining {
|
||||
}
|
||||
|
||||
message Algorithms {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string code_dir = 3;
|
||||
string boot_file = 4;
|
||||
EngineCreateTraining engine = 5; // @gotags: copier:"EngineCreateTraining"
|
||||
repeated ParametersTrainJob parameters = 6; // @gotags: copier:"ParametersTrainJob"
|
||||
PoliciesCreateTraining policies = 7; // @gotags: copier:"PoliciesCreateTraining"
|
||||
string id = 1; // @gotags: copier:"Id"
|
||||
string name = 2; // @gotags: copier:"Name"
|
||||
string code_dir = 3; // @gotags: copier:"CodeDir"
|
||||
string boot_file = 4; // @gotags: copier:"BootFile"
|
||||
EngineCreateTraining engine = 5;// @gotags: copier:"EngineCreateTraining"
|
||||
repeated ParametersTrainJob parameters = 6;// @gotags: copier:"ParametersTrainJob"
|
||||
PoliciesCreateTraining policies = 7;// @gotags: copier:"PoliciesCreateTraining"
|
||||
}
|
||||
|
||||
message ResourceCreateTraining {
|
||||
|
@ -516,9 +516,9 @@ message LogExportPathCreateTraining {
|
|||
}
|
||||
|
||||
message Specs {
|
||||
ResourceCreateTraining resource = 1;
|
||||
LogExportPathCreateTraining log_export_path = 2;
|
||||
bool is_hosted_log = 3;
|
||||
ResourceCreateTraining resource = 1; // @gotags: copier:"ResourceCreateTraining"
|
||||
LogExportPathCreateTraining log_export_path = 2; // @gotags: copier:"LogExportPathCreateTrainingJob"
|
||||
bool is_hosted_log = 3; // @gotags: copier:"IsHostedLog"
|
||||
}
|
||||
/******************CreateTrainingJob end*************************/
|
||||
|
||||
|
|
Loading…
Reference in New Issue