Skip to content

Commit

Permalink
Merge pull request #20 from amun-ai/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ctr26 authored Feb 17, 2024
2 parents 06632c4 + 2c5014d commit 7bff81c
Show file tree
Hide file tree
Showing 18 changed files with 105 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ minikube.setup:

helm.package:
helm package charts/hypha --dependency-update --destination helm-chart
helm package charts/tritoninferenceserver-hypha --dependency-update --destination helm-chart
helm package charts/tritoninferenceserver --dependency-update --destination helm-chart
# VERSION=$(shell grep -Eo '[0-9]\.[0-9]\.[0-9]+' helm-chart/hypha/Chart.yaml | head -1)

VERSION=$(shell grep -Po "(?<=version: )([0-9]|\.)*(?=\s|$$)" charts/hypha/Chart.yaml | head -1)
Expand Down
10 changes: 5 additions & 5 deletions charts/hypha/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ dependencies:
- name: minio
repository: https://charts.bitnami.com/bitnami
version: 13.4.3
- name: tritoninferenceserver-hypha
repository: file://../tritoninferenceserver-hypha
version: 1.0.13
- name: tritoninferenceserver
repository: file://../tritoninferenceserver
version: 1.1.0
- name: redis
repository: https://charts.bitnami.com/bitnami
version: 17.11.6
digest: sha256:6db886f63b952120e9c3f63d986c30bda2c39b008562bae5d7b16743ce2b75b3
generated: "2024-02-08T08:55:56.380060859Z"
digest: sha256:4ddffcc437f1c6a058c6417aa70b0ce49e2094894137925655197d803941c14e
generated: "2024-02-17T16:13:51.942747589Z"
10 changes: 5 additions & 5 deletions charts/hypha/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.16.15
version: 0.17.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
Expand All @@ -28,10 +28,10 @@ dependencies:
# repository: https://helm.ngc.nvidia.com/nvidia
# version: 1.0.0
# condition: tritoninferenceserver.enabled
- name: tritoninferenceserver-hypha
repository: "file://../tritoninferenceserver-hypha"
version: 1.0.13
condition: tritoninferenceserver-hypha.enabled
- name: tritoninferenceserver
repository: "file://../tritoninferenceserver"
version: 1.1.0
condition: tritoninferenceserver.enabled
- name: redis
repository: "https://charts.bitnami.com/bitnami"
version: 17.11.6
Expand Down
Binary file not shown.
Binary file not shown.
6 changes: 2 additions & 4 deletions charts/hypha/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{{ $MINIO_BROWSER_REDIRECT_URL = .Values.minio.browserRedirectUrl }}
{{- end }}

{{- if (index .Values "tritoninferenceserver-hypha" "enabled") }}
{{- if (index .Values "tritoninferenceserver" "enabled") }}
{{ $TRITON_URL = "http://tritoninferenceserver:8000" }}
{{- end }}

