Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename host to connection_string and expect couchbase://
Signed-off-by: Elliot Scribner <elliot.scribner@couchbase.com>
  • Loading branch information
ejscribner committed Oct 30, 2024
commit d3b81410d55b9573a7aca1b4d385110741301492
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Couchbase Online Store
Utilizes Couchbase Server as the underlying store for the online feature store.
This contribution makes it possible to use [Couchbase Capella Operational](https://docs.couchbase.com/cloud/get-started/intro.html) as an online store for Feast.


#### Create a feature repository
Expand All @@ -11,18 +11,19 @@ cd feature_repo

#### Edit `feature_store.yaml`

set `online_store` type to be `couchbase`
Set the `online_store` type to `couchbase`, and fill in the required fields as shown below.

```yaml
project: feature_repo
registry: data/registry.db
provider: local
online_store:
type: couchbase
host: 127.0.0.1 # Couchbase host, default to 127.0.0.1
connection_string: couchbase://127.0.0.1 # Couchbase connection string, default to couchbase://127.0.0.1
user: Administrator # Couchbase username, default to Administrator
password: password # Couchbase password, default to password
bucket_name: feast # Couchbase bucket name, default to feast
kv_port: 11210 # Couchbase key-value port, default to 11210. Required if custom ports are used.
entity_key_serialization_version: 2
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CouchbaseOnlineStoreConfig(FeastConfigBaseModel):

type: Literal["couchbase"] = "couchbase"

host: Optional[StrictStr] = None
connection_string: Optional[StrictStr] = None
user: Optional[StrictStr] = None
password: Optional[StrictStr] = None
bucket_name: Optional[StrictStr] = None
Expand All @@ -51,7 +51,7 @@ def _get_conn(self, config: RepoConfig, scope_name: str, collection_name: str):

if not self._cluster:
self._cluster = Cluster(
f"couchbase://{online_store_config.host or '127.0.0.1'}:{online_store_config.kv_port or '11210'}",
f"{online_store_config.connection_string or 'couchbase://127.0.0.1'}:{online_store_config.kv_port or '11210'}",
ClusterOptions(
PasswordAuthenticator(
online_store_config.user or "Administrator",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def create_online_store(self) -> Dict[str, object]:
views_port = self.container.get_exposed_port("8092")
query_port = self.container.get_exposed_port("8093")
kv_port = self.container.get_exposed_port("11210")
base_url = f"http://localhost:{rest_port}"
base_url = f"http://127.0.0.1:{rest_port}"

port_map = {
"rest": rest_port,
Expand All @@ -67,7 +67,7 @@ def create_online_store(self) -> Dict[str, object]:
# Return the configuration for Feast
return {
"type": "couchbase",
"host": "127.0.0.1",
"connection_string": "couchbase://127.0.0.1",
"user": self.username,
"password": self.password,
"bucket_name": self.bucket_name,
Expand Down