From 500c5dd1a4daa12e747d95c68096668fd9cabf61 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Mon, 19 Feb 2024 19:21:55 +0100 Subject: [PATCH] Rename nvidia.com/sharing.mps.enabled to nvidia.com/mps.capable Signed-off-by: Evan Lezar --- .../daemonset-mps-control-daemon.yml | 2 +- internal/lm/nvml.go | 2 +- internal/lm/nvml_test.go | 10 +++--- tests/e2e/gpu-feature-discovery_test.go | 32 +++++++++---------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/deployments/helm/nvidia-device-plugin/templates/daemonset-mps-control-daemon.yml b/deployments/helm/nvidia-device-plugin/templates/daemonset-mps-control-daemon.yml index c23bcc374..1087446e1 100644 --- a/deployments/helm/nvidia-device-plugin/templates/daemonset-mps-control-daemon.yml +++ b/deployments/helm/nvidia-device-plugin/templates/daemonset-mps-control-daemon.yml @@ -209,7 +209,7 @@ spec: {{- end }} nodeSelector: # We only deploy this pod if the following sharing label is applied. - nvidia.com/sharing.mps.enabled: "true" + nvidia.com/mps.capable: "true" {{- with .Values.nodeSelector }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/internal/lm/nvml.go b/internal/lm/nvml.go index 26e9f765d..5b54699cd 100644 --- a/internal/lm/nvml.go +++ b/internal/lm/nvml.go @@ -146,6 +146,6 @@ func newSharingLabeler(config *spec.Config) Labeler { } return Labels{ - "nvidia.com/sharing.mps.enabled": strconv.FormatBool(mpsEnabled), + "nvidia.com/mps.capable": strconv.FormatBool(mpsEnabled), } } diff --git a/internal/lm/nvml_test.go b/internal/lm/nvml_test.go index 36353d656..00aade5c3 100644 --- a/internal/lm/nvml_test.go +++ b/internal/lm/nvml_test.go @@ -87,14 +87,14 @@ func TestSharingLabeler(t *testing.T) { { descrition: "nil config", expectedLabels: map[string]string{ - "nvidia.com/sharing.mps.enabled": "false", + "nvidia.com/mps.capable": "false", }, }, { descrition: "empty config", config: &spec.Config{}, expectedLabels: map[string]string{ - "nvidia.com/sharing.mps.enabled": "false", + "nvidia.com/mps.capable": "false", }, }, { @@ -111,7 +111,7 @@ func TestSharingLabeler(t *testing.T) { }, }, expectedLabels: map[string]string{ - "nvidia.com/sharing.mps.enabled": "false", + "nvidia.com/mps.capable": "false", }, }, { @@ -128,7 +128,7 @@ func TestSharingLabeler(t *testing.T) { }, }, expectedLabels: map[string]string{ - "nvidia.com/sharing.mps.enabled": "false", + "nvidia.com/mps.capable": "false", }, }, { @@ -145,7 +145,7 @@ func TestSharingLabeler(t *testing.T) { }, }, expectedLabels: map[string]string{ - "nvidia.com/sharing.mps.enabled": "true", + "nvidia.com/mps.capable": "true", }, }, } diff --git a/tests/e2e/gpu-feature-discovery_test.go b/tests/e2e/gpu-feature-discovery_test.go index 0872a8194..7bf3c6cb0 100644 --- a/tests/e2e/gpu-feature-discovery_test.go +++ b/tests/e2e/gpu-feature-discovery_test.go @@ -43,22 +43,22 @@ var _ = NVDescribe("GPU Feature Discovery", func() { f := framework.NewFramework("gpu-feature-discovery") expectedLabelPatterns := k8sLabels{ - "nvidia.com/gfd.timestamp": "[0-9]{10}", - "nvidia.com/cuda.driver.major": "[0-9]+", - "nvidia.com/cuda.driver.minor": "[0-9]+", - "nvidia.com/cuda.driver.rev": "[0-9]*", - "nvidia.com/cuda.runtime.major": "[0-9]+", - "nvidia.com/cuda.runtime.minor": "[0-9]+", - "nvidia.com/gpu.machine": ".*", - "nvidia.com/gpu.count": "[0-9]+", - "nvidia.com/gpu.replicas": "[0-9]+", - "nvidia.com/gpu.product": "[A-Za-z_-]+", - "nvidia.com/gpu.memory": "[0-9]+", - "nvidia.com/gpu.family": "[a-z]+", - "nvidia.com/mig.capable": "[true|false]", - "nvidia.com/gpu.compute.major": "[0-9]+", - "nvidia.com/gpu.compute.minor": "[0-9]+", - "nvidia.com/sharing.mps.enabled": "[true|false]", + "nvidia.com/gfd.timestamp": "[0-9]{10}", + "nvidia.com/cuda.driver.major": "[0-9]+", + "nvidia.com/cuda.driver.minor": "[0-9]+", + "nvidia.com/cuda.driver.rev": "[0-9]*", + "nvidia.com/cuda.runtime.major": "[0-9]+", + "nvidia.com/cuda.runtime.minor": "[0-9]+", + "nvidia.com/gpu.machine": ".*", + "nvidia.com/gpu.count": "[0-9]+", + "nvidia.com/gpu.replicas": "[0-9]+", + "nvidia.com/gpu.product": "[A-Za-z_-]+", + "nvidia.com/gpu.memory": "[0-9]+", + "nvidia.com/gpu.family": "[a-z]+", + "nvidia.com/mig.capable": "[true|false]", + "nvidia.com/gpu.compute.major": "[0-9]+", + "nvidia.com/gpu.compute.minor": "[0-9]+", + "nvidia.com/mps.capable": "[true|false]", } Context("When deploying GFD", Ordered, func() {