Skip to content

Commit

Permalink
Merge pull request #258 from piyush-jena/nvidia-mig-feature
Browse files Browse the repository at this point in the history
feat: add nvidia MIG
  • Loading branch information
piyush-jena authored Feb 6, 2025
2 parents 1beb172 + 6feabca commit 16100a8
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ std = { version = "v1", helpers = ["default"] }
+++
version: v1
flags:
{{#if (eq settings.kubelet-device-plugins.nvidia.device-partitioning-strategy "mig")}}
migStrategy: "single"
{{else}}
migStrategy: "none"
{{/if}}
failOnInitError: true
plugin:
passDeviceSpecs: {{default true settings.kubelet-device-plugins.nvidia.pass-device-specs}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[required-extensions]
kubelet-device-plugins = "v1"
std = { version = "v1", helpers = ["if_not_null", "toml_encode"]}
+++
{{#if_not_null settings.kubelet-device-plugins.nvidia.device-partitioning-strategy}}
device-partitioning-strategy = "{{{settings.kubelet-device-plugins.nvidia.device-partitioning-strategy}}}"
{{/if_not_null}}
{{#if_not_null settings.kubelet-device-plugins.nvidia.mig.profile}}
profile = {{ toml_encode settings.kubelet-device-plugins.nvidia.mig.profile }}
{{/if_not_null}}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Source0: https://%{goimport}/archive/v%{gover}/v%{gover}.tar.gz#/k8s-device-plug
Source1: nvidia-k8s-device-plugin.service
Source2: nvidia-k8s-device-plugin-conf
Source3: nvidia-k8s-device-plugin-exec-start-conf
Source4: nvidia-k8s-device-plugin-mig-conf


BuildRequires: %{_cross_os}glibc-devel
Expand Down Expand Up @@ -69,6 +70,7 @@ install -p -m 0644 %{S:1} %{buildroot}%{_cross_unitdir}
install -d %{buildroot}%{_cross_unitdir}/nvidia-k8s-device-plugin.service.d
install -D -m 0644 %{S:2} %{buildroot}%{_cross_templatedir}/nvidia-k8s-device-plugin-conf
install -D -m 0644 %{S:3} %{buildroot}%{_cross_templatedir}/nvidia-k8s-device-plugin-exec-start-conf
install -D -m 0644 %{S:4} %{buildroot}%{_cross_templatedir}/nvidia-k8s-device-plugin-mig-conf


%files
Expand All @@ -78,6 +80,7 @@ install -D -m 0644 %{S:3} %{buildroot}%{_cross_templatedir}/nvidia-k8s-device-pl
%dir %{_cross_unitdir}/nvidia-k8s-device-plugin.service.d
%{_cross_templatedir}/nvidia-k8s-device-plugin-conf
%{_cross_templatedir}/nvidia-k8s-device-plugin-exec-start-conf
%{_cross_templatedir}/nvidia-k8s-device-plugin-mig-conf

%files bin
%{_cross_bindir}/nvidia-device-plugin
Expand Down
66 changes: 33 additions & 33 deletions sources/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions sources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,13 @@ base64 = "0.22"

[workspace.dependencies.bottlerocket-modeled-types]
git = "https://github.com/bottlerocket-os/bottlerocket-settings-sdk"
tag = "bottlerocket-settings-models-v0.7.0"
version = "0.7.0"
tag = "bottlerocket-settings-models-v0.8.0"
version = "0.8.0"

[workspace.dependencies.bottlerocket-settings-models]
git = "https://github.com/bottlerocket-os/bottlerocket-settings-sdk"
tag = "bottlerocket-settings-models-v0.7.0"
version = "0.7.0"
tag = "bottlerocket-settings-models-v0.8.0"
version = "0.8.0"

[workspace.dependencies.bottlerocket-settings-plugin]
git = "https://github.com/bottlerocket-os/bottlerocket-settings-sdk"
Expand All @@ -226,7 +226,7 @@ version = "0.1.0"

[workspace.dependencies.settings-extension-oci-defaults]
git = "https://github.com/bottlerocket-os/bottlerocket-settings-sdk"
tag = "bottlerocket-settings-models-v0.7.0"
tag = "bottlerocket-settings-models-v0.8.0"
version = "0.1.0"

[profile.release]
Expand Down

0 comments on commit 16100a8

Please sign in to comment.