Skip to content

Commit

Permalink
helm-feast-python-server add feast-python-server helm chart (#2177)
Browse files Browse the repository at this point in the history
Signed-off-by: Michelle Rascati <michelle.rascati@sailpoint.com>
  • Loading branch information
michelle-rascati-sp authored Dec 30, 2021
1 parent 89eb3a5 commit ff86e3e
Show file tree
Hide file tree
Showing 7 changed files with 291 additions and 0 deletions.
23 changes: 23 additions & 0 deletions infra/charts/feast-python-server/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
12 changes: 12 additions & 0 deletions infra/charts/feast-python-server/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v2
name: feast-python-server
description: Feast Feature Server in Python
type: application
version: 0.1.0
keywords:
- machine learning
- big data
- mlops
home: https://feast.dev/
sources:
- https://github.com/feast-dev/feast
71 changes: 71 additions & 0 deletions infra/charts/feast-python-server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# feast-python-server

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Feast Feature Server in Python

**Homepage:** <https://feast.dev/>

## Source Code

* <https://github.com/feast-dev/feast>

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| fullnameOverride | string | `""` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `""` | [required] The repository for the Docker image |
| image.tag | string | `""` | [required] The Docker image tag |
| 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.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.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.7
RUN apt update && \
apt install -y jq
RUN pip install pip --upgrade
RUN pip install feast
COPY feature_store.yaml /feature_store.yaml
```

Make sure that you have enabled the flags for the python server. Example `feature_store.yaml`:
```
project: feature_repo
registry: data/registry.db
provider: local
online_store:
path: data/online_store.db
flags:
alpha_features: true
python_feature_server: true
```
52 changes: 52 additions & 0 deletions infra/charts/feast-python-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -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 }}
61 changes: 61 additions & 0 deletions infra/charts/feast-python-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
15 changes: 15 additions & 0 deletions infra/charts/feast-python-server/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
57 changes: 57 additions & 0 deletions infra/charts/feast-python-server/values.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ff86e3e

Please sign in to comment.