feast-integrator

Feast Integrator

Channel Revision Published Runs on
latest/edge 108 13 Aug 2025
Ubuntu 24.04
0.49/stable 93 18 Jun 2025
Ubuntu 24.04
0.49/edge 95 18 Jun 2025
Ubuntu 24.04
juju deploy feast-integrator --channel edge
Show information

Platform:

Ubuntu
24.04

charms.feast_integrator.v0.feast_store_configuration

Library for sharing Feast store configuration information.

This library offers a Python API for providing and requesting information about Feast feature store configuration. The default relation name is feast-configuration and it's recommended to use that name, though if changed, you must ensure to pass the correct name when instantiating the provider and requirer classes, as well as in metadata.yaml.

Getting Started
Fetching the library with charmcraft

Using charmcraft you can:

charmcraft fetch-lib charms.feast_integrator.v0.feast_store_configuration
Using the library as requirer
Add relation to metadata.yaml
requires:
  feast-configuration:
    interface: feast-configuration
    limit: 1
Instantiate the class in charm.py
from ops.charm import CharmBase
from charms.feast_integrator.v0.feast_store_configuration import (
    FeastStoreConfigurationRequirer,
    FeastStoreConfigurationRelationError
)

class RequirerCharm(CharmBase):
    def __init__(self, *args):
        self.feast_configuration_requirer = FeastStoreConfigurationRequirer(self)
        self.framework.observe(self.on.some_event_emitted, self.some_event_function)

    def some_event_function():
        # use the getter function wherever the info is needed
        try:
            feast_configuration_yaml = self.feast_configuration_requirer.get_feature_store_yaml()
        except FeastStoreConfigurationRelationError as error:
            "your error handler goes here"
        except FeastStoreConfigurationDataInvalidError as error:
            "your error handler goes here"
Using the library as provider
Add relation to metadata.yaml
provides:
  feast-configuration:
    interface: feast-configuration
    limit: 1
Instantiate the class in charm.py
from ops.charm import CharmBase
from charms.feast_integrator.v0.feast_store_configuration import (
FeastStoreConfigurationProvider,
FeastStoreConfigurationRelationMissingError
)

class ProviderCharm(CharmBase):
    def __init__(self, *args, **kwargs):
        ...
        self.feast_configuration_provider = FeastStoreConfigurationProvider(self)
        self.observe(self.on.some_event, self._some_event_handler)

    def _some_event_handler(self, ...):
        # Create the FeastStoreConfiguration object
        try:
            store_config = FeastStoreConfiguration(
                registry_user="my_user",
                registry_password="pass",
                registry_host="host",
                registry_port=5432,
                registry_database="reg_db",
                offline_store_host="offline_host",
                offline_store_port=3306,
                offline_store_database="offline_db",
                offline_store_user="off_user",
                offline_store_password="off_pass",
                online_store_host="online_host",
                online_store_port=6379,
                online_store_database="online_db",
                online_store_user="on_user",
                online_store_password="on_pass"
            )
        except FeastStoreConfigurationDataInvalidError as e:
            "your error handler goes here"

        try:
            self.feast_configuration_provider.send_data(store_config)
        except FeastStoreConfigurationRelationMissingError as error:
            "your error handler goes here"
Relation data

The data shared by this library is defined by the FeastStoreConfiguration dataclass. The attributes of this dataclass are shared in the relation data bag as a dictionary.


class FeastStoreConfigurationUpdatedEvent

Description

Indicates the Feast Store Configuration data was updated. None

class FeastStoreConfigurationEvents

Description

Events for the Feast Store Configuration library. None

class FeastStoreConfigurationRelationError

Description

Base exception class for any relation error handled by this library. None

class FeastStoreConfigurationRelationMissingError

Description

Exception to raise when the relation is missing on either end. None

Methods

FeastStoreConfigurationRelationMissingError. __init__( self , relation_name )

class FeastStoreConfigurationRelationDataMissingError

Description

Exception to raise when there is missing data in the relation data bag. None

Methods

FeastStoreConfigurationRelationDataMissingError. __init__( self , relation_name )

class FeastStoreConfigurationDataInvalidError

Description

Exception to raise when the data in the relation data bag has incorrect format. None

Methods

FeastStoreConfigurationDataInvalidError. __init__( self , error )

class FeastStoreConfiguration

Configuration parameters for generating a Feast feature store.

Attributes

registry_user (str)
Username for connecting to the registry database.
registry_password (str)
Password for the registry user.
registry_host (str)
Hostname or IP address of the registry database.
registry_port (int)
Port number for the registry database.
registry_database (str)
Name of the registry database.
offline_store_host (str)
Hostname or IP for the offline store database.
offline_store_port (int)
Port number for the offline store.
offline_store_database (str)
Database name for the offline store.
offline_store_user (str)
Username for the offline store.
offline_store_password (str)
Password for the offline store user.
online_store_host (str)
Hostname or IP for the online store database.
online_store_port (int)
Port number for the online store.
online_store_database (str)
Database name for the online store.
online_store_user (str)
Username for the online store.
online_store_password (str)
Password for the online store user.

Description

This dataclass captures all dynamic, parameterizable values used in the Feast store configuration template. These values are typically substituted into the YAML template at runtime or during deployment to configure connections to the registry, online store, and offline store.

Methods

FeastStoreConfiguration. __post_init__( self )

class FeastStoreConfigurationProvider

Implement the Provider end of the Feast Configuration relation.

Attributes

charm (CharmBase)
the requirer application
relation_name (str)
the name of the relation

Methods

FeastStoreConfigurationProvider. __init__( self , charm: CharmBase , relation_name )

FeastStoreConfigurationProvider. send_data( self , store_configuration: FeastStoreConfiguration )

Update the relation data bag with data from a Store Configuration.

Arguments

store_configuration (StoreConfiguration)

the Feast store configuration object

class FeastStoreConfigurationRequirer

Implement the Requirer end of the Feast Configuration relation.

Attributes

charm (CharmBase)
the requirer application
relation_name (str)
the name of the relation

Methods

FeastStoreConfigurationRequirer. __init__( self , charm: CharmBase , relation_name )

FeastStoreConfigurationRequirer. get_feature_store_yaml( self )

Generate the Feast feature_store.yaml content from a FeastConfiguration instance.

Description

Args: config (FeastConfiguration): The configuration values to populate the YAML.

Returns: str: A string representation of the feature_store.yaml file.

Raises: FeatureStoreConfigurationRelationDataMissingError if data is missing FeatureStoreConfigurationRelationMissingError: if there is no related application