Skip to content

Commit ad7a364

Browse files
committed
fix: simplify and assume accept-nvidia-visible-devices-envvar-when-unprivileged is true
1 parent 67856ee commit ad7a364

5 files changed

Lines changed: 14 additions & 64 deletions

File tree

helm/fiftyone-teams-app/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ If pods show unhealthy states (e.g., `0/1`, `CrashLoopBackOff`, `Pending`):
885885
| casSettings.volumes | list | `[]` | Volumes for `teams-cas`. [Reference][volumes]. |
886886
| delegatedOperatorDeployments.deployments | object | `{"teamsDoCpuDefault":{"enabled":false,"env":{"FIFTYONE_MEDIA_CACHE_DIR":"/opt/media_cache","FIFTYONE_MEDIA_CACHE_SIZE_BYTES":"2147483648"},"replicaCount":1,"resources":{"limits":{"cpu":4,"ephemeral-storage":"1Gi","memory":"16Gi"},"requests":{"cpu":4,"ephemeral-storage":"1Gi","memory":"16Gi"}},"volumeMounts":[{"mountPath":"/dev/shm","name":"shm-vol"},{"mountPath":"/opt/media_cache","name":"memory-media-cache-vol"}],"volumes":[{"emptyDir":{"medium":"Memory","sizeLimit":"2Gi"},"name":"shm-vol"},{"emptyDir":{"medium":"Memory","sizeLimit":"2.5Gi"},"name":"memory-media-cache-vol"}]}}` | Additional deployments to configure. Each template will use .Values.delegatedOperatorDeployments.template as a base. Each template value may be overridden. Maps/dictionaries will be merged key-wise, with the deployment instance taking precedence. List values will not be merged, but be overridden completely by the deployment instance. |
887887
| delegatedOperatorDeployments.deployments.teamsDoCpuDefault | object | `{"enabled":false,"env":{"FIFTYONE_MEDIA_CACHE_DIR":"/opt/media_cache","FIFTYONE_MEDIA_CACHE_SIZE_BYTES":"2147483648"},"replicaCount":1,"resources":{"limits":{"cpu":4,"ephemeral-storage":"1Gi","memory":"16Gi"},"requests":{"cpu":4,"ephemeral-storage":"1Gi","memory":"16Gi"}},"volumeMounts":[{"mountPath":"/dev/shm","name":"shm-vol"},{"mountPath":"/opt/media_cache","name":"memory-media-cache-vol"}],"volumes":[{"emptyDir":{"medium":"Memory","sizeLimit":"2Gi"},"name":"shm-vol"},{"emptyDir":{"medium":"Memory","sizeLimit":"2.5Gi"},"name":"memory-media-cache-vol"}]}` | Default (CPU-only) delegated operator runner. Defaults to an 4vCPU, 16Gi RAM runner. The deployment is backed with a 2.5Gi in-memory volume for caching media and an extra 2Gi of shared memory. |
888-
| delegatedOperatorDeployments.template | object | `{"affinity":{},"deploymentAnnotations":{},"description":"","env":{"FIFTYONE_DELEGATED_OPERATION_LOG_PATH":"","FIFTYONE_INTERNAL_SERVICE":true,"FIFTYONE_MEDIA_CACHE_SIZE_BYTES":-1},"image":{"pullPolicy":"Always","repository":"voxel51/fiftyone-teams-cv-full","tag":""},"labels":{},"liveness":{"failureThreshold":5,"periodSeconds":30,"timeoutSeconds":30},"nodeSelector":{},"podAnnotations":{},"podDisruptionBudget":{"enabled":false,"minAvailable":null},"podSecurityContext":{"fsGroup":1000,"runAsGroup":1000,"runAsNonRoot":true,"runAsUser":1000},"readiness":{"failureThreshold":5,"periodSeconds":30,"timeoutSeconds":30},"replicaCount":3,"resources":{"limits":{},"requests":{}},"secretEnv":{},"securityContext":{},"startup":{"failureThreshold":5,"periodSeconds":30,"timeoutSeconds":30},"telemetry":{"sidecar":{"env":{},"resources":{}}},"tolerations":[],"topologySpreadConstraints":[],"updateStrategy":{"type":"RollingUpdate"},"volumeMounts":[],"volumes":[]}` | A common template applied to all deployments. Each deployment can then override individual fields as needed by the operator. |
888+
| delegatedOperatorDeployments.template | object | `{"affinity":{},"deploymentAnnotations":{},"description":"","env":{"FIFTYONE_DELEGATED_OPERATION_LOG_PATH":"","FIFTYONE_INTERNAL_SERVICE":true,"FIFTYONE_MEDIA_CACHE_SIZE_BYTES":-1},"image":{"pullPolicy":"Always","repository":"voxel51/fiftyone-teams-cv-full","tag":""},"labels":{},"liveness":{"failureThreshold":5,"periodSeconds":30,"timeoutSeconds":30},"nodeSelector":{},"podAnnotations":{},"podDisruptionBudget":{"enabled":false,"minAvailable":null},"podSecurityContext":{"fsGroup":1000,"runAsGroup":1000,"runAsNonRoot":true,"runAsUser":1000},"readiness":{"failureThreshold":5,"periodSeconds":30,"timeoutSeconds":30},"replicaCount":3,"resources":{"limits":{},"requests":{}},"secretEnv":{},"securityContext":{},"startup":{"failureThreshold":5,"periodSeconds":30,"timeoutSeconds":30},"tolerations":[],"topologySpreadConstraints":[],"updateStrategy":{"type":"RollingUpdate"},"volumeMounts":[],"volumes":[]}` | A common template applied to all deployments. Each deployment can then override individual fields as needed by the operator. |
889889
| delegatedOperatorDeployments.template.affinity | object | `{}` | Affinity and anti-affinity for `delegated-operator-executor`. [Reference][affinity]. |
890890
| delegatedOperatorDeployments.template.deploymentAnnotations | object | `{}` | Annotations for the `teams-do` deployment. [Reference][annotations]. |
891891
| delegatedOperatorDeployments.template.description | string | `""` | A description for the delegated operator instance. This is unused in the template context. Each operator should either set their own description or, optionally, use the default. If unset at the operator context, it will be defaulted to `Long running operations delegated to $name` where `$name` is the name of the Deployment object. |
@@ -914,8 +914,6 @@ If pods show unhealthy states (e.g., `0/1`, `CrashLoopBackOff`, `Pending`):
914914
| delegatedOperatorDeployments.template.startup.failureThreshold | int | `5` | Number of times to retry the startup probe for the `teams-do`. [Reference][probes]. |
915915
| delegatedOperatorDeployments.template.startup.periodSeconds | int | `30` | How often (in seconds) to perform the startup probe for `teams-do`. [Reference][probes]. |
916916
| delegatedOperatorDeployments.template.startup.timeoutSeconds | int | `30` | Timeout for the startup probe for the `teams-do`. [Reference][probes]. |
917-
| delegatedOperatorDeployments.template.telemetry.sidecar.env | object | `{}` | Extra sidecar env vars. Rarely set; GPU env is auto-configured. |
918-
| delegatedOperatorDeployments.template.telemetry.sidecar.resources | object | `{}` | Sidecar resource overrides. Only needed on GKE-style clusters where GPU charts stay empty: give the sidecar a GPU (enable GPU time-sharing so it shares the operator's GPU). |
919917
| delegatedOperatorDeployments.template.tolerations | list | `[]` | Allow the k8s scheduler to schedule delegated-operator-executor pods with matching taints. [Reference][taints-and-tolerations]. |
920918
| delegatedOperatorDeployments.template.topologySpreadConstraints | list | `[]` | Control how Pods are spread across your distributed footprint. Label selectors will be defaulted to those of the `teams-do` deployment(s). [Reference][topology-spread-constraints]. |
921919
| delegatedOperatorDeployments.template.updateStrategy | object | `{"type":"RollingUpdate"}` | Control how `teams-do` pods are redeployed during an upgrade. [Reference][upgrade-strategies] |

helm/fiftyone-teams-app/templates/_telemetry.tpl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,15 @@ Inputs (dict):
137137

138138
{{/*
139139
A regular spec.containers entry: telemetry-sidecar for api/app/plugins/DO deployments.
140-
Inputs: same dict as telemetry.sidecar-env, plus optional `sidecarResources` —
141-
when non-empty it replaces telemetry.sidecar.resources for this one sidecar
142-
(e.g. to request `nvidia.com/gpu` so the sidecar can read GPU metrics).
140+
Inputs: same dict as telemetry.sidecar-env.
143141
*/}}
144142
{{- define "telemetry.sidecar" -}}
145143
- name: telemetry-sidecar
146144
image: "{{ .ctx.Values.telemetry.sidecar.image.repository }}:{{ .ctx.Values.telemetry.sidecar.image.tag | default .ctx.Chart.AppVersion }}"
147145
imagePullPolicy: {{ .ctx.Values.telemetry.sidecar.image.pullPolicy | default "Always" }}
148146
env:
149147
{{- include "telemetry.sidecar-env" . | nindent 4 }}
150-
{{- with (.sidecarResources | default .ctx.Values.telemetry.sidecar.resources) }}
148+
{{- with .ctx.Values.telemetry.sidecar.resources }}
151149
resources:
152150
{{- toYaml . | nindent 4 }}
153151
{{- end }}
@@ -177,7 +175,7 @@ would block Job completion.
177175
restartPolicy: Always
178176
env:
179177
{{- include "telemetry.sidecar-env" . | nindent 4 }}
180-
{{- with (.sidecarResources | default .ctx.Values.telemetry.sidecar.resources) }}
178+
{{- with .ctx.Values.telemetry.sidecar.resources }}
181179
resources:
182180
{{- toYaml . | nindent 4 }}
183181
{{- end }}

helm/fiftyone-teams-app/templates/delegated-operator-instance-deployment.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,16 @@
1717
{{- $defaultDescription := printf "Long running operations delegated to %s" $name }}
1818
{{- $updateStrategy := merge (dict) ($v.updateStrategy|default dict) ($baseTpl.updateStrategy) }}
1919
{{- $mergedResources := merge (dict) ($v.resources | default dict) ($baseTpl.resources | default dict) }}
20-
{{- $sidecarOverride := (merge (dict) ($v.telemetry | default dict) ($baseTpl.telemetry | default dict)).sidecar | default dict }}
21-
{{- /* When the worker requests a GPU, expose it to the sidecar too so GPU
22-
metrics are collected without any extra config. NVIDIA_VISIBLE_DEVICES is
23-
honored where the NVIDIA runtime accepts it (most non-GKE setups); GKE
24-
gates GPUs via the device plugin, so use telemetry.sidecar.resources there. */}}
20+
{{- /* When the executor requests a GPU, expose that same GPU to its telemetry
21+
sidecar for read-only metrics. This sets env vars only — the sidecar never
22+
requests its own nvidia.com/gpu, so it consumes no GPU quota and the
23+
executor keeps the allocated GPU. Honored where the NVIDIA runtime accepts
24+
NVIDIA_VISIBLE_DEVICES (most setups; GKE blocks env-based exposure). */}}
2525
{{- $gpuRequested := or (not (empty (dig "limits" "nvidia.com/gpu" "" $mergedResources))) (not (empty (dig "requests" "nvidia.com/gpu" "" $mergedResources))) }}
26-
{{- $autoSidecarEnv := dict }}
26+
{{- $sidecarEnv := dict }}
2727
{{- if $gpuRequested }}
28-
{{- $autoSidecarEnv = dict "NVIDIA_VISIBLE_DEVICES" "all" "NVIDIA_DRIVER_CAPABILITIES" "utility" }}
28+
{{- $sidecarEnv = dict "NVIDIA_VISIBLE_DEVICES" "all" "NVIDIA_DRIVER_CAPABILITIES" "compute,utility" }}
2929
{{- end }}
30-
{{- $sidecarEnv := merge (dict) ($sidecarOverride.env | default dict) $autoSidecarEnv }}
3130
{{- $mergedVolumeMounts := $v.volumeMounts | default $baseTpl.volumeMounts | default list }}
3231
{{- $mergedVolumes := $v.volumes | default $baseTpl.volumes | default list }}
3332
{{- if $.Values.telemetry.enabled }}
@@ -141,7 +140,7 @@ spec:
141140
periodSeconds: {{ ($v.startup).periodSeconds | default $baseTpl.startup.periodSeconds }}
142141
timeoutSeconds: {{ ($v.startup).timeoutSeconds | default $baseTpl.startup.timeoutSeconds }}
143142
{{- if $.Values.telemetry.enabled }}
144-
{{- include "telemetry.sidecar" (dict "ctx" $ "serviceType" "delegated-operator" "targetName" "fiftyone delegated" "executor" true "sidecarEnv" $sidecarEnv "sidecarResources" ($sidecarOverride.resources | default dict)) | nindent 8 }}
143+
{{- include "telemetry.sidecar" (dict "ctx" $ "serviceType" "delegated-operator" "targetName" "fiftyone delegated" "executor" true "sidecarEnv" $sidecarEnv) | nindent 8 }}
145144
{{- end }}
146145
{{- with (merge (dict) ($v.nodeSelector | default dict) ($baseTpl.nodeSelector)) }}
147146
nodeSelector:

helm/fiftyone-teams-app/values.schema.json

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,33 +2288,6 @@
22882288
"title": "startup",
22892289
"type": "object"
22902290
},
2291-
"telemetry": {
2292-
"description": "GPU metrics auto-enable when this operator requests a GPU. Only set the\noptions below if GPU charts stay empty while the operator uses the GPU.",
2293-
"properties": {
2294-
"sidecar": {
2295-
"properties": {
2296-
"env": {
2297-
"description": "Extra sidecar env vars. Rarely set; GPU env is auto-configured.",
2298-
"required": [],
2299-
"title": "env",
2300-
"type": "object"
2301-
},
2302-
"resources": {
2303-
"description": "Sidecar resource overrides. Only needed on GKE-style clusters where\nGPU charts stay empty: give the sidecar a GPU (enable GPU time-sharing\nso it shares the operator's GPU).",
2304-
"required": [],
2305-
"title": "resources",
2306-
"type": "object"
2307-
}
2308-
},
2309-
"required": [],
2310-
"title": "sidecar",
2311-
"type": "object"
2312-
}
2313-
},
2314-
"required": [],
2315-
"title": "telemetry",
2316-
"type": "object"
2317-
},
23182291
"tolerations": {
23192292
"description": "Allow the k8s scheduler to schedule delegated-operator-executor pods with matching taints. [Reference][taints-and-tolerations].",
23202293
"items": {

helm/fiftyone-teams-app/values.yaml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -779,17 +779,6 @@ delegatedOperatorDeployments:
779779
# cpu: 8
780780
# memory: 16Gi
781781

782-
# GPU metrics auto-enable when this operator requests a GPU. Only set the
783-
# options below if GPU charts stay empty while the operator uses the GPU.
784-
telemetry:
785-
sidecar:
786-
# -- Extra sidecar env vars. Rarely set; GPU env is auto-configured.
787-
env: {}
788-
# -- Sidecar resource overrides. Only needed on GKE-style clusters where
789-
# GPU charts stay empty: give the sidecar a GPU (enable GPU time-sharing
790-
# so it shares the operator's GPU).
791-
resources: {}
792-
793782
# -- Affinity and anti-affinity for `delegated-operator-executor`. [Reference][affinity].
794783
affinity: {}
795784
# -- nodeSelector for `delegated-operator-executor`. [Reference][node-selector].
@@ -909,15 +898,8 @@ delegatedOperatorDeployments:
909898
# cpu: 8
910899
# ephemeral-storage: 1Gi
911900
# memory: 16Gi
912-
# # Only on GKE-style clusters where GPU charts stay empty: give the
913-
# # sidecar a GPU too (turn on GPU time-sharing first).
914-
# telemetry:
915-
# sidecar:
916-
# resources:
917-
# limits:
918-
# nvidia.com/gpu: 1
919-
# requests:
920-
# nvidia.com/gpu: 1
901+
# # GPU metrics appear automatically — the telemetry sidecar reads this
902+
# # operator's GPU without requesting its own allocation.
921903
# volumes:
922904
# - name: shm-vol
923905
# emptyDir:

0 commit comments

Comments
 (0)