Skip to content

Commit

Permalink
migration: add migrations for k8 NVIDIA time-slicing
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Sessions <[email protected]>
  • Loading branch information
KCSesh committed Oct 10, 2024
1 parent 07ff34e commit 5c12e86
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 4 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",
]
6 changes: 3 additions & 3 deletions Twoliter.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ digest = "CIx/G74W+Ie4gdJ40D/N/UbyQ9JqwVOd/9IH4ru3zYk="

[[kit]]
name = "bottlerocket-core-kit"
version = "2.8.4"
version = "2.9.0"
vendor = "bottlerocket"
source = "public.ecr.aws/bottlerocket/bottlerocket-core-kit:v2.8.4"
digest = "3HaJokkQgfZONwthRVqXFsZHCmIVQTarzWP2jo8gLaM="
source = "public.ecr.aws/bottlerocket/bottlerocket-core-kit:v2.9.0"
digest = "eVsost9ltE9BimWyB9UV2rhPyzr0MlzbvZd0GRexGwc="
2 changes: 1 addition & 1 deletion Twoliter.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ vendor = "bottlerocket"

[[kit]]
name = "bottlerocket-core-kit"
version = "2.8.4"
version = "2.9.0"
vendor = "bottlerocket"
7 changes: 7 additions & 0 deletions sources/Cargo.lock

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

1 change: 1 addition & 0 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
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 5c12e86

Please sign in to comment.