You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/how-to-guides/running-feast-in-production.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -242,14 +242,12 @@ This service will provide an HTTP API with JSON I/O, which can be easily used wi
242
242
243
243
[Read more about this feature](../reference/alpha-aws-lambda-feature-server.md)
244
244
245
-
### 4.3. Java based Feature Server deployed on Kubernetes
245
+
### 4.3. Go feature server deployed on Kubernetes
246
246
247
-
For users with very latency-sensitive and high QPS use-cases, Feast offers a high-performance Java feature server.
248
-
Besides the benefits of running on JVM, this implementation also provides a gRPC API, which guarantees good connection utilization and
249
-
small request / response body size (compared to JSON).
250
-
You will need the Feast Java SDK to retrieve features from this service. This SDK wraps all the gRPC logic for you and provides more convenient APIs.
247
+
For users with very latency-sensitive and high QPS use-cases, Feast offers a high-performance [Go feature server](../reference/feature-servers/go-feature-server.md).
248
+
It can use either HTTP or gRPC.
251
249
252
-
The Java based feature server can be deployed to Kubernetes cluster via Helm charts in a few simple steps:
250
+
The Go feature server can be deployed to a Kubernetes cluster via Helm charts in a few simple steps:
253
251
254
252
1. Install [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) and [helm 3](https://helm.sh/)
255
253
2. Add the Feast Helm repository and download the latest charts:
This chart will deploy two services: `feature-server` and `transformation-service`.
268
-
Both must have read access to the registry file on cloud storage. Both will keep a copy of the registry in their memory and periodically refresh it, so expect some delays in update propagation in exchange for better performance.
265
+
This chart will deploy a single service.
266
+
The service must have read access to the registry file on cloud storage.
267
+
It will keep a copy of the registry in their memory and periodically refresh it, so expect some delays in update propagation in exchange for better performance.
268
+
In order for the Go feature server to be enabled, you should set `go_feature_serving: True` in the `feature_store.yaml`.
269
269
270
270
#### Load balancing
271
271
272
-
The next step would be to install an L7 Load Balancer (eg, [Envoy](https://www.envoyproxy.io/)) in front of the Java feature server.
272
+
The next step would be to install an L7 Load Balancer (eg, [Envoy](https://www.envoyproxy.io/)) in front of the Go feature server.
273
273
For seamless integration with Kubernetes (including services created by Feast Helm chart) we recommend using [Istio](https://istio.io/) as Envoy's orchestrator.
274
274
275
275
## 5. Ingesting features from a stream source
@@ -344,8 +344,8 @@ Summarizing it all together we want to show several options of architecture that
344
344
* Feast SDK is being triggered by CI (eg, Github Actions). It applies the latest changes from the feature repo to the Feast registry
345
345
* Airflow manages materialization jobs to ingest data from DWH to the online store periodically
346
346
* For the stream ingestion Feast Python SDK is used in the existing Spark / Beam pipeline
347
-
* Online features are served via either a Python feature server or a high performance Java feature server
348
-
* Both the Java feature server and the transformation server are deployed on Kubernetes cluster (via Helm charts)
347
+
* Online features are served via either a Python feature server or a high performance Go feature server
348
+
* The Go feature server can be deployed on a Kubernetes cluster (via Helm charts)
349
349
* Feast Python SDK is called locally to generate a training dataset
350
350
351
351

The Go feature server is an HTTP/gRPC endpoint that serves features.
6
+
It is written in Go, and is therefore significantly faster than the Python feature server.
7
+
See this [blog post](https://feast.dev/blog/go-feature-server-benchmarks/) for more details on the comparison between Python and Go.
8
+
In general, we recommend the Go feature server for all production use cases that require extremely low-latency feature serving.
9
+
Currently only the Redis and SQLite online stores are supported.
10
+
11
+
## CLI
12
+
13
+
By default, the Go feature server is turned off.
14
+
To turn it on you can add `go_feature_serving: True` to your `feature_store.yaml`:
15
+
16
+
{% code title="feature_store.yaml" %}
17
+
```yaml
18
+
project: my_feature_repo
19
+
registry: data/registry.db
20
+
provider: local
21
+
online_store:
22
+
type: redis
23
+
connection_string: "localhost:6379"
24
+
go_feature_serving: True
25
+
```
26
+
{% endcode %}
27
+
28
+
Then the `feast serve` CLI command will start the Go feature server.
29
+
As with Python, the Go feature server uses port 6566 by default; the port be overridden with a `--port` flag.
30
+
Moreover, the server uses HTTP by default, but can be set to use gRPC with `--type=grpc`.
31
+
32
+
Alternatively, if you wish to experiment with the Go feature server instead of permanently turning it on, you can just run `feast serve --go`.
33
+
34
+
## Installation
35
+
36
+
The Go component comes pre-compiled when you install Feast with Python versions 3.8-3.10 on macOS or Linux (on x86).
37
+
In order to install the additional Python dependencies, you should install Feast with
38
+
```
39
+
pip install feast[go]
40
+
```
41
+
You must also install the Apache Arrow C++ libraries.
42
+
This is because the Go feature server uses the cgo memory allocator from the Apache Arrow C++ library for interoperability between Go and Python, to prevent memory from being accidentally garbage collected when executing on-demand feature views.
43
+
You can read more about the usage of the cgo memory allocator in these [docs](https://pkg.go.dev/github.com/apache/arrow/go/[email protected]/cdata#ExportArrowRecordBatch).
44
+
45
+
For macOS, run `brew install apache-arrow`.
46
+
For linux users, you have to install `libarrow-dev`.
For developers, if you want to build from source, run `make compile-go-lib` to build and compile the go server. In order to build the go binaries, you will need to install the `apache-arrow` c++ libraries.
56
+
57
+
## Alpha features
58
+
59
+
### Feature logging
60
+
61
+
The Go feature server can log all requested entities and served features to a configured destination inside an offline store.
62
+
This allows users to create new datasets from features served online. Those datasets could be used for future trainings or for
63
+
feature validations. To enable feature logging we need to edit `feature_store.yaml`:
64
+
```yaml
65
+
project: my_feature_repo
66
+
registry: data/registry.db
67
+
provider: local
68
+
online_store:
69
+
type: redis
70
+
connection_string: "localhost:6379"
71
+
go_feature_serving: True
72
+
feature_server:
73
+
feature_logging:
74
+
enable: True
75
+
```
76
+
77
+
Feature logging configuration in `feature_store.yaml` also allows to tweak some low-level parameters to achieve the best performance:
78
+
```yaml
79
+
feature_server:
80
+
feature_logging:
81
+
enable: True
82
+
flush_interval_secs: 300
83
+
write_to_disk_interval_secs: 30
84
+
emit_timeout_micro_secs: 10000
85
+
queue_capacity: 10000
86
+
```
87
+
All these parameters are optional.
88
+
89
+
### Python SDK retrieval
90
+
91
+
The logic for the Go feature server can also be used to retrieve features during a Python `get_online_features` call.
92
+
To enable this behavior, you must add `go_feature_retrieval: True` to your `feature_store.yaml`.
93
+
You must also have all the dependencies installed as detailed above.
Copy file name to clipboardExpand all lines: docs/reference/feature-servers/python-feature-server.md
+13-16Lines changed: 13 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,23 +2,22 @@
2
2
3
3
## Overview
4
4
5
-
The feature server is an HTTP endpoint that serves features with JSON I/O. This enables users to write + read features from Feast online stores using any programming language that can make HTTP requests.
5
+
The Python feature server is an HTTP endpoint that serves features with JSON I/O. This enables users to write and read features from the online store using any programming language that can make HTTP requests.
6
6
7
7
## CLI
8
8
9
-
There is a CLI command that starts the server: `feast serve`. By default, Feast uses port 6566; the port be overridden by a `--port` flag.
9
+
There is a CLI command that starts the server: `feast serve`. By default, Feast uses port 6566; the port be overridden with a `--port` flag.
10
10
11
11
## Deploying as a service
12
12
13
-
One can also deploy a feature server by building a docker image that bundles in the project's `feature_store.yaml`. See [helm chart](https://github.com/feast-dev/feast/blob/master/infra/charts/feast-python-server) for example.
14
-
15
-
A [remote feature server](../alpha-aws-lambda-feature-server.md) on AWS Lambda is available. A remote feature server on GCP Cloud Run is currently being developed.
13
+
One can deploy a feature server by building a docker image that bundles in the project's `feature_store.yaml`. See this [helm chart](https://github.com/feast-dev/feast/blob/master/infra/charts/feast-python-server) for an example.
16
14
15
+
A [remote feature server](../alpha-aws-lambda-feature-server.md) on AWS Lambda is also available.
17
16
18
17
## Example
19
18
20
19
### Initializing a feature server
21
-
Here's the local feature server usage example with the local template:
20
+
Here's an example of how to start the Python feature server with a local feature repo:
22
21
23
22
```bash
24
23
$ feast init feature_repo
@@ -27,9 +26,11 @@ Creating a new Feast repository in /home/tsotne/feast/feature_repo.
27
26
$ cd feature_repo
28
27
29
28
$ feast apply
30
-
Registered entity driver_id
31
-
Registered feature view driver_hourly_stats
32
-
Deploying infrastructure for driver_hourly_stats
29
+
Created entity driver
30
+
Created feature view driver_hourly_stats
31
+
Created feature service driver_activity
32
+
33
+
Created sqlite table feature_repo_driver_hourly_stats
33
34
34
35
$ feast materialize-incremental $(date +%Y-%m-%d)
35
36
Materializing 1 feature views to 2021-09-09 17:00:00-07:00 into the sqlite online store.
@@ -38,8 +39,6 @@ driver_hourly_stats from 2021-09-09 16:51:08-07:00 to 2021-09-09 17:00:00-07:00:
This is an experimental feature. It's intended for early testing and feedback, and could change without warnings in future releases.
42
-
INFO: Started server process [8889]
43
42
09/10/2021 10:42:11 AM INFO:Started server process [8889]
44
43
INFO: Waiting for application startup.
45
44
09/10/2021 10:42:11 AM INFO:Waiting for application startup.
@@ -49,7 +48,7 @@ INFO: Uvicorn running on http://127.0.0.1:6566 (Press CTRL+C to quit)
49
48
09/10/2021 10:42:11 AM INFO:Uvicorn running on http://127.0.0.1:6566 (Press CTRL+C to quit)
50
49
```
51
50
52
-
### Retrieving features from the online store
51
+
### Retrieving features
53
52
After the server starts, we can execute cURL commands from another terminal tab:
54
53
55
54
```bash
@@ -153,11 +152,9 @@ curl -X POST \
153
152
```
154
153
155
154
### Pushing features to the online and offline stores
156
-
You can push data corresponding to a push source to the online and offline stores (note that timestamps need to be strings):
157
-
158
-
You can also define a pushmode to push stream or batch data, either to the online store, offline store, or both. The feature server will throw an error if the online/offline store doesn't support the push api functionality.
155
+
The Python feature server also exposes an endpoint for [push sources](../../data-sources/push.md). This endpoint allows you to push data to the online and/or offline store.
159
156
160
-
The request definition for pushmode is a string parameter `to` where the options are: ["online", "offline", "online_and_offline"].
157
+
The request definition for pushmode is a string parameter `to` where the options are: ["online", "offline", "online_and_offline"]. Note that timestamps need to be strings.
0 commit comments