Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
Signed-off-by: Tommy Hughes <[email protected]>
  • Loading branch information
tchughesiv committed Dec 3, 2024
1 parent d921b92 commit 40437a7
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/operator-quickstart/01-Install.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"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/tchughesiv/feast-operator:0.41.0-demo"
"!make -C ../../infra/feast-operator deploy IMG=quay.io/tchughesiv/feast-operator:0.41.0-dev"
]
},
{
Expand Down Expand Up @@ -230,7 +230,7 @@
"metadata": {},
"outputs": [],
"source": [
"!PSQL_POD=$(kubectl get pods -l app=postgres -oname) && kubectl exec $PSQL_POD -- psql -h localhost -U feast feast -c '\\dt'"
"!kubectl exec deploy/postgres -- psql -h localhost -U feast feast -c '\\dt'"
]
},
{
Expand Down
10 changes: 7 additions & 3 deletions examples/operator-quickstart/02-Client-Openshift.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Run a test client in Openshift"
"# Run a test client in Openshift\n",
"\n",
"Running the Feast Operator in OpenShift provides the added benefit of automated TLS via [service serving certificates](https://docs.openshift.com/container-platform/4.17/security/certificates/service-serving-certificate.html), which will be used in this client deployment."
]
},
{
Expand Down Expand Up @@ -59,7 +61,8 @@
"outputs": [],
"source": [
"!kubectl wait --for=condition=available deployment/client --timeout=2m\n",
"!kubectl logs deploy/client -c feast-apply"
"!kubectl logs deploy/client -c feast-apply\n",
"!kubectl exec deploy/postgres -- psql -h localhost -U feast feast -c 'select count(*) from sample_driver_hourly_stats'"
]
},
{
Expand Down Expand Up @@ -98,7 +101,8 @@
"metadata": {},
"outputs": [],
"source": [
"!kubectl exec deploy/client -c client -- python3 test_workflow.py"
"!kubectl exec deploy/client -c client -- python3 test_workflow.py\n",
"!kubectl exec deploy/postgres -- psql -h localhost -U feast feast -c 'select count(*) from sample_driver_hourly_stats'"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion examples/operator-quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
The following notebooks will guide you through an end-to-end journey to install and validate a simple Feast feature store in a
Kind Kubernetes or OpenShift cluster:
* [01-Install.ipynb](./01-Install.ipynb): Install and configure the cluster with the Operator.
* [02-Client-OpenShift.ipynb](./02-Client-OpenShift.ipynb): Validate the feature store with a remote test application.
* [02a-Client.ipynb](./02-Client.ipynb): In a kind/k8s cluster, validate the feature store with a remote test application.
* [02b-Client-OpenShift.ipynb](./02-Client-OpenShift.ipynb): In an OpenShift cluster, validate the feature store with a remote test application.
* [03-Uninstall.ipynb](./03-Uninstall.ipynb): Clear the installed deployments.
1 change: 1 addition & 0 deletions examples/operator-quickstart/client-openshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ spec:
sed -i 's/print("\\n--- Run feast/# print("\\n--- Run feast/' test_workflow.py;
sed -i 's/print("\\n--- Load features/# print("\\n--- Load features/' test_workflow.py;
sed -i 's/store.materialize_incremental/# store.materialize_incremental/' test_workflow.py;
sed -i 's/store.push/# store.push/' test_workflow.py;
# cat feature_store.yaml;
echo "";
Expand Down
84 changes: 84 additions & 0 deletions examples/operator-quickstart/client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: client
spec:
replicas: 1
selector:
matchLabels:
app: client
template:
metadata:
labels:
app: client
spec:
initContainers:
- name: init-registry
command:
- sh
- '-c'
- 'until grpcurl -plaintext -d '''' -format text feast-example-registry.feast.svc.cluster.local:80 grpc.health.v1.Health/Check; do echo waiting for registry; sleep 2; done'
image: 'fullstorydev/grpcurl:v1.9.1-alpine'
- name: feast-apply
image: 'quay.io/tchughesiv/feature-server:0.41.0-dev'
command: ["/bin/sh", "-c"]
args:
- |
echo "Starting feast initialization job...";
cd /feast-init;
echo 'from feast.repo_operations import init_repo
from unittest import mock
from feast.templates.postgres.bootstrap import bootstrap
project_directory = "sample"
template = "postgres"
with mock.patch("click.prompt", side_effect=["postgres.feast.svc.cluster.local", "5432", "feast", "public", "feast", "feast"]):
with mock.patch("click.confirm", side_effect=[True]):
init_repo(project_directory, template)' > postgres-apply.py;
python3 postgres-apply.py;
rm postgres-apply.py;
cd /feast-init/sample/feature_repo;
sed -i 's/postgresql:\/\/postgres:[email protected]:55001/postgresql+psycopg:\/\/feast:[email protected]:5432/' feature_store.yaml;
sed -i 's/entity_key_serialization_version: 2/entity_key_serialization_version: 3/' feature_store.yaml;
sed -i 's/subprocess.run/# subprocess.run/' test_workflow.py;
sed -i 's/print("\\n--- Run feast/# print("\\n--- Run feast/' test_workflow.py;
sed -i 's/print("\\n--- Load features/# print("\\n--- Load features/' test_workflow.py;
sed -i 's/store.materialize_incremental/# store.materialize_incremental/' test_workflow.py;
sed -i 's/store.push/# store.push/' test_workflow.py;
# cat feature_store.yaml;
echo "";
echo "Executing feast apply...";
feast apply;
CURRENT_TIME=$(date -u +"%Y-%m-%dT%H:%M:%S");
feast materialize-incremental $CURRENT_TIME;
cp -f /feast-client/feature_store.yaml .;
volumeMounts:
- name: client-feature-store-config
mountPath: /feast-client
readOnly: true
- name: shared-data
mountPath: /feast-init
containers:
- name: client
image: 'quay.io/tchughesiv/feature-server:0.41.0-dev'
imagePullPolicy: Always
workingDir: /feast-init/sample/feature_repo
command: ["sleep", "infinity"]
volumeMounts:
- name: client-feature-store-config
mountPath: /feast-client
readOnly: true
- name: shared-data
mountPath: /feast-init
volumes:
- name: client-feature-store-config
configMap:
name: feast-example-client
- name: shared-data
emptyDir: {}

0 comments on commit 40437a7

Please sign in to comment.