训练任务参数创建
This commit is contained in:
parent
d71fdaa96c
commit
2280a72820
File diff suppressed because one or more lines are too long
|
@ -27,10 +27,10 @@ func NewCreateTrainingJobLogic(ctx context.Context, svcCtx *svc.ServiceContext)
|
|||
}
|
||||
|
||||
// CreateTrainingJob 创建训练作业
|
||||
func (l *CreateTrainingJobLogic) CreateTrainingJob(in *modelarts.CreateTrainingJobreq) (*modelarts.CreateTrainingJobresp, error) {
|
||||
var resp modelarts.CreateTrainingJobresp
|
||||
//url := "https://modelarts.cn-north-4.myhuaweicloud.com/v2/" + in.ProjectId + "/training-jobs/"
|
||||
url := "https://modelarts.cn-north-4.myhuaweicloud.com/v2/0a62ffb0d48026c12fbfc011b8d23f0b/training-jobs"
|
||||
func (l *CreateTrainingJobLogic) CreateTrainingJob(in *modelarts.CreateTrainingJobReq) (*modelarts.CreateTrainingJobResp, error) {
|
||||
var resp modelarts.CreateTrainingJobResp
|
||||
url := "https://modelarts.cn-north-4.myhuaweicloud.com/v2/" + in.ProjectId + "/training-jobs"
|
||||
//url := "https://modelarts.cn-north-4.myhuaweicloud.com/v2/0a62ffb0d48026c12fbfc011b8d23f0b/training-jobs"
|
||||
reqByte, err := json.Marshal(in)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
@ -424,20 +424,23 @@ message Task_statuses{
|
|||
/******************ListTrainingJobs end*************************/
|
||||
|
||||
/******************CreateTrainingJob start*************************/
|
||||
message CreateTrainingJobreq {
|
||||
//创建训练任务入参
|
||||
message CreateTrainingJobReq {
|
||||
string kind = 1;
|
||||
Metadata metadata = 2;
|
||||
Algorithm1 algorithm = 3;
|
||||
Algorithms algorithm = 3;
|
||||
Spec1 spec = 4;
|
||||
string project_id =5;
|
||||
}
|
||||
message CreateTrainingJobresp{
|
||||
//创建训练任务出参
|
||||
message CreateTrainingJobResp{
|
||||
string kind = 1;
|
||||
Metadata1 metadata = 2;
|
||||
MetadataS metadata = 2;
|
||||
Status status = 3;
|
||||
Algorithm1 algorithm = 4;
|
||||
Algorithms algorithm = 4;
|
||||
Spec spec = 5;
|
||||
}
|
||||
message Metadata1 {
|
||||
message MetadataS {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string description = 3;
|
||||
|
@ -445,12 +448,12 @@ message Metadata1 {
|
|||
string workspace_id = 5;
|
||||
string ai_project = 6;
|
||||
string user_name = 7;
|
||||
Annotations1 annotations = 8;
|
||||
AnnotationsS annotations = 8;
|
||||
TrainingExperimentReference training_experiment_reference = 9;
|
||||
repeated string tags= 10;
|
||||
}
|
||||
|
||||
message Annotations1 {
|
||||
message AnnotationsS {
|
||||
string job_template = 1;
|
||||
string key_task = 2;
|
||||
}
|
||||
|
@ -464,7 +467,7 @@ message Metadata {
|
|||
int32 create_time = 5;
|
||||
}
|
||||
|
||||
message Constraint1 {
|
||||
message ConstraintS {
|
||||
string type = 1;
|
||||
bool editable = 2;
|
||||
bool required = 3;
|
||||
|
@ -475,35 +478,59 @@ message Constraint1 {
|
|||
message Parameters {
|
||||
string name = 1;
|
||||
string value = 2;
|
||||
Constraint1 constraint = 3;
|
||||
ConstraintS constraint = 3;
|
||||
}
|
||||
|
||||
message Engine1 {
|
||||
message Engines {
|
||||
string engine_id = 1;
|
||||
string engine_name = 2;
|
||||
string engine_version = 3;
|
||||
}
|
||||
|
||||
message Algorithm1 {
|
||||
message Algorithms {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string code_dir = 3;
|
||||
string boot_file = 4;
|
||||
repeated Parameters parameters = 5;
|
||||
Engine1 engine = 6;
|
||||
Engines engine = 6;
|
||||
}
|
||||
|
||||
message Resource1 {
|
||||
message ResourceS {
|
||||
string flavor_id = 1;
|
||||
int32 node_count = 2;
|
||||
}
|
||||
|
||||
message Spec1 {
|
||||
Resource1 resource = 1;
|
||||
ResourceS resource = 1;
|
||||
}
|
||||
/******************CreateTrainingJob end*************************/
|
||||
|
||||
/******************CreateTrainingJobConfig start*************************/
|
||||
message CreateTrainingJobConfigReq {
|
||||
string config_name = 1;
|
||||
string app_url = 2;
|
||||
string boot_file_url = 3;
|
||||
int32 model_id = 4;
|
||||
int32 worker_server_num = 5;
|
||||
int32 engine_id = 6;
|
||||
int32 spec_id = 7;
|
||||
repeated ParameterS parameter = 8;
|
||||
string project_id =9;
|
||||
}
|
||||
|
||||
message ParameterS {
|
||||
string label = 1;
|
||||
string value = 2;
|
||||
}
|
||||
|
||||
/******************CreateTrainingJob end*************************/
|
||||
message CreateTrainingJobConfigResp{
|
||||
bool is_success =1;
|
||||
string error_message =2;
|
||||
string error_code =3;
|
||||
}
|
||||
|
||||
/******************CreateTrainingJobConfig end*************************/
|
||||
|
||||
/******************Task(export) Start*************************/
|
||||
message ExportTaskReq{
|
||||
|
@ -1105,11 +1132,12 @@ service ModelArts {
|
|||
rpc createTask(ImportTaskData) returns(ImprotTaskDataReq);
|
||||
//get taskList
|
||||
rpc GetImportTaskList(ListImportTasks) returns (ReturnListImportTasks);
|
||||
// get ListTrainingJobs
|
||||
// ListTrainingJobs 查询训练作业列表
|
||||
rpc GetListTrainingJobs(ListTrainingJobsreq) returns (ListTrainingJobsresp);
|
||||
// CreateTrainingJob 创建训练作业
|
||||
rpc CreateTrainingJob(CreateTrainingJobreq) returns (CreateTrainingJobresp);
|
||||
|
||||
rpc CreateTrainingJob(CreateTrainingJobReq) returns (CreateTrainingJobResp);
|
||||
// CreateTrainingJobConfig 创建训练作业参数
|
||||
rpc CreateTrainingJobConfig(CreateTrainingJobConfigReq) returns (CreateTrainingJobConfigResp);
|
||||
//export task
|
||||
rpc ExportTask(ExportTaskReq) returns (ExportTaskResp);
|
||||
rpc GetExportTasksOfDataset(GetExportTasksOfDatasetReq) returns (GetExportTasksOfDatasetResp);
|
||||
|
|
Loading…
Reference in New Issue