Skip to content

Commit

Permalink
Sombra and dependent chart 1st release.
Browse files Browse the repository at this point in the history
  • Loading branch information
shashiranjan84 committed May 10, 2024
1 parent dbb8798 commit 6053a3b
Show file tree
Hide file tree
Showing 48 changed files with 1,431 additions and 511 deletions.
Binary file added .cr-release-packages/sombra-0.1.0.tgz
Binary file not shown.
File renamed without changes.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 0.1.0

* Initial version
9 changes: 9 additions & 0 deletions Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies:
- name: llm-classifier
repository: ""
version: 0.1.0
- name: pathfinder
repository: ""
version: 0.1.0
digest: sha256:26fd39c0e565bd556f6283737752308354cca927f0a98316568bee4d04301d29
generated: "2024-04-24T16:36:51.762617-05:00"
15 changes: 15 additions & 0 deletions Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v2
name: sombra
description: A Helm chart for deploying sombra and its dependent services in Kubernetes
type: application
version: 0.1.0
maintainers:
- name: Transcend
email: [email protected]
dependencies:
- name: llm-classifier
condition: llm-classifier.enabled
version: "0.1.0"
- name: pathfinder
condition: pathfinder.enabled
version: "0.1.0"
541 changes: 539 additions & 2 deletions README.md

Large diffs are not rendered by default.

File renamed without changes.
6 changes: 6 additions & 0 deletions charts/llm-classifier/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: llm-classifier
description: A Helm chart for deploying LLM Classifier in Kubernetes cluster
type: application
version: 0.1.0

8 changes: 8 additions & 0 deletions charts/llm-classifier/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{- if .Values.enabled -}}
1. Get the application URL by running these commands:
{{- if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Values.namespace }} -l "app.kubernetes.io/name={{ include "llm-classifier.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Values.namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
kubectl --namespace {{ .Values.namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{- if .Values.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "llm-classifier.fullname" . }}
namespace: {{ .Values.namespace }}
labels:
{{- include "llm-classifier.labels" . | nindent 4 }}
spec:
Expand All @@ -23,37 +25,29 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "llm-classifier.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- range $name, $value := .Values.envs }}
- name: {{ $value.name }}
value: {{ $value.value | quote }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
startupProbe:
{{- toYaml .Values.startupProbe | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand All @@ -66,3 +60,4 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{{- if .Values.autoscaling.enabled }}
{{- if and .Values.enabled .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "llm-classifier.fullname" . }}
namespace: {{ .Values.namespace }}
labels:
{{- include "llm-classifier.labels" . | nindent 4 }}
spec:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{- if .Values.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "llm-classifier.fullname" . }}
namespace: {{ .Values.namespace }}
labels:
{{- include "llm-classifier.labels" . | nindent 4 }}
spec:
Expand All @@ -13,3 +15,4 @@ spec:
name: http
selector:
{{- include "llm-classifier.selectorLabels" . | nindent 4 }}
{{- end }}
83 changes: 83 additions & 0 deletions charts/llm-classifier/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Default values for sombra-chart.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

# Namespace in which resources will be deployed
enabled: false
namespace: transcend
# Number of instances of Datadog Operator
replicaCount: 1
# Set it to `true` to deploy llm-classifier resources.
enabled: false

image:
# Repository to use for llm-classifier image
repository: docker.transcend.io/llm-classifier
# Define the pullPolicy for llm-classifier image
pullPolicy: IfNotPresent
# llm-classifer version to deploy
tag: "v1.0.0"

# Override name of app
nameOverride: ""
# Override the full qualified app name
fullnameOverride: ""

# Define annotations for sombra pod
podAnnotations: {}
# Define lables for sombra pod
podLabels: {}

# Define llm-classifier networking
service:
type: ClusterIP
port: 6081

envs:
- name: LLM_SERVER_PORT
value: '6081'
- name: LLM_SERVER_CONCURRENCY
value: '2'
- name: LLM_SERVER_TIMEOUT
value: '120'

# Define resources as per required throughput
# Make sure cluster support `nvidia.com/gpu`
resources:
limits:
memory: 8Gi
nvidia.com/gpu: '1'

livenessProbe:
httpGet:
path: /health/ping
port: 6081
scheme: HTTP
timeoutSeconds: 30
periodSeconds: 10
successThreshold: 1
failureThreshold: 10

startupProbe:
httpGet:
path: /health/ping
port: 6081
scheme: HTTP
timeoutSeconds: 30
periodSeconds: 20
successThreshold: 1
failureThreshold: 10

# Enable to use horizontal pod autoscaling based of metrics
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 5
targetCPUUtilizationPercentage: 80
targetMemoryUtilizationPercentage: 80

nodeSelector: {}

tolerations: []

affinity: {}
23 changes: 23 additions & 0 deletions charts/pathfinder/.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/
5 changes: 5 additions & 0 deletions charts/pathfinder/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
name: pathfinder
description: A Helm chart to deploy Pathfinder in Kubernetes cluster
type: application
version: 0.1.0
8 changes: 8 additions & 0 deletions charts/pathfinder/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{- if .Values.enabled -}}
1. Get the application URL by running these commands:
{{- if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Values.namespace }} -l "app.kubernetes.io/name={{ include "pathfinder.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Values.namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
kubectl --namespace {{ .Values.namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
{{- end }}
62 changes: 62 additions & 0 deletions charts/pathfinder/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "pathfinder.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 "pathfinder.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 "pathfinder.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "pathfinder.labels" -}}
helm.sh/chart: {{ include "pathfinder.chart" . }}
{{ include "pathfinder.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "pathfinder.selectorLabels" -}}
app.kubernetes.io/name: {{ include "pathfinder.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "pathfinder.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "pathfinder.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/pathfinder/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{- if and .Values.enabled .Values.proxyPolicy.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-policy-config
namespace: {{ .Values.namespace }}
data: |
'pathfinder.yml': {{ .Values.proxyPolicy.policy }}
{{- end }}
Loading

0 comments on commit 6053a3b

Please sign in to comment.