Skip to content

Commit

Permalink
PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gshaibi committed Jul 16, 2024
1 parent bad9106 commit 94cab57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion deploy/fake-gpu-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ topology:
gpuCount: 2
gpuMemory: 11441
nodePoolLabelKey: run.ai/simulated-gpu-node-pool
mig-strategy: mixed
migStrategy: mixed
13 changes: 9 additions & 4 deletions internal/status-updater/handlers/node/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ import (
"k8s.io/apimachinery/pkg/types"
)

const (
dcgmExporterLabelKey = "nvidia.com/gpu.deploy.dcgm-exporter"
devicePluginLabelKey = "nvidia.com/gpu.deploy.device-plugin"
)

// labelNode labels the node with required labels for the fake-gpu-operator to function.
func (p *NodeHandler) labelNode(node *v1.Node) error {
err := p.patchNodeLabels(node, map[string]interface{}{
"nvidia.com/gpu.deploy.dcgm-exporter": "true",
"nvidia.com/gpu.deploy.device-plugin": "true",
dcgmExporterLabelKey: "true",
devicePluginLabelKey: "true",
})
if err != nil {
return fmt.Errorf("failed to label node %s: %w", node.Name, err)
Expand All @@ -26,8 +31,8 @@ func (p *NodeHandler) labelNode(node *v1.Node) error {
// unlabelNode removes the labels from the node that were added by the fake-gpu-operator.
func (p *NodeHandler) unlabelNode(node *v1.Node) error {
err := p.patchNodeLabels(node, map[string]interface{}{
"nvidia.com/gpu.deploy.dcgm-exporter": nil,
"nvidia.com/gpu.deploy.device-plugin": nil,
dcgmExporterLabelKey: nil,
devicePluginLabelKey: nil,
})
if err != nil {
return fmt.Errorf("failed to unlabel node %s: %w", node.Name, err)
Expand Down

0 comments on commit 94cab57

Please sign in to comment.