All pages
Powered by GitBook
1 of 8

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Install Feast

A production deployment of Feast is deployed using Kubernetes.

This guide installs Feast into an existing Kubernetes cluster using Helm. The installation is not specific to any cloud platform or environment, but requires Kubernetes and Helm.

This guide installs Feast into an AWS environment using Terraform. The Terraform script is opinionated and intended to allow you to start quickly.

This guide installs Feast into an Azure AKS environment with Helm.

This guide installs Feast into an Azure environment using Terraform. The Terraform script is opinionated and intended to allow you to start quickly.

This guide installs Feast into a Google Cloud environment using Terraform. The Terraform script is opinionated and intended to allow you to start quickly.

This guide installs Feast into an existing or using Kustomize.

Kubernetes (with Helm)

Amazon EKS (with Terraform)

Azure AKS (with Helm)

Azure AKS (with Terraform)

Google Cloud GKE (with Terraform)

IBM Cloud Kubernetes Service (IKS) and Red Hat OpenShift (using Kustomize)

Kubernetes (with Helm)
Amazon EKS (with Terraform)
Azure AKS (with Helm)
Azure AKS (with Terraform)
Google Cloud GKE (with Terraform)
IBM Cloud Kubernetes Service
Red Hat OpenShift on IBM Cloud
IBM Cloud Kubernetes Service (IKS) and Red Hat OpenShift (with Kustomize)

Amazon EKS (with Terraform)

Overview

This guide installs Feast on AWS using our reference Terraform configuration.

The Terraform configuration used here is a greenfield installation that neither assumes anything about, nor integrates with, existing resources in your AWS account. The Terraform configuration presents an easy way to get started, but you may want to customize this set up before using Feast in production.

This Terraform configuration creates the following resources:

  • Kubernetes cluster on Amazon EKS (3x r3.large nodes)

  • Kafka managed by Amazon MSK (2x kafka.t3.small nodes)

  • Postgres database for Feast metadata, using serverless Aurora (min capacity: 2)

  • Redis cluster, using Amazon Elasticache (1x cache.t2.micro)

  • Amazon EMR cluster to run Spark (3x spot m4.xlarge)

  • Staging S3 bucket to store temporary data

  • Create an AWS account and

  • Install > = 0.12 (tested with 0.13.3)

  • Install (tested with v3.3.4)

Create a .tfvars file underfeast/infra/terraform/aws. Name the file. In our example, we use my_feast.tfvars. You can see the full list of configuration variables in variables.tf. At a minimum, you need to set name_prefix and an AWS region:

After completing the configuration, initialize Terraform and apply:

Starting may take a minute. A kubectl configuration file is also created in this directory, and the file's name will start with kubeconfig_ and end with a random suffix.

After all pods are running, connect to the Jupyter Notebook Server running in the cluster.

To connect to the remote Feast server you just created, forward a port from the remote k8s cluster to your local machine. Replace kubeconfig_XXXXXXX below with the kubeconfig file name Terraform generates for you.

You can now connect to the bundled Jupyter Notebook Server at localhost:8888 and follow the example Jupyter notebook.

my_feast.tfvars
name_prefix = "my-feast"
region      = "us-east-1"
$ cd feast/infra/terraform/aws
$ terraform init
$ terraform apply -var-file=my_feast.tfvars
KUBECONFIG=kubeconfig_XXXXXXX kubectl port-forward \
$(kubectl get pod -o custom-columns=:metadata.name | grep jupyter) 8888:8888
Forwarding from 127.0.0.1:8888 -> 8888
Forwarding from [::1]:8888 -> 8888

1. Requirements

2. Configure Terraform

3. Apply

4. Connect to Feast using Jupyter

configure credentials locally
Terraform
Helm

Google Cloud GKE (with Terraform)

Overview

This guide installs Feast on GKE using our reference Terraform configuration.

The Terraform configuration used here is a greenfield installation that neither assumes anything about, nor integrates with, existing resources in your GCP account. The Terraform configuration presents an easy way to get started, but you may want to customize this set up before using Feast in production.

This Terraform configuration creates the following resources:

  • GKE cluster

  • Feast services running on GKE

  • Google Memorystore (Redis) as online store

  • Dataproc cluster

  • Kafka running on GKE, exposed to the dataproc cluster via internal load balancer

  • Install > = 0.12 (tested with 0.13.3)

  • Install (tested with v3.3.4)

  • GCP and sufficient to create the resources listed above.

