Skip to content

Commit

Permalink
migration: add migrations for new NVIDIA APIs
Browse files Browse the repository at this point in the history
Signed-off-by: Arnaldo Garcia Rincon <[email protected]>
  • Loading branch information
arnaldo2792 committed Sep 12, 2024
1 parent 2a4d3ab commit 2b09476
Show file tree
Hide file tree
Showing 12 changed files with 187 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Release.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "1.22.0"
version = "1.23.0"

[migrations]
"(0.3.1, 0.3.2)" = ["migrate_v0.3.2_admin-container-v0-5-0.lz4"]
Expand Down Expand Up @@ -344,3 +344,9 @@ version = "1.22.0"
"migrate_v1.22.0_bootstrap-commands-settings.lz4",
"migrate_v1.22.0_bootstrap-commands-metadata.lz4",
]
"(1.22.0, 1.23.0)" = [
"migrate_v1.23.0_kubelet-device-plugins-metadata.lz4",
"migrate_v1.23.0_kubelet-device-plugins-settings.lz4",
"migrate_v1.23.0_nvidia-container-runtime-metadata.lz4",
"migrate_v1.23.0_nvidia-container-runtime-settings.lz4",
]
2 changes: 1 addition & 1 deletion Twoliter.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
schema-version = 1
release-version = "1.22.0"
release-version = "1.23.0"

[vendor.bottlerocket]
registry = "public.ecr.aws/bottlerocket"
Expand Down
28 changes: 28 additions & 0 deletions sources/Cargo.lock

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

4 changes: 4 additions & 0 deletions sources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ members = [
"settings-migrations/v1.22.0/public-control-container-v0-7-15",
"settings-migrations/v1.22.0/bootstrap-commands-settings",
"settings-migrations/v1.22.0/bootstrap-commands-metadata",
"settings-migrations/v1.23.0/nvidia-container-runtime-metadata",
"settings-migrations/v1.23.0/nvidia-container-runtime-settings",
"settings-migrations/v1.23.0/kubelet-device-plugins-metadata",
"settings-migrations/v1.23.0/kubelet-device-plugins-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-metadata"
version = "0.1.0"
authors = ["Monirul Islam <[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::{AddMetadataMigration, SettingMetadata};
use migration_helpers::{migrate, Result};
use std::process;

/// We added a new setting for configuring the NVIDIA k8s device plugin.
fn run() -> Result<()> {
migrate(AddMetadataMigration(&[SettingMetadata {
metadata: &["affected-services"],
setting: "settings.kubelet-device-plugins",
}]))
}

// 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);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "kubelet-device-plugins-settings"
version = "0.1.0"
authors = ["Monirul Islam <[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::AddPrefixesMigration;
use migration_helpers::{migrate, Result};
use std::process;

/// We added a new setting for configuring the NVIDIA k8s device plugin.
fn run() -> Result<()> {
migrate(AddPrefixesMigration(vec![
"settings.kubelet-device-plugins",
"services.nvidia-k8s-device-plugin",
"configuration-files.nvidia-k8s-device-plugin-conf",
"configuration-files.nvidia-k8s-device-plugin-exec-start-conf",
]))
}

// 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);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "nvidia-container-runtime-metadata"
version = "0.1.0"
authors = ["Monirul Islam <[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::{AddMetadataMigration, SettingMetadata};
use migration_helpers::{migrate, Result};
use std::process;

/// We added a new setting for configuring container runtime (containerd) settings only for NVIDIA k8s variants.
fn run() -> Result<()> {
migrate(AddMetadataMigration(&[SettingMetadata {
metadata: &["affected-services"],
setting: "settings.nvidia-container-runtime",
}]))
}

// 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);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "nvidia-container-runtime-settings"
version = "0.1.0"
authors = ["Monirul Islam <[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,22 @@
use migration_helpers::common_migrations::AddPrefixesMigration;
use migration_helpers::{migrate, Result};
use std::process;

/// We added a new setting for configuring container runtime (containerd) settings only for NVIDIA k8s variants.
fn run() -> Result<()> {
migrate(AddPrefixesMigration(vec![
"settings.nvidia-container-runtime",
"services.nvidia-container-toolkit",
"configuration-files.nvidia-container-toolkit",
]))
}

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

0 comments on commit 2b09476

Please sign in to comment.