Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings extension #4050

Merged
merged 12 commits into from
Jun 12, 2024
Merged

Conversation

mgsharm
Copy link
Contributor

@mgsharm mgsharm commented Jun 10, 2024

Issue number:

Closes #3651 #3652 #3650 #3663 #3666 #3664

Description of changes:

  • Creates bootstrap_containers, network, host_containers and autoscaling settings extension and uses it in every variant's settings model.

Testing done:

bootstrap_containers

cargo run proto1 set --setting-version v1 --value '{"mybootstrap":{"source":"uri.to.container.in.oci-compatible-registry.example.com/foo:1.0.0","mode":"once","user-data":"dXNlcmRhdGE=","essential":true}}' 
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.27s
     Running `/Users/mgsharm/bottlerocket/bottlerocket/sources/target/debug/settings-extension-bootstrap-container proto1 set --setting-version v1 --value '{"mybootstrap":{"source":"uri.to.container.in.oci-compatible-registry.example.com/foo:1.0.0","mode":"once","user-data":"dXNlcmRhdGE=","essential":true}}'`

network

cargo run proto1 set --setting-version v1 --value '{"should-wait":true}'
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.30s
     Running `/Users/mgsharm/bottlerocket/bottlerocket/sources/target/debug/settings-extension-autoscaling proto1 set --setting-version v1 --value '{"should-wait":true}'`

host_containers

cargo run proto1 set --setting-version v1 --value '{"foo":{"source":"public.ecr.aws/example/example","enabled":true,"superpowered":true,"user-data":"Zm9vCg=="}}'
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.73s
     Running `/Users/mgsharm/bottlerocket/bottlerocket/sources/target/debug/settings-extension-host-containers proto1 set --setting-version v1 --value '{"foo":{"source":"public.ecr.aws/example/example","enabled":true,"superpowered":true,"user-data":"Zm9vCg=="}}'`

autoscaling

cargo run proto1 set --setting-version v1 --value '{"hostname":"foo","hosts":[["127.0.0.1",["localhost"]]],"https-proxy":"https://example.net","no-proxy":["foo"]}'
   Compiling settings-extension-network v0.1.0 (/Users/mgsharm/bottlerocket/bottlerocket/sources/settings-extensions/network)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.75s
     Running `/Users/mgsharm/bottlerocket/bottlerocket/sources/target/debug/settings-extension-network proto1 set --setting-version v1 --value '{"hostname":"foo","hosts":[["127.0.0.1",["localhost"]]],"https-proxy":"https://example.net","no-proxy":["foo"]}'`

conatiner_runtime

cargo run proto1 set --setting-version v1 --value '{"max-container-log-line-size":1024,"max-concurrent-downloads":5,"enable-unprivileged-ports":true,"enable-unprivileged-icmp":false}'
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.33s
     Running `/Users/gauravsharma/Work/bottlerocket/sources/target/debug/settings-extension-container-runtime proto1 set --setting-version v1 --value '{"max-container-log-line-size":1024,"max-concurrent-downloads":5,"enable-unprivileged-ports":true,"enable-unprivileged-icmp":false}'`

oci_defaults

cargo run proto1 set --setting-version v1 --value '{"capabilities":{"sys-admin":true,"net-admin":false},"resource-limits":{"max-cpu-time":{"hard-limit":1000,"soft-limit":500}}}'

    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.32s
     Running `/Users/gauravsharma/Work/bottlerocket/sources/target/debug/settings-extension-oci-defaults proto1 set --setting-version v1 --value '{"capabilities":{"sys-admin":true,"net-admin":false},"resource-limits":{"max-cpu-time":{"hard-limit":1000,"soft-limit":500}}}'`

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@mgsharm mgsharm force-pushed the settings-extension branch 4 times, most recently from 04c3283 to 000efc7 Compare June 11, 2024 05:49
@mgsharm mgsharm force-pushed the settings-extension branch from 000efc7 to ff4979d Compare June 11, 2024 06:40
@sumukhballal
Copy link
Contributor

Would you be able to do some instance testing as well? Just to be sure everything boots as expected since we are touching bootstrap_containers & host_containers .

@mgsharm mgsharm force-pushed the settings-extension branch from 76093e8 to 4e1534f Compare June 11, 2024 17:55
@mgsharm mgsharm requested a review from sumukhballal June 11, 2024 17:56
Copy link
Contributor

@cbgbt cbgbt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

sources/Cargo.toml Outdated Show resolved Hide resolved
@mgsharm mgsharm force-pushed the settings-extension branch from a73c328 to f9869d9 Compare June 12, 2024 04:06
@mgsharm
Copy link
Contributor Author

mgsharm commented Jun 12, 2024

Addressed comments.

@mgsharm mgsharm merged commit 1f7f2ce into bottlerocket-os:develop Jun 12, 2024
31 checks passed
@mgsharm mgsharm deleted the settings-extension branch June 12, 2024 17:51
@vigh-m vigh-m mentioned this pull request Aug 1, 2024
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OOTB: Port bootstrap_containers settings model to settings extensions
5 participants