Skip to content

Commit

Permalink
migration: add migrations for NVIDIA MIG
Browse files Browse the repository at this point in the history
  • Loading branch information
piyush-jena committed Jan 15, 2025
1 parent 2b12b1a commit 8914623
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 44 deletions.
6 changes: 5 additions & 1 deletion Release.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "1.31.0"
version = "1.32.0"

[migrations]
"(0.3.1, 0.3.2)" = ["migrate_v0.3.2_admin-container-v0-5-0.lz4"]
Expand Down Expand Up @@ -393,4 +393,8 @@ version = "1.31.0"
"migrate_v1.31.0_public-admin-container-v0-11-16.lz4",
"migrate_v1.31.0_aws-control-container-v0-7-20.lz4",
"migrate_v1.31.0_public-control-container-v0-7-20.lz4",
"migrate_v1.31.0_kubelet-device-plugins-mig-settings.lz4",
]
"(1.31.0, 1.32.0)" = [
"migrate_v1.31.0_kubelet-device-plugins-mig-settings.lz4",
]
75 changes: 41 additions & 34 deletions sources/Cargo.lock

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

19 changes: 10 additions & 9 deletions sources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ members = [
"settings-migrations/v1.31.0/public-admin-container-v0-11-16",
"settings-migrations/v1.31.0/aws-control-container-v0-7-20",
"settings-migrations/v1.31.0/public-control-container-v0-7-20",
"settings-migrations/v1.32.0/kubelet-device-plugins-mig-settings",

"settings-plugins/aws-dev",
"settings-plugins/aws-ecs-1",
Expand Down Expand Up @@ -158,23 +159,23 @@ tag = "bottlerocket-defaults-helper-v0.1.0"
version = "0.1.0"

[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"
git = "https://github.com/piyush-jena/bottlerocket-settings-sdk"
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"
git = "https://github.com/piyush-jena/bottlerocket-settings-sdk"
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"
tag = "bottlerocket-settings-models-v0.7.0"
tag = "bottlerocket-settings-plugin-v0.1.0"
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"
git = "https://github.com/piyush-jena/bottlerocket-settings-sdk"
tag = "bottlerocket-settings-models-v0.8.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-mig-settings"
version = "0.1.0"
authors = ["Piyush Jena <[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,21 @@
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-partitioning-strategy",
"settings.kubelet-device-plugins.nvidia.mig",
]))
}

// 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);
}
}
Loading

0 comments on commit 8914623

Please sign in to comment.