Local feature server implementation (HTTP endpoint)#1780
Conversation
Signed-off-by: Tsotne Tabidze <tsotne@tecton.ai>
Codecov Report
@@ Coverage Diff @@
## master #1780 +/- ##
==========================================
+ Coverage 84.71% 85.23% +0.51%
==========================================
Files 86 91 +5
Lines 6308 6752 +444
==========================================
+ Hits 5344 5755 +411
- Misses 964 997 +33
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
…id extra structure (e.g. "int64_val") in json Signed-off-by: Tsotne Tabidze <tsotne@tecton.ai>
|
The request API is now much more compact. Here's an example JSON request: {
"features": [
"driver_hourly_stats:conv_rate",
"driver_hourly_stats:acc_rate",
"driver_hourly_stats:avg_daily_trips"
],
"entities": {
"driver_id": [1001, 1002, 1003]
},
"full_feature_names": true
}I haven't modified the response yet. I'm thinking about making it columnar as well, and making the |
Agreed on the above. @tsotnet do we have an idea of the performance impact of using a columnar representation? Ultimately we'll be converting the representation into row level keys in order to do lookups. Can we do it in a way that has little overhead? |
Signed-off-by: Tsotne Tabidze <tsotne@tecton.ai>
I haven't done benchmarks, but I suspect that the savings from the network overhead (due to the smaller request size) will be more significant than columnar to row level in-memory transformation. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: felixwang9817, tsotnet The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Tsotne Tabidze tsotne@tecton.ai
What this PR does / why we need it: Implements the local HTTP feature consumption server.
RFCs for context:
From one terminal tab we can run
feast serve:From another tab we can run cURL requests:
$ curl -X GET \ "http://127.0.0.1:6566/get-online-features/" \ -H "Content-type: application/json" \ -H "Accept: application/json" \ -d '{ "features": [ "driver_hourly_stats:conv_rate", "driver_hourly_stats:acc_rate", "driver_hourly_stats:avg_daily_trips" ], "entities": { "driver_id": [1001, 1002, 1003] }, "full_feature_names": true }' | jq % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1345 100 1054 100 291 3685 1017 --:--:-- --:--:-- --:--:-- 4702 { "field_values": [ { "fields": { "driver_hourly_stats__conv_rate": 0.5315734148025513, "driver_id": 1001, "driver_hourly_stats__acc_rate": 0.5842991471290588, "driver_hourly_stats__avg_daily_trips": 714 }, "statuses": { "driver_hourly_stats__conv_rate": "PRESENT", "driver_hourly_stats__acc_rate": "PRESENT", "driver_hourly_stats__avg_daily_trips": "PRESENT", "driver_id": "PRESENT" } }, { "fields": { "driver_id": 1002, "driver_hourly_stats__avg_daily_trips": 133, "driver_hourly_stats__conv_rate": 0.23269200325012207, "driver_hourly_stats__acc_rate": 0.5605814456939697 }, "statuses": { "driver_hourly_stats__avg_daily_trips": "PRESENT", "driver_hourly_stats__acc_rate": "PRESENT", "driver_id": "PRESENT", "driver_hourly_stats__conv_rate": "PRESENT" } }, { "fields": { "driver_hourly_stats__conv_rate": 0.7948746085166931, "driver_hourly_stats__avg_daily_trips": 506, "driver_id": 1003, "driver_hourly_stats__acc_rate": 0.9278625845909119 }, "statuses": { "driver_hourly_stats__acc_rate": "PRESENT", "driver_hourly_stats__avg_daily_trips": "PRESENT", "driver_hourly_stats__conv_rate": "PRESENT", "driver_id": "PRESENT" } } ]Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?: