Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing difficulties in accessing Feast online store #4986

Open
VidhyaPandi opened this issue Jan 30, 2025 · 2 comments
Open

Facing difficulties in accessing Feast online store #4986

VidhyaPandi opened this issue Jan 30, 2025 · 2 comments

Comments

@VidhyaPandi
Copy link

We are trying to use Feast as the feature store for our analytics platform. Offline store and online store were successfully setup and we are able to access via Jupyter notebook using Feast python SDK. However, we are facing difficulties in accessing Feast online store.
Issue Details:

  1. We tried setting up a feature server in Kubernetes environment to serve online features via REST API. We can invoke the endpoint /get-online-features with status 200 OK. But the response contains only NULL values as shown below.
    {
    "metadata": {
    "feature_names": [
    "equipment_id",
    "usage_metrics"
    ]
    },
    "results": [
    {
    "values": [
    14991,
    14989
    ],
    "statuses": [
    "PRESENT",
    "PRESENT"
    ],
    "event_timestamps": [
    "1970-01-01T00:00:00Z",
    "1970-01-01T00:00:00Z"
    ]
    },
    {
    "values": [
    null,
    null
    ],
    "statuses": [
    "NOT_FOUND",
    "NOT_FOUND"
    ],
    "event_timestamps": [
    "1970-01-01T00:00:00Z",
    "1970-01-01T00:00:00Z"
    ]
    }
    ]
    }

  2. To run an inference in SPARK environment we tried to query the postgres database (online store) to fetch the features to feed the inference.
    We still get the null values in value column.
    Query:
    SELECT entity_key, feature_name,value FROM feast_features
    LIMIT 5;
    Deserialization function: (udf)
    def deserialize_value(serialized_value):
    if serialized_value is None:
    return None # Handle null values safely

    if isinstance(serialized_value, bytearray):
    serialized_value = bytes(serialized_value) # Convert bytearray to bytes

    Deserialize using Protobuf

    value_proto = Value_pb2.Value()
    value_proto.ParseFromString(serialized_value)

    Extract the actual feature value

    if value_proto.HasField("int64_val"):
    return value_proto.int64_val
    elif value_proto.HasField("double_val"):
    return value_proto.double_val
    elif value_proto.HasField("string_val"):
    return value_proto.string_val
    elif value_proto.HasField("bool_val"):
    return value_proto.bool_val
    elif value_proto.HasField("bytes_val"):
    return value_proto.bytes_val.decode("utf-8") # Convert bytes to string
    else:
    return None

We decided to go with postgres as datasource so we installed Feast using
pip install feast['postgres']
Now the feature store set up has been completed, We are able to get the online features using feast SDK and here is configuration details.
feature_store.yaml:

project: project_name
provider: local
registry:
registry_type: sql
path: postgresql+psycopg2://user:[email protected]:55001/feast_db
cache_ttl_seconds: 60
sqlalchemy_config_kwargs:
echo: false
pool_pre_ping: true
online_store:
type: postgres
host: host_ip1
port: port1
database: db_name
db_schema: schema_name
user: user1
password: password1
offline_store:
type: postgres
host: host_ip2
port: port2
database: db_name
db_schema: schema_name
user: user2
password: password2
entity_key_serialization_version: 2
auth:
type: no_auth

Please help us to integrate Feast online store with our ML ops inference pipeline running in SPARK cluster. So that we could pass the latest data from online store for predicting ML models via pipeline.

@redhatHameed
Copy link
Contributor

can you verify if you have performed materialization successfully and have data in onlinestore db ?

@VidhyaPandi
Copy link
Author

VidhyaPandi commented Jan 31, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants