Repository navigation
Expand file tree
/
Copy pathServingService.proto
More file actions
228 lines (185 loc) · 7.54 KB
/
Copy pathServingService.proto
File metadata and controls
228 lines (185 loc) · 7.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
/*
* Copyright 2018 The Feast Authors
*
* 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
*
* https://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 feast.serving;
import "google/protobuf/timestamp.proto";
import "feast/types/Value.proto";
import "tensorflow_metadata/proto/v0/statistics.proto";
option java_package = "feast.proto.serving";
option java_outer_classname = "ServingAPIProto";
option go_package = "github.com/feast-dev/feast/sdk/go/protos/feast/serving";
service ServingService {
// Get information about this Feast serving.
rpc GetFeastServingInfo (GetFeastServingInfoRequest) returns (GetFeastServingInfoResponse);
// Get online features synchronously.
rpc GetOnlineFeatures (GetOnlineFeaturesRequest) returns (GetOnlineFeaturesResponse);
// Get batch features asynchronously.
//
// The client should check the status of the returned job periodically by
// calling ReloadJob to determine if the job has completed successfully
// or with an error. If the job completes successfully i.e.
// status = JOB_STATUS_DONE with no error, then the client can check
// the file_uris for the location to download feature values data.
// The client is assumed to have access to these file URIs.
rpc GetBatchFeatures (GetBatchFeaturesRequest) returns (GetBatchFeaturesResponse);
// Get the latest job status for batch feature retrieval.
rpc GetJob (GetJobRequest) returns (GetJobResponse);
}
message GetFeastServingInfoRequest {}
message GetFeastServingInfoResponse {
// Feast version of this serving deployment.
string version = 1;
// Type of serving deployment, either ONLINE or BATCH. Different store types support different
// feature retrieval methods.
FeastServingType type = 2;
// Note: Batch specific options start from 10.
// Staging location for this serving store, if any.
string job_staging_location = 10;
}
message FeatureReference {
// Project name. This field is optional, if unspecified will default to 'default'.
string project = 1;
// Feature name
string name = 2;
// Feature set name specifying the feature set of this referenced feature.
// This field is optional if the feature referenced is unique across the project
// in which case the feature set would be automatically infered
string feature_set = 5;
// Feature version and max_age was removed in v0.5.0
reserved 3, 4;
}
message GetOnlineFeaturesRequest {
// List of features that are being retrieved
repeated FeatureReference features = 4;
// List of entity rows, containing entity id and timestamp data.
// Used during retrieval of feature rows and for joining feature
// rows into a final dataset
repeated EntityRow entity_rows = 2;
// Option to omit entities from the response. If true, only feature
// values will be returned.
bool omit_entities_in_response = 3;
// Optional field to specify project name override. If specified, uses the
// given project for retrieval. Overrides the projects specified in
// Feature References if both are specified.
string project = 5;
message EntityRow {
// Request timestamp of this row. This value will be used,
// together with maxAge, to determine feature staleness.
google.protobuf.Timestamp entity_timestamp = 1;
// Map containing mapping of entity name to entity value.
map<string,feast.types.Value> fields = 2;
}
}
message GetBatchFeaturesRequest {
// List of features that are being retrieved
repeated FeatureReference features = 3;
// Source of the entity dataset containing the timestamps and entity keys to retrieve
// features for.
DatasetSource dataset_source = 2;
// Compute statistics for the dataset retrieved
bool compute_statistics = 4;
}
message GetOnlineFeaturesResponse {
// Feature values retrieved from feast.
repeated FieldValues field_values = 1;
message FieldValues {
// Map of feature or entity name to feature/entity values.
// Timestamps are not returned in this response.
map<string, feast.types.Value> fields = 1;
// Map of feature or entity name to feature/entity statuses/metadata.
map<string, FieldStatus> statuses = 2;
}
enum FieldStatus {
// Status is unset for this field.
INVALID = 0;
// Field value is present for this field and age is within max age.
PRESENT = 1;
// Values could be found for entity key and age is within max age, but
// this field value is assigned a value on ingestion into feast.
NULL_VALUE = 2;
// Entity key did not return any values as they do not exist in Feast.
// This could suggest that the feature values have not yet been ingested
// into feast or the ingestion failed.
NOT_FOUND = 3;
// Values could be found for entity key, but field values are outside the maximum
// allowable range.
OUTSIDE_MAX_AGE = 4;
}
}
message GetBatchFeaturesResponse {
Job job = 1;
}
message GetJobRequest {
Job job = 1;
}
message GetJobResponse {
Job job = 1;
}
enum FeastServingType {
FEAST_SERVING_TYPE_INVALID = 0;
// Online serving receives entity data directly and synchronously and will
// respond immediately.
FEAST_SERVING_TYPE_ONLINE = 1;
// Batch serving receives entity data asynchronously and orchestrates the
// retrieval through a staging location.
FEAST_SERVING_TYPE_BATCH = 2;
}
enum JobType {
JOB_TYPE_INVALID = 0;
JOB_TYPE_DOWNLOAD = 1;
}
enum JobStatus {
JOB_STATUS_INVALID = 0;
JOB_STATUS_PENDING = 1;
JOB_STATUS_RUNNING = 2;
JOB_STATUS_DONE = 3;
}
enum DataFormat {
DATA_FORMAT_INVALID = 0;
DATA_FORMAT_AVRO = 1;
}
message Job {
string id = 1;
// Output only. The type of the job.
JobType type = 2;
// Output only. Current state of the job.
JobStatus status = 3;
// Output only. If not empty, the job has failed with this error message.
string error = 4;
// Output only. The list of URIs for the files to be downloaded or
// uploaded (depends on the job type) for this particular job.
repeated string file_uris = 5;
// Output only. The data format for all the files.
// For CSV format, the files contain both feature values and a column header.
DataFormat data_format = 6;
// Output only. The statistics computed over
// the retrieved dataset. Only available for BigQuery stores.
tensorflow.metadata.v0.DatasetFeatureStatisticsList dataset_feature_statistics_list = 7;
}
message DatasetSource {
oneof dataset_source {
// File source to load the dataset from.
FileSource file_source = 1;
}
message FileSource {
// URIs to retrieve the dataset from, e.g. gs://bucket/directory/object.csv. Wildcards are
// supported. This data must be compatible to be uploaded to the serving store, and also be
// accessible by this serving instance.
repeated string file_uris = 1;
// Format of the data. Currently only avro is supported.
DataFormat data_format = 2;
}
}