-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Applying dynamic taint and nvidia daemonset #64
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4152193
Applying dynamic taint and nvidia daemonset
mclacore 2f08291
Updated tf functions to actually work, removing tf plan
mclacore a6d61dd
Intermittently working :(
mclacore 3a7aa69
adding version for 1.29 and versioning widget
mclacore e866851
ds backwards compat fix #1
mclacore 097eb1d
renaming locals, using name prefix to avoid name collision
mclacore b82821d
Removing unnecessary changes
mclacore 7daebc8
Updating instance type labels
mclacore c8f83b9
taint values
mclacore File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
locals { | ||
gpu_regex = "^(p[0-9][a-z]*|g[0-9+][a-z]*|trn[0-9][a-z]*|inf[0-9]|dl[0-9][a-z]*|f[0-9]|vt[0-9])\\..*" | ||
has_gpu_node_groups = length([for ng in var.node_groups : ng if length(regexall(local.gpu_regex, ng.instance_type)) > 0]) > 0 | ||
gpu_enabled_instance_types = [for ng in var.node_groups : ng.instance_type if length(regexall(local.gpu_regex, ng.instance_type)) > 0] | ||
} | ||
|
||
resource "kubernetes_daemonset" "nvidia" { | ||
count = local.has_gpu_node_groups ? 1 : 0 | ||
metadata { | ||
name = "nvidia-device-plugin-daemonset" | ||
namespace = kubernetes_namespace_v1.md-core-services.metadata.0.name | ||
labels = merge(var.md_metadata.default_tags, { | ||
k8s-app = "nvidia-device-plugin-daemonset" | ||
}) | ||
} | ||
spec { | ||
selector { | ||
match_labels = { | ||
name = "nvidia-device-plugin-ds" | ||
} | ||
} | ||
strategy { | ||
type = "RollingUpdate" | ||
} | ||
template { | ||
metadata { | ||
labels = merge(var.md_metadata.default_tags, { | ||
name = "nvidia-device-plugin-ds" | ||
}) | ||
annotations = { | ||
"scheduler.alpha.kubernetes.io/critical-pod" : "" | ||
} | ||
} | ||
spec { | ||
priority_class_name = "system-node-critical" | ||
affinity { | ||
node_affinity { | ||
required_during_scheduling_ignored_during_execution { | ||
node_selector_term { | ||
match_expressions { | ||
key = "node.kubernetes.io/instance-type" | ||
operator = "In" | ||
values = local.gpu_enabled_instance_types | ||
} | ||
} | ||
} | ||
} | ||
} | ||
toleration { | ||
key = "CriticalAddonsOnly" | ||
operator = "Exists" | ||
} | ||
toleration { | ||
key = "nvidia.com/gpu" | ||
operator = "Exists" | ||
effect = "NoSchedule" | ||
} | ||
toleration { | ||
mclacore marked this conversation as resolved.
Show resolved
Hide resolved
|
||
key = "gpu" | ||
operator = "Equal" | ||
value = "true" | ||
effect = "NoSchedule" | ||
} | ||
container { | ||
name = "nvidia-device-plugin-ctr" | ||
image = "nvcr.io/nvidia/k8s-device-plugin:v0.15.0" | ||
env { | ||
name = "FAIL_ON_INIT_ERROR" | ||
value = "false" | ||
} | ||
security_context { | ||
privileged = true | ||
capabilities { | ||
drop = ["all"] | ||
} | ||
} | ||
volume_mount { | ||
name = "device-plugin" | ||
mount_path = "/var/lib/kubelet/device-plugins" | ||
} | ||
} | ||
volume { | ||
name = "device-plugin" | ||
host_path { | ||
path = "/var/lib/kubelet/device-plugins" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this toleration needed? We aren't applying it, are we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It comes with the NVIDIA daemonset plugin: https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v0.14.0/nvidia-device-plugin.yml
And then used by GPU pods it seems? https://github.com/NVIDIA/k8s-device-plugin?tab=readme-ov-file#running-gpu-jobs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they are just using that as the taint in place of the
gpu=true
taint we added. We probably don't need both. We can use theirs instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To confirm, remove the toleration for
sku=gpu:NoSchedule
and update the dynamic taint in the node group fornvidia.com/gpu:NoSchedule
?