examples/operator-quickstart/02-Demo.ipynb
We'll use the following tutorial as a demonstration.
!kubectl logs -f deploy/feast-example -c feast-init
feature_store.yaml.!kubectl exec deploy/feast-example -itc online -- cat feature_store.yaml
Update the feature store definitions for the tutorial and load data from feature views into the online store, beginning from either the previous materialize or materialize-incremental end date, or the beginning of time.
We'll do this by using the CronJob created by the operator which, by default, will execute the following commands when run -
Before we run the Job, let's ensure our FeatureStore CR is configured accordingly.
!kubectl get feast/example -o jsonpath='{.status.applied.cronJob.containerConfigs.commands}'
Now let's run a Job from the existing CronJob, wait for its completion, and then check the logs.
!kubectl create job --from=cronjob/feast-example feast-example-apply
!kubectl wait --for=condition=complete --timeout=8m job/feast-example-apply
!kubectl logs job/feast-example-apply --all-containers=true
List the registered feast projects, feature views, & entities.
!kubectl exec deploy/feast-example -itc online -- feast projects list
!kubectl exec deploy/feast-example -itc online -- feast feature-views list
!kubectl exec deploy/feast-example -itc online -- feast entities list
Install the required packages, then train and test the model.
We'll do this by leveraging the same Operator created CronJob. We'll modify it to run the following commands for us -
!kubectl patch feast/example --patch '{"spec":{"cronJob":{"containerConfigs":{"commands":["pip install -r ../requirements.txt","cd ../ && python run.py"]}}}}' --type=merge
Again, before we run the Job, let's ensure our FeatureStore CR is configured accordingly.
!kubectl get feast/example -o jsonpath='{.status.applied.cronJob.containerConfigs.commands}'
Now let's run another Job from the modified CronJob, wait for its completion, and then check the logs. The completed Job logs should show all necessary python installs and end with "Loan rejected!".
!kubectl create job --from=cronjob/feast-example feast-example-demo
!kubectl wait --for=condition=complete --timeout=8m job/feast-example-demo
!kubectl logs job/feast-example-demo --all-containers=true
In a new terminal, run the following command and leave it active.
$ kubectl port-forward deploy/feast-example 8501:8501
Start the Streamlit application
!kubectl exec deploy/feast-example -itc online -- bash -c 'cd ../ && streamlit run --server.port 8501 streamlit_app.py'
Then navigate to the local URL on which Streamlit is being served.