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

Feature/lrangine master #7

Merged
merged 17 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
91c8910
feat: Loading the CA trusted store certificate into Feast to verify t…
lokeshrangineni Dec 18, 2024
efdebcd
fix: Updated python-helm-demo example to use MinIO instead of GS (#4691)
dmartinol Dec 18, 2024
c63f28d
fix: Fixing some of the warnings with the github actions (#4763)
lokeshrangineni Dec 19, 2024
0925e47
Update README.md
franciscojavierarceo Dec 19, 2024
1f32e40
Snyk scan vulnerability fixes.
lokeshrangineni Dec 19, 2024
ce6f792
Reverting the grpc version so hoping that it will fix the java integr…
lokeshrangineni Dec 19, 2024
f571b5c
Upgrading the grpc version as it didn't fix the problem
lokeshrangineni Dec 19, 2024
02a8dda
adding grpc-api libraries as dependency to solve some of the class no…
lokeshrangineni Dec 19, 2024
611966c
fix: sdk/python/feast/ui/package.json & sdk/python/feast/ui/yarn.lock…
snyk-bot Dec 19, 2024
c8c8345
[Snyk] Fix for 2 vulnerabilities (#3)
lokeshrangineni Dec 19, 2024
af2db69
Updating the requirements files.
lokeshrangineni Dec 19, 2024
fdff6de
Updating the requirements files.
lokeshrangineni Dec 19, 2024
e80d6de
Changing the python httpx package to 0.27.2 because after 0.28.0 vers…
lokeshrangineni Dec 20, 2024
89db2c6
[Snyk] Security upgrade io.grpc:grpc-services from 1.53.0 to 1.63.0 (#4)
lokeshrangineni Dec 20, 2024
a76bc57
[Snyk] Fix for 1 vulnerabilities (#5)
lokeshrangineni Dec 20, 2024
ba9bd1c
trying to fix some vulnerabilities in the requirements.txt files.
lokeshrangineni Dec 20, 2024
dfaa710
Updating the lettuce-core to fix the snyk vulnerability.
lokeshrangineni Dec 20, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/java_master_only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ jobs:
java-version: '11'
java-package: jdk
architecture: x64
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-it-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-it-maven-
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-ut-maven-${{ hashFiles('**/pom.xml') }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/java_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ jobs:
java-version: '11'
java-package: jdk
architecture: x64
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-it-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-it-maven-
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-ut-maven-${{ hashFiles('**/pom.xml') }}
Expand Down Expand Up @@ -97,11 +97,11 @@ jobs:
python-version: "3.11"
architecture: x64
- name: Authenticate to Google Cloud
uses: 'google-github-actions/auth@v1'
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Set up gcloud SDK
uses: google-github-actions/setup-gcloud@v1
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
- run: gcloud auth configure-docker --quiet
Expand Down Expand Up @@ -137,18 +137,18 @@ jobs:
with:
python-version: '3.11'
architecture: 'x64'
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-it-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-it-maven-
- name: Authenticate to Google Cloud
uses: 'google-github-actions/auth@v1'
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Set up gcloud SDK
uses: google-github-actions/setup-gcloud@v1
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
- name: Use gcloud CLI
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
- uses: amannn/action-semantic-pull-request@v5
with:
# Must use uppercase
subjectPattern: ^(?=[A-Z]).+$
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/operator_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: 1.21.x
- name: Operator tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_local_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Get uv cache dir
id: uv-cache
run: |
echo "::set-output name=dir::$(uv cache dir)"
echo "dir=$(uv cache dir)" >> $GITHUB_OUTPUT
- name: uv cache
uses: actions/cache@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Get uv cache dir
id: uv-cache
run: |
echo "::set-output name=dir::$(uv cache dir)"
echo "dir=$(uv cache dir)" >> $GITHUB_OUTPUT
- name: uv cache
uses: actions/cache@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Get uv cache dir
id: uv-cache
run: |
echo "::set-output name=dir::$(uv cache dir)"
run: |
echo "dir=$(uv cache dir)" >> $GITHUB_OUTPUT
- name: uv cache
uses: actions/cache@v4
with:
Expand All @@ -52,7 +52,7 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: './ui/.nvmrc'
registry-url: 'https://registry.npmjs.org'
Expand Down
13 changes: 8 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,15 @@ serving system must make a request to the feature store to retrieve feature valu

## Who is Feast for?

Feast helps ML platform/MLOps teams with DevOps experience productionize real-time models. Feast also helps these teams
build a feature platform that improves collaboration between data engineers, software engineers, machine learning
engineers, and data scientists.
Feast helps ML platform/MLOps teams with DevOps experience productionize real-time models. Feast also helps these teams build a feature platform that improves collaboration between data engineers, software engineers, machine learning engineers, and data scientists.

Feast is likely **not** the right tool if you
* are in an organization that’s just getting started with ML and is not yet sure what the business impact of ML is
* *For Data Scientists*: Feast is a a tool where you can easily define, store, and retrieve your features for both model development and model deployment. By using Feast, you can focus on what you do best: build features that power your AI/ML models and maximize the value of your data.

* *For MLOps Engineers*: Feast is a library that allows you to connect your existing infrastructure (e.g., online database, application server, microservice, analytical database, and orchestration tooling) that enables your Data Scientists to ship features for their models to production using a friendly SDK without having to be concerned with software engineering challenges that occur from serving real-time production systems. By using Feast, you can focus on maintaining a resilient system, instead of implementing features for Data Scientists.

* *For Data Engineers*: Feast provides a centralized catalog for storing feature definitions allowing one to maintain a single source of truth for feature data. It provides the abstraction for reading and writing to many different types of offline and online data stores. Using either the provided python SDK or the feature server service, users can write data to the online and/or offline stores and then read that data out again in either low-latency online scenarios for model inference, or in batch scenarios for model training.

* *For AI Engineers*: Feast provides a platform designed to scale your AI applications by enabling seamless integration of richer data and facilitating fine-tuning. With Feast, you can optimize the performance of your AI models while ensuring a scalable and efficient data pipeline.

## What Feast is not?

Expand Down
3 changes: 3 additions & 0 deletions docs/getting-started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Feast (Feature Store) is an open-source feature store designed to facilitate the

* *For Data Engineers*: Feast provides a centralized catalog for storing feature definitions allowing one to maintain a single source of truth for feature data. It provides the abstraction for reading and writing to many different types of offline and online data stores. Using either the provided python SDK or the feature server service, users can write data to the online and/or offline stores and then read that data out again in either low-latency online scenarios for model inference, or in batch scenarios for model training.

* *For AI Engineers*: Feast provides a platform designed to scale your AI applications by enabling seamless integration of richer data and facilitating fine-tuning. With Feast, you can optimize the performance of your AI models while ensuring a scalable and efficient data pipeline.


For more info refer to [Introduction to feast](../README.md)

## Prerequisites
Expand Down
5 changes: 5 additions & 0 deletions docs/how-to-guides/starting-feast-servers-tls-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,8 @@ INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on https://0.0.0.0:8888 (Press CTRL+C to quit)
```


## Adding public key to CA trust store and configuring the feast to use the trust store.
You can pass the public key for SSL verification using the `cert` parameter, however, it is sometimes difficult to maintain individual certificates and pass them individually.
The alternative recommendation is to add the public certificate to CA trust store and set the path as an environment variable (e.g., `FEAST_CA_CERT_FILE_PATH`). Feast will use the trust store path in the `FEAST_CA_CERT_FILE_PATH` environment variable.
159 changes: 120 additions & 39 deletions examples/python-helm-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,87 +3,168 @@

For this tutorial, we set up Feast with Redis.

We use the Feast CLI to register and materialize features, and then retrieving via a Feast Python feature server deployed in Kubernetes
We use the Feast CLI to register and materialize features from the current machine, and then retrieving via a
Feast Python feature server deployed in Kubernetes

## First, let's set up a Redis cluster
1. Start minikube (`minikube start`)
2. Use helm to install a default Redis cluster
1. Use helm to install a default Redis cluster
```bash
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm install my-redis bitnami/redis
```
![](redis-screenshot.png)
3. Port forward Redis so we can materialize features to it
1. Port forward Redis so we can materialize features to it

```bash
kubectl port-forward --namespace default svc/my-redis-master 6379:6379
```
4. Get your Redis password using the command (pasted below for convenience). We'll need this to tell Feast how to communicate with the cluster.
1. Get your Redis password using the command (pasted below for convenience). We'll need this to tell Feast how to communicate with the cluster.

```bash
export REDIS_PASSWORD=$(kubectl get secret --namespace default my-redis -o jsonpath="{.data.redis-password}" | base64 --decode)
echo $REDIS_PASSWORD
```

## Then, let's set up a MinIO S3 store
Manifests have been taken from [Deploy Minio in your project](https://ai-on-openshift.io/tools-and-applications/minio/minio/#deploy-minio-in-your-project).

1. Deploy MinIO instance:
```
kubectl apply -f minio-dev.yaml
```

1. Forward the UI port:
```console
kubectl port-forward svc/minio-service 9090:9090
```
1. Login to (localhost:9090)[http://localhost:9090] as `minio`/`minio123` and create bucket called `feast-demo`.
1. Stop previous port forwarding and forward the API port instead:
```console
kubectl port-forward svc/minio-service 9000:9000
```

## Next, we setup a local Feast repo
1. Install Feast with Redis dependencies `pip install "feast[redis]"`
2. Make a bucket in GCS (or S3)
3. The feature repo is already setup here, so you just need to swap in your GCS bucket and Redis credentials.
We need to modify the `feature_store.yaml`, which has two fields for you to replace:
1. Install Feast with Redis dependencies `pip install "feast[redis,aws]"`
1. The feature repo is already setup here, so you just need to swap in your Redis credentials.
We need to modify the `feature_store.yaml`, which has one field for you to replace:
```console
sed "s/_REDIS_PASSWORD_/${REDIS_PASSWORD}/" feature_repo/feature_store.yaml.template > feature_repo/feature_store.yaml
cat feature_repo/feature_store.yaml
```

Example repo:
```yaml
registry: gs://[YOUR GCS BUCKET]/demo-repo/registry.db
registry: s3://localhost:9000/feast-demo/registry.db
project: feast_python_demo
provider: gcp
provider: local
online_store:
type: redis
# Note: this would normally be using instance URL's to access Redis
connection_string: localhost:6379,password=[YOUR PASSWORD]
connection_string: localhost:6379,password=****
offline_store:
type: file
entity_key_serialization_version: 2
```
4. Run `feast apply` from within the `feature_repo` directory to apply your local features to the remote registry
- Note: you may need to authenticate to gcloud first with `gcloud auth login`
5. Materialize features to the online store:
1. To run `feast apply` from the current machine we need to define the AWS credentials to connect the MinIO S3 store, which
are defined in [minio.env](./minio.env):
```console
source minio.env
cd feature_repo
feast apply
```
1. Let's validate the setup by running some queries
```console
feast entities list
feast feature-views list
```
1. Materialize features to the online store:
```bash
cd feature_repo
CURRENT_TIME=$(date -u +"%Y-%m-%dT%H:%M:%S")
feast materialize-incremental $CURRENT_TIME
```

## Now let's setup the Feast Server
1. Add the gcp-auth addon to mount GCP credentials:
```bash
minikube addons enable gcp-auth
```
2. Add Feast's Python/Go feature server chart repo
1. Add Feast's Python feature server chart repo
```bash
helm repo add feast-charts https://feast-helm-charts.storage.googleapis.com
helm repo update
```
3. For this tutorial, because we don't have a direct hosted endpoint into Redis, we need to change `feature_store.yaml` to talk to the Kubernetes Redis service
```bash
sed -i '' 's/localhost:6379/my-redis-master:6379/g' feature_store.yaml
```
4. Install the Feast helm chart: `helm install feast-release feast-charts/feast-feature-server --set feature_store_yaml_base64=$(base64 feature_store.yaml)`
> **Dev instructions**: if you're changing the java logic or chart, you can do
1. `eval $(minikube docker-env)`
2. `make build-feature-server-dev`
3. `helm install feast-release ../../../infra/charts/feast-feature-server --set image.tag=dev --set feature_store_yaml_base64=$(base64 feature_store.yaml)`
5. (Optional): check logs of the server to make sure it’s working
1. For this tutorial, we'll use a predefined configuration where we just needs to inject the Redis service password:
```console
sed "s/_REDIS_PASSWORD_/$REDIS_PASSWORD/" online_feature_store.yaml.template > online_feature_store.yaml
cat online_feature_store.yaml
```
As you see, the connection points to `my-redis-master:6379` instead of `localhost:6379`.

1. Install the Feast helm chart:
```console
helm upgrade --install feast-online feast-charts/feast-feature-server \
--set fullnameOverride=online-server --set feast_mode=online \
--set feature_store_yaml_base64=$(base64 -i 'online_feature_store.yaml')
```
1. Patch the deployment to include MinIO settings:
```console
kubectl patch deployment online-server --type='json' -p='[
{
"op": "add",
"path": "/spec/template/spec/containers/0/env/-",
"value": {
"name": "AWS_ACCESS_KEY_ID",
"value": "minio"
}
},
{
"op": "add",
"path": "/spec/template/spec/containers/0/env/-",
"value": {
"name": "AWS_SECRET_ACCESS_KEY",
"value": "minio123"
}
},
{
"op": "add",
"path": "/spec/template/spec/containers/0/env/-",
"value": {
"name": "AWS_DEFAULT_REGION",
"value": "default"
}
},
{
"op": "add",
"path": "/spec/template/spec/containers/0/env/-",
"value": {
"name": "FEAST_S3_ENDPOINT_URL",
"value": "http://minio-service:9000"
}
}
]'
kubectl wait --for=condition=available deployment/online-server --timeout=2m
```
1. (Optional): check logs of the server to make sure it’s working
```bash
kubectl logs svc/feast-release-feast-feature-server
kubectl logs svc/online-server
```
6. Port forward to expose the grpc endpoint:
1. Port forward to expose the grpc endpoint:
```bash
kubectl port-forward svc/feast-release-feast-feature-server 6566:80
kubectl port-forward svc/online-server 6566:80
```
7. Run test fetches for online features:8.
- First: change back the Redis connection string to allow localhost connections to Redis
1. Run test fetches for online features:8.
```bash
sed -i '' 's/my-redis-master:6379/localhost:6379/g' feature_store.yaml
source minio.env
cd test
python test_python_fetch.py
```
- Then run the included fetch script, which fetches both via the HTTP endpoint and for comparison, via the Python SDK
```bash
python test_python_fetch.py

Output example:
```console
--- Online features with SDK ---
WARNING:root:_list_feature_views will make breaking changes. Please use _list_batch_feature_views instead. _list_feature_views will behave like _list_all_feature_views in the future.
conv_rate : [0.6799587607383728, 0.9761165976524353]
driver_id : [1001, 1002]

--- Online features with HTTP endpoint ---
conv_rate : [0.67995876 0.9761166 ]
driver_id : [1001 1002]
```
Binary file not shown.
10 changes: 0 additions & 10 deletions examples/python-helm-demo/feature_repo/feature_store.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
registry: s3://feast-demo/registry.db
project: feast_python_demo
provider: local
online_store:
type: redis
connection_string: localhost:6379,password=_REDIS_PASSWORD_
offline_store:
type: file
entity_key_serialization_version: 2
Loading
Loading