Python feature server
Python feature server
Overview
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.
CLI
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.
Deploying as a service
One can deploy a feature server by building a docker image that bundles in the project's feature_store.yaml
. See this helm chart for an example on how to run Feast on Kubernetes.
Example
Initializing a feature server
Here's an example of how to start the Python feature server with a local feature repo:
Retrieving features
After the server starts, we can execute cURL commands from another terminal tab:
It's also possible to specify a feature service name instead of the list of features:
Pushing features to the online and offline stores
The Python feature server also exposes an endpoint for push sources. This endpoint allows you to push data to the online and/or offline store.
The request definition for PushMode
is a string parameter to
where the options are: ["online"
, "offline"
, "online_and_offline"
].
Note: timestamps need to be strings, and might need to be timezone aware (matching the schema of the offline store)
or equivalently from Python:
Starting the feature server in SSL mode
Enabling SSL mode ensures that data between the Feast client and server is transmitted securely. For an ideal production environment, it is recommended to start the feature server in SSL mode.
Obtaining a self-signed SSL certificate and key
In development mode we can generate a self-signed certificate for testing. In an actual production environment it is always recommended to get it from a trusted SSL certificate provider.
The above command will generate two files
key.pem
: certificate private keycert.pem
: certificate public key
Starting the Online Server in SSL Mode
To start the feature server in SSL mode, you need to provide the private and public keys using the --ssl-key-path
and --ssl-cert-path
arguments with the feast serve
command.
Online Feature Server Permissions and Access Control
API Endpoints and Permissions
Endpoint | Resource Type | Permission | Description |
---|---|---|---|
/get-online-features | FeatureView,OnDemandFeatureView | Read Online | Get online features from the feature store |
/push | FeatureView | Write Online, Write Offline, Write Online and Offline | Push features to the feature store (online, offline, or both) |
/write-to-online-store | FeatureView | Write Online | Write features to the online store |
/materialize | FeatureView | Write Online | Materialize features within a specified time range |
/materialize-incremental | FeatureView | Write Online | Incrementally materialize features up to a specified timestamp |
How to configure Authentication and Authorization ?
Please refer the page for more details on how to configure authentication and authorization.
Last updated