Merge remote-tracking branch 'origin/pcm_modelarts_1.0' into pcm_modelarts_1.0

# Conflicts:
#	adaptor/AIComputing/modelarts/rpc/pb/modelarts.proto
This commit is contained in:
qiwang 2023-03-01 21:03:11 +08:00
commit 1167cb476a
19 changed files with 810 additions and 169 deletions

View File

@ -0,0 +1,49 @@
package logic
import (
"PCM/adaptor/AIComputing/modelarts/rpc/internal/common"
"PCM/common/tool"
"context"
"k8s.io/apimachinery/pkg/util/json"
"strings"
"PCM/adaptor/AIComputing/modelarts/rpc/internal/svc"
"PCM/adaptor/AIComputing/modelarts/rpc/modelarts"
"github.com/zeromicro/go-zero/core/logx"
)
type CreateAlgorithmLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewCreateAlgorithmLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateAlgorithmLogic {
return &CreateAlgorithmLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
// CreateAlgorithm 创建算法
func (l *CreateAlgorithmLogic) CreateAlgorithm(in *modelarts.CreateAlgorithmReq) (*modelarts.CreateAlgorithmResp, error) {
var resp modelarts.CreateAlgorithmResp
url := "https://modelarts.cn-north-4.myhuaweicloud.com/v2/" + in.ProjectId + "/algorithms"
reqByte, err := json.Marshal(in)
if err != nil {
return nil, err
}
payload := strings.NewReader(string(reqByte))
token := common.GetToken()
body, err := tool.HttpClient(tool.POST, url, payload, token)
if err != nil {
return nil, err
}
json.Unmarshal(body, &resp)
if &resp == nil {
return nil, err
}
return &resp, nil
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -28,8 +28,8 @@ func NewCreateTaskLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Create
}
// creat task 创建导入任务
func (l *CreateTaskLogic) CreateTask(in *modelarts.ImportTaskData) (*modelarts.ImprotTaskDataReq, error) {
var resp modelarts.ImprotTaskDataReq
func (l *CreateTaskLogic) CreateTask(in *modelarts.ImportTaskDataReq) (*modelarts.ImportTaskDataResp, error) {
var resp modelarts.ImportTaskDataResp
url := "https://modelarts.cn-north-4.myhuaweicloud.com/v2/" + in.ProjectId + "/datasets/" + in.DatasetId + "/import-tasks"
reqByte, err := json.Marshal(in)

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,44 @@
package logic
/*
desc: "AI core微服务"
author: "xie"
*/
import (
"PCM/adaptor/AIComputing/modelarts/rpc/internal/common"
"PCM/adaptor/AIComputing/modelarts/rpc/internal/svc"
"PCM/adaptor/AIComputing/modelarts/rpc/modelarts"
"PCM/common/tool"
"context"
"k8s.io/apimachinery/pkg/util/json"
"github.com/zeromicro/go-zero/core/logx"
)
type DeleteServiceLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewDeleteServiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteServiceLogic {
return &DeleteServiceLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *DeleteServiceLogic) DeleteService(in *modelarts.DeleteServiceReq) (*modelarts.DeleteServiceResp, error) {
// todo: add your logic here and delete this line
var resp modelarts.DeleteServiceResp
url := "https://modelarts.cn-north-4.myhuaweicloud.com/v1/" + in.ProjectId + "/services/" + in.ServiceId
token := common.GetToken()
body, err := tool.HttpClient(tool.DELETE, url, nil, token)
if err != nil {
return nil, err
}
json.Unmarshal(body, &resp)
return &resp, nil
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,47 @@
package logic
/*
desc: "AI core微服务"
author: "xie"
*/
import (
"PCM/adaptor/AIComputing/modelarts/rpc/internal/common"
"PCM/common/tool"
"context"
"k8s.io/apimachinery/pkg/util/json"
"PCM/adaptor/AIComputing/modelarts/rpc/internal/svc"
"PCM/adaptor/AIComputing/modelarts/rpc/modelarts"
"github.com/zeromicro/go-zero/core/logx"
)
type GetExportTaskStatusOfDatasetLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewGetExportTaskStatusOfDatasetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetExportTaskStatusOfDatasetLogic {
return &GetExportTaskStatusOfDatasetLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *GetExportTaskStatusOfDatasetLogic) GetExportTaskStatusOfDataset(in *modelarts.GetExportTaskStatusOfDatasetReq) (*modelarts.GetExportTaskStatusOfDatasetResp, error) {
// todo: add your logic here and delete this line
var resp modelarts.GetExportTaskStatusOfDatasetResp
url := "https://modelarts.cn-north-4.myhuaweicloud.com/v2/" + in.ProjectId + "/datasets/" + in.ResourceId + "/export-tasks/" + in.TaskId
token := common.GetToken()
body, err := tool.HttpClient(tool.GET, url, nil, token)
if err != nil {
return nil, err
}
// var resp Pppp
json.Unmarshal(body, &resp)
return &resp, nil
}

View File

@ -30,12 +30,12 @@ func NewGetImportTaskListLogic(ctx context.Context, svcCtx *svc.ServiceContext)
}
// find taskList 查询数据集导入任务列表
func (l *GetImportTaskListLogic) GetImportTaskList(in *modelarts.ListImportTasks) (*modelarts.ReturnListImportTasks, error) {
func (l *GetImportTaskListLogic) GetImportTaskList(in *modelarts.ListImportTasksReq) (*modelarts.ListImportTasksResp, error) {
datasetId := in.DatasetId
projectId := in.ProjectId
limit := strconv.Itoa(int(in.Limit))
offset := strconv.Itoa(int(in.Offset))
var resp modelarts.ReturnListImportTasks
var resp modelarts.ListImportTasksResp
token := common.GetToken()
//c := http.Client{Timeout: time.Duration(3) * time.Second}
reqUrl, err := tool.HttpClient(tool.GET, "https://modelarts.cn-north-4.myhuaweicloud.com/v2/"+projectId+"/datasets/"+datasetId+"/import-tasks?"+limit+"&"+offset, strings.NewReader(``), token)

View File

@ -0,0 +1,46 @@
package logic
/*
desc: "AI core微服务"
author: "xie"
*/
import (
"PCM/adaptor/AIComputing/modelarts/rpc/internal/common"
"PCM/common/tool"
"context"
"k8s.io/apimachinery/pkg/util/json"
"PCM/adaptor/AIComputing/modelarts/rpc/internal/svc"
"PCM/adaptor/AIComputing/modelarts/rpc/modelarts"
"github.com/zeromicro/go-zero/core/logx"
)
type ListClustersLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewListClustersLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListClustersLogic {
return &ListClustersLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *ListClustersLogic) ListClusters(in *modelarts.ListClustersReq) (*modelarts.ListClustersResp, error) {
// todo: add your logic here and delete this line
var resp modelarts.ListClustersResp
url := "https://modelarts.cn-north-4.myhuaweicloud.com/v1/" + in.ProjectId + "/clusters"
token := common.GetToken()
body, err := tool.HttpClient(tool.GET, url, nil, token)
if err != nil {
return nil, err
}
// var resp Pppp
json.Unmarshal(body, &resp)
return &resp, nil
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,44 @@
package logic
/*
desc: "AI core微服务"
author: "xie"
*/
import (
"PCM/adaptor/AIComputing/modelarts/rpc/internal/common"
"PCM/adaptor/AIComputing/modelarts/rpc/internal/svc"
"PCM/adaptor/AIComputing/modelarts/rpc/modelarts"
"PCM/common/tool"
"context"
"k8s.io/apimachinery/pkg/util/json"
"github.com/zeromicro/go-zero/core/logx"
)
type ShowServiceLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewShowServiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShowServiceLogic {
return &ShowServiceLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *ShowServiceLogic) ShowService(in *modelarts.ShowServiceReq) (*modelarts.ShowServiceResp, error) {
// todo: add your logic here and delete this line
var resp modelarts.ShowServiceResp
url := "https://modelarts.cn-north-4.myhuaweicloud.com/v1/" + in.ProjectId + "/services/" + in.ServiceId
token := common.GetToken()
body, err := tool.HttpClient(tool.GET, url, nil, token)
if err != nil {
return nil, err
}
json.Unmarshal(body, &resp)
return &resp, nil
}

View File

@ -15,18 +15,17 @@ import (
type (
AlgoConfigs = modelarts.AlgoConfigs
Algorithm = modelarts.Algorithm
Algorithm1 = modelarts.Algorithm1
Algorithms = modelarts.Algorithms
AnnotationFormatConfig = modelarts.AnnotationFormatConfig
Annotations1 = modelarts.Annotations1
AnnotationsS = modelarts.AnnotationsS
Auth = modelarts.Auth
AutoSearch = modelarts.AutoSearch
AutoSearchAlgoConfigParameter = modelarts.AutoSearchAlgoConfigParameter
Billing = modelarts.Billing
ConfigResponse = modelarts.ConfigResponse
Constraint = modelarts.Constraint
Constraint1 = modelarts.Constraint1
ConstraintS = modelarts.ConstraintS
Cpu = modelarts.Cpu
CreatServiceReq = modelarts.CreatServiceReq
CreatServiceResp = modelarts.CreatServiceResp
CreateModelReq = modelarts.CreateModelReq
CreateModelRequestInferParams = modelarts.CreateModelRequestInferParams
CreateModelRequestModelApis = modelarts.CreateModelRequestModelApis
@ -34,8 +33,12 @@ type (
CreateModelResp = modelarts.CreateModelResp
CreateProcessorTaskReq = modelarts.CreateProcessorTaskReq
CreateProcessorTaskResp = modelarts.CreateProcessorTaskResp
CreateTrainingJobreq = modelarts.CreateTrainingJobreq
CreateTrainingJobresp = modelarts.CreateTrainingJobresp
CreateServiceReq = modelarts.CreateServiceReq
CreateServiceResp = modelarts.CreateServiceResp
CreateTrainingJobConfigReq = modelarts.CreateTrainingJobConfigReq
CreateTrainingJobConfigResp = modelarts.CreateTrainingJobConfigResp
CreateTrainingJobReq = modelarts.CreateTrainingJobReq
CreateTrainingJobResp = modelarts.CreateTrainingJobResp
CustomSpec = modelarts.CustomSpec
DataSource = modelarts.DataSource
DataSources = modelarts.DataSources
@ -46,12 +49,18 @@ type (
DeleteModelReq = modelarts.DeleteModelReq
DeleteModelResp = modelarts.DeleteModelResp
DeleteModelResponseFailedList = modelarts.DeleteModelResponseFailedList
DeleteServiceReq = modelarts.DeleteServiceReq
DeleteServiceResp = modelarts.DeleteServiceResp
DeleteTrainingJobConfigReq = modelarts.DeleteTrainingJobConfigReq
DeleteTrainingJobConfigResp = modelarts.DeleteTrainingJobConfigResp
DeleteTrainingJobReq = modelarts.DeleteTrainingJobReq
DeleteTrainingJobResp = modelarts.DeleteTrainingJobResp
DescribeProcessorTaskReq = modelarts.DescribeProcessorTaskReq
DescribeProcessorTaskResp = modelarts.DescribeProcessorTaskResp
Disk = modelarts.Disk
Domain = modelarts.Domain
Engine = modelarts.Engine
Engine1 = modelarts.Engine1
Engines = modelarts.Engines
ExportParams = modelarts.ExportParams
ExportTaskReq = modelarts.ExportTaskReq
ExportTaskResp = modelarts.ExportTaskResp
@ -81,12 +90,14 @@ type (
ListServices = modelarts.ListServices
ListServicesReq = modelarts.ListServicesReq
ListServicesResp = modelarts.ListServicesResp
ListTrainingJobConfigReq = modelarts.ListTrainingJobConfigReq
ListTrainingJobConfigResp = modelarts.ListTrainingJobConfigResp
ListTrainingJobsreq = modelarts.ListTrainingJobsreq
ListTrainingJobsresp = modelarts.ListTrainingJobsresp
LogExportPath = modelarts.LogExportPath
Memory = modelarts.Memory
Metadata = modelarts.Metadata
Metadata1 = modelarts.Metadata1
MetadataS = modelarts.MetadataS
Methods = modelarts.Methods
ModelDependencies = modelarts.ModelDependencies
ModelHealth = modelarts.ModelHealth
@ -103,15 +114,17 @@ type (
Outputs = modelarts.Outputs
Packages = modelarts.Packages
Parameter = modelarts.Parameter
ParameterS = modelarts.ParameterS
Parameters = modelarts.Parameters
Password = modelarts.Password
Policies = modelarts.Policies
ProcessorDataSource = modelarts.ProcessorDataSource
Project = modelarts.Project
QueryServiceConfig = modelarts.QueryServiceConfig
Remote = modelarts.Remote
RemoteConstraint = modelarts.RemoteConstraint
Resource = modelarts.Resource
Resource1 = modelarts.Resource1
ResourceS = modelarts.ResourceS
ReturnListImportTasks = modelarts.ReturnListImportTasks
RewardAttrs = modelarts.RewardAttrs
Scheduler = modelarts.Scheduler
@ -125,6 +138,8 @@ type (
ServiceConfig = modelarts.ServiceConfig
ShowModelReq = modelarts.ShowModelReq
ShowModelResp = modelarts.ShowModelResp
ShowServiceReq = modelarts.ShowServiceReq
ShowServiceResp = modelarts.ShowServiceResp
SourceInfo = modelarts.SourceInfo
Spec = modelarts.Spec
Spec1 = modelarts.Spec1
@ -146,14 +161,22 @@ type (
GetToken(ctx context.Context, in *TokenReq, opts ...grpc.CallOption) (*TokenResp, error)
// get modelarts Token
GetDatasetList(ctx context.Context, in *DatasetReq, opts ...grpc.CallOption) (*DatasetResp, error)
// creat task
// creat task 创建导入任务
CreateTask(ctx context.Context, in *ImportTaskData, opts ...grpc.CallOption) (*ImprotTaskDataReq, error)
// get taskList
// get taskList 查询数据集导入任务列表
GetImportTaskList(ctx context.Context, in *ListImportTasks, opts ...grpc.CallOption) (*ReturnListImportTasks, error)
// get ListTrainingJobs
// ListTrainingJobs 查询训练作业列表
GetListTrainingJobs(ctx context.Context, in *ListTrainingJobsreq, opts ...grpc.CallOption) (*ListTrainingJobsresp, error)
// CreateTrainingJob 创建训练作业
CreateTrainingJob(ctx context.Context, in *CreateTrainingJobreq, opts ...grpc.CallOption) (*CreateTrainingJobresp, error)
CreateTrainingJob(ctx context.Context, in *CreateTrainingJobReq, opts ...grpc.CallOption) (*CreateTrainingJobResp, error)
// DeleteTrainingJobConfig 删除训练作业
DeleteTrainingJob(ctx context.Context, in *DeleteTrainingJobReq, opts ...grpc.CallOption) (*DeleteTrainingJobResp, error)
// CreateTrainingJobConfig 创建训练作业参数
CreateTrainingJobConfig(ctx context.Context, in *CreateTrainingJobConfigReq, opts ...grpc.CallOption) (*CreateTrainingJobConfigResp, error)
// DeleteTrainingJobConfig 删除训练作业参数
DeleteTrainingJobConfig(ctx context.Context, in *DeleteTrainingJobConfigReq, opts ...grpc.CallOption) (*DeleteTrainingJobConfigResp, error)
// ListTrainingJobConfig 查询训练作业参数
ListTrainingJobConfig(ctx context.Context, in *ListTrainingJobConfigReq, opts ...grpc.CallOption) (*ListTrainingJobConfigResp, error)
// export task
ExportTask(ctx context.Context, in *ExportTaskReq, opts ...grpc.CallOption) (*ExportTaskResp, error)
GetExportTasksOfDataset(ctx context.Context, in *GetExportTasksOfDatasetReq, opts ...grpc.CallOption) (*GetExportTasksOfDatasetResp, error)
@ -166,8 +189,10 @@ type (
ListModels(ctx context.Context, in *ListModelReq, opts ...grpc.CallOption) (*ListModelResp, error)
ShowModels(ctx context.Context, in *ShowModelReq, opts ...grpc.CallOption) (*ShowModelResp, error)
// service management
CreateService(ctx context.Context, in *CreatServiceReq, opts ...grpc.CallOption) (*CreatServiceResp, error)
CreateService(ctx context.Context, in *CreateServiceReq, opts ...grpc.CallOption) (*CreateServiceResp, error)
ListServices(ctx context.Context, in *ListServicesReq, opts ...grpc.CallOption) (*ListServicesResp, error)
ShowService(ctx context.Context, in *ShowServiceReq, opts ...grpc.CallOption) (*ShowServiceResp, error)
DeleteService(ctx context.Context, in *DeleteServiceReq, opts ...grpc.CallOption) (*DeleteServiceResp, error)
}
defaultModelArts struct {
@ -193,30 +218,54 @@ func (m *defaultModelArts) GetDatasetList(ctx context.Context, in *DatasetReq, o
return client.GetDatasetList(ctx, in, opts...)
}
// creat task
// creat task 创建导入任务
func (m *defaultModelArts) CreateTask(ctx context.Context, in *ImportTaskData, opts ...grpc.CallOption) (*ImprotTaskDataReq, error) {
client := modelarts.NewModelArtsClient(m.cli.Conn())
return client.CreateTask(ctx, in, opts...)
}
// get taskList
// get taskList 查询数据集导入任务列表
func (m *defaultModelArts) GetImportTaskList(ctx context.Context, in *ListImportTasks, opts ...grpc.CallOption) (*ReturnListImportTasks, error) {
client := modelarts.NewModelArtsClient(m.cli.Conn())
return client.GetImportTaskList(ctx, in, opts...)
}
// get ListTrainingJobs
// ListTrainingJobs 查询训练作业列表
func (m *defaultModelArts) GetListTrainingJobs(ctx context.Context, in *ListTrainingJobsreq, opts ...grpc.CallOption) (*ListTrainingJobsresp, error) {
client := modelarts.NewModelArtsClient(m.cli.Conn())
return client.GetListTrainingJobs(ctx, in, opts...)
}
// CreateTrainingJob 创建训练作业
func (m *defaultModelArts) CreateTrainingJob(ctx context.Context, in *CreateTrainingJobreq, opts ...grpc.CallOption) (*CreateTrainingJobresp, error) {
func (m *defaultModelArts) CreateTrainingJob(ctx context.Context, in *CreateTrainingJobReq, opts ...grpc.CallOption) (*CreateTrainingJobResp, error) {
client := modelarts.NewModelArtsClient(m.cli.Conn())
return client.CreateTrainingJob(ctx, in, opts...)
}
// DeleteTrainingJobConfig 删除训练作业
func (m *defaultModelArts) DeleteTrainingJob(ctx context.Context, in *DeleteTrainingJobReq, opts ...grpc.CallOption) (*DeleteTrainingJobResp, error) {
client := modelarts.NewModelArtsClient(m.cli.Conn())
return client.DeleteTrainingJob(ctx, in, opts...)
}
// CreateTrainingJobConfig 创建训练作业参数
func (m *defaultModelArts) CreateTrainingJobConfig(ctx context.Context, in *CreateTrainingJobConfigReq, opts ...grpc.CallOption) (*CreateTrainingJobConfigResp, error) {
client := modelarts.NewModelArtsClient(m.cli.Conn())
return client.CreateTrainingJobConfig(ctx, in, opts...)
}
// DeleteTrainingJobConfig 删除训练作业参数
func (m *defaultModelArts) DeleteTrainingJobConfig(ctx context.Context, in *DeleteTrainingJobConfigReq, opts ...grpc.CallOption) (*DeleteTrainingJobConfigResp, error) {
client := modelarts.NewModelArtsClient(m.cli.Conn())
return client.DeleteTrainingJobConfig(ctx, in, opts...)
}
// ListTrainingJobConfig 查询训练作业参数
func (m *defaultModelArts) ListTrainingJobConfig(ctx context.Context, in *ListTrainingJobConfigReq, opts ...grpc.CallOption) (*ListTrainingJobConfigResp, error) {
client := modelarts.NewModelArtsClient(m.cli.Conn())
return client.ListTrainingJobConfig(ctx, in, opts...)
}
// export task
func (m *defaultModelArts) ExportTask(ctx context.Context, in *ExportTaskReq, opts ...grpc.CallOption) (*ExportTaskResp, error) {
client := modelarts.NewModelArtsClient(m.cli.Conn())
@ -261,7 +310,7 @@ func (m *defaultModelArts) ShowModels(ctx context.Context, in *ShowModelReq, opt
}
// service management
func (m *defaultModelArts) CreateService(ctx context.Context, in *CreatServiceReq, opts ...grpc.CallOption) (*CreatServiceResp, error) {
func (m *defaultModelArts) CreateService(ctx context.Context, in *CreateServiceReq, opts ...grpc.CallOption) (*CreateServiceResp, error) {
client := modelarts.NewModelArtsClient(m.cli.Conn())
return client.CreateService(ctx, in, opts...)
}
@ -270,3 +319,13 @@ func (m *defaultModelArts) ListServices(ctx context.Context, in *ListServicesReq
client := modelarts.NewModelArtsClient(m.cli.Conn())
return client.ListServices(ctx, in, opts...)
}
func (m *defaultModelArts) ShowService(ctx context.Context, in *ShowServiceReq, opts ...grpc.CallOption) (*ShowServiceResp, error) {
client := modelarts.NewModelArtsClient(m.cli.Conn())
return client.ShowService(ctx, in, opts...)
}
func (m *defaultModelArts) DeleteService(ctx context.Context, in *DeleteServiceReq, opts ...grpc.CallOption) (*DeleteServiceResp, error) {
client := modelarts.NewModelArtsClient(m.cli.Conn())
return client.DeleteService(ctx, in, opts...)
}

View File

@ -48,17 +48,43 @@ message TokenResp{
}
/******************auth end*************************/
/******************find datasetList start*************************/
message datasetReq{
string project_id = 1;
}
message datasetResp{
string total_number = 1;
datasets datasets =2;
}
message datasets{
string dataset_id =1;
string data_format =2;
DataSources data_sources =3;
int32 dataset_format =4;
string dataset_name =5;
int32 dataset_type =6;
bool import_data =7;
}
message DataSources{
string data_path =1;
int32 data_type =2;
}
/******************find datasetList end*************************/
/******************ImportTask start*************************/
//
message ImportTaskData{
message ImportTaskDataReq{
string dataset_id = 1;
string project_id = 2;
string import_path = 3;
}
message ImprotTaskDataReq{
message ImportTaskDataResp{
string task_id =1;
}
/******************ImportTask end*************************/
@ -66,7 +92,7 @@ message ImprotTaskDataReq{
/******************ListImportTasks Start*************************/
//
message ListImportTasks{
message ListImportTasksReq{
string dataset_id = 1; // @gotags: copier:"Dataset_id"
string project_id = 2; // @gotags: copier:"Project_id"
int32 limit = 3; // @gotags: copier:"Limit"
@ -74,7 +100,7 @@ message ListImportTasks{
}
message ReturnListImportTasks{
message ListImportTasksResp{
uint32 total_count = 1; //@gotags: copier:"Total_count"
repeated Import_tasks import_tasks = 2; //@gotags: copier:"Import_tasks"
}
@ -542,6 +568,7 @@ message DeleteTrainingJobResp{
}
/******************DeleteTrainingJob end*************************/
/******************DeleteTrainingJobConfig start*************************/
message DeleteTrainingJobConfigReq{
string project_id =1;
@ -554,6 +581,8 @@ message DeleteTrainingJobConfigResp{
}
/******************DeleteTrainingJobConfig end*************************/
/******************ListTrainingJobConfig start*************************/
message ListTrainingJobConfigReq{
string project_id =1;
@ -586,6 +615,180 @@ message ConfigResponse{
/******************ListTrainingJobConfig end*************************/
/******************CreateAlgorithm start*************************/
message CreateAlgorithmReq{
MetadataAlRq metadata = 1;
JobConfigAl job_config = 2;
repeated ResourceRequirements resource_requirements = 3;
AdvancedConfigAl advanced_config = 4;
string project_id =5;
}
message ResourceRequirements{
string key=1;
repeated string value=2;
string operator=3;
}
message AdvancedConfigAl {
auto_search auto_search =1;
}
message MetadataAlRq {
string id = 1;
string name = 2;
string description = 3;
string workspace_id = 4;
string ai_project = 5;
}
message ConstraintAlRq {
string type = 1;
bool editable = 2;
bool required = 3;
bool sensitive = 4;
string valid_type = 5;
repeated string valid_range= 6;
}
message ParametersAlRq {
string name = 1;
string description = 2;
i18n_description i18n_description = 3;
string value = 4;
ConstraintAlRq constraint = 5;
}
message InputsAlRq {
string name = 1;
string description = 2;
repeated remote_constraints remote_constraints =3;
}
message remote_constraints{
string data_type =1;
repeated attributesAlRq attributes=2;
}
message attributesAlRq{
map<string,string> attributes =1;
}
message OutputsAl {
string name = 1;
string description = 2;
}
message EngineAlRq {
string engine_id = 1;
string engine_name = 2;
string engine_version = 3;
string image_url =4;
}
message Children {
string name = 1;
}
message CodeTree {
string name = 1;
repeated Children children = 2;
}
message JobConfigAl {
string code_dir = 1;
string boot_file = 2;
string command = 3;
repeated ParametersAlRq parameters = 4;
bool parameters_customization = 5;
repeated InputsAlRq inputs = 6;
repeated OutputsAl outputs = 7;
EngineAlRq engine = 8;
}
//
message CreateAlgorithmResp{
MetadataAlRp metadata = 1;
ShareInfoAlRp share_info = 2;
JobConfigAl job_config = 3;
repeated ResourceRequirements resource_requirements= 4;
AdvancedConfigAl advanced_config = 5;
}
message MetadataAlRp {
string id = 1;
string name = 2;
string description = 3;
int32 create_time = 4;
string workspace_id = 5;
string ai_project = 6;
string user_name = 7;
string domain_id = 8;
string source = 9;
string api_version = 10;
bool is_valid = 11;
string state = 12;
int32 size = 13;
repeated TagsAlRp tags = 14;
repeated string attr_list = 15;
int32 version_num = 16;
int32 update_time = 17;
}
message TagsAlRp{
map<string,string> tags =1;
}
message ShareInfoAlRp {
}
message ConstraintAlRp {
string type = 1;
bool editable = 2;
bool required = 3;
bool sensitive = 4;
string valid_type = 5;
repeated string valid_range = 6;
}
message ParametersAlRp {
string name = 1;
string description = 2;
i18n_description i18n_description = 3;
string value = 4;
ConstraintAlRp constraint = 5;
}
message InputsAlRp {
string name = 1;
string access_method = 2;
}
message OutputsAlRp {
string name = 1;
string access_method = 2;
bool prefetch_to_local = 3;
}
message ImageInfo {
string cpu_image_url = 1;
string gpu_image_url = 2;
string image_version = 3;
}
message EngineAlRp {
string engine_id = 1;
string engine_name = 2;
string engine_version = 3;
bool v1_compatible = 4;
string run_user = 5;
ImageInfo image_info = 6;
bool image_source = 7;
}
/******************CreateAlgorithm end*************************/
/******************Task(export) Start*************************/
message ExportTaskReq{
string annotation_format = 1; //
@ -728,108 +931,32 @@ message ExportTaskStatus {
}
/******************Get Export Tasks Of Dataset End*************************/
/******************Create Service Start*************************/
message CreatServiceReq{
string workspace_id = 1;
Scheduler schedule = 2;
string cluster_id = 3;
string infer_type = 4;
string vpc_id = 5;
string service_name = 6;
string description = 7;
string security_group_id = 8;
string subnet_network_id = 9;
repeated ServiceConfig config = 10;
string project_id = 11;
/******************Get Export Task Status Of Dataset Start*************************/
message GetExportTaskStatusOfDatasetReq{
string resource_id = 1;
string project_id = 2;
string task_id = 3;
}
message CreatServiceResp{
message GetExportTaskStatusOfDatasetResp{
uint32 code = 1; // @gotags: copier:"Code"
string service_id = 2;
repeated string resource_ids = 3;
}
message Scheduler{
int32 duration = 1;
string time_unit = 2;
string type = 3;
}
message ServiceConfig{
CustomSpec custom_spec = 1;
map<string,string> envs = 2;
string specification = 3;
int32 weight = 4;
string model_id = 5;
string src_path = 6;
string req_uri = 7;
string mapping_type = 8;
string cluster_id = 9;
repeated string nodes = 10;
string src_type = 11;
string dest_path = 12;
int32 instance_count = 13;
}
message CustomSpec{
float gpu_p4 = 1;
int64 memory = 2;
float cpu = 3;
int64 ascend_a310 = 4;
}
/******************Create Service End*************************/
/******************List Services Start*************************/
message ListServicesReq{
string service_id = 1;
string service_name = 2;
string model_id = 3;
string workspace_id = 4;
string infer_type = 5;
string status = 6;
int32 offset = 7;
int32 limit = 8;
string sort_by = 9;
string order = 10;
string project_id = 11;
}
message ListServicesResp{
int32 code = 1; // @gotags: copier:"Code"
int32 total_count = 2;
int32 count = 3;
repeated ListServices services = 4;
}
message ListServices{
uint32 failed_times = 1;
string owner = 2;
int32 due_time = 3;
int32 finished_time = 4;
string infer_type = 5;
string service_name = 6;
string description = 7;
string project = 8;
uint32 invocation_times = 9;
uint32 publish_at = 10;
string workspace_id = 11;
repeated Scheduler scheduler = 12;
int32 start_time = 13;
string operation_time = 14;
bool is_shared = 15;
string service_id = 16;
int32 progress = 17;
int32 shared_count = 18;
string tenant = 19;
string status = 20;
string is_opened_sample_collection = 21;
int32 transition_at = 22;
bool is_free = 23;
map<string,string> additional_properties = 24;
uint32 create_time = 2;
string error_code = 3;
string error_msg = 4;
int32 export_format = 5;
ExportParams export_params = 6;
repeated ExportTaskStatus export_tasks = 7;
int32 export_type = 8;
int32 finished_sample_count = 9;
string path = 10;
float progress = 11;
string status = 12;
string task_id = 13;
int64 total_count = 14;
int64 total_sample = 15;
uint32 update_time = 16;
string version_format = 17;
string version_id = 18;
}
/******************List Services End*************************/
@ -841,8 +968,8 @@ message datasetReq{
}
message datasetResp{
int32 total_number = 1;
repeated datasets datasets =2;
string total_number = 1;
datasets datasets =2;
}
message datasets{
@ -860,22 +987,6 @@ message DataSources{
int32 data_type =2;
}
/******************create dataset start*************************/
message CreateDataSetReq {
repeated DataSources data_sources = 1;
string dataset_name = 2;
int32 dataset_type = 3;
string description = 4;
string work_path = 5;
int32 work_path_type = 6;
string project_id = 7;
}
message CreateDataSetResq{
string dataset_id =1;
}
/******************create dataset end*************************/
/******************find datasetList end*************************/
@ -929,9 +1040,6 @@ message OperatorParam {
string name = 3;
string params = 4;
}
/******************Create Processor Task End*************************/
/******************Describe Processor Task Start*************************/
@ -1190,6 +1298,229 @@ message ModelParamsInfo{
}
/******************Show Model End*************************/
/******************Create Service Start*************************/
message CreateServiceReq{
string workspace_id = 1;
Scheduler schedule = 2;
string cluster_id = 3;
string infer_type = 4;
string vpc_id = 5;
string service_name = 6;
string description = 7;
string security_group_id = 8;
string subnet_network_id = 9;
repeated ServiceConfig config = 10;
string project_id = 11;
}
message CreateServiceResp{
uint32 code = 1; // @gotags: copier:"Code"
string service_id = 2;
repeated string resource_ids = 3;
}
message Scheduler{
int32 duration = 1;
string time_unit = 2;
string type = 3;
}
message ServiceConfig{
CustomSpec custom_spec = 1;
map<string,string> envs = 2;
string specification = 3;
int32 weight = 4;
string model_id = 5;
string src_path = 6;
string req_uri = 7;
string mapping_type = 8;
string cluster_id = 9;
repeated string nodes = 10;
string src_type = 11;
string dest_path = 12;
int32 instance_count = 13;
}
message CustomSpec{
float gpu_p4 = 1;
int64 memory = 2;
float cpu = 3;
int64 ascend_a310 = 4;
}
/******************Create Service End*************************/
/******************Delete Service Start*************************/
message DeleteServiceReq{
string project_id = 1;
string service_id = 2;
}
message DeleteServiceResp{
}
/******************Delete Service End*************************/
/******************Show Service Start*************************/
message ShowServiceReq{
string project_id = 1;
string service_id = 2;
}
message ShowServiceResp{
uint32 failed_times = 1;
string owner = 2;
int32 due_time = 3;
int32 finished_time = 4;
string infer_type = 5;
string service_name = 6;
string description = 7;
string project = 8;
uint32 invocation_times = 9;
uint32 publish_at = 10;
string workspace_id = 11;
repeated Scheduler scheduler = 12;
int32 start_time = 13;
string operation_time = 14;
bool is_shared = 15;
string service_id = 16;
int32 progress = 17;
int32 shared_count = 18;
string tenant = 19;
string status = 20;
string is_opened_sample_collection = 21;
int32 transition_at = 22;
bool is_free = 23;
map<string,string> additional_properties = 24;
string cluster_id = 25;
string vpc_id = 26;
string subnet_network_id = 27;
string security_group_id = 28;
string error_msg = 29;
repeated QueryServiceConfig config = 30;
string access_address = 31;
string bind_access_address = 32;
string update_time = 33;
string debug_url = 34;
}
message QueryServiceConfig{
string model_version = 1;
string finished_time = 2;
CustomSpec CustomSpec = 3;
map<string,string> envs = 4;
string specification = 5;
int32 weight = 6;
string model_id = 7;
string src_path = 8;
string req_uri = 9;
string mapping_type = 10;
string start_time = 11;
string cluster_id = 12;
repeated string nodes = 13;
string mapping_rule = 14;
string model_name = 15;
string src_type = 16;
string dest_path = 17;
int32 instance_count = 18;
string status = 19;
bool scaling = 20;
bool support_debug = 21;
map<string,string> additional_properties = 22;
}
/******************Show Service End*************************/
/******************List Services Start*************************/
message ListServicesReq{
string service_id = 1;
string service_name = 2;
string model_id = 3;
string workspace_id = 4;
string infer_type = 5;
string status = 6;
int32 offset = 7;
int32 limit = 8;
string sort_by = 9;
string order = 10;
string project_id = 11;
}
message ListServicesResp{
int32 code = 1; // @gotags: copier:"Code"
int32 total_count = 2;
int32 count = 3;
repeated ListServices services = 4;
}
message ListServices{
uint32 failed_times = 1;
string owner = 2;
int32 due_time = 3;
int32 finished_time = 4;
string infer_type = 5;
string service_name = 6;
string description = 7;
string project = 8;
uint32 invocation_times = 9;
uint32 publish_at = 10;
string workspace_id = 11;
repeated Scheduler scheduler = 12;
int32 start_time = 13;
string operation_time = 14;
bool is_shared = 15;
string service_id = 16;
int32 progress = 17;
int32 shared_count = 18;
string tenant = 19;
string status = 20;
string is_opened_sample_collection = 21;
int32 transition_at = 22;
bool is_free = 23;
map<string,string> additional_properties = 24;
}
/******************List Services End*************************/
/******************List Clusters Start*************************/
message ListClustersReq{
string project_id = 1;
string Cluster_name = 2;
int64 offset = 3;
int64 limit = 4;
string sort_by = 5;
string order = 6;
}
message ListClustersResp{
int32 code = 1; // @gotags: copier:"Code"
int32 count = 2;
repeated Cluster clusters= 3;
}
message Cluster{
string owner = 1;
string cluster_name = 2;
int32 period_num = 3;
int32 created_at = 4;
string description = 5;
string project = 6;
int64 allocatable_memory = 7;
string cluster_id = 8;
ClusterNode nodes = 9;
float allocatable_cpu_cores = 10;
string order_id = 11;
string period_type = 12;
string tenant = 13;
string status = 14;
}
message ClusterNode{
int32 available_count = 1;
int32 count = 2;
string specification = 3;
}
/******************List Clusters End*************************/
// Slurm Services for Shuguang Branch
service ModelArts {
@ -1197,12 +1528,11 @@ service ModelArts {
rpc GetToken(TokenReq) returns (TokenResp);
//get modelarts Token
rpc GetDatasetList(datasetReq) returns (datasetResp);
//create DateSet
rpc CreateDataSet(CreateDataSetReq) returns (CreateDataSetResq);
//creat task
rpc createTask(ImportTaskData) returns(ImprotTaskDataReq);
rpc createTask(ImportTaskDataReq) returns(ImportTaskDataResp);
//get taskList
rpc GetImportTaskList(ListImportTasks) returns (ReturnListImportTasks);
rpc GetImportTaskList(ListImportTasksReq) returns (ListImportTasksResp);
// ListTrainingJobs
rpc GetListTrainingJobs(ListTrainingJobsreq) returns (ListTrainingJobsresp);
// CreateTrainingJob
@ -1215,13 +1545,14 @@ service ModelArts {
rpc DeleteTrainingJobConfig(DeleteTrainingJobConfigReq) returns (DeleteTrainingJobConfigResp);
// ListTrainingJobConfig
rpc ListTrainingJobConfig(ListTrainingJobConfigReq) returns (ListTrainingJobConfigResp);
// CreateAlgorithm
rpc CreateAlgorithm(CreateAlgorithmReq) returns (CreateAlgorithmResp);
//export task
rpc ExportTask(ExportTaskReq) returns (ExportTaskResp);
rpc GetExportTasksOfDataset(GetExportTasksOfDatasetReq) returns (GetExportTasksOfDatasetResp);
rpc GetExportTaskStatusOfDataset(GetExportTaskStatusOfDatasetReq) returns (GetExportTaskStatusOfDatasetResp);
//processor task
rpc CreateProcessorTask(CreateProcessorTaskReq) returns (CreateProcessorTaskResp);
rpc DescribeProcessorTask(DescribeProcessorTaskReq) returns (DescribeProcessorTaskResp);
@ -1233,7 +1564,9 @@ service ModelArts {
rpc ShowModels(ShowModelReq) returns (ShowModelResp);
//service management
rpc CreateService(CreatServiceReq) returns (CreatServiceResp);
rpc CreateService(CreateServiceReq) returns (CreateServiceResp);
rpc ListServices(ListServicesReq) returns (ListServicesResp);
rpc ShowService(ShowServiceReq) returns (ShowServiceResp);
rpc DeleteService(DeleteServiceReq) returns (DeleteServiceResp);
rpc ListClusters(ListClustersReq) returns (ListClustersResp);
}