Learn how to deploy Geneva on Kubernetes using KubeRay for distributed feature engineering workflows on GKE and EKS.
Feature Engineering is deployed automatically in LanceDB EnterpriseFor manual installation in self-managed environments, follow the instructions below.
Feature Engineering can be deployed as part of LanceDB Enterprise in managed or self-managed environments. First class support is provided for Azure, AWS, and GCP, including deployment automation via Terraform and Helm.
Inside your Kubernetes cluster, you need a Kubernetes service account which provides the credentials your k8s pods (Ray) run with. Here’s how to create your KSA.
Google Kubernetes Engine (GKE) is a GCP service that deploys Kubernetes and can manage on-demand provisioning of cluster nodes. Ray can be deployed on GKE clusters using the KubeRay k8s operator.GKE provides the option for an out-of-the-box KubeRay operator deployment. The version of KubeRay is tied to the version of GKE you have deployed. Currently these versions are supported:
GKE 1.30 / KubeRay 1.1
GKE 1.31 / KubeRay 1.2
Alternatively, you can also deploy your own KubeRay operator to get the latest KubeRay 1.3 version.The following sections describe in more details other required configuration settings required for Geneva to perform distributed execution.
GKE allows you to specify templates for virtual machines in “node pools”. These allow you to manage and configure resources such as the number of CPUs, number of GPUs, amount of memory, and if instances are spot or regular virtual machines.You can define your node pools however you want but Geneva uses three specific Kubernetes labels when deploying Ray pods on GKE: ray-head, ray-worker-cpu, ray-worker-gpu
Head nodes are where the Ray dashboard and scheduler run. They should be non-spot instances and should not have processing workloads scheduled on them. Geneva looks for nodes with the geneva.lancedb.com/ray-head k8s label for this role.
CPU Worker nodes are where distributed processing that does not require GPU should be scheduled. Geneva looks for nodes with the geneva.lancedb.com/ray-worker-cpu k8s label when these nodes are requested.
GPU Worker nodes are where distributed processing that require GPU should be scheduled. Geneva looks for nodes with the geneva.lancedb.com/ray-worker-gpu k8s label when these nodes are requested.
Geneva needs the ability to deploy a KubeRay cluster and submit jobs to Ray. The workers in the Ray cluster need the ability to read and write to the Google Cloud Storage (GCS) buckets. This requires setting up the proper k8s permissions and GCP IAM grants. There are three main areas to setup and verify:
In the following sections we’ll use these variables:
NAMESPACE=lancedb # replace with your actual namespace if differentKSA_NAME=geneva-ray-runner # replace with an identity namePROJECT_ID=... # replace with your google cloud project nameGSA_EMAIL=${KSA_NAME}@${PROJECT_ID}.iam.gserviceaccount.comLANCEDB_URI=gs://bucket/db # replace with your own path
To give your k8s workers the ability to read and write from your LanceDB buckets, your KSA needs to be bound to a Google Cloud service account (GSA) with those grants. With this setup, any pod using the KSA will automatically get a token that lets it impersonate the GSA.Let’s set this up:Create a Google Cloud Service Account
gcloud iam service-accounts create ${KSA_NAME} \ --project=${PROJECT_ID} \ --description="Service account for ray workloads in GKE" \ --display-name="Ray Runner GSA"
You can verify this using:
gcloud iam service-accounts list --filter="displayName:Ray Runner GSA"
Warning: You need roles/iam.serviceAccountAdmin or minimally roles/iam.serviceAccountTokenCreator rights to run these commands.
Next, you’ll need to verify that your KSA is bound to your GSA and has roles/iam.workloadIdentityUser:
A GKE workload identity is required to enable k8s workloads access Google Cloud services securely and without needing to manually manage service account keys. The workload identity is attached to Google Cloud service accounts (GSA) and mapped to a Kubernetes service account (KSA). This feature needs to be enabled on the GKE cluster.You can confirm that your workers have abilities to read/write to the LanceDB bucket:
Geneva can be used to provision Ray clusters running in Amazon Web Services (AWS) Elastic Kubernetes Service (EKS).In the following sections we’ll use these variables:
NAMESPACE=lancedb # replace with your actual namespace if differentCLUSTER=geneva # replace with your actual namespace if differentKSA_NAME=geneva-ray-runner # replace with an identity name
EKS allows you to specify templates for virtual machines in “node groups”. These allow you to manage and configure resources such as the number of CPUs, number of GPUs, amount of memory, and if instances are spot or regular virtual machines.You can define your node groups however you want but Geneva uses three specific Kubernetes labels when deploying Ray pods on EKS: ray-head, ray-worker-cpu, ray-worker-gpu
Head nodes are where the Ray dashboard and scheduler run. They should be non-spot instances and should not have processing workloads scheduled on them. Geneva looks for nodes with the geneva.lancedb.com/ray-head: true k8s label for this role.
CPU Worker nodes are where distributed processing that does not require GPU should be scheduled. Geneva looks for nodes with the geneva.lancedb.com/ray-worker-cpu: true k8s label when these nodes are requested.
GPU Worker nodes are where distributed processing that require GPU should be scheduled. Geneva looks for nodes with the geneva.lancedb.com/ray-worker-gpu: true k8s label when these nodes are requested.
Geneva must be run in an environment with access to AWS credentials with permissions to sts:AssumeRole on the Geneva Client IAM Role.For example, this could be a laptop with credentials provided by environment variables, or an EC2 instance with credentials provided via Instance Profile.
The Geneva Client IAM Role is assumed by the Geneva client to provision the Kuberay cluster and run remote jobs.This role requires IAM permissions to access the storage bucket and Kubernetes API.Create an IAM role with the following policy:
This role should also have a trust policy with sts:AssumeRole permissions for any principal initiating the Geneva client.When using Geneva, this role can be specified with the role_name RayCluster parameter.
An IAM role is required for the Kubernetes Service Account (KSA) that will be used by the Ray head and worker pods.This role must have permissions to access the storage bucket and to describe the EKS cluster:
Associate the IAM Role with the Kubernetes Service Account
Modify the Kubernetes Service Account created in “Basic Kubernetes setup” to associate it with the IAM role created above.The role ARN is specified using eks.amazonaws.com/role-arn annotation: