Skip to content

Commit dc212b9

Browse files
committed
feat(chart): install gpu-sharing as OCI dependency
Signed-off-by: davidLif <davidshani12@gmail.com>
1 parent 37eb874 commit dc212b9

15 files changed

Lines changed: 189 additions & 9 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: Added
2+
body: |-
3+
Install gpu-sharing as an OCI subchart

.github/workflows/on-pr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ jobs:
233233
234234
- name: Build helm chart
235235
run: |
236+
helm dependency build ./deployments/kai-scheduler
236237
helm package ./deployments/kai-scheduler -d ./charts --app-version $PACKAGE_VERSION --version $PACKAGE_VERSION
237238
cp charts/kai-scheduler-$PACKAGE_VERSION.tgz /mnt/images/
238239

.github/workflows/on-release.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
- name: Build helm chart
6464
run: |
6565
sed -i 's#registry/local/kai-scheduler#${{ env.DOCKER_REGISTRY }}#' deployments/kai-scheduler/values.yaml
66+
helm dependency build ./deployments/kai-scheduler
6667
helm package ./deployments/kai-scheduler -d ./charts --app-version $PACKAGE_VERSION --version $PACKAGE_VERSION
6768
cp charts/kai-scheduler-$PACKAGE_VERSION.tgz /mnt/images/
6869

.github/workflows/push-artifacts.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ jobs:
5959
- name: Build helm chart
6060
run: |
6161
sed -i 's#registry/local/kai-scheduler#${{ env.DOCKER_REGISTRY }}#' deployments/kai-scheduler/values.yaml
62+
helm dependency build ./deployments/kai-scheduler
6263
helm package ./deployments/kai-scheduler -d ./charts --app-version $PACKAGE_VERSION --version $PACKAGE_VERSION
6364
6465
- name: Push Helm Chart

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@ K8S_COPYRIGHTED_MANIFEST_FILES := deployments/kai-scheduler/crds/kai.scheduler_t
2727
lint: fmt-go vet-go lint-go
2828
.PHONY: lint
2929

30+
.PHONY: chart-deps
31+
chart-deps:
32+
@echo "Fetching Helm chart dependencies: kai-scheduler"
33+
helm dependency build ./deployments/kai-scheduler
34+
3035
.PHONY: test-chart
31-
test-chart:
36+
test-chart: chart-deps
3237
@echo "Running tests for Helm chart: kai-scheduler"
3338
docker run -t --rm -v ./deployments/kai-scheduler:/apps helmunittest/helm-unittest:3.17.2-0.8.1 . -f 'tests/**/*_test.yaml'
3439

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: gpu-sharing
3+
repository: oci://ghcr.io/kai-scheduler/gpu-sharing
4+
version: v0.1.0-alpha.1
5+
digest: sha256:c3d7f76c6d2b2fd7b256b7450fb435a82693e8acef1265d10a8d5270fcb028db
6+
generated: "2026-08-02T20:53:54.374149+03:00"

deployments/kai-scheduler/Chart.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,10 @@ name: kai-scheduler
66
description: KAI Scheduler by NVIDIA
77
type: application
88
version: 0.0.0
9-
appVersion: 0.0.0
9+
appVersion: 0.0.0
10+
11+
dependencies:
12+
- name: gpu-sharing
13+
version: v0.1.0-alpha.1
14+
repository: oci://ghcr.io/kai-scheduler/gpu-sharing
15+
condition: global.nvFractions.set

deployments/kai-scheduler/templates/_helpers.tpl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,14 @@ spec:
108108
{{- if .Values.podgrouper.queueLabelKey }}
109109
queueLabelKey: {{ .Values.podgrouper.queueLabelKey | quote }}
110110
{{- end }}
111-
{{- /* GpuSharingMode precedence: an explicit (non-empty) mode wins; otherwise a
112-
legacy gpuSharing value is passed through (operator derives the mode); when
113-
neither is set, default to NonMemoryEnforced. */}}
114-
{{- if .Values.global.gpuSharingMode }}
111+
{{- /* GpuSharingMode precedence: nvFractions.set forces NvFractions (validate.yaml has
112+
already rejected a conflicting explicit mode, so this only guards against a legacy
113+
gpuSharing value downgrading it); then an explicit (non-empty) mode; then a legacy
114+
gpuSharing value is passed through (operator derives the mode); when none is set,
115+
default to NonMemoryEnforced. */}}
116+
{{- if .Values.global.nvFractions.set }}
117+
gpuSharingMode: NvFractions
118+
{{- else if .Values.global.gpuSharingMode }}
115119
gpuSharingMode: {{ .Values.global.gpuSharingMode }}
116120
{{- else if not (hasKey .Values.global "gpuSharing") }}
117121
gpuSharingMode: NonMemoryEnforced
@@ -260,7 +264,7 @@ spec:
260264
maxUnavailable: {{ .Values.admission.podDisruptionBudget.maxUnavailable }}
261265
{{- end }}
262266
{{- end }}
263-
{{- if and (not .Values.global.gpuSharingMode) (hasKey .Values.global "gpuSharing") }}
267+
{{- if and (not .Values.global.nvFractions.set) (not .Values.global.gpuSharingMode) (hasKey .Values.global "gpuSharing") }}
264268
gpuSharing: {{ .Values.global.gpuSharing }}
265269
{{- end }}
266270
blockNvidiaVisibleDevices: {{ .Values.global.blockNvidiaVisibleDevices | default false }}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{{/*
2+
Copyright 2025 NVIDIA CORPORATION
3+
SPDX-License-Identifier: Apache-2.0
4+
*/}}
5+
{{- /* Renders no resource. Aborts the render when nvFractions.set asks for the gpu-sharing
6+
operator while gpuSharingMode explicitly selects a different mode. */}}
7+
{{- if and .Values.global.nvFractions.set .Values.global.gpuSharingMode (ne .Values.global.gpuSharingMode "NvFractions") }}
8+
{{- fail (printf "global.nvFractions.set=true requires global.gpuSharingMode to be empty or \"NvFractions\", got %q" .Values.global.gpuSharingMode) }}
9+
{{- end }}

deployments/kai-scheduler/tests/gpu_sharing_mode_test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
suite: test gpu sharing mode configuration
55

66
set:
7-
_test:
8-
renderKaiConfig: true
7+
kaiConfigDeployer.enabled: false
8+
kaiConfig.render: true
99
templates:
1010
- kai-config.yaml
1111
tests:

0 commit comments

Comments
 (0)