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

docs: Operator example notebook & api reference docs #4807

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft
1 change: 1 addition & 0 deletions examples/operator-quickstart/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.tar.gz
282 changes: 282 additions & 0 deletions examples/operator-quickstart/01-Install.ipynb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems these notebooks have no output. While I agree that maintaining outputs in git can be challenging, having the outputs preserved is indeed very helpful when the notebooks from a browser. It provides immediate insight into the results of the experiment without needing to rerun it. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh ok, i hadn't thought of it that way. i'll add them

Original file line number Diff line number Diff line change
@@ -0,0 +1,282 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Install Feast on Kind with the Feast Operator\n",
"## Objective\n",
"\n",
"Provide a reference implementation of a runbook to deploy a Feast development environment on a Kubernetes cluster using [Kind](https://kind.sigs.k8s.io/docs/user/quick-start) and the [Feast Operator](../../infra/feast-operator/)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Prerequisites\n",
"* Kubernetes Cluster - e.g. [Kind](https://kind.sigs.k8s.io/) or OpenShift\n",
"* [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) Kubernetes CLI tool."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Install Prerequisites\n",
"\n",
"The following commands install and configure all the prerequisites on MacOS environment. You can find the\n",
"equivalent instructions on the offical documentation pages:\n",
"* Install Kind and Container runtime (e.g. [Colima](https://github.com/abiosoft/colima)).\n",
"* Create Kind cluster named `feast`.\n",
"* Install and setup the `kubectl` context.\n",
"```bash\n",
"brew install colima\n",
"colima start\n",
"brew install kind\n",
"kind create cluster --name feast\n",
"kind start\n",
"brew install kubectl\n",
"kubectl config use-context kind-feast\n",
"```\n",
"\n",
"Additionally, we create a `feast` namespace and use it as the default for the `kubectl` CLI:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!kubectl create ns feast\n",
"!kubectl config set-context --current --namespace feast"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Validate the cluster setup:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!kubectl get ns feast"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Deployment Architecture\n",
"The primary objective of this runbook is to guide the deployment of Feast services on a Kubernetes Kind cluster, using the `postgres` template to set up a basic feature store.\n",
"\n",
"In this notebook, we will deploy a distributed topology of Feast services, which includes:\n",
"\n",
"* `Registry Server`: Handles metadata storage for feature definitions.\n",
"* `Online Store Server`: Uses the `Registry Server` to query metadata and is responsible for low-latency serving of features.\n",
"* `Offline Store Server`: Uses the `Registry Server` to query metadata and provides access to batch data for historical feature retrieval.\n",
"\n",
"Each service is backed by a `PostgreSQL` database, which is also deployed within the same Kind cluster."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Install PostgreSQL\n",
"Install the [reference deployment](postgres.yaml) to install and configure a simple PostgreSQL database."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!kubectl apply -f postgres.yaml\n",
"!kubectl wait --for=condition=available deployment/postgres --timeout=2m"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!kubectl get all"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Install the Operator"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!kubectl apply -f ../../infra/feast-operator/dist/install.yaml\n",
"#!make -C ../../infra/feast-operator install\n",
"#!make -C ../../infra/feast-operator deploy IMG=quay.io/<org>/feast-operator:<tag>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Install the Feast services via FeatureStore CR\n",
"We'll use the Operator in this local repository to install the feast services. Install the [reference deployment](feast.yaml) to install and configure Feast."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!kubectl apply -f feast.yaml"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Validate deployment\n",
"Validate application and service status:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!kubectl get feast\n",
"!kubectl get all\n",
"!kubectl wait --for=condition=available deployment/feast-example-registry --timeout=2m\n",
"!kubectl wait --for=condition=available deployment/feast-example-offline --timeout=2m\n",
"!kubectl wait --for=condition=available deployment/feast-example-online --timeout=2m"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Then verify the content of each feast service's local configuration file (it's stored in the `FEATURE_STORE_YAML_BASE64` env variable)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!kubectl get deploy feast-example-online -o jsonpath='{.spec.template.spec.containers[*].env[?(@.name==\"FEATURE_STORE_YAML_BASE64\")].value}' | base64 -d"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!kubectl get deploy feast-example-offline -o jsonpath='{.spec.template.spec.containers[*].env[?(@.name==\"FEATURE_STORE_YAML_BASE64\")].value}' | base64 -d"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!kubectl get deploy feast-example-registry -o jsonpath='{.spec.template.spec.containers[*].env[?(@.name==\"FEATURE_STORE_YAML_BASE64\")].value}' | base64 -d"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Verify the content of the feast client configuration file (it's generated by the Operator and stored in a `ConfigMap`)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!kubectl get cm feast-example-client -o jsonpath='{.data.feature_store\\.yaml}'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Verify that the DB includes the expected tables."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!kubectl exec deploy/postgres -- psql -h localhost -U feast feast -c '\\dt'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Finally, let's verify the `feast` version in each server"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!kubectl exec deployment/feast-example-registry -- feast version\n",
"!kubectl exec deployment/feast-example-offline -- feast version\n",
"!kubectl exec deployment/feast-example-online -- feast version"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading
Loading