diff --git a/Makefile b/Makefile index 4941f15..42c5495 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/charts/hypha/Chart.lock b/charts/hypha/Chart.lock index a7fbf53..8598eb8 100644 --- a/charts/hypha/Chart.lock +++ b/charts/hypha/Chart.lock @@ -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" diff --git a/charts/hypha/Chart.yaml b/charts/hypha/Chart.yaml index 1308905..7d9d65f 100644 --- a/charts/hypha/Chart.yaml +++ b/charts/hypha/Chart.yaml @@ -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. @@ -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 diff --git a/charts/hypha/charts/tritoninferenceserver-1.1.0.tgz b/charts/hypha/charts/tritoninferenceserver-1.1.0.tgz new file mode 100644 index 0000000..b4cfa5a Binary files /dev/null and b/charts/hypha/charts/tritoninferenceserver-1.1.0.tgz differ diff --git a/charts/hypha/charts/tritoninferenceserver-hypha-1.0.13.tgz b/charts/hypha/charts/tritoninferenceserver-hypha-1.0.13.tgz deleted file mode 100644 index 92c8870..0000000 Binary files a/charts/hypha/charts/tritoninferenceserver-hypha-1.0.13.tgz and /dev/null differ diff --git a/charts/hypha/templates/deployment.yaml b/charts/hypha/templates/deployment.yaml index 4072277..127e4ca 100644 --- a/charts/hypha/templates/deployment.yaml +++ b/charts/hypha/templates/deployment.yaml @@ -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 }} @@ -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 }} \ diff --git a/charts/hypha/templates/service.yaml b/charts/hypha/templates/service.yaml index ba4a780..cfb2ad9 100644 --- a/charts/hypha/templates/service.yaml +++ b/charts/hypha/templates/service.yaml @@ -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" \ No newline at end of file + - 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 }} diff --git a/charts/hypha/values.yaml b/charts/hypha/values.yaml index 4b8131f..33e4300 100644 --- a/charts/hypha/values.yaml +++ b/charts/hypha/values.yaml @@ -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 @@ -84,3 +85,10 @@ minio: auth: rootUser: "minio" rootPassword: "minio123" + + # mode: "distributed" + # statefulset: + # replicaCount: 4 + +# tritoninferenceserver: +# nameOverride: "tritoninferenceserver" diff --git a/charts/tritoninferenceserver-hypha/.helmignore b/charts/tritoninferenceserver/.helmignore similarity index 100% rename from charts/tritoninferenceserver-hypha/.helmignore rename to charts/tritoninferenceserver/.helmignore diff --git a/charts/tritoninferenceserver-hypha/Chart.yaml b/charts/tritoninferenceserver/Chart.yaml similarity index 95% rename from charts/tritoninferenceserver-hypha/Chart.yaml rename to charts/tritoninferenceserver/Chart.yaml index 66aa049..ffaa4d5 100644 --- a/charts/tritoninferenceserver-hypha/Chart.yaml +++ b/charts/tritoninferenceserver/Chart.yaml @@ -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. @@ -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 diff --git a/charts/tritoninferenceserver-hypha/templates/_helpers.tpl b/charts/tritoninferenceserver/templates/_helpers.tpl similarity index 53% rename from charts/tritoninferenceserver-hypha/templates/_helpers.tpl rename to charts/tritoninferenceserver/templates/_helpers.tpl index 862e2d4..8d92e5c 100644 --- a/charts/tritoninferenceserver-hypha/templates/_helpers.tpl +++ b/charts/tritoninferenceserver/templates/_helpers.tpl @@ -18,4 +18,25 @@ {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} {{- end -}} -{{- end -}} \ No newline at end of file +{{- 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 }} diff --git a/charts/tritoninferenceserver-hypha/templates/deployment.yaml b/charts/tritoninferenceserver/templates/deployment.yaml similarity index 88% rename from charts/tritoninferenceserver-hypha/templates/deployment.yaml rename to charts/tritoninferenceserver/templates/deployment.yaml index 6d7678e..79b582c 100644 --- a/charts/tritoninferenceserver-hypha/templates/deployment.yaml +++ b/charts/tritoninferenceserver/templates/deployment.yaml @@ -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 }} @@ -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: diff --git a/charts/tritoninferenceserver-hypha/templates/deployment.yaml.ignore b/charts/tritoninferenceserver/templates/deployment.yaml.ignore similarity index 100% rename from charts/tritoninferenceserver-hypha/templates/deployment.yaml.ignore rename to charts/tritoninferenceserver/templates/deployment.yaml.ignore diff --git a/charts/tritoninferenceserver-hypha/templates/hpa.yaml b/charts/tritoninferenceserver/templates/hpa.yaml similarity index 100% rename from charts/tritoninferenceserver-hypha/templates/hpa.yaml rename to charts/tritoninferenceserver/templates/hpa.yaml diff --git a/charts/tritoninferenceserver-hypha/templates/ingress.yaml b/charts/tritoninferenceserver/templates/ingress.yaml similarity index 100% rename from charts/tritoninferenceserver-hypha/templates/ingress.yaml rename to charts/tritoninferenceserver/templates/ingress.yaml diff --git a/charts/tritoninferenceserver-hypha/templates/secrets.yaml b/charts/tritoninferenceserver/templates/secrets.yaml similarity index 76% rename from charts/tritoninferenceserver-hypha/templates/secrets.yaml rename to charts/tritoninferenceserver/templates/secrets.yaml index c8e6af0..ebfffc9 100644 --- a/charts/tritoninferenceserver-hypha/templates/secrets.yaml +++ b/charts/tritoninferenceserver/templates/secrets.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Secret metadata: - name: tritoninferenceserver-hypha-secrets + name: tritoninferenceserver-secrets type: Opaque data: {{- range .Values.image.env }} diff --git a/charts/tritoninferenceserver-hypha/templates/service.yaml b/charts/tritoninferenceserver/templates/service.yaml similarity index 90% rename from charts/tritoninferenceserver-hypha/templates/service.yaml rename to charts/tritoninferenceserver/templates/service.yaml index a93e64d..e82e55e 100644 --- a/charts/tritoninferenceserver-hypha/templates/service.yaml +++ b/charts/tritoninferenceserver/templates/service.yaml @@ -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 }} \ No newline at end of file +{{- include "tritoninferenceserver.selectorLabels" . | nindent 4 }} diff --git a/charts/tritoninferenceserver-hypha/values.yaml b/charts/tritoninferenceserver/values.yaml similarity index 90% rename from charts/tritoninferenceserver-hypha/values.yaml rename to charts/tritoninferenceserver/values.yaml index 491481c..84600ec 100644 --- a/charts/tritoninferenceserver-hypha/values.yaml +++ b/charts/tritoninferenceserver/values.yaml @@ -12,7 +12,6 @@ image: - name: TF_FORCE_GPU_ALLOW_GROWTH value: "true" - ingress: enabled: false className: nginx @@ -56,6 +55,7 @@ securityContext: enabled: true seLinuxOptions: null runAsUser: 1001 + fsGroup: 1001 runAsNonRoot: true privileged: false readOnlyRootFilesystem: false @@ -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 @@ -100,8 +108,6 @@ volumes: name: dshm - ephemeral: volumeClaimTemplate: - metadata: - creationTimestamp: null spec: accessModes: - ReadWriteOnce