Skip to content

Commit ebbd643

Browse files
woopChen Zhiling
authored andcommitted
Update Protos, Java SDK, Golang SDK to support Project Namespacing (#370)
1 parent f2d4db5 commit ebbd643

30 files changed

Lines changed: 1714 additions & 613 deletions

core/src/main/java/feast/core/service/SpecService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ public GetFeatureSetResponse getFeatureSet(GetFeatureSetRequest request)
139139
* Get featureSets matching the feature name and version provided in the filter. If the feature
140140
* name is not provided, the method will return all featureSets currently registered to Feast.
141141
*
142-
* <p>The feature set name in the filter accepts any valid regex string. All matching featureSets
143-
* will be returned.
142+
* <p>The feature set name in the filter accepts an asterisk as a wildcard. All matching
143+
* featureSets will be returned.
144144
*
145145
* <p>The version filter is optional; If not provided, this method will return all featureSet
146146
* versions of the featureSet name provided. Valid version filters should optionally contain a

protos/feast/core/CoreService.proto

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,28 @@ service CoreService {
5858
//
5959
// If the changes are valid, core will return the given store configuration in response, and
6060
// start or update the necessary feature population jobs for the updated store.
61-
rpc UpdateStore(UpdateStoreRequest) returns (UpdateStoreResponse);
61+
rpc UpdateStore (UpdateStoreRequest) returns (UpdateStoreResponse);
62+
63+
// Creates a project. Projects serve as namespaces within which resources like features will be
64+
// created. Both feature set names as well as field names must be unique within a project. Project
65+
// names themselves must be globally unique.
66+
rpc CreateProject (CreateProjectRequest) returns (CreateProjectResponse);
67+
68+
// Archives a project. Archived projects will continue to exist and function, but won't be visible
69+
// through the Core API. Any existing ingestion or serving requests will continue to function,
70+
// but will result in warning messages being logged. It is not possible to unarchive a project
71+
// through the Core API
72+
rpc ArchiveProject (ArchiveProjectRequest) returns (ArchiveProjectResponse);
73+
74+
// Lists all projects active projects.
75+
rpc ListProjects (ListProjectsRequest) returns (ListProjectsResponse);
6276
}
6377

6478
// Request for a single feature set
6579
message GetFeatureSetRequest {
80+
// Name of project the feature set belongs to (required)
81+
string project = 3;
82+
6683
// Name of feature set (required).
6784
string name = 1;
6885

@@ -77,21 +94,25 @@ message GetFeatureSetResponse {
7794

7895
// Retrieves details for all versions of a specific feature set
7996
message ListFeatureSetsRequest {
97+
Filter filter = 1;
98+
8099
message Filter {
81-
// Name of the desired feature set. Valid regex strings are allowed.
100+
// Name of project that the feature sets belongs to.
101+
string project = 3;
102+
103+
// Name of the desired feature set. Asterisks can be used as wildcards in the name.
82104
// e.g.
83-
// - .* can be used to match all feature sets
84-
// - my-project-.* can be used to match all features prefixed by "my-project"
105+
// - * can be used to match all feature sets
106+
// - my-feature-set* can be used to match all features prefixed by "my-feature-set"
85107
string feature_set_name = 1;
108+
86109
// Version of the desired feature set. Either a number or valid expression can be provided.
87110
// e.g.
88111
// - 1 will match version 1 exactly
89112
// - >=1 will match all versions greater or equal to 1
90113
// - <10 will match all versions less than 10
91114
string feature_set_version = 2;
92115
}
93-
94-
Filter filter = 1;
95116
}
96117

97118
message ListFeatureSetsResponse {
@@ -133,7 +154,8 @@ message ApplyFeatureSetResponse {
133154
Status status = 2;
134155
}
135156

136-
message GetFeastCoreVersionRequest {}
157+
message GetFeastCoreVersionRequest {
158+
}
137159

138160
message GetFeastCoreVersionResponse {
139161
string version = 1;
@@ -153,4 +175,34 @@ message UpdateStoreResponse {
153175
}
154176
feast.core.Store store = 1;
155177
Status status = 2;
178+
}
179+
180+
// Request to create a project
181+
message CreateProjectRequest {
182+
// Name of project (required)
183+
string name = 1;
184+
}
185+
186+
// Response for creation of a project
187+
message CreateProjectResponse {
188+
}
189+
190+
// Request for the archival of a project
191+
message ArchiveProjectRequest {
192+
// Name of project to be archived
193+
string name = 1;
194+
}
195+
196+
// Response for archival of a project
197+
message ArchiveProjectResponse {
198+
}
199+
200+
// Request for listing of projects
201+
message ListProjectsRequest {
202+
}
203+
204+
// Response for listing of projects
205+
message ListProjectsResponse {
206+
// List of project names (archived projects are filtered out)
207+
repeated string projects = 1;
156208
}

protos/feast/core/FeatureSet.proto

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
//
1616

1717
syntax = "proto3";
18-
1918
package feast.core;
20-
2119
option java_package = "feast.core";
2220
option java_outer_classname = "FeatureSetProto";
2321
option go_package = "github.com/gojek/feast/sdk/go/protos/feast/core";
@@ -30,18 +28,11 @@ import "google/protobuf/timestamp.proto";
3028
message FeatureSet {
3129
// User-specified specifications of this feature set.
3230
FeatureSetSpec spec = 1;
33-
3431
// System-populated metadata for this feature set.
3532
FeatureSetMeta meta = 2;
3633
}
3734

3835
message FeatureSetSpec {
39-
// Name of the featureSet. Must be unique.
40-
string name = 1;
41-
42-
// FeatureSet version.
43-
int32 version = 2;
44-
4536
// List of entities contained within this featureSet.
4637
// This allows the feature to be used during joins between feature sets.
4738
// If the featureSet is ingested into a store that supports keys, this value
@@ -77,8 +68,16 @@ message FeatureSpec {
7768
feast.types.ValueType.Enum value_type = 2;
7869
}
7970

80-
8171
message FeatureSetMeta {
72+
// Name of project that this feature set belongs to.
73+
string project = 3;
74+
75+
// Name of the feature set. Must be unique.
76+
string name = 4;
77+
78+
// Feature set version.
79+
int32 version = 5;
80+
8281
// Created timestamp of this specific feature set.
8382
google.protobuf.Timestamp created_timestamp = 1;
8483

@@ -95,4 +94,4 @@ enum FeatureSetStatus {
9594
STATUS_INVALID = 0;
9695
STATUS_PENDING = 1;
9796
STATUS_READY = 2;
98-
}
97+
}

protos/feast/core/Store.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ message Store {
123123
}
124124

125125
message Subscription {
126+
// Name of project where subscribed feature sets can be found. All feature sets must be located
127+
// within this project. Wildcards are not supported.
128+
string project = 3;
129+
126130
// Name of featureSet to subscribe to. This field supports any valid basic POSIX regex,
127131
// e.g. customer_.* or .*
128132
// https://www.regular-expressions.info/posix.html

protos/feast/serving/ServingService.proto

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ message GetFeastServingInfoResponse {
6262
string job_staging_location = 10;
6363
}
6464

65-
message FeatureSetRequest {
66-
// Feature set name
67-
string name = 1;
65+
message FeatureReference {
66+
// Project name
67+
string project = 1;
6868

69-
// Feature set version
70-
int32 version = 2;
69+
// Feature name
70+
string name = 2;
7171

72-
// Features that should be retrieved from this feature set
73-
repeated string feature_names = 3;
72+
// Feature version
73+
int32 version = 3;
7474

7575
// The features will be retrieved if:
7676
// entity_timestamp - max_age <= event_timestamp <= entity_timestamp
@@ -81,8 +81,8 @@ message FeatureSetRequest {
8181
}
8282

8383
message GetOnlineFeaturesRequest {
84-
// List of feature sets and their features that are being retrieved
85-
repeated FeatureSetRequest feature_sets = 1;
84+
// List of features that are being retrieved
85+
repeated FeatureReference features = 4;
8686

8787
// List of entity rows, containing entity id and timestamp data.
8888
// Used during retrieval of feature rows and for joining feature
@@ -104,8 +104,8 @@ message GetOnlineFeaturesRequest {
104104
}
105105

106106
message GetBatchFeaturesRequest {
107-
// List of feature sets and their features that are being retrieved.
108-
repeated FeatureSetRequest feature_sets = 1;
107+
// List of features that are being retrieved
108+
repeated FeatureReference features = 3;
109109

110110
// Source of the entity dataset containing the timestamps and entity keys to retrieve
111111
// features for.

sdk/go/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.13
44

55
require (
66
github.com/golang/protobuf v1.3.2
7-
github.com/google/go-cmp v0.3.0
7+
github.com/google/go-cmp v0.3.1
88
github.com/opentracing/opentracing-go v1.1.0
99
github.com/stretchr/testify v1.4.0 // indirect
1010
go.opencensus.io v0.22.1

sdk/go/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
1616
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
1717
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
1818
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
19+
github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg=
20+
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
1921
github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU=
2022
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
2123
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=

0 commit comments

Comments
 (0)