Skip to content

Commit 08232f7

Browse files
felixwang9817gitbook-bot
authored andcommitted
GitBook: [master] 4 pages modified
1 parent d0778f7 commit 08232f7

File tree

4 files changed

+140
-7
lines changed

4 files changed

+140
-7
lines changed

docs/SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
* [feature\_store.yaml](reference/feature-repository/feature-store-yaml.md)
7171
* [.feastignore](reference/feature-repository/feast-ignore.md)
7272
* [\[Alpha\] On demand feature view](reference/alpha-on-demand-feature-view.md)
73-
* [\[Alpha\] Feature server](reference/feature-server.md)
73+
* [\[Alpha\] Local feature server](reference/feature-server.md)
74+
* [\[Alpha\] AWS Lambda feature server](reference/alpha-aws-lambda-feature-server.md)
7475
* [Feast CLI reference](reference/feast-cli-commands.md)
7576
* [Python API reference](http://rtd.feast.dev/)
7677
* [Usage](reference/usage.md)

docs/getting-started/concepts/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,3 @@
1414

1515
{% page-ref page="point-in-time-joins.md" %}
1616

17-
18-
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# \[Alpha\] AWS Lambda feature server
2+
3+
**Warning**: This is an _experimental_ feature. It's intended for early testing and feedback, and could change without warnings in future releases.
4+
5+
{% hint style="info" %}
6+
To enable this feature, run**`feast alpha enable aws_lambda_feature_server`**
7+
{% endhint %}
8+
9+
## Overview
10+
11+
The AWS Lambda feature server is an HTTP endpoint that serves features with JSON I/O, deployed as a Docker image through AWS Lambda and AWS API Gateway. This enables users to get features from Feast using any programming language that can make HTTP requests. A [local feature server](feature-server.md) is also available. A remote feature server on GCP Cloud Run is currently being developed.
12+
13+
## Deployment
14+
15+
The AWS Lambda feature server is only available to projects using the `AwsProvider` with registries on S3. It is disabled by default. To enable it, `feature_store.yaml` must be modified; specifically, the `enable` flag must be on and an `execution_role_name` must be specified. For example, after running `feast init -t aws`, changing the registry to be on S3, and enabling the feature server, the contents of `feature_store.yaml` should look similar to the following:
16+
17+
```text
18+
project: dev
19+
registry: s3://feast/registries/dev
20+
provider: aws
21+
online_store:
22+
region: us-west-2
23+
offline_store:
24+
cluster_id: feast
25+
region: us-west-2
26+
user: admin
27+
database: feast
28+
s3_staging_location: s3://feast/redshift/tests/staging_location
29+
iam_role: arn:aws:iam::{aws_account}:role/redshift_s3_access_role
30+
flags:
31+
alpha_features: true
32+
aws_lambda_feature_server: true
33+
feature_server:
34+
enabled: True
35+
execution_role_name: arn:aws:iam::{aws_account}:role/lambda_execution_role
36+
```
37+
38+
If enabled, the feature server will be deployed during `feast apply`. After it is deployed, the `feast endpoint` CLI command will indicate the server's endpoint.
39+
40+
## Example
41+
42+
After `feature_store.yaml` has been modified as described in the previous section, it can be deployed as follows:
43+
44+
```bash
45+
$ feast apply
46+
10/07/2021 03:57:26 PM INFO:Pulling remote image feastdev/feature-server:aws:
47+
10/07/2021 03:57:28 PM INFO:Creating remote ECR repository feast-python-server-key_shark-0_13_1_dev23_gb3c08320:
48+
10/07/2021 03:57:29 PM INFO:Pushing local image to remote 402087665549.dkr.ecr.us-west-2.amazonaws.com/feast-python-server-key_shark-0_13_1_dev23_gb3c08320:0_13_1_dev23_gb3c08320:
49+
10/07/2021 03:58:44 PM INFO:Deploying feature server...
50+
10/07/2021 03:58:45 PM INFO: Creating AWS Lambda...
51+
10/07/2021 03:58:46 PM INFO: Creating AWS API Gateway...
52+
Registered entity driver_id
53+
Registered feature view driver_hourly_stats
54+
Deploying infrastructure for driver_hourly_stats
55+
56+
$ feast endpoint
57+
10/07/2021 03:59:01 PM INFO:Feature server endpoint: https://hkosgmz4m2.execute-api.us-west-2.amazonaws.com
58+
59+
$ feast materialize-incremental $(date +%Y-%m-%d)
60+
Materializing 1 feature views to 2021-10-06 17:00:00-07:00 into the dynamodb online store.
61+
62+
driver_hourly_stats from 2020-10-08 23:01:34-07:00 to 2021-10-06 17:00:00-07:00:
63+
100%|█████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 16.89it/s]
64+
```
65+
66+
After the feature server starts, we can execute cURL commands against it:
67+
68+
```bash
69+
$ curl -X POST \
70+
"https://hkosgmz4m2.execute-api.us-west-2.amazonaws.com/get-online-features" \
71+
-H "Content-type: application/json" \
72+
-H "Accept: application/json" \
73+
-d '{
74+
"features": [
75+
"driver_hourly_stats:conv_rate",
76+
"driver_hourly_stats:acc_rate",
77+
"driver_hourly_stats:avg_daily_trips"
78+
],
79+
"entities": {
80+
"driver_id": [1001, 1002, 1003]
81+
},
82+
"full_feature_names": true
83+
}' | jq
84+
% Total % Received % Xferd Average Speed Time Time Time Current
85+
Dload Upload Total Spent Left Speed
86+
100 1346 100 1055 100 291 3436 947 --:--:-- --:--:-- --:--:-- 4370
87+
{
88+
"field_values": [
89+
{
90+
"fields": {
91+
"driver_id": 1001,
92+
"driver_hourly_stats__conv_rate": 0.025330161675810814,
93+
"driver_hourly_stats__avg_daily_trips": 785,
94+
"driver_hourly_stats__acc_rate": 0.835975170135498
95+
},
96+
"statuses": {
97+
"driver_hourly_stats__avg_daily_trips": "PRESENT",
98+
"driver_id": "PRESENT",
99+
"driver_hourly_stats__conv_rate": "PRESENT",
100+
"driver_hourly_stats__acc_rate": "PRESENT"
101+
}
102+
},
103+
{
104+
"fields": {
105+
"driver_hourly_stats__conv_rate": 0.7595187425613403,
106+
"driver_hourly_stats__acc_rate": 0.1740121990442276,
107+
"driver_id": 1002,
108+
"driver_hourly_stats__avg_daily_trips": 875
109+
},
110+
"statuses": {
111+
"driver_hourly_stats__acc_rate": "PRESENT",
112+
"driver_id": "PRESENT",
113+
"driver_hourly_stats__avg_daily_trips": "PRESENT",
114+
"driver_hourly_stats__conv_rate": "PRESENT"
115+
}
116+
},
117+
{
118+
"fields": {
119+
"driver_hourly_stats__acc_rate": 0.7785481214523315,
120+
"driver_hourly_stats__conv_rate": 0.33832859992980957,
121+
"driver_hourly_stats__avg_daily_trips": 846,
122+
"driver_id": 1003
123+
},
124+
"statuses": {
125+
"driver_id": "PRESENT",
126+
"driver_hourly_stats__conv_rate": "PRESENT",
127+
"driver_hourly_stats__acc_rate": "PRESENT",
128+
"driver_hourly_stats__avg_daily_trips": "PRESENT"
129+
}
130+
}
131+
]
132+
}
133+
```
134+

docs/reference/feature-server.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# \[Alpha\] Feature server
1+
# \[Alpha\] Local feature server
22

33
**Warning**: This is an _experimental_ feature. It's intended for early testing and feedback, and could change without warnings in future releases.
44

55
{% hint style="info" %}
6-
To enable this feature, run **`feast alpha enable python_feature_server`**
6+
To enable this feature, run**`feast alpha enable python_feature_server`**
77
{% endhint %}
88

99
## Overview
1010

11-
Feature Server is an HTTP endpoint that serves features with JSON I/O. This enables users to get features from Feast using any programming language that can make HTTP requests. As of now, it's only possible to run the server locally. A remote feature server is work in progress.
11+
The local feature server is an HTTP endpoint that serves features with JSON I/O. This enables users to get features from Feast using any programming language that can make HTTP requests. A [remote feature server](alpha-aws-lambda-feature-server.md) on AWS Lambda is also available. A remote feature server on GCP Cloud Run is currently being developed.
1212

1313
## CLI
1414

15-
There is a new CLI command that starts the server: `feast serve`. By default Feast uses port 6566, however it can be overriden by a `--port` flag.
15+
There is a new CLI command that starts the server: `feast serve`. By default Feast uses port 6566; the port be overridden by a `--port` flag.
1616

1717
## Example
1818

0 commit comments

Comments
 (0)