From b63aae597b4fc4fc3e01a5292d5ed2b3c3152df1 Mon Sep 17 00:00:00 2001 From: Sparks Song Date: Tue, 26 Nov 2024 00:42:00 +0000 Subject: [PATCH 1/4] migrations: migrate to admin container v0.11.14 --- Release.toml | 4 ++- sources/Cargo.lock | 28 +++++++++++++++++++ sources/Cargo.toml | 3 ++ .../aws-admin-container-v0-11-14/Cargo.toml | 15 ++++++++++ .../aws-admin-container-v0-11-14/src/main.rs | 27 ++++++++++++++++++ .../Cargo.toml | 15 ++++++++++ .../src/main.rs | 24 ++++++++++++++++ 7 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 sources/settings-migrations/v1.28.0/aws-admin-container-v0-11-14/Cargo.toml create mode 100644 sources/settings-migrations/v1.28.0/aws-admin-container-v0-11-14/src/main.rs create mode 100644 sources/settings-migrations/v1.28.0/public-admin-container-v0-11-14/Cargo.toml create mode 100644 sources/settings-migrations/v1.28.0/public-admin-container-v0-11-14/src/main.rs diff --git a/Release.toml b/Release.toml index 43ef28e7fca..fa4c3d55c16 100644 --- a/Release.toml +++ b/Release.toml @@ -373,5 +373,7 @@ version = "1.28.0" ] "(1.27.0, 1.27.1)" = [] "(1.27.1, 1.28.0)" = [ - "migrate_v1.28.0_kernel-sysctl-hugepages.lz4" + "migrate_v1.28.0_kernel-sysctl-hugepages.lz4", + "migrate_v1.28.0_aws-admin-container-v0-11-14.lz4", + "migrate_v1.28.0_public-admin-container-v0-11-14.lz4", ] diff --git a/sources/Cargo.lock b/sources/Cargo.lock index 6c687c411ab..826b31e5429 100644 --- a/sources/Cargo.lock +++ b/sources/Cargo.lock @@ -315,6 +315,13 @@ dependencies = [ "migration-helpers", ] +[[package]] +name = "aws-admin-container-v0-11-14" +version = "0.1.0" +dependencies = [ + "migration-helpers", +] + [[package]] name = "aws-config" version = "0.1.0" @@ -350,6 +357,13 @@ dependencies = [ "migration-helpers", ] +[[package]] +name = "aws-control-container-v0-7-18" +version = "0.1.0" +dependencies = [ + "migration-helpers", +] + [[package]] name = "aws-lc-fips-sys" version = "0.12.13" @@ -2067,6 +2081,13 @@ dependencies = [ "migration-helpers", ] +[[package]] +name = "public-admin-container-v0-11-14" +version = "0.1.0" +dependencies = [ + "migration-helpers", +] + [[package]] name = "public-control-container-v0-7-14" version = "0.1.0" @@ -2095,6 +2116,13 @@ dependencies = [ "migration-helpers", ] +[[package]] +name = "public-control-container-v0-7-18" +version = "0.1.0" +dependencies = [ + "migration-helpers", +] + [[package]] name = "quinn" version = "0.11.5" diff --git a/sources/Cargo.toml b/sources/Cargo.toml index e893f7a2f10..3a91e500d31 100644 --- a/sources/Cargo.toml +++ b/sources/Cargo.toml @@ -67,6 +67,9 @@ members = [ "settings-migrations/v1.25.0/public-control-container-v0-7-17", "settings-migrations/v1.27.0/aws-config", "settings-migrations/v1.28.0/kernel-sysctl-hugepages", + "settings-migrations/v1.28.0/aws-admin-container-v0-11-14", + "settings-migrations/v1.28.0/public-admin-container-v0-11-14", + "settings-plugins/aws-dev", "settings-plugins/aws-ecs-1", "settings-plugins/aws-ecs-2", diff --git a/sources/settings-migrations/v1.28.0/aws-admin-container-v0-11-14/Cargo.toml b/sources/settings-migrations/v1.28.0/aws-admin-container-v0-11-14/Cargo.toml new file mode 100644 index 00000000000..cf182363445 --- /dev/null +++ b/sources/settings-migrations/v1.28.0/aws-admin-container-v0-11-14/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "aws-admin-container-v0-11-14" +version = "0.1.0" +authors = ["Sparks Song "] +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 diff --git a/sources/settings-migrations/v1.28.0/aws-admin-container-v0-11-14/src/main.rs b/sources/settings-migrations/v1.28.0/aws-admin-container-v0-11-14/src/main.rs new file mode 100644 index 00000000000..43c36f376aa --- /dev/null +++ b/sources/settings-migrations/v1.28.0/aws-admin-container-v0-11-14/src/main.rs @@ -0,0 +1,27 @@ +use migration_helpers::common_migrations::ReplaceSchnauzerMigration; +use migration_helpers::{migrate, Result}; +use std::process; + +const OLD_ADMIN_CTR_CMDLINE: &str = + "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-admin:v0.11.13'"; +const NEW_ADMIN_CTR_CMDLINE: &str = + "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-admin:v0.11.14'"; + +/// We bumped the version of the default admin container +fn run() -> Result<()> { + migrate(ReplaceSchnauzerMigration { + setting: "settings.host-containers.admin.source", + old_schnauzer_cmdline: OLD_ADMIN_CTR_CMDLINE, + new_schnauzer_cmdline: NEW_ADMIN_CTR_CMDLINE, + }) +} + +// 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); + } +} diff --git a/sources/settings-migrations/v1.28.0/public-admin-container-v0-11-14/Cargo.toml b/sources/settings-migrations/v1.28.0/public-admin-container-v0-11-14/Cargo.toml new file mode 100644 index 00000000000..56a9b83bd5e --- /dev/null +++ b/sources/settings-migrations/v1.28.0/public-admin-container-v0-11-14/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "public-admin-container-v0-11-14" +version = "0.1.0" +authors = ["Sparks Song "] +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 diff --git a/sources/settings-migrations/v1.28.0/public-admin-container-v0-11-14/src/main.rs b/sources/settings-migrations/v1.28.0/public-admin-container-v0-11-14/src/main.rs new file mode 100644 index 00000000000..ce524514f4a --- /dev/null +++ b/sources/settings-migrations/v1.28.0/public-admin-container-v0-11-14/src/main.rs @@ -0,0 +1,24 @@ +use migration_helpers::common_migrations::ReplaceStringMigration; +use migration_helpers::{migrate, Result}; +use std::process; + +const OLD_ADMIN_CTR_SOURCE_VAL: &str = "public.ecr.aws/bottlerocket/bottlerocket-admin:v0.11.13"; +const NEW_ADMIN_CTR_SOURCE_VAL: &str = "public.ecr.aws/bottlerocket/bottlerocket-admin:v0.11.14"; +/// We bumped the version of the default admin container +fn run() -> Result<()> { + migrate(ReplaceStringMigration { + setting: "settings.host-containers.admin.source", + old_val: OLD_ADMIN_CTR_SOURCE_VAL, + new_val: NEW_ADMIN_CTR_SOURCE_VAL, + }) +} + +// 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); + } +} From 55cddc226702ee10aac360c63022b3932e8d3aea Mon Sep 17 00:00:00 2001 From: Sparks Song Date: Tue, 26 Nov 2024 00:43:36 +0000 Subject: [PATCH 2/4] migrations: migrate to control container v0.7.18 --- Release.toml | 2 ++ sources/Cargo.toml | 2 ++ .../aws-control-container-v0-7-18/Cargo.toml | 15 +++++++++++ .../aws-control-container-v0-7-18/src/main.rs | 27 +++++++++++++++++++ .../Cargo.toml | 15 +++++++++++ .../src/main.rs | 25 +++++++++++++++++ 6 files changed, 86 insertions(+) create mode 100644 sources/settings-migrations/v1.28.0/aws-control-container-v0-7-18/Cargo.toml create mode 100644 sources/settings-migrations/v1.28.0/aws-control-container-v0-7-18/src/main.rs create mode 100644 sources/settings-migrations/v1.28.0/public-control-container-v0-7-18/Cargo.toml create mode 100644 sources/settings-migrations/v1.28.0/public-control-container-v0-7-18/src/main.rs diff --git a/Release.toml b/Release.toml index fa4c3d55c16..c20c239dd20 100644 --- a/Release.toml +++ b/Release.toml @@ -376,4 +376,6 @@ version = "1.28.0" "migrate_v1.28.0_kernel-sysctl-hugepages.lz4", "migrate_v1.28.0_aws-admin-container-v0-11-14.lz4", "migrate_v1.28.0_public-admin-container-v0-11-14.lz4", + "migrate_v1.28.0_aws-control-container-v0-7-18.lz4", + "migrate_v1.28.0_public-control-container-v0-7-18.lz4", ] diff --git a/sources/Cargo.toml b/sources/Cargo.toml index 3a91e500d31..d59c84dfe04 100644 --- a/sources/Cargo.toml +++ b/sources/Cargo.toml @@ -69,6 +69,8 @@ members = [ "settings-migrations/v1.28.0/kernel-sysctl-hugepages", "settings-migrations/v1.28.0/aws-admin-container-v0-11-14", "settings-migrations/v1.28.0/public-admin-container-v0-11-14", + "settings-migrations/v1.28.0/aws-control-container-v0-7-18", + "settings-migrations/v1.28.0/public-control-container-v0-7-18", "settings-plugins/aws-dev", "settings-plugins/aws-ecs-1", diff --git a/sources/settings-migrations/v1.28.0/aws-control-container-v0-7-18/Cargo.toml b/sources/settings-migrations/v1.28.0/aws-control-container-v0-7-18/Cargo.toml new file mode 100644 index 00000000000..42c9b15a97b --- /dev/null +++ b/sources/settings-migrations/v1.28.0/aws-control-container-v0-7-18/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "aws-control-container-v0-7-18" +version = "0.1.0" +authors = ["Sparks Song "] +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 diff --git a/sources/settings-migrations/v1.28.0/aws-control-container-v0-7-18/src/main.rs b/sources/settings-migrations/v1.28.0/aws-control-container-v0-7-18/src/main.rs new file mode 100644 index 00000000000..c6c23da9eca --- /dev/null +++ b/sources/settings-migrations/v1.28.0/aws-control-container-v0-7-18/src/main.rs @@ -0,0 +1,27 @@ +use migration_helpers::common_migrations::ReplaceSchnauzerMigration; +use migration_helpers::{migrate, Result}; +use std::process; + +const OLD_CONTROL_CTR_CMDLINE: &str = + "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-control:v0.7.17'"; +const NEW_CONTROL_CTR_CMDLINE: &str = + "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-control:v0.7.18'"; + +/// We bumped the version of the default control container +fn run() -> Result<()> { + migrate(ReplaceSchnauzerMigration { + setting: "settings.host-containers.control.source", + old_schnauzer_cmdline: OLD_CONTROL_CTR_CMDLINE, + new_schnauzer_cmdline: NEW_CONTROL_CTR_CMDLINE, + }) +} + +// 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); + } +} diff --git a/sources/settings-migrations/v1.28.0/public-control-container-v0-7-18/Cargo.toml b/sources/settings-migrations/v1.28.0/public-control-container-v0-7-18/Cargo.toml new file mode 100644 index 00000000000..e8d7ecf732e --- /dev/null +++ b/sources/settings-migrations/v1.28.0/public-control-container-v0-7-18/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "public-control-container-v0-7-18" +version = "0.1.0" +authors = ["Sparks Song "] +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 diff --git a/sources/settings-migrations/v1.28.0/public-control-container-v0-7-18/src/main.rs b/sources/settings-migrations/v1.28.0/public-control-container-v0-7-18/src/main.rs new file mode 100644 index 00000000000..1910f2ccaf7 --- /dev/null +++ b/sources/settings-migrations/v1.28.0/public-control-container-v0-7-18/src/main.rs @@ -0,0 +1,25 @@ +use migration_helpers::common_migrations::ReplaceStringMigration; +use migration_helpers::{migrate, Result}; +use std::process; + +const OLD_CONTROL_CTR_SOURCE_VAL: &str = "public.ecr.aws/bottlerocket/bottlerocket-control:v0.7.17"; +const NEW_CONTROL_CTR_SOURCE_VAL: &str = "public.ecr.aws/bottlerocket/bottlerocket-control:v0.7.18"; + +/// We bumped the version of the default control container +fn run() -> Result<()> { + migrate(ReplaceStringMigration { + setting: "settings.host-containers.control.source", + old_val: OLD_CONTROL_CTR_SOURCE_VAL, + new_val: NEW_CONTROL_CTR_SOURCE_VAL, + }) +} + +// 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); + } +} From e5864480ab22997f8d2b5db3a1b55ed0441d8cd9 Mon Sep 17 00:00:00 2001 From: Sparks Song Date: Tue, 26 Nov 2024 00:45:04 +0000 Subject: [PATCH 3/4] host-containers: update admin container to v0.11.14 --- sources/shared-defaults/aws-host-containers.toml | 2 +- sources/shared-defaults/public-host-containers.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/shared-defaults/aws-host-containers.toml b/sources/shared-defaults/aws-host-containers.toml index 2639be0750a..90dac48d0bf 100644 --- a/sources/shared-defaults/aws-host-containers.toml +++ b/sources/shared-defaults/aws-host-containers.toml @@ -3,7 +3,7 @@ enabled = false superpowered = true [metadata.settings.host-containers.admin.source] -setting-generator = "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-admin:v0.11.13'" +setting-generator = "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-admin:v0.11.14'" [metadata.settings.host-containers.admin.user-data] setting-generator = "shibaken generate-admin-userdata" diff --git a/sources/shared-defaults/public-host-containers.toml b/sources/shared-defaults/public-host-containers.toml index 446c678a452..5da888e385f 100644 --- a/sources/shared-defaults/public-host-containers.toml +++ b/sources/shared-defaults/public-host-containers.toml @@ -6,7 +6,7 @@ [settings.host-containers.admin] enabled = false superpowered = true -source = "public.ecr.aws/bottlerocket/bottlerocket-admin:v0.11.13" +source = "public.ecr.aws/bottlerocket/bottlerocket-admin:v0.11.14" [settings.host-containers.control] enabled = false From 735e1e95bc600057597652c81f6ad9d596222c10 Mon Sep 17 00:00:00 2001 From: Sparks Song Date: Tue, 26 Nov 2024 00:45:56 +0000 Subject: [PATCH 4/4] host-containers: update control container to v0.7.18 --- sources/shared-defaults/aws-host-containers.toml | 2 +- sources/shared-defaults/public-host-containers.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/shared-defaults/aws-host-containers.toml b/sources/shared-defaults/aws-host-containers.toml index 90dac48d0bf..7d11572af7b 100644 --- a/sources/shared-defaults/aws-host-containers.toml +++ b/sources/shared-defaults/aws-host-containers.toml @@ -13,4 +13,4 @@ enabled = true superpowered = false [metadata.settings.host-containers.control.source] -setting-generator = "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-control:v0.7.17'" +setting-generator = "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-control:v0.7.18'" diff --git a/sources/shared-defaults/public-host-containers.toml b/sources/shared-defaults/public-host-containers.toml index 5da888e385f..5ba49a64d4b 100644 --- a/sources/shared-defaults/public-host-containers.toml +++ b/sources/shared-defaults/public-host-containers.toml @@ -11,4 +11,4 @@ source = "public.ecr.aws/bottlerocket/bottlerocket-admin:v0.11.14" [settings.host-containers.control] enabled = false superpowered = false -source = "public.ecr.aws/bottlerocket/bottlerocket-control:v0.7.17" +source = "public.ecr.aws/bottlerocket/bottlerocket-control:v0.7.18"