Commit 8621d914 authored by Biswa Panda's avatar Biswa Panda Committed by GitHub
Browse files

feat: dynamo deploy hello world example to k8s (#205)

parent 988378ab
This diff is collapsed.
...@@ -20,8 +20,9 @@ set -euo pipefail ...@@ -20,8 +20,9 @@ set -euo pipefail
# Set default values only if not already set # Set default values only if not already set
export NAMESPACE="${NAMESPACE:=cai-system}" # Default namespace export NAMESPACE="${NAMESPACE:=cai-system}" # Default namespace
export NGC_TOKEN="${NGC_TOKEN:=<your-ngc-token>}" # Default NGC token export NGC_TOKEN="${NGC_TOKEN:=<your-ngc-token>}" # Default NGC token
export CI_COMMIT_SHA="${CI_COMMIT_SHA:=6083324a0a5f310dcec38c6863f043cd9070ffcc}" # Default commit SHA export CI_COMMIT_SHA="${CI_COMMIT_SHA:=250e2e0f93f7af3d83a4a0ff992e56956f7651f2}" # Default commit SHA
export RELEASE_NAME="${RELEASE_NAME:=dynamo-platform}" # Default commit SHA export RELEASE_NAME="${RELEASE_NAME:=dynamo-platform}" # Default commit SHA
export DYNAMO_INGRESS_SUFFIX="${DYNAMO_INGRESS_SUFFIX:=}"
# Check if required variables are set # Check if required variables are set
...@@ -50,12 +51,13 @@ echo "NGC_TOKEN: [HIDDEN]" ...@@ -50,12 +51,13 @@ echo "NGC_TOKEN: [HIDDEN]"
echo "RELEASE_NAME: $RELEASE_NAME" echo "RELEASE_NAME: $RELEASE_NAME"
echo "generated file contents:" echo "generated file contents:"
envsubst '${NAMESPACE} ${NGC_TOKEN} ${CI_COMMIT_SHA} ${RELEASE_NAME}' < dynamo-platform-values.yaml envsubst '${NAMESPACE} ${NGC_TOKEN} ${CI_COMMIT_SHA} ${RELEASE_NAME} ${DYNAMO_INGRESS_SUFFIX}' < dynamo-platform-values.yaml
envsubst '${NAMESPACE} ${NGC_TOKEN} ${CI_COMMIT_SHA} ${RELEASE_NAME}' < dynamo-platform-values.yaml > generated-values.yaml envsubst '${NAMESPACE} ${NGC_TOKEN} ${CI_COMMIT_SHA} ${RELEASE_NAME} ${DYNAMO_INGRESS_SUFFIX}' < dynamo-platform-values.yaml > generated-values.yaml
echo "Generated values file saved as generated-values.yaml" echo "Generated values file saved as generated-values.yaml"
# Install/upgrade the helm chart # Install/upgrade the helm chart
echo "Installing/upgrading helm chart..." echo "Installing/upgrading helm chart..."
helm upgrade --install $RELEASE_NAME platform/ \ helm upgrade --install $RELEASE_NAME platform/ \
......
...@@ -33,11 +33,9 @@ dynamo-operator: ...@@ -33,11 +33,9 @@ dynamo-operator:
args: args:
- --health-probe-bind-address=:8081 - --health-probe-bind-address=:8081
- --metrics-bind-address=127.0.0.1:8080 - --metrics-bind-address=127.0.0.1:8080
- --leader-elect=false
- --natsAddr=nats://my-nats:4222
- --etcdAddr=etcd:2379
dynamo: dynamo:
dynamoIngressSuffix: ${DYNAMO_INGRESS_SUFFIX}
yatai: yatai:
# todo: only use dns name # todo: only use dns name
endpoint: http://dynamo-server endpoint: http://dynamo-server
...@@ -66,9 +64,9 @@ dynamo-operator: ...@@ -66,9 +64,9 @@ dynamo-operator:
inClusterServer: '' inClusterServer: ''
username: '$oauthtoken' username: '$oauthtoken'
# Password will use global.NGC_API_KEY by default # Password will use global.NGC_API_KEY by default
password: "" # password: ""
passwordExistingSecretName: '' passwordExistingSecretName: 'nvcrimagepullsecret'
passwordExistingSecretKey: '' # passwordExistingSecretKey: ''
secure: true secure: true
bentoRepositoryName: yatai-bentos bentoRepositoryName: yatai-bentos
...@@ -97,7 +95,11 @@ dynamo-api-server: ...@@ -97,7 +95,11 @@ dynamo-api-server:
image: image:
repository: gitlab-master.nvidia.com:5005/aire/microservices/compoundai/dynamo-api-server repository: gitlab-master.nvidia.com:5005/aire/microservices/compoundai/dynamo-api-server
tag: ${CI_COMMIT_SHA} tag: ${CI_COMMIT_SHA}
pullPolicy: Always pullPolicy: IfNotPresent
storeImage:
repository: gitlab-master.nvidia.com:5005/aire/microservices/compoundai/dynamo-api-store
tag: ${CI_COMMIT_SHA}
pullPolicy: IfNotPresent
imagePullSecrets: imagePullSecrets:
- name: nvcrimagepullsecret - name: nvcrimagepullsecret
- name: gitlab-imagepull - name: gitlab-imagepull
...@@ -108,8 +110,8 @@ dynamo-api-server: ...@@ -108,8 +110,8 @@ dynamo-api-server:
minio: minio:
persistence: persistence:
enabled: true enabled: true
size: 10Gi size: 5Gi
storageClass: "" storageClass: "local-path"
apiIngress: apiIngress:
enabled: false enabled: false
ingressClassName: nginx ingressClassName: nginx
...@@ -118,6 +120,17 @@ dynamo-api-server: ...@@ -118,6 +120,17 @@ dynamo-api-server:
etcd: etcd:
enabled: true enabled: true
persistence:
enabled: true
storageClass: "local-path"
size: 1Gi
nats: nats:
enabled: true enabled: true
config:
jetstream:
enabled: true
fileStore:
pvc:
size: 1Gi
storageClassName: "local-path"
\ No newline at end of file
...@@ -55,7 +55,7 @@ spec: ...@@ -55,7 +55,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
ports: ports:
- name: http - name: http
containerPort: {{ .Values.dynamo.port }} containerPort: {{ .Values.dynamo.apiServer.port }}
protocol: TCP protocol: TCP
livenessProbe: livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }} {{- toYaml .Values.livenessProbe | nindent 12 }}
...@@ -84,25 +84,11 @@ spec: ...@@ -84,25 +84,11 @@ spec:
- name: API_DATABASE_PORT - name: API_DATABASE_PORT
value: "8001" value: "8001"
- name: API_BACKEND_URL - name: API_BACKEND_URL
value: "http://127.0.0.1:8001" value: "http://dynamo-store"
- name: RESOURCE_SCOPE - name: RESOURCE_SCOPE
value: {{ .Values.dynamo.env.resource_scope | quote }} value: {{ .Values.dynamo.env.resource_scope | quote }}
- name: DEFAULT_KUBE_NAMESPACE - name: DEFAULT_KUBE_NAMESPACE
value: {{ .Release.Namespace }} value: {{ .Release.Namespace }}
- name: DYNAMO_CONTAINER_NAME
value: "dynamo-storage"
- name: S3_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-minio"
key: root-user
- name: S3_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-minio"
key: root-password
- name: S3_ENDPOINT_URL
value: "http://{{ .Release.Name }}-minio:9000"
envFrom: envFrom:
- secretRef: - secretRef:
name: dynamo-deployment-env name: dynamo-deployment-env
......
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: apps/v1
kind: Deployment
metadata:
name: dynamo-api-store
spec:
replicas: 1
selector:
matchLabels:
app: dynamo-api-store
template:
metadata:
labels:
app: dynamo-api-store
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "helm.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: wait-for-postgres
image: busybox
command: [ 'sh', '-c', 'until nc -z {{ .Release.Name }}-postgresql 5432; do echo "PostgreSQL is unavailable. Sleeping for 5 seconds"; sleep 5; done;' ]
containers:
- name: "api-store"
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
imagePullPolicy: {{ .Values.storeImage.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.dynamo.apiStore.port }}
protocol: TCP
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
- name: DB_HOST
value: "{{ .Release.Name }}-postgresql"
- name: DB_USER
value: {{ .Values.postgresql.auth.username | quote }}
- name: DB_NAME
value: {{ .Values.postgresql.auth.database | quote }}
- name: DB_PORT
value: "5432"
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-postgresql"
key: password
- name: SERVICE_PORT
value: "8000"
- name: RESOURCE_SCOPE
value: {{ .Values.dynamo.env.resource_scope | quote }}
- name: DEFAULT_KUBE_NAMESPACE
value: {{ .Release.Namespace }}
- name: DYN_OBJECT_STORE_BUCKET
value: "dynamo-storage"
- name: DYN_OBJECT_STORE_ID
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-minio"
key: root-user
- name: DYN_OBJECT_STORE_KEY
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-minio"
key: root-password
- name: DYN_OBJECT_STORE_ENDPOINT
value: "http://{{ .Release.Name }}-minio:9000"
envFrom:
- secretRef:
name: dynamo-deployment-env
image: "{{ .Values.storeImage.repository }}:{{ .Values.storeImage.tag | default .Chart.AppVersion }}"
{{- with .Values.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
imagePullSecrets: {{ .Values.imagePullSecrets | default list | toJson }}
\ No newline at end of file
...@@ -36,7 +36,7 @@ spec: ...@@ -36,7 +36,7 @@ spec:
spec: spec:
containers: containers:
- image: nvcr.io/nvidian/nim-llm-dev/compoundai-ui:0.0.11 - image: nvcr.io/nvidian/nim-llm-dev/compoundai-ui:0.0.11
imagePullPolicy: Always imagePullPolicy: IfNotPresent
livenessProbe: livenessProbe:
failureThreshold: 3 failureThreshold: 3
httpGet: httpGet:
......
...@@ -27,6 +27,18 @@ rules: ...@@ -27,6 +27,18 @@ rules:
- apiGroups: [""] - apiGroups: [""]
resources: ["pods"] resources: ["pods"]
verbs: ["get", "list", "watch"] verbs: ["get", "list", "watch"]
- apiGroups:
- nvidia.com
resources:
- dynamodeployments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
--- ---
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
{{- if .Values.namespaceRestriction.enabled }} {{- if .Values.namespaceRestriction.enabled }}
...@@ -44,6 +56,10 @@ subjects: ...@@ -44,6 +56,10 @@ subjects:
name: {{ include "helm.serviceAccountName" . }} name: {{ include "helm.serviceAccountName" . }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
roleRef: roleRef:
{{- if .Values.namespaceRestriction.enabled }}
kind: Role
{{- else }}
kind: ClusterRole kind: ClusterRole
{{- end }}
name: {{ include "helm.fullname" . }}-role name: {{ include "helm.fullname" . }}-role
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
\ No newline at end of file
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: v1
kind: Service
metadata:
name: "dynamo-store"
labels:
{{- include "helm.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: {{ .Values.dynamo.apiStore.port }}
protocol: TCP
name: http
selector:
app: dynamo-api-store
...@@ -22,7 +22,7 @@ spec: ...@@ -22,7 +22,7 @@ spec:
type: {{ .Values.service.type }} type: {{ .Values.service.type }}
ports: ports:
- port: {{ .Values.service.port }} - port: {{ .Values.service.port }}
targetPort: {{ .Values.dynamo.port }} targetPort: {{ .Values.dynamo.apiServer.port }}
protocol: TCP protocol: TCP
name: http name: http
selector: selector:
......
...@@ -19,7 +19,7 @@ replicaCount: 1 ...@@ -19,7 +19,7 @@ replicaCount: 1
image: image:
repository: gitlab-master.nvidia.com:5005/aire/microservices/dynamo/api-server repository: gitlab-master.nvidia.com:5005/aire/microservices/dynamo/api-server
# This sets the pull policy for images. # This sets the pull policy for images.
pullPolicy: Always pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion. # Overrides the image tag whose default is the chart appVersion.
tag: "" tag: ""
...@@ -105,7 +105,7 @@ ingress: ...@@ -105,7 +105,7 @@ ingress:
# Istio settings # Istio settings
istio: istio:
host: cai.dev.aire.nvidia.com host: ""
## In-cluster minio deployment configuration ## In-cluster minio deployment configuration
## ref: https://github.com/bitnami/charts/blob/minio/13.3.1/bitnami/minio/values.yaml ## ref: https://github.com/bitnami/charts/blob/minio/13.3.1/bitnami/minio/values.yaml
...@@ -145,7 +145,10 @@ resources: {} ...@@ -145,7 +145,10 @@ resources: {}
# memory: 128Mi # memory: 128Mi
dynamo: dynamo:
apiServer:
port: 8181 port: 8181
apiStore:
port: 8000
postgresql: postgresql:
auth: auth:
......
...@@ -391,6 +391,8 @@ spec: ...@@ -391,6 +391,8 @@ spec:
type: object type: object
dynamoNim: dynamoNim:
type: string type: string
dynamoTag:
type: string
envFromSecret: envFromSecret:
type: string type: string
envs: envs:
...@@ -2784,6 +2786,7 @@ spec: ...@@ -2784,6 +2786,7 @@ spec:
type: string type: string
required: required:
- dynamoNim - dynamoNim
- dynamoTag
type: object type: object
status: status:
properties: properties:
......
...@@ -96,9 +96,18 @@ Generate docker config json for registry credentials ...@@ -96,9 +96,18 @@ Generate docker config json for registry credentials
{{- $username := .Values.dynamo.dockerRegistry.username -}} {{- $username := .Values.dynamo.dockerRegistry.username -}}
{{- $password := default .Values.global.NGC_API_KEY .Values.dynamo.dockerRegistry.password -}} {{- $password := default .Values.global.NGC_API_KEY .Values.dynamo.dockerRegistry.password -}}
{{- if .Values.dynamo.dockerRegistry.passwordExistingSecretName -}} {{- if .Values.dynamo.dockerRegistry.passwordExistingSecretName -}}
{{- $password = .Values.dynamo.dockerRegistry.passwordExistingSecretKey -}} {{- $secretName := .Values.dynamo.dockerRegistry.passwordExistingSecretName -}}
{{- end -}} {{- $secretKey := .Values.dynamo.dockerRegistry.passwordExistingSecretKey -}}
{ {{- $dockerconfigjson := lookup "v1" "Secret" .Release.Namespace $secretName }}
{{- if $dockerconfigjson -}}
{{- if eq $dockerconfigjson.type "kubernetes.io/dockerconfigjson" -}}
{{/* If the secret is already of type kubernetes.io/dockerconfigjson, use its .dockerconfigjson value directly */}}
{{- index $dockerconfigjson.data ".dockerconfigjson" | b64dec }}
{{- else -}}
{{/* If the secret is not of the correct type, extract password from the secret and build a new one */}}
{{- $password = index $dockerconfigjson.data $secretKey | b64dec }}
{
"auths": { "auths": {
"{{ $server }}": { "{{ $server }}": {
"username": "{{ $username }}", "username": "{{ $username }}",
...@@ -106,5 +115,64 @@ Generate docker config json for registry credentials ...@@ -106,5 +115,64 @@ Generate docker config json for registry credentials
"auth": "{{ printf "%s:%s" $username $password | b64enc }}" "auth": "{{ printf "%s:%s" $username $password | b64enc }}"
} }
} }
} }
{{- end -}}
{{- else -}}
{{/* If no secret is found, use the default password */}}
{{- $password = .Values.dynamo.dockerRegistry.password | default .Values.global.NGC_API_KEY }}
{
"auths": {
"{{ $server }}": {
"username": "{{ $username }}",
"password": "{{ $password }}",
"auth": "{{ printf "%s:%s" $username $password | b64enc }}"
}
}
}
{{- end -}}
{{- else -}}
{{/* Build a new dockerconfigjson if passwordExistingSecretName is not set */}}
{
"auths": {
"{{ $server }}": {
"username": "{{ $username }}",
"password": "{{ $password }}",
"auth": "{{ printf "%s:%s" $username $password | b64enc }}"
}
}
}
{{- end -}} {{- end -}}
{{- end -}}
{{/*
Extract username and password from docker registry configuration
*/}}
{{- define "dynamo-operator.extractDockerCredentials" -}}
{{- $server := .Values.dynamo.dockerRegistry.server -}}
{{- $username := .Values.dynamo.dockerRegistry.username -}}
{{- $password := default .Values.global.NGC_API_KEY .Values.dynamo.dockerRegistry.password -}}
{{- $result := dict "username" $username "password" $password }}
{{- if .Values.dynamo.dockerRegistry.passwordExistingSecretName }}
{{- $secretName := .Values.dynamo.dockerRegistry.passwordExistingSecretName }}
{{- $secretKey := .Values.dynamo.dockerRegistry.passwordExistingSecretKey }}
{{- $dockerconfigjson := lookup "v1" "Secret" .Release.Namespace $secretName }}
{{- if $dockerconfigjson }}
{{- if eq $dockerconfigjson.type "kubernetes.io/dockerconfigjson" }}
{{- $decodedConfig := index $dockerconfigjson.data ".dockerconfigjson" | b64dec | fromJson }}
{{- range $registry, $authConfig := $decodedConfig.auths }}
{{- $_ := set $result "username" $authConfig.username }}
{{- $_ := set $result "password" $authConfig.password }}
{{- break }}
{{- end }}
{{- else if hasKey $dockerconfigjson.data $secretKey }}
{{- $_ := set $result "password" (index $dockerconfigjson.data $secretKey | b64dec) }}
{{- end }}
{{- end }}
{{- end }}
{{- toYaml $result }}
{{- end }}
\ No newline at end of file
...@@ -42,12 +42,15 @@ stringData: ...@@ -42,12 +42,15 @@ stringData:
ENABLE_RESTRICTED_SECURITY_CONTEXT: "true" ENABLE_RESTRICTED_SECURITY_CONTEXT: "true"
{{- end }} {{- end }}
{{- if .Values.dynamo.dynamoIngressSuffix }}
DYNAMO_INGRESS_SUFFIX: {{ .Values.dynamo.dynamoIngressSuffix | quote }}
{{- end }}
DOCKER_REGISTRY_SERVER: {{ .Values.dynamo.dockerRegistry.server | quote }} DOCKER_REGISTRY_SERVER: {{ .Values.dynamo.dockerRegistry.server | quote }}
DOCKER_REGISTRY_IN_CLUSTER_SERVER: {{ .Values.dynamo.dockerRegistry.inClusterServer | quote }} DOCKER_REGISTRY_IN_CLUSTER_SERVER: {{ .Values.dynamo.dockerRegistry.inClusterServer | quote }}
DOCKER_REGISTRY_USERNAME: {{ .Values.dynamo.dockerRegistry.username | quote }} {{- with include "dynamo-operator.extractDockerCredentials" . | fromYaml }}
{{- if not .Values.dynamo.dockerRegistry.passwordExistingSecretName }} DOCKER_REGISTRY_USERNAME: {{ .username | quote }}
DOCKER_REGISTRY_PASSWORD: {{ default .Values.global.NGC_API_KEY .Values.dynamo.dockerRegistry.password | quote }} DOCKER_REGISTRY_PASSWORD: {{ .password | quote }}
{{- end }} {{- end }}
DOCKER_REGISTRY_SECURE: {{ .Values.dynamo.dockerRegistry.secure | quote }} DOCKER_REGISTRY_SECURE: {{ .Values.dynamo.dockerRegistry.secure | quote }}
DOCKER_REGISTRY_BENTO_REPOSITORY_NAME: {{ .Values.dynamo.dockerRegistry.bentoRepositoryName | quote }} DOCKER_REGISTRY_BENTO_REPOSITORY_NAME: {{ .Values.dynamo.dockerRegistry.bentoRepositoryName | quote }}
......
...@@ -61,6 +61,10 @@ spec: ...@@ -61,6 +61,10 @@ spec:
{{- end }} {{- end }}
{{- if .Values.namespaceRestriction.enabled }} {{- if .Values.namespaceRestriction.enabled }}
- --restrictedNamespace={{ default .Release.Namespace .Values.namespaceRestriction.targetNamespace }} - --restrictedNamespace={{ default .Release.Namespace .Values.namespaceRestriction.targetNamespace }}
- --leader-elect=false
{{- else }}
- --leader-elect
- --leader-election-id=dynamo.nvidia.com
{{- end }} {{- end }}
{{- if .Values.natsAddr }} {{- if .Values.natsAddr }}
- --natsAddr={{ .Values.natsAddr }} - --natsAddr={{ .Values.natsAddr }}
......
...@@ -329,6 +329,7 @@ rules: ...@@ -329,6 +329,7 @@ rules:
- nvidia.com - nvidia.com
resources: resources:
- dynamonimdeployments - dynamonimdeployments
- dynamodeployments
verbs: verbs:
- create - create
- delete - delete
...@@ -341,12 +342,14 @@ rules: ...@@ -341,12 +342,14 @@ rules:
- nvidia.com - nvidia.com
resources: resources:
- dynamonimdeployments/finalizers - dynamonimdeployments/finalizers
- dynamodeployments/finalizers
verbs: verbs:
- update - update
- apiGroups: - apiGroups:
- nvidia.com - nvidia.com
resources: resources:
- dynamonimdeployments/status - dynamonimdeployments/status
- dynamodeployments/status
verbs: verbs:
- get - get
- patch - patch
......
...@@ -41,6 +41,8 @@ type DynamoNimDeploymentSpec struct { ...@@ -41,6 +41,8 @@ type DynamoNimDeploymentSpec struct {
Labels map[string]string `json:"labels,omitempty"` Labels map[string]string `json:"labels,omitempty"`
DynamoNim string `json:"dynamoNim"` DynamoNim string `json:"dynamoNim"`
// contains the tag of the DynamoNim: for example, "my_package:MyService"
DynamoTag string `json:"dynamoTag"`
// contains the name of the service // contains the name of the service
ServiceName string `json:"serviceName,omitempty"` ServiceName string `json:"serviceName,omitempty"`
......
//go:build !ignore_autogenerated //go:build !ignore_autogenerated
/*
SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/* /*
Copyright 2024. Copyright 2024.
......
...@@ -392,6 +392,8 @@ spec: ...@@ -392,6 +392,8 @@ spec:
type: object type: object
dynamoNim: dynamoNim:
type: string type: string
dynamoTag:
type: string
envFromSecret: envFromSecret:
type: string type: string
envs: envs:
...@@ -2785,6 +2787,7 @@ spec: ...@@ -2785,6 +2787,7 @@ spec:
type: string type: string
required: required:
- dynamoNim - dynamoNim
- dynamoTag
type: object type: object
status: status:
properties: properties:
......
...@@ -391,6 +391,8 @@ spec: ...@@ -391,6 +391,8 @@ spec:
type: object type: object
dynamoNim: dynamoNim:
type: string type: string
dynamoTag:
type: string
envFromSecret: envFromSecret:
type: string type: string
envs: envs:
...@@ -2784,6 +2786,7 @@ spec: ...@@ -2784,6 +2786,7 @@ spec:
type: string type: string
required: required:
- dynamoNim - dynamoNim
- dynamoTag
type: object type: object
status: status:
properties: properties:
......
...@@ -187,7 +187,9 @@ func (r *DynamoDeploymentReconciler) getSecret(ctx context.Context, namespace, n ...@@ -187,7 +187,9 @@ func (r *DynamoDeploymentReconciler) getSecret(ctx context.Context, namespace, n
// SetupWithManager sets up the controller with the Manager. // SetupWithManager sets up the controller with the Manager.
func (r *DynamoDeploymentReconciler) SetupWithManager(mgr ctrl.Manager) error { func (r *DynamoDeploymentReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr). return ctrl.NewControllerManagedBy(mgr).
For(&nvidiacomv1alpha1.DynamoDeployment{}). For(&nvidiacomv1alpha1.DynamoDeployment{}, builder.WithPredicates(
predicate.GenerationChangedPredicate{},
)).
Named("dynamodeployment"). Named("dynamodeployment").
Owns(&nvidiacomv1alpha1.DynamoNimDeployment{}, builder.WithPredicates(predicate.Funcs{ Owns(&nvidiacomv1alpha1.DynamoNimDeployment{}, builder.WithPredicates(predicate.Funcs{
// ignore creation cause we don't want to be called again after we create the deployment // ignore creation cause we don't want to be called again after we create the deployment
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment