This guide is targeted at developers looking to contribute to Feast Serving:
- Maven build tool version 3.6.x
- A Feast feature repo (e.g. https://github.com/feast-dev/feast-demo)
- A running Store instance e.g. local Redis instance with
redis-server
From the Feast GitHub root, run:
mvn -f java/pom.xml install -Dmaven.test.skip=true- Package an executable jar for serving:
mvn -f java/serving/pom.xml package -Dmaven.test.skip=true - Make a file called
application-override.yamlthat specifies your Feast repo project and registry path:- Note if you have a remote registry, you can specify that too (e.g.
gs://...)
feast: project: feast_demo registry: /Users/[your username]/GitHub/feast-demo/feature_repo/data/registry.db entityKeySerializationVersion: 3
- An example of if you're using Redis with a remote registry:
feast: project: feast_java_demo registry: gs://[YOUR BUCKET]/demo-repo/registry.db entityKeySerializationVersion: 3 activeStore: online stores: - name: online type: REDIS config: host: localhost port: 6379 password: [YOUR PASSWORD]
- Note if you have a remote registry, you can specify that too (e.g.
- Run the jar with dependencies that was built from Maven (note the version might vary):
java \ -Xms1g \ -Xmx4g \ -jar java/serving/target/feast-serving-[YOUR VERSION]-jar-with-dependencies.jar \ classpath:/application.yml,file:./application-override.yaml - Now you have a Feast Serving gRPC service running on port 6566 locally!
If you have grpc_cli installed, you can check that Feast Serving is running
grpc_cli ls localhost:6566
An example of fetching features
grpc_cli call localhost:6566 GetOnlineFeatures '
features {
val: "driver_hourly_stats:conv_rate"
val: "driver_hourly_stats:acc_rate"
}
entities {
key: "driver_id"
value {
val {
int64_val: 1001
}
val {
int64_val: 1002
}
}
}
'Example output:
connecting to localhost:6566
metadata {
feature_names {
val: "driver_hourly_stats:conv_rate"
val: "driver_hourly_stats:acc_rate"
}
}
results {
values {
float_val: 0.812357187
}
values {
float_val: 0.379484832
}
statuses: PRESENT
statuses: PRESENT
event_timestamps {
seconds: 1631725200
}
event_timestamps {
seconds: 1631725200
}
}
results {
values {
float_val: 0.840873241
}
values {
float_val: 0.151376978
}
statuses: PRESENT
statuses: PRESENT
event_timestamps {
seconds: 1631725200
}
event_timestamps {
seconds: 1631725200
}
}
Rpc succeeded with OK status
You can debug this like any other Java executable. Swap the java command above with:
java \
-Xdebug \
-Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y \
-Xms1g \
-Xmx4g \
-jar java/serving/target/feast-serving-[YOUR VERSION]-jar-with-dependencies.jar \
classpath:/application.yml,file:./application-override.yaml
Now you can attach e.g. a Remote debugger in IntelliJ to port 5005 to debug / make breakpoints.
Unit & Integration Tests can be used to verify functionality:
# run unit tests
mvn test -pl serving --also-make
# run integration tests
mvn verify -pl serving --also-make
# run integration tests with debugger
mvn -Dmaven.failsafe.debug verify -pl serving --also-makeLook at java-demo for steps on how to update the helm chart or java logic and test their interactions.