Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
oeqqwq committed Aug 22, 2024
1 parent e4812d7 commit ee4309c
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 51 deletions.
7 changes: 4 additions & 3 deletions proto/kuscia/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ message RequestHeader {
}

// Status carries the response status information.
// Reference: https://github.com/grpc/grpc/blob/master/src/proto/grpc/status/status.proto
// Reference:
// https://github.com/grpc/grpc/blob/master/src/proto/grpc/status/status.proto
message Status {
// The status code, which should be one of google rpc code or custom code.
int32 code = 1;
Expand All @@ -40,7 +41,7 @@ message Status {

message Partition {
// enum path, odps
string type = 1;
string type = 1;
repeated DataColumn fields = 2;
}

Expand All @@ -56,4 +57,4 @@ message DataColumn {
enum FileFormat {
UNKNOWN = 0;
CSV = 1;
}
}
66 changes: 39 additions & 27 deletions proto/kuscia/domaindata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,42 +22,48 @@ option go_package = "github.com/secretflow/kuscia/proto/api/v1alpha1/datamesh";
option java_package = "org.secretflow.v1alpha1.kusciaapi";

service DomainDataService {
rpc CreateDomainData(CreateDomainDataRequest) returns (CreateDomainDataResponse);
rpc CreateDomainData(CreateDomainDataRequest)
returns (CreateDomainDataResponse);

rpc QueryDomainData(QueryDomainDataRequest) returns (QueryDomainDataResponse);

rpc UpdateDomainData(UpdateDomainDataRequest) returns (UpdateDomainDataResponse);
rpc UpdateDomainData(UpdateDomainDataRequest)
returns (UpdateDomainDataResponse);

rpc DeleteDomainData(DeleteDomainDataRequest) returns (DeleteDomainDataResponse);
rpc DeleteDomainData(DeleteDomainDataRequest)
returns (DeleteDomainDataResponse);
}

message CreateDomainDataRequest {
RequestHeader header = 1;
// Optional, The domaindata_id would be generated by server if the domaindata_id is empty.
// The unique identity of domaindata, it couldn't duplicate in the same domain.
// Optional, The domaindata_id would be generated by server if the
// domaindata_id is empty. The unique identity of domaindata, it couldn't
// duplicate in the same domain.
string domaindata_id = 2;
// The human readable, it could duplicate in the domain.
string name = 3;
// Enum: table,model,rule,report,unknown
string type = 4;
// The relative_uri is relative to the datasource URI, The datasourceURI appends relative_uri is the domaindataURI.
// e.g. the relative_uri is "train/table.csv"
// The relative_uri is relative to the datasource URI, The datasourceURI
// appends relative_uri is the domaindataURI. e.g. the relative_uri is
// "train/table.csv"
// the URI of datasource is "/home/data"
// the URI of domaindata is "/home/data/train/table.csv"
string relative_uri = 5;
// Optional, server would use default datasource if datasource_id is empty.
// The datasource is where the domain is stored.
string datasource_id = 6;
// Optional, The attributes of the domaindata, this field use as a extra field, User could set
// this field to any data what they need.
// Optional, The attributes of the domaindata, this field use as a extra
// field, User could set this field to any data what they need.
map<string, string> attributes = 7;
// Optional, Partition not support now
Partition partition = 8;
// This field must be set if the type is 'table',
// the columns describe the table's schema information.
repeated DataColumn columns = 9;
// Optional , The vendor is the one who outputs the domain data, it may be the SecretFlow engine,
// another vendor's engine, or manually registered. it's could be manual, secretflow or other vendor string.
// Optional , The vendor is the one who outputs the domain data, it may be the
// SecretFlow engine, another vendor's engine, or manually registered. it's
// could be manual, secretflow or other vendor string.
string vendor = 10;
}

Expand All @@ -79,23 +85,25 @@ message UpdateDomainDataRequest {
string name = 3;
// Enum: table,model,rule,report,unknown
string type = 4;
// The relative_uri is relative to the datasource URI, The datasourceURI appends relative_uri is the domaindataURI.
// e.g. the relative_uri is "train/table.csv"
// The relative_uri is relative to the datasource URI, The datasourceURI
// appends relative_uri is the domaindataURI. e.g. the relative_uri is
// "train/table.csv"
// the URI of datasource is "/home/data"
// the URI of domaindata is "/home/data/train/table.csv"
string relative_uri = 5;
// The datasource is where the domain is stored.
string datasource_id = 6;
// The attributes of the domaindata, this field use as a extra field, User could set
// this field to any data that they need.
// The attributes of the domaindata, this field use as a extra field, User
// could set this field to any data that they need.
map<string, string> attributes = 7;
// Partition not support now
Partition partition = 8;
// columns: the columns' information of the table data.
// this field must be set if the type is 'table'
repeated DataColumn columns = 9;
// The vendor is the one who outputs the domain data, it may be the secretFlow engine,
// another vendor's engine, or manually registered. enum manual,secretflow.
// The vendor is the one who outputs the domain data, it may be the secretFlow
// engine, another vendor's engine, or manually registered. enum
// manual,secretflow.
string vendor = 10;
}

Expand All @@ -119,36 +127,40 @@ message QueryDomainDataRequest {
}

message QueryDomainDataResponse {
Status status = 1;
Status status = 1;
DomainData data = 2;
}

message DomainData {
// domaindata_id is the identification of domaindata, it couldn't duplicate in the domain.
// domaindata_id is the identification of domaindata, it couldn't duplicate in
// the domain.
string domaindata_id = 1;
// The human readable, it could duplicate in the domain.
string name = 2;
// domaindata type , Enum: table,model,rule,report,unknown
string type = 3;
// The relative_uri is relative to the datasource URI, The datasourceURI appends relative_uri is the domaindataURI.
// e.g. the relative_uri is "train/table.csv"
// The relative_uri is relative to the datasource URI, The datasourceURI
// appends relative_uri is the domaindataURI. e.g. the relative_uri is
// "train/table.csv"
// the URI of datasource is "/home/data"
// the URI of domaindata is "/home/data/train/table.csv"
string relative_uri = 4;
// datasource_id is the identity of the domaindatasource, the domaindatasource that storage the domaindata file.
// datasource_id is the identity of the domaindatasource, the domaindatasource
// that storage the domaindata file.
string datasource_id = 5;
// attributes : the attributes of the domaindata, this field use as a extra field, User could set
// this field to any data what they need.
// attributes : the attributes of the domaindata, this field use as a extra
// field, User could set this field to any data what they need.
map<string, string> attributes = 6;
// Partition not support now,
Partition partition = 7;
// This field must be set if the type is 'table',
// The columns describe the table's schema information.
repeated DataColumn columns = 8;
// The vendor is the one who outputs the domain data, it may be the SecretFlow engine,
// another vendor's engine, or manually registered. it's could be manual, secretflow or other vendor string.
// The vendor is the one who outputs the domain data, it may be the SecretFlow
// engine, another vendor's engine, or manually registered. it's could be
// manual, secretflow or other vendor string.
string vendor = 9;

// if the data is stored with file format, file_format describe file format
FileFormat file_format = 10;
}
}
18 changes: 11 additions & 7 deletions proto/kuscia/domaindatasource.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ option go_package = "github.com/secretflow/kuscia/proto/api/v1alpha1/datamesh";
option java_package = "org.secretflow.v1alpha1.kusciaapi";

service DomainDataSourceService {
rpc CreateDomainDataSource(CreateDomainDataSourceRequest) returns (CreateDomainDataSourceResponse);
rpc CreateDomainDataSource(CreateDomainDataSourceRequest)
returns (CreateDomainDataSourceResponse);

rpc QueryDomainDataSource(QueryDomainDataSourceRequest) returns (QueryDomainDataSourceResponse);
rpc QueryDomainDataSource(QueryDomainDataSourceRequest)
returns (QueryDomainDataSourceResponse);

rpc UpdateDomainDataSource(UpdateDomainDataSourceRequest) returns (UpdateDomainDataSourceResponse);
rpc UpdateDomainDataSource(UpdateDomainDataSourceRequest)
returns (UpdateDomainDataSourceResponse);

rpc DeleteDomainDataSource(DeleteDomainDataSourceRequest) returns (DeleteDomainDataSourceResponse);
rpc DeleteDomainDataSource(DeleteDomainDataSourceRequest)
returns (DeleteDomainDataSourceResponse);
}

message CreateDomainDataSourceRequest {
Expand Down Expand Up @@ -77,7 +81,7 @@ message QueryDomainDataSourceRequest {
}

message QueryDomainDataSourceResponse {
Status status = 1;
Status status = 1;
DomainDataSource data = 2;
}

Expand Down Expand Up @@ -128,7 +132,7 @@ message OssDataSourceInfo {
// access secret
string access_key_secret = 5;
// virtualhost is the same as AliyunOSS's virtualhost , default true
bool virtualhost = 6;
bool virtualhost = 6;
// optional enum[s3v2,s3v4]
string version = 7;
// optional enum[oss,minio] , default oss
Expand All @@ -153,4 +157,4 @@ message OdpsDataSourceInfo {
string project = 2;
string access_key_id = 3;
string access_key_secret = 4;
}
}
29 changes: 18 additions & 11 deletions proto/kuscia/flightdm.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,26 @@ message CSVWriteOptions {
}

// write options varies by file format
message FileWriteOptions {
message FileWriteOptions {
oneof Options {
CSVWriteOptions csv_options = 1;
}
}

// ContentFormat describe the schema of ArrowRecordBatch response from DataProxy
// Only for Table Type, the schema is defined by DomainData's columns
// And for rest types, the schema is a dummy schema which only contains one column of arrow::Binary type
enum ContentType{
// And for rest types, the schema is a dummy schema which only contains one
// column of arrow::Binary type
enum ContentType {
Table = 0;
// read raw data from datasource
RAW = 1;
// convert data to csv file format, and return file content as dummy schema
CSV = 2;
}

// call with GetSchema, return SchemaResult, extension attributes are set with metadata
// call with GetSchema, return SchemaResult, extension attributes are set with
// metadata
message CommandGetDomainDataSchema {
string domaindata_id = 1;
}
Expand All @@ -64,8 +66,8 @@ message CommandDomainDataQuery {
string partition_spec = 5;
}

// call GetFlightInfo with CommandDomainDataUpdate, return TicketDomainDataQuery which is an update query
// and then call DoPut with TicketDomainDataQuery
// call GetFlightInfo with CommandDomainDataUpdate, return TicketDomainDataQuery
// which is an update query and then call DoPut with TicketDomainDataQuery
message CommandDomainDataUpdate {
string domaindata_id = 1;
// create an nonexistent domaindata and get a update ticket
Expand All @@ -84,7 +86,8 @@ message TicketDomainDataQuery {
string domaindata_handle = 1;
}

// call DoAction with ActionCreateDomainDataRequest, return ActionCreateDomainDataResponse
// call DoAction with ActionCreateDomainDataRequest, return
// ActionCreateDomainDataResponse
message ActionCreateDomainDataRequest {
CreateDomainDataRequest request = 1;
}
Expand All @@ -93,7 +96,8 @@ message ActionCreateDomainDataResponse {
CreateDomainDataResponse response = 1;
}

// call DoAction with ActionQueryDomainDataRequest, return ActionQueryDomainDataResponse
// call DoAction with ActionQueryDomainDataRequest, return
// ActionQueryDomainDataResponse
message ActionQueryDomainDataRequest {
QueryDomainDataRequest request = 1;
}
Expand All @@ -102,7 +106,8 @@ message ActionQueryDomainDataResponse {
QueryDomainDataResponse response = 1;
}

// call DoAction with ActionUpdateDomainDataRequest, return ActionUpdateDomainDataResponse
// call DoAction with ActionUpdateDomainDataRequest, return
// ActionUpdateDomainDataResponse
message ActionUpdateDomainDataRequest {
UpdateDomainDataRequest request = 1;
}
Expand All @@ -111,7 +116,8 @@ message ActionUpdateDomainDataResponse {
UpdateDomainDataResponse response = 1;
}

// call DoAction with ActionDeleteDomainDataRequest, return ActionDeleteDomainDataResponse
// call DoAction with ActionDeleteDomainDataRequest, return
// ActionDeleteDomainDataResponse
message ActionDeleteDomainDataRequest {
DeleteDomainDataRequest request = 1;
// not supported now
Expand All @@ -122,7 +128,8 @@ message ActionDeleteDomainDataResponse {
DeleteDomainDataResponse response = 1;
}

// call DoAction with ActionCreateDomainDataSourceRequest, return ActionCreateDomainDataSourceResponse
// call DoAction with ActionCreateDomainDataSourceRequest, return
// ActionCreateDomainDataSourceResponse
message ActionCreateDomainDataSourceRequest {
CreateDomainDataSourceRequest request = 1;
}
Expand Down
20 changes: 17 additions & 3 deletions proto/kuscia/flightinner.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2023 Ant Group Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package kuscia.proto.api.v1alpha1.datamesh;
Expand All @@ -10,12 +24,12 @@ option java_package = "org.secretflow.v1alpha1.kusciaapi";

message CommandDataMeshQuery {
CommandDomainDataQuery query = 1;
DomainData domaindata = 2 ;
DomainData domaindata = 2;
DomainDataSource datasource = 3;
}

message CommandDataMeshUpdate {
CommandDomainDataUpdate update = 1;
DomainData domaindata = 2 ;
DomainData domaindata = 2;
DomainDataSource datasource = 3;
}
}

0 comments on commit ee4309c

Please sign in to comment.