Skip to content

Commit

Permalink
Merge pull request #4230 from KCSesh/api-time-slice
Browse files Browse the repository at this point in the history
Add Nvidia Time-Slicing
  • Loading branch information
KCSesh authored Oct 10, 2024
2 parents e141c06 + 5c12e86 commit 742f343
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 37 deletions.
1 change: 1 addition & 0 deletions Release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -359,4 +359,5 @@ version = "1.25.0"
]
"(1.24.1, 1.25.0)" = [
"migrate_v1.25.0_kubernetes-service-config.lz4",
"migrate_v1.25.0_kubelet-device-plugins-time-slicing-settings.lz4",
]
81 changes: 49 additions & 32 deletions sources/Cargo.lock

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

11 changes: 6 additions & 5 deletions sources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ members = [
"settings-migrations/v1.24.1/aws-control-container-v0-7-16",
"settings-migrations/v1.24.1/public-control-container-v0-7-16",
"settings-migrations/v1.25.0/kubernetes-service-config",
"settings-migrations/v1.25.0/kubelet-device-plugins-time-slicing-settings",

"settings-plugins/aws-dev",
"settings-plugins/aws-ecs-1",
Expand Down Expand Up @@ -134,13 +135,13 @@ version = "0.1.0"

[workspace.dependencies.bottlerocket-modeled-types]
git = "https://github.com/bottlerocket-os/bottlerocket-settings-sdk"
tag = "bottlerocket-settings-models-v0.5.0"
version = "0.5.0"
tag = "bottlerocket-settings-models-v0.6.0"
version = "0.6.0"

[workspace.dependencies.bottlerocket-settings-models]
git = "https://github.com/bottlerocket-os/bottlerocket-settings-sdk"
tag = "bottlerocket-settings-models-v0.5.0"
version = "0.5.0"
tag = "bottlerocket-settings-models-v0.6.0"
version = "0.6.0"

[workspace.dependencies.bottlerocket-settings-plugin]
git = "https://github.com/bottlerocket-os/bottlerocket-settings-sdk"
Expand All @@ -149,7 +150,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.5.0"
tag = "bottlerocket-settings-models-v0.6.0"
version = "0.1.0"

[profile.release]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "kubelet-device-plugins-time-slicing-settings"
version = "0.1.0"
authors = ["Kyle Sessions <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2021"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]


# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
migration-helpers.workspace = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use migration_helpers::common_migrations::AddSettingsMigration;
use migration_helpers::{migrate, Result};
use std::process;

/// We added new settings for configuring the NVIDIA k8s device plugin.
fn run() -> Result<()> {
migrate(AddSettingsMigration(&[
"settings.kubelet-device-plugins.nvidia.device-sharing-strategy",
"settings.kubelet-device-plugins.nvidia.time-slicing.replicas",
"settings.kubelet-device-plugins.nvidia.time-slicing.rename-by-default",
"settings.kubelet-device-plugins.nvidia.time-slicing.fail-requests-greater-than-one",
]))
}

// Returning a Result from main makes it print a Debug representation of the error, but with Snafu
// we have nice Display representations of the error, so we wrap "main" (run) and print any error.
// https://github.com/shepmaster/snafu/issues/110
fn main() {
if let Err(e) = run() {
eprintln!("{}", e);
process::exit(1);
}
}
1 change: 1 addition & 0 deletions sources/shared-defaults/nvidia-k8s-device-plugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ affected-services = ["nvidia-k8s-device-plugin"]
pass-device-specs = true
device-id-strategy="index"
device-list-strategy="volume-mounts"
device-sharing-strategy="none"

0 comments on commit 742f343

Please sign in to comment.