Expand Down Expand Up @@ -67,9 +67,7 @@ spec:
--host=0.0.0.0 \
--port={{ .Values.service.port }} \
--redis-uri=redis://:{{ .Values.redis.global.redis.password }}@{{ .Values.redis.fullnameOverride }}-master:6379/0 \
{{- if (index .Values "tritoninferenceserver-hypha" "enabled") }}
--triton-servers=http://{{(index .Values "tritoninferenceserver-hypha" "fullnameOverride")}}:{{(index .Values "tritoninferenceserver-hypha" "service" "port")}} \
{{- end }}
--triton-servers={{ $TRITON_URL }} \
--enable-s3 \
--endpoint-url=http://{{ .Values.minio.fullnameOverride }}:{{.Values.minio.service.ports.api}} \
--endpoint-url-public={{ $S3_ENDPOINT_URL_PUBLIC }} \
Expand Down
42 changes: 36 additions & 6 deletions charts/hypha/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,42 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "hypha.name" . }}
name: {{ template "hypha.fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels:
app: {{ template "hypha.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.service.annotations }}
annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
spec:
selector:
{{- include "hypha.selectorLabels" . | nindent 4 }}
type: {{ .Values.service.type }}
{{- if (and (eq .Values.service.type "ClusterIP") (not (empty .Values.service.clusterIP))) }}
clusterIP: {{ .Values.service.clusterIP }}
{{- end }}
{{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
{{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerSourceRanges))) }}
loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }}
{{- end }}
{{- if .Values.service.sessionAffinity }}
sessionAffinity: {{ .Values.service.sessionAffinity }}
{{- if .Values.service.sessionAffinityConfig }}
sessionAffinityConfig:
{{ toYaml .Values.service.sessionAffinityConfig | nindent 4 }}
{{- end -}}
{{- end }}
ports:
- protocol: TCP
port: {{ .Values.service.port}}
targetPort: "http"
- port: {{ .Values.service.port }}
protocol: TCP
name: {{ if .Values.tlsSecretName }}https{{ else }}http{{ end }}-{{ .Values.service.port }}
targetPort: http
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
selector:
{{- include "hypha.selectorLabels" . | nindent 4 }}
8 changes: 8 additions & 0 deletions charts/hypha/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ auth0_domain: ""
jwt_secret: "xZ/aDcP+PfoTWgwA9ZADTtU/+djwMeMKz4QlSKRcgEs="
nodeSelector: {}
podLabels: {}

# TODO add when https://github.com/amun-ai/hypha/pull/588
# securityContext:
# enabled: true
Expand Down Expand Up @@ -84,3 +85,10 @@ minio:
auth:
rootUser: "minio"
rootPassword: "minio123"

# mode: "distributed"
# statefulset:
# replicaCount: 4

# tritoninferenceserver:
# nameOverride: "tritoninferenceserver"
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: tritoninferenceserver-hypha
name: tritoninferenceserver
description: A Helm chart for deploying ImJoy App Engine to Kubernetes

# A chart can be either an 'application' or a 'library' chart.
Expand All @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.13
version: 1.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,25 @@
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}


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

{{/*
Selector labels
*/}}
{{- define "tritoninferenceserver.selectorLabels" -}}
app.kubernetes.io/name: {{ include "tritoninferenceserver.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "tritoninferenceserver.name" . }}
release: {{ .Release.Name }}
{{- include "tritoninferenceserver.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
app: {{ template "tritoninferenceserver.name" . }}
release: {{ .Release.Name }}
{{- include "tritoninferenceserver.selectorLabels" . | nindent 8 }}
{{- if .Values.podLabels }}
{{ toYaml .Values.podLabels | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -48,6 +46,11 @@ spec:
httpGet:
path: /v2/health/ready
port: 8000
startupProbe:
httpGet:
path: /v2/models
port: 8000
{{- toYaml .Values.startupProbe | nindent 12 }}
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
httpGet:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: tritoninferenceserver-hypha-secrets
name: tritoninferenceserver-secrets
type: Opaque
data:
{{- range .Values.image.env }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ spec:
- port: {{ .Values.service.port }}
protocol: TCP
name: {{ if .Values.tlsSecretName }}https{{ else }}http{{ end }}-{{ .Values.service.port }}
targetPort: 8000
# TODO check if we need to add targetPort http
targetPort: {{ .Values.service.port }}
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
selector:
app: {{ template "tritoninferenceserver.name" . }}
release: {{ .Release.Name }}
{{- include "tritoninferenceserver.selectorLabels" . | nindent 4 }}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ image:
- name: TF_FORCE_GPU_ALLOW_GROWTH
value: "true"


ingress:
enabled: false
className: nginx
Expand Down Expand Up @@ -56,6 +55,7 @@ securityContext:
enabled: true
seLinuxOptions: null
runAsUser: 1001
fsGroup: 1001
runAsNonRoot: true
privileged: false
readOnlyRootFilesystem: false
Expand All @@ -76,17 +76,25 @@ readinessProbe:
successThreshold: 1
failureThreshold: 3

livenessProbe:
startupProbe:
httpGet:
path: /v2/health/live
port: 8000
initialDelaySeconds: 1800
periodSeconds: 5
initialDelaySeconds: 10
periodSeconds: 60
timeoutSeconds: 2
successThreshold: 1
failureThreshold: 3

initContainers: []
livenessProbe:
httpGet:
path: /v2/health/live
port: 8000
initialDelaySeconds: 10
periodSeconds: 60
timeoutSeconds: 2
successThreshold: 1
failureThreshold: 3

# - name: copy-models
# image: alpine
Expand All @@ -100,8 +108,6 @@ volumes:
name: dshm
- ephemeral:
volumeClaimTemplate:
metadata:
creationTimestamp: null
spec:
accessModes:
- ReadWriteOnce
Expand Down

0 comments on commit 7bff81c

Please sign in to comment.