1+ //
2+ // Copyright 2018 The Feast Authors
3+ //
4+ // Licensed under the Apache License, Version 2.0 (the "License");
5+ // you may not use this file except in compliance with the License.
6+ // You may obtain a copy of the License at
7+ //
8+ // https://www.apache.org/licenses/LICENSE-2.0
9+ //
10+ // Unless required by applicable law or agreed to in writing, software
11+ // distributed under the License is distributed on an "AS IS" BASIS,
12+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ // See the License for the specific language governing permissions and
14+ // limitations under the License.
15+ //
16+
17+ syntax = "proto3" ;
18+ package feast.core ;
19+
20+ option go_package = "github.com/feast-dev/feast/sdk/go/protos/feast/core" ;
21+ option java_outer_classname = "JobServiceProto" ;
22+ option java_package = "feast.proto.core" ;
23+
24+ import "google/protobuf/timestamp.proto" ;
25+ import "feast/core/DataSource.proto" ;
26+ import "feast/serving/ServingService.proto" ;
27+
28+ service JobService {
29+ // Start job to ingest data from offline store into online store
30+ rpc StartOfflineToOnlineIngestionJob (StartOfflineToOnlineIngestionJobRequest ) returns (StartOfflineToOnlineIngestionJobResponse );
31+
32+ // Produce a training dataset, return a job id that will provide a file reference
33+ rpc GetHistoricalFeatures (GetHistoricalFeaturesRequest ) returns (GetHistoricalFeaturesResponse );
34+
35+ // Start job to ingest data from stream into online store
36+ rpc StartStreamToOnlineIngestionJob (StartStreamToOnlineIngestionJobRequest ) returns (StartStreamToOnlineIngestionJobResponse );
37+
38+ // List all types of jobs
39+ rpc ListJobs (ListJobsRequest ) returns (ListJobsResponse );
40+
41+ // Stop a single job
42+ rpc StopJob (StopJobRequest ) returns (StopJobResponse );
43+
44+ // Get details of a single job
45+ rpc GetJob (GetJobRequest ) returns (GetJobResponse );
46+ }
47+
48+
49+ enum JobType {
50+ INVALID_JOB = 0 ;
51+ OFFLINE_TO_ONLINE_JOB = 1 ;
52+ STREAM_TO_ONLINE_JOB = 2 ;
53+ EXPORT_JOB = 4 ;
54+ }
55+
56+ enum JobStatus {
57+ JOB_STATUS_INVALID = 0 ;
58+ // The Job has be registered and waiting to get scheduled to run
59+ JOB_STATUS_PENDING = 1 ;
60+ // The Job is currently processing its task
61+ JOB_STATUS_RUNNING = 2 ;
62+ // The Job has successfully completed its task
63+ JOB_STATUS_DONE = 3 ;
64+ // The Job has encountered an error while processing its task
65+ JOB_STATUS_ERROR = 4 ;
66+ }
67+
68+ message Job {
69+ // Identifier of the Job
70+ string id = 1 ;
71+ // External Identifier of the Job assigned by the Spark executor
72+ string external_id = 2 ;
73+ // Type of the Job
74+ JobType type = 3 ;
75+ // Current job status
76+ JobStatus status = 4 ;
77+ // Timestamp on when the job was is created
78+ google.protobuf.Timestamp created_timestamp = 5 ;
79+ // Timestamp on when the job has stopped.
80+ google.protobuf.Timestamp stop_timestamp = 6 ;
81+
82+ message ExportJobMeta {
83+ // Glob of the exported files that should be retrieved to reconstruct
84+ // the dataframe with retrieved features.
85+ repeated string file_glob = 1 ;
86+ // The Historical Features request that triggered this export job
87+ GetHistoricalFeaturesRequest request = 2 ;
88+ }
89+
90+ message OfflineToOnlineMeta {
91+ // Reference to the Feature Table being populated by this job
92+ string project = 1 ;
93+ string table_name = 2 ;
94+ }
95+
96+ message StreamToOnlineMeta {
97+ // Reference to the Feature Table being populated by this job
98+ string project = 1 ;
99+ string table_name = 2 ;
100+ }
101+
102+ // JobType specific metadata on the job
103+ oneof meta {
104+ ExportJobMeta export = 7 ;
105+ OfflineToOnlineMeta offline_to_online = 8 ;
106+ StreamToOnlineMeta stream_to_online = 9 ;
107+ }
108+ }
109+
110+ // Ingest data from offline store into online store
111+ message StartOfflineToOnlineIngestionJobRequest {
112+ // Feature table to ingest
113+ string project = 1 ;
114+ string table_name = 2 ;
115+
116+ // Start of time range for source data from offline store
117+ google.protobuf.Timestamp start_date = 3 ;
118+
119+ // End of time range for source data from offline store
120+ google.protobuf.Timestamp end_date = 4 ;
121+ }
122+
123+ message StartOfflineToOnlineIngestionJobResponse {
124+ // Job ID assigned by Feast
125+ string id = 1 ;
126+ }
127+
128+ message GetHistoricalFeaturesRequest {
129+ // List of features that are being retrieved
130+ repeated feast.serving.FeatureReferenceV2 features = 1 ;
131+
132+ // Batch DataSource that can be used to obtain entity values for historical retrieval.
133+ // For each entity value, a feature value will be retrieved for that value/timestamp
134+ // Only 'BATCH_*' source types are supported.
135+ // Currently only BATCH_FILE source type is supported.
136+ DataSource entities_source = 2 ;
137+
138+ // Optional field to specify project name override. If specified, uses the
139+ // given project for retrieval. Overrides the projects specified in
140+ // Feature References if both are specified.
141+ string project = 3 ;
142+
143+ // Specifies the path in a bucket to write the exported feature data files
144+ // Export to AWS S3 - s3://path/to/features
145+ // Export to GCP GCS - gs://path/to/features
146+ string destination_path = 4 ;
147+ }
148+
149+ message GetHistoricalFeaturesResponse {
150+ // Export Job with ID assigned by Feast
151+ string id = 1 ;
152+ }
153+
154+ message StartStreamToOnlineIngestionJobRequest {
155+ // Feature table to ingest
156+ string project = 1 ;
157+ string table_name = 2 ;
158+ }
159+
160+ message StartStreamToOnlineIngestionJobResponse {
161+ // Job ID assigned by Feast
162+ string id = 1 ;
163+ }
164+
165+ message ListJobsRequest {
166+ Filter filter = 1 ;
167+ message Filter {
168+ // Filter jobs by job type
169+ JobType type = 1 ;
170+ // Filter jobs by current job status
171+ JobStatus status = 2 ;
172+ }
173+ }
174+
175+ message ListJobsResponse {
176+ repeated Job jobs = 1 ;
177+ }
178+
179+ message GetJobRequest {
180+ string job_id = 1 ;
181+ }
182+
183+ message GetJobResponse {
184+ Job job = 1 ;
185+ }
186+
187+ message RestartJobRequest {
188+ string job_id = 1 ;
189+ }
190+
191+ message RestartJobResponse {}
192+
193+ message StopJobRequest {
194+ string job_id = 1 ;
195+ }
196+
197+ message StopJobResponse {}
0 commit comments