From 88f6fa876a510b0736342dcfaec7847f654e892f Mon Sep 17 00:00:00 2001 From: Felix Wang Date: Mon, 25 Jul 2022 14:19:55 -0700 Subject: [PATCH 1/7] Rename feast-python-server helm chart to feast-feature-server Signed-off-by: Felix Wang --- infra/charts/feast-feature-server/.helmignore | 23 +++++++ infra/charts/feast-feature-server/Chart.yaml | 12 ++++ infra/charts/feast-feature-server/README.md | 59 ++++++++++++++++++ .../templates/_helpers.tpl | 52 ++++++++++++++++ .../templates/deployment.yaml | 61 +++++++++++++++++++ .../templates/service.yaml | 15 +++++ infra/charts/feast-feature-server/values.yaml | 57 +++++++++++++++++ 7 files changed, 279 insertions(+) create mode 100644 infra/charts/feast-feature-server/.helmignore create mode 100644 infra/charts/feast-feature-server/Chart.yaml create mode 100644 infra/charts/feast-feature-server/README.md create mode 100644 infra/charts/feast-feature-server/templates/_helpers.tpl create mode 100644 infra/charts/feast-feature-server/templates/deployment.yaml create mode 100644 infra/charts/feast-feature-server/templates/service.yaml create mode 100644 infra/charts/feast-feature-server/values.yaml diff --git a/infra/charts/feast-feature-server/.helmignore b/infra/charts/feast-feature-server/.helmignore new file mode 100644 index 00000000000..0e8a0eb36f4 --- /dev/null +++ b/infra/charts/feast-feature-server/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/infra/charts/feast-feature-server/Chart.yaml b/infra/charts/feast-feature-server/Chart.yaml new file mode 100644 index 00000000000..6c4751e3b7e --- /dev/null +++ b/infra/charts/feast-feature-server/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v2 +name: feast-python-server +description: Feast Feature Server in Python +type: application +version: 0.22.0 +keywords: + - machine learning + - big data + - mlops +home: https://feast.dev/ +sources: + - https://github.com/feast-dev/feast diff --git a/infra/charts/feast-feature-server/README.md b/infra/charts/feast-feature-server/README.md new file mode 100644 index 00000000000..9c6f3c0038f --- /dev/null +++ b/infra/charts/feast-feature-server/README.md @@ -0,0 +1,59 @@ +# feast-python-server + +![Version: 0.22.0](https://img.shields.io/badge/Version-0.22.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) + +Feast Feature Server in Python + +**Homepage:** + +## Source Code + +* + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `""` | | +| image.tag | string | `""` | | +| imagePullSecrets | list | `[]` | | +| livenessProbe.initialDelaySeconds | int | `30` | | +| livenessProbe.periodSeconds | int | `30` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podAnnotations | object | `{}` | | +| podSecurityContext | object | `{}` | | +| readinessProbe.initialDelaySeconds | int | `20` | | +| readinessProbe.periodSeconds | int | `10` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.port | int | `80` | | +| service.type | string | `"ClusterIP"` | | +| tolerations | list | `[]` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) + + +Docker repository and tag are required. Helm install example: +``` +helm install feast-python-server . --set image.repository=REPO --set image.tag=TAG +``` + +Deployment assumes that `feature_store.yaml` exists on docker image. Example docker image: +``` +FROM python:3.8 + +RUN apt update && \ + apt install -y jq + +RUN pip install pip --upgrade + +RUN pip install feast + +COPY feature_store.yaml /feature_store.yaml +``` \ No newline at end of file diff --git a/infra/charts/feast-feature-server/templates/_helpers.tpl b/infra/charts/feast-feature-server/templates/_helpers.tpl new file mode 100644 index 00000000000..b64e10536d1 --- /dev/null +++ b/infra/charts/feast-feature-server/templates/_helpers.tpl @@ -0,0 +1,52 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "feast-python-server.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "feast-python-server.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "feast-python-server.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "feast-python-server.labels" -}} +helm.sh/chart: {{ include "feast-python-server.chart" . }} +{{ include "feast-python-server.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "feast-python-server.selectorLabels" -}} +app.kubernetes.io/name: {{ include "feast-python-server.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/infra/charts/feast-feature-server/templates/deployment.yaml b/infra/charts/feast-feature-server/templates/deployment.yaml new file mode 100644 index 00000000000..56439be658c --- /dev/null +++ b/infra/charts/feast-feature-server/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "feast-python-server.fullname" . }} + labels: + {{- include "feast-python-server.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "feast-python-server.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "feast-python-server.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + command: ["feast", "serve", "-h", "0.0.0.0"] + ports: + - name: http + containerPort: 6566 + protocol: TCP + livenessProbe: + tcpSocket: + port: http + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.livenessProbe.periodSeconds }} + readinessProbe: + tcpSocket: + port: http + initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.readinessProbe.periodSeconds }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/infra/charts/feast-feature-server/templates/service.yaml b/infra/charts/feast-feature-server/templates/service.yaml new file mode 100644 index 00000000000..86bf38a9a45 --- /dev/null +++ b/infra/charts/feast-feature-server/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "feast-python-server.name" . }} + labels: + {{- include "feast-python-server.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "feast-python-server.selectorLabels" . | nindent 4 }} diff --git a/infra/charts/feast-feature-server/values.yaml b/infra/charts/feast-feature-server/values.yaml new file mode 100644 index 00000000000..f62f95a7577 --- /dev/null +++ b/infra/charts/feast-feature-server/values.yaml @@ -0,0 +1,57 @@ +# Default values for feast. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: "" + pullPolicy: IfNotPresent + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +livenessProbe: + initialDelaySeconds: 30 + periodSeconds: 30 + +readinessProbe: + initialDelaySeconds: 20 + periodSeconds: 10 From 1fb4d193258acc521613f763a375b5063a792aa1 Mon Sep 17 00:00:00 2001 From: Felix Wang Date: Mon, 25 Jul 2022 14:20:07 -0700 Subject: [PATCH 2/7] Switch example to Python 3.8 Signed-off-by: Felix Wang --- infra/charts/feast-python-server/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/charts/feast-python-server/README.md b/infra/charts/feast-python-server/README.md index 3f60cc6c549..17ce5be6829 100644 --- a/infra/charts/feast-python-server/README.md +++ b/infra/charts/feast-python-server/README.md @@ -46,7 +46,7 @@ helm install feast-python-server . --set image.repository=REPO --set image.tag=T Deployment assumes that `feature_store.yaml` exists on docker image. Example docker image: ``` -FROM python:3.7 +FROM python:3.8 RUN apt update && \ apt install -y jq From 1496216f4470101e1224f099ff894801018c784d Mon Sep 17 00:00:00 2001 From: Felix Wang Date: Mon, 25 Jul 2022 14:21:41 -0700 Subject: [PATCH 3/7] Update helm chart docs Signed-off-by: Felix Wang --- docs/how-to-guides/running-feast-in-production.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/how-to-guides/running-feast-in-production.md b/docs/how-to-guides/running-feast-in-production.md index eba3507f7d0..f03629ea4be 100644 --- a/docs/how-to-guides/running-feast-in-production.md +++ b/docs/how-to-guides/running-feast-in-production.md @@ -257,7 +257,7 @@ helm repo update ``` 3. Run Helm Install ``` -helm install feast-release feast-charts/feast-python-server \ +helm install feast-release feast-charts/feast-feature-server \ --set global.registry.path=s3://feast/registries/prod \ --set global.project= ``` @@ -267,11 +267,6 @@ The service must have read access to the registry file on cloud storage. It will keep a copy of the registry in their memory and periodically refresh it, so expect some delays in update propagation in exchange for better performance. In order for the Go feature server to be enabled, you should set `go_feature_serving: True` in the `feature_store.yaml`. -#### Load balancing - -The next step would be to install an L7 Load Balancer (eg, [Envoy](https://www.envoyproxy.io/)) in front of the Go feature server. -For seamless integration with Kubernetes (including services created by Feast Helm chart) we recommend using [Istio](https://istio.io/) as Envoy's orchestrator. - ## 5. Ingesting features from a stream source Recently Feast added functionality for [stream ingestion](../reference/data-sources/push.md). From 6d08ee6fa14b7ea06f6ff452a9d46151f9216e25 Mon Sep 17 00:00:00 2001 From: Felix Wang Date: Mon, 25 Jul 2022 14:24:31 -0700 Subject: [PATCH 4/7] Change name Signed-off-by: Felix Wang --- infra/charts/feast-feature-server/Chart.yaml | 4 ++-- infra/charts/feast-feature-server/README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/infra/charts/feast-feature-server/Chart.yaml b/infra/charts/feast-feature-server/Chart.yaml index 6c4751e3b7e..6c1afc9540e 100644 --- a/infra/charts/feast-feature-server/Chart.yaml +++ b/infra/charts/feast-feature-server/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 -name: feast-python-server -description: Feast Feature Server in Python +name: feast-feature-server +description: Feast Feature Server in Go or Python type: application version: 0.22.0 keywords: diff --git a/infra/charts/feast-feature-server/README.md b/infra/charts/feast-feature-server/README.md index 9c6f3c0038f..8d5a8fcac4b 100644 --- a/infra/charts/feast-feature-server/README.md +++ b/infra/charts/feast-feature-server/README.md @@ -1,8 +1,8 @@ -# feast-python-server +# feast-feature-server ![Version: 0.22.0](https://img.shields.io/badge/Version-0.22.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) -Feast Feature Server in Python +Feast Feature Server in Go or Python **Homepage:** From 273bc8d9e96aabc64d5b881c5141bad7e23c1b96 Mon Sep 17 00:00:00 2001 From: Felix Wang Date: Mon, 25 Jul 2022 14:26:02 -0700 Subject: [PATCH 5/7] Change references Signed-off-by: Felix Wang --- .../feast-feature-server/templates/_helpers.tpl | 16 ++++++++-------- .../templates/deployment.yaml | 8 ++++---- .../feast-feature-server/templates/service.yaml | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/infra/charts/feast-feature-server/templates/_helpers.tpl b/infra/charts/feast-feature-server/templates/_helpers.tpl index b64e10536d1..19c2febd13d 100644 --- a/infra/charts/feast-feature-server/templates/_helpers.tpl +++ b/infra/charts/feast-feature-server/templates/_helpers.tpl @@ -2,7 +2,7 @@ {{/* Expand the name of the chart. */}} -{{- define "feast-python-server.name" -}} +{{- define "feast-feature-server.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} @@ -11,7 +11,7 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "feast-python-server.fullname" -}} +{{- define "feast-feature-server.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -27,16 +27,16 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "feast-python-server.chart" -}} +{{- define "feast-feature-server.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "feast-python-server.labels" -}} -helm.sh/chart: {{ include "feast-python-server.chart" . }} -{{ include "feast-python-server.selectorLabels" . }} +{{- define "feast-feature-server.labels" -}} +helm.sh/chart: {{ include "feast-feature-server.chart" . }} +{{ include "feast-feature-server.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -46,7 +46,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "feast-python-server.selectorLabels" -}} -app.kubernetes.io/name: {{ include "feast-python-server.name" . }} +{{- define "feast-feature-server.selectorLabels" -}} +app.kubernetes.io/name: {{ include "feast-feature-server.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} diff --git a/infra/charts/feast-feature-server/templates/deployment.yaml b/infra/charts/feast-feature-server/templates/deployment.yaml index 56439be658c..69cf92f6c02 100644 --- a/infra/charts/feast-feature-server/templates/deployment.yaml +++ b/infra/charts/feast-feature-server/templates/deployment.yaml @@ -1,14 +1,14 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "feast-python-server.fullname" . }} + name: {{ include "feast-feature-server.fullname" . }} labels: - {{- include "feast-python-server.labels" . | nindent 4 }} + {{- include "feast-feature-server.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: - {{- include "feast-python-server.selectorLabels" . | nindent 6 }} + {{- include "feast-feature-server.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} @@ -16,7 +16,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "feast-python-server.selectorLabels" . | nindent 8 }} + {{- include "feast-feature-server.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/infra/charts/feast-feature-server/templates/service.yaml b/infra/charts/feast-feature-server/templates/service.yaml index 86bf38a9a45..d6914828e49 100644 --- a/infra/charts/feast-feature-server/templates/service.yaml +++ b/infra/charts/feast-feature-server/templates/service.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "feast-python-server.name" . }} + name: {{ include "feast-feature-server.name" . }} labels: - {{- include "feast-python-server.labels" . | nindent 4 }} + {{- include "feast-feature-server.labels" . | nindent 4 }} spec: type: {{ .Values.service.type }} ports: @@ -12,4 +12,4 @@ spec: protocol: TCP name: http selector: - {{- include "feast-python-server.selectorLabels" . | nindent 4 }} + {{- include "feast-feature-server.selectorLabels" . | nindent 4 }} From d5c544ad12cdb274e58193153918605e078e97ab Mon Sep 17 00:00:00 2001 From: Felix Wang Date: Mon, 25 Jul 2022 14:26:28 -0700 Subject: [PATCH 6/7] Change another reference Signed-off-by: Felix Wang --- infra/charts/feast-feature-server/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/charts/feast-feature-server/README.md b/infra/charts/feast-feature-server/README.md index 8d5a8fcac4b..2fb096d19f4 100644 --- a/infra/charts/feast-feature-server/README.md +++ b/infra/charts/feast-feature-server/README.md @@ -41,7 +41,7 @@ Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/n Docker repository and tag are required. Helm install example: ``` -helm install feast-python-server . --set image.repository=REPO --set image.tag=TAG +helm install feast-feature-server . --set image.repository=REPO --set image.tag=TAG ``` Deployment assumes that `feature_store.yaml` exists on docker image. Example docker image: From 93e3fa8ba33c1d7a957a9b12e7bbcd0c2ad43b66 Mon Sep 17 00:00:00 2001 From: Felix Wang Date: Mon, 25 Jul 2022 14:33:03 -0700 Subject: [PATCH 7/7] Add arrow C++ library to example Dockerfile Signed-off-by: Felix Wang --- infra/charts/feast-feature-server/README.md | 23 +++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/infra/charts/feast-feature-server/README.md b/infra/charts/feast-feature-server/README.md index 2fb096d19f4..a55451e7883 100644 --- a/infra/charts/feast-feature-server/README.md +++ b/infra/charts/feast-feature-server/README.md @@ -55,5 +55,28 @@ RUN pip install pip --upgrade RUN pip install feast +COPY feature_store.yaml /feature_store.yaml +``` + +Furthermore, if you wish to use the Go feature server, then you must install the Apache Arrow C++ libraries, and your `feature_store.yaml` should include `go_feature_server: True`. +For more details, see the [docs](https://docs.feast.dev/reference/feature-servers/go-feature-server). +The docker image might look like: +``` +FROM python:3.8 + +RUN apt update && \ + apt install -y jq + +RUN pip install pip --upgrade + +RUN pip install feast + +RUN apt update +RUN apt install -y -V ca-certificates lsb-release wget +RUN wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb +RUN apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb +RUN apt update +RUN apt -y install libarrow-dev + COPY feature_store.yaml /feature_store.yaml ``` \ No newline at end of file