Create a .tfvars file underfeast/infra/terraform/gcp. Name the file. In our example, we use my_feast.tfvars. You can see the full list of configuration variables in variables.tf. Sample configurations are provided below:

After completing the configuration, initialize Terraform and apply:

Azure AKS (with Terraform)

Overview

This guide installs Feast on Azure using our reference Terraform configuration.

The Terraform configuration used here is a greenfield installation that neither assumes anything about, nor integrates with, existing resources in your Azure account. The Terraform configuration presents an easy way to get started, but you may want to customize this set up before using Feast in production.

This Terraform configuration creates the following resources:

  • Kubernetes cluster on Azure AKS

  • Kafka managed by HDInsight

  • Postgres database for Feast metadata, running as a pod on AKS

  • Redis cluster, using Azure Cache for Redis

  • to run Spark

  • Staging Azure blob storage container to store temporary data

  • Create an Azure account and

  • Install (tested with 0.13.5)

  • Install (tested with v3.4.2)

Create a .tfvars file underfeast/infra/terraform/azure. Name the file. In our example, we use my_feast.tfvars. You can see the full list of configuration variables in variables.tf. At a minimum, you need to set name_prefix and resource_group:

After completing the configuration, initialize Terraform and apply:

After all pods are running, connect to the Jupyter Notebook Server running in the cluster.

To connect to the remote Feast server you just created, forward a port from the remote k8s cluster to your local machine.

You can now connect to the bundled Jupyter Notebook Server at localhost:8888 and follow the example Jupyter notebook.

1. Requirements

2. Configure Terraform

3. Apply

Terraform
Helm
authentication
privilege

1. Requirements

2. Configure Terraform

3. Apply

4. Connect to Feast using Jupyter

spark-on-k8s-operator
configure credentials locally
Terraform
Helm
my_feast.tfvars
gcp_project_name        = "kf-feast"
name_prefix             = "feast-0-8"
region                  = "asia-east1"
gke_machine_type        = "n1-standard-2"
network                 = "default"
subnetwork              = "default"
dataproc_staging_bucket = "feast-dataproc"
$ cd feast/infra/terraform/gcp
$ terraform init
$ terraform apply -var-file=my_feast.tfvars
my_feast.tfvars
name_prefix = "feast"
resource_group = "Feast" # pre-existing resource group
$ cd feast/infra/terraform/azure
$ terraform init
$ terraform apply -var-file=my_feast.tfvars
kubectl port-forward $(kubectl get pod -o custom-columns=:metadata.name | grep jupyter) 8888:8888
Forwarding from 127.0.0.1:8888 -> 8888
Forwarding from [::1]:8888 -> 8888

Docker Compose

This guide is meant for exploratory purposes only. It allows users to run Feast locally using Docker Compose instead of Kubernetes. The goal of this guide is for users to be able to quickly try out the full Feast stack without needing to deploy to Kubernetes. It is not meant for production use.

Overview

This guide shows you how to deploy Feast using Docker Compose. Docker Compose allows you to explore the functionality provided by Feast while requiring only minimal infrastructure.

This guide includes the following containerized components:

  • A complete Feast deployment

    • Feast Core with Postgres

    • Feast Online Serving with Redis.

    • Feast Job Service

  • A Jupyter Notebook Server with built in Feast example(s). For demo purposes only.

  • A Kafka cluster for testing streaming ingestion. For demo purposes only.

Clone the latest stable version of Feast from the :

Create a new configuration file:

Start Feast with Docker Compose:

Wait until all all containers are in a running state:

You can now connect to the bundled Jupyter Notebook Server running at localhost:8888 and follow the example Jupyter notebook.

Please ensure that the following ports are available on your host machine:

  • 6565

  • 6566

  • 8888

If a port conflict cannot be resolved, you can modify the port mappings in the provided file to use different ports on the host.

If some of the containers continue to restart, or you are unable to access a service, inspect the logs using the following command:

If you are unable to resolve the problem, visit to create an issue.

The Feast Docker Compose setup can be configured by modifying properties in your .env file.

To access Google Cloud Storage as a data source, the Docker Compose installation requires access to a GCP service account.

  • Create a new and save a JSON key.

  • Grant the service account access to your bucket(s).

  • Copy the service account to the path you have configured in .env under GCP_SERVICE_ACCOUNT.

IBM Cloud Kubernetes Service (IKS) and Red Hat OpenShift (with Kustomize)

This guide installs Feast on an existing IBM Cloud Kubernetes cluster or Red Hat OpenShift on IBM Cloud , and ensures the following services are running:

  • Feast Core

  • Feast Online Serving

  • Postgres

9094

  • 5432

  • Restart your Docker Compose setup of Feast.

    git clone https://github.com/feast-dev/feast.git
    cd feast/infra/docker-compose
    cp .env.sample .env
    docker-compose pull && docker-compose up -d
    docker-compose ps
    docker-compose logs -f -t

    Get Feast

    Start Feast

    Try our example(s)

    Troubleshooting

    Open ports

    Containers are restarting or unavailable

    Configuration

    Accessing Google Cloud Storage (GCP)

    Feast repository
    docker-compose.yml
    GitHub
    service account

    Redis

  • Kafka (Optional)

  • Feast Jupyter (Optional)

  • Prometheus (Optional)

    1. IBM Cloud Kubernetes Service or Red Hat OpenShift on IBM Cloud

    2. Install Kubectl that matches the major.minor versions of your IKS or Install the OpenShift CLI that matches your local operating system and OpenShift cluster version.

    3. Install Helm 3

    4. Install

    :warning: If you have Red Hat OpenShift Cluster on IBM Cloud skip to this section.

    By default, IBM Cloud Kubernetes cluster uses IBM Cloud File Storage based on NFS as the default storage class, and non-root users do not have write permission on the volume mount path for NFS-backed storage. Some common container images in Feast, such as Redis, Postgres, and Kafka specify a non-root user to access the mount path in the images. When containers are deployed using these images, the containers fail to start due to insufficient permissions of the non-root user creating folders on the mount path.

    IBM Cloud Block Storage allows for the creation of raw storage volumes and provides faster performance without the permission restriction of NFS-backed storage

    Therefore, to deploy Feast we need to set up IBM Cloud Block Storage as the default storage class so that you can have all the functionalities working and get the best experience from Feast.

    1. Follow the instructions to install the Helm version 3 client on your local machine.

    2. Add the IBM Cloud Helm chart repository to the cluster where you want to use the IBM Cloud Block Storage plug-in.

       helm repo add iks-charts https://icr.io/helm/iks-charts
       helm repo update
    3. Install the IBM Cloud Block Storage plug-in. When you install the plug-in, pre-defined block storage classes are added to your cluster.

       helm install v2.0.2 iks-charts/ibmcloud-block-storage-plugin -n kube-system

      Example output:

      NAME: v2.0.2
      LAST DEPLOYED: Fri Feb  5 12:29:50 2021
      NAMESPACE: kube-system
      STATUS: deployed
      REVISION: 1
      NOTES:
      Thank you for installing: ibmcloud-block-storage-plugin.   Your release is named: v2.0.2
       ...
    4. Verify that all block storage plugin pods are in a "Running" state.

    5. Verify that the storage classes for Block Storage were added to your cluster.

    6. Set the Block Storage as the default storageclass.

      Example output:

      Security Context Constraint Setup (OpenShift only)

    By default, in OpenShift, all pods or containers will use the Restricted SCC which limits the UIDs pods can run with, causing the Feast installation to fail. To overcome this, you can allow Feast pods to run with any UID by executing the following:

    Install Feast using kustomize. The pods may take a few minutes to initialize.

    You may optionally enable the Feast Jupyter component which contains code examples to demonstrate Feast. Some examples require Kafka to stream real time features to the Feast online serving. To enable, edit the following properties in the values.yaml under the manifests/contrib/feast folder:

    Then regenerate the resource manifests and deploy:

    After all the pods are in a RUNNING state, port-forward to the Jupyter Notebook Server in the cluster:

    You can now connect to the bundled Jupyter Notebook Server at localhost:8888 and follow the example Jupyter notebook.

    When running the minimal_ride_hailing_example Jupyter Notebook example the following errors may occur:

    1. When running job = client.get_historical_features(...):

       KeyError: 'historical_feature_output_location'

      or

       KeyError: 'spark_staging_location'

      Add the following environment variable:

       os.environ["FEAST_HISTORICAL_FEATURE_OUTPUT_LOCATION"] = "file:///home/jovyan/historical_feature_output"
       os.environ["FEAST_SPARK_STAGING_LOCATION"] = "file:///home/jovyan/test_data"
    2. When running job.get_status()

       <SparkJobStatus.FAILED: 2>

      Add the following environment variable:

       os.environ["FEAST_REDIS_HOST"] = "feast-release-redis-master"
    3. When running job = client.start_stream_to_online_ingestion(...)

      Add the following environment variable:

    Overview

    oc adm policy add-scc-to-user anyuid -z default,kf-feast-kafka -n feast
    git clone https://github.com/kubeflow/manifests
    cd manifests/contrib/feast/
    kustomize build feast/base | kubectl apply -n feast -f -
    kafka.enabled: true
    feast-jupyter.enabled: true
    make feast/base
    kustomize build feast/base | kubectl apply -n feast -f -
    kubectl port-forward \
    $(kubectl get pod -l app=feast-jupyter -o custom-columns=:metadata.name) 8888:8888 -n feast
    Forwarding from 127.0.0.1:8888 -> 8888
    Forwarding from [::1]:8888 -> 8888
    kustomize build feast/base | kubectl delete -n feast -f -

    1. Prerequisites

    2. Preparation

    IBM Cloud Block Storage Setup (IKS only)

    3. Installation

    Optional: Enable Feast Jupyter and Kafka

    4. Use Feast Jupyter Notebook Server to connect to Feast

    5. Uninstall Feast

    6. Troubleshooting

    Azure AKS (with Helm)

    Overview

    This guide installs Feast on Azure Kubernetes cluster (known as AKS), and ensures the following services are running:

    • Feast Core

    • Feast Online Serving

    • Postgres

    • Redis

    • Spark

    • Kafka

    • Feast Jupyter (Optional)

    • Prometheus (Optional)

    1. Install and configure

    2. Install and configure

    3. Install

    Create an AKS cluster with Azure CLI. The detailed steps can be found , and a high-level walk through includes:

    Add the Feast Helm repository and download the latest charts:

    Feast includes a Helm chart that installs all necessary components to run Feast Core, Feast Online Serving, and an example Jupyter notebook.

    Feast Core requires Postgres to run, which requires a secret to be set on Kubernetes:

    Install Feast using Helm. The pods may take a few minutes to initialize.

    Follow the documentation , and Feast documentation to

    and ensure the service account used by Feast has permissions to manage Spark Application resources. This depends on your k8s setup, but typically you'd need to configure a Role and a RoleBinding like the one below:

    After all the pods are in a RUNNING state, port-forward to the Jupyter Notebook Server in the cluster:

    You can now connect to the bundled Jupyter Notebook Server at localhost:8888 and follow the example Jupyter notebook.

    If you are running the , you may want to make sure the following environment variables are correctly set:

    Kubernetes (with Helm)

    This guide installs Feast on an existing Kubernetes cluster, and ensures the following services are running:

    • Feast Core

    • Feast Online Serving

    • Postgres

    Feast and Spark

    az group create --name myResourceGroup  --location eastus
    az acr create --resource-group myResourceGroup  --name feast-AKS-ACR --sku Basic
    az aks create -g myResourceGroup  -n feast-AKS --location eastus --attach-acr feast-AKS-ACR --generate-ssh-keys
    
    az aks install-cli
    az aks get-credentials --resource-group myResourceGroup  --name  feast-AKS
    helm version # make sure you have the latest Helm installed
    helm repo add feast-charts https://feast-helm-charts.storage.googleapis.com
    helm repo update
    kubectl create secret generic feast-postgresql --from-literal=postgresql-password=password
    helm install feast-release feast-charts/feast
    helm repo add spark-operator https://googlecloudplatform.github.io/spark-on-k8s-operator 
    helm install my-release spark-operator/spark-operator  --set serviceAccounts.spark.name=spark --set image.tag=v1beta2-1.1.2-2.4.5
    cat <<EOF | kubectl apply -f -
    kind: Role
    apiVersion: rbac.authorization.k8s.io/v1beta1
    metadata:
      name: use-spark-operator
      namespace: <REPLACE ME>
    rules:
    - apiGroups: ["sparkoperator.k8s.io"]
      resources: ["sparkapplications"]
      verbs: ["create", "delete", "deletecollection", "get", "list", "update", "watch", "patch"]
    ---
    apiVersion: rbac.authorization.k8s.io/v1beta1
    kind: RoleBinding
    metadata:
      name: use-spark-operator
      namespace: <REPLACE ME>
    roleRef:
      kind: Role
      name: use-spark-operator
      apiGroup: rbac.authorization.k8s.io
    subjects:
      - kind: ServiceAccount
        name: default
    EOF
    kubectl port-forward \
    $(kubectl get pod -o custom-columns=:metadata.name | grep jupyter) 8888:8888
    Forwarding from 127.0.0.1:8888 -> 8888
    Forwarding from [::1]:8888 -> 8888
    demo_data_location = "wasbs://<container_name>@<storage_account_name>.blob.core.windows.net/"
    os.environ["FEAST_AZURE_BLOB_ACCOUNT_NAME"] = "<storage_account_name>"
    os.environ["FEAST_AZURE_BLOB_ACCOUNT_ACCESS_KEY"] = <Insert your key here>
    os.environ["FEAST_HISTORICAL_FEATURE_OUTPUT_LOCATION"] = "wasbs://<container_name>@<storage_account_name>.blob.core.windows.net/out/"
    os.environ["FEAST_SPARK_STAGING_LOCATION"] = "wasbs://<container_name>@<storage_account_name>.blob.core.windows.net/artifacts/"
    os.environ["FEAST_SPARK_LAUNCHER"] = "k8s"
    os.environ["FEAST_SPARK_K8S_NAMESPACE"] = "default"
    os.environ["FEAST_HISTORICAL_FEATURE_OUTPUT_FORMAT"] = "parquet"
    os.environ["FEAST_REDIS_HOST"] = "feast-release-redis-master.default.svc.cluster.local"
    os.environ["DEMO_KAFKA_BROKERS"] = "feast-release-kafka.default.svc.cluster.local:9092"

    1. Requirements

    2. Preparation

    3. Feast installation

    4. Spark operator installation

    5. Use Jupyter to connect to Feast

    6. Environment variables

    7. Further Reading

    Azure CLI
    Kubectl
    Helm 3
    here
    to install Spark operator on Kubernetes
    configure Spark roles
    Minimal Ride Hailing Example
    Feast Concepts
    Feast Examples/Tutorials
    Feast Helm Chart Documentation
    Configuring Feast components

    Redis

  • Feast Jupyter (Optional)

  • Prometheus (Optional)

    1. Install and configure Kubectl

    2. Install Helm 3

    Add the Feast Helm repository and download the latest charts:

    Feast includes a Helm chart that installs all necessary components to run Feast Core, Feast Online Serving, and an example Jupyter notebook.

    Feast Core requires Postgres to run, which requires a secret to be set on Kubernetes:

    Install Feast using Helm. The pods may take a few minutes to initialize.

    After all the pods are in a RUNNING state, port-forward to the Jupyter Notebook Server in the cluster:

    You can now connect to the bundled Jupyter Notebook Server at localhost:8888 and follow the example Jupyter notebook.

    • Feast Concepts

    • Feast Examples/Tutorials

    • Feast Helm Chart Documentation

    • Configuring Feast components

    Overview

    helm repo add feast-charts https://feast-helm-charts.storage.googleapis.com
    helm repo update
    kubectl create secret generic feast-postgresql --from-literal=postgresql-password=password
    helm install feast-release feast-charts/feast
    kubectl port-forward \
    $(kubectl get pod -l app=feast-jupyter -o custom-columns=:metadata.name) 8888:8888
    Forwarding from 127.0.0.1:8888 -> 8888
    Forwarding from [::1]:8888 -> 8888

    1. Requirements

    2. Preparation

    3. Installation

    4. Use Jupyter to connect to Feast

    5. Further Reading

     kubectl get pods -n kube-system | grep ibmcloud-block-storage
     kubectl get storageclasses | grep ibmc-block
     kubectl patch storageclass ibmc-block-gold -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
     kubectl patch storageclass ibmc-file-gold -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
    
     # Check the default storageclass is block storage
     kubectl get storageclass | grep \(default\)
     ibmc-block-gold (default)   ibm.io/ibmc-block   65s
     org.apache.kafka.vendor.common.KafkaException: Failed to construct kafka consumer
     os.environ["DEMO_KAFKA_BROKERS"] = "feast-release-kafka:9092"
    Kustomize
    Feast and Spark
    http://localhost:8888/tree?localhost
    http://localhost:8888/tree?localhost
    http://localhost:8888/tree?localhost
    http://localhost:8888/tree?localhost