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

vmm: Deprecate static CPU templates #4126

Merged
merged 6 commits into from
Sep 28, 2023

Conversation

zulinx86
Copy link
Contributor

@zulinx86 zulinx86 commented Sep 21, 2023

Changes

Deprecate the cpu_template field in the /machine-config API, which is used to set static CPU templates.

Reason

Since v1.4.0, Firecracker has supported custom CPU templates that allows users to define their own CPU templates and can be used as an alternative of static CPU templates.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following
Developer Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • [ ] If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • [ ] New TODOs link to an issue.
  • Commits meet contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@zulinx86 zulinx86 force-pushed the depr_static_templates branch 2 times, most recently from 6e86a93 to b8d6b66 Compare September 21, 2023 17:49
@zulinx86 zulinx86 changed the title vmm: Deprecate cpu_template in /machine-config API vmm: Deprecate static CPU templates Sep 21, 2023
@zulinx86 zulinx86 force-pushed the depr_static_templates branch 3 times, most recently from 6edb796 to bfa2afb Compare September 22, 2023 13:57
@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (2557b17) 83.12% compared to head (1c8885f) 83.10%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4126      +/-   ##
==========================================
- Coverage   83.12%   83.10%   -0.03%     
==========================================
  Files         225      225              
  Lines       28581    28604      +23     
==========================================
+ Hits        23758    23771      +13     
- Misses       4823     4833      +10     
Flag Coverage Δ
4.14-c7g.metal 78.67% <96.77%> (-0.01%) ⬇️
4.14-m5d.metal 80.47% <96.77%> (-0.03%) ⬇️
4.14-m6a.metal 79.61% <96.77%> (-0.01%) ⬇️
4.14-m6g.metal 78.67% <96.77%> (-0.01%) ⬇️
4.14-m6i.metal 80.45% <96.77%> (-0.01%) ⬇️
5.10-c7g.metal 81.57% <96.77%> (-0.02%) ⬇️
5.10-m5d.metal 83.11% <96.77%> (-0.04%) ⬇️
5.10-m6a.metal 82.37% <96.77%> (-0.02%) ⬇️
5.10-m6g.metal 81.57% <96.77%> (-0.02%) ⬇️
5.10-m6i.metal 83.11% <96.77%> (-0.02%) ⬇️
6.1-c7g.metal 81.57% <96.77%> (-0.02%) ⬇️
6.1-m5d.metal 83.11% <96.77%> (-0.03%) ⬇️
6.1-m6a.metal 82.37% <96.77%> (-0.02%) ⬇️
6.1-m6g.metal 81.57% <96.77%> (-0.02%) ⬇️
6.1-m6i.metal 83.11% <96.77%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/api_server/src/lib.rs 85.71% <ø> (ø)
src/api_server/src/request/balloon.rs 100.00% <ø> (ø)
src/api_server/src/request/boot_source.rs 100.00% <ø> (ø)
src/api_server/src/request/cpu_configuration.rs 100.00% <ø> (ø)
src/api_server/src/request/drive.rs 100.00% <ø> (ø)
src/api_server/src/request/logger.rs 100.00% <ø> (ø)
...rc/api_server/src/request/machine_configuration.rs 100.00% <100.00%> (ø)
src/api_server/src/request/metrics.rs 100.00% <ø> (ø)
src/api_server/src/request/mmds.rs 100.00% <ø> (ø)
src/api_server/src/request/net.rs 100.00% <ø> (ø)
... and 4 more

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zulinx86 zulinx86 force-pushed the depr_static_templates branch 2 times, most recently from ab5d750 to 1a6ba57 Compare September 22, 2023 14:29
@zulinx86 zulinx86 marked this pull request as ready for review September 22, 2023 14:31
@zulinx86 zulinx86 marked this pull request as draft September 22, 2023 14:32
@zulinx86 zulinx86 self-assigned this Sep 22, 2023
@zulinx86 zulinx86 force-pushed the depr_static_templates branch 3 times, most recently from 59cc7f7 to b264d55 Compare September 22, 2023 15:19
@zulinx86 zulinx86 marked this pull request as ready for review September 22, 2023 15:38
@zulinx86 zulinx86 force-pushed the depr_static_templates branch 4 times, most recently from 4ff2c99 to 8b4c3b2 Compare September 27, 2023 11:09
@zulinx86 zulinx86 added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Sep 27, 2023
docs/cpu_templates/cpu-templates.md Outdated Show resolved Hide resolved
src/api_server/src/request/machine_configuration.rs Outdated Show resolved Hide resolved
src/api_server/swagger/firecracker.yaml Outdated Show resolved Hide resolved
@zulinx86 zulinx86 force-pushed the depr_static_templates branch from 8b4c3b2 to 5bc9599 Compare September 27, 2023 11:30
@zulinx86 zulinx86 force-pushed the depr_static_templates branch 2 times, most recently from 8a27695 to c38966e Compare September 27, 2023 18:08
As different indentation styles of raw JSON strings were being used,
unify them into the 4 spaces indentation.

Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
Make unit tests more idiomatic by using `assert_eq!()` rather than
`match` + `panic!()`. With this, `#[allow(clippy::match_wild_err_arm)]`
can be removed.

Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
`tests/framework/resources.py` was removed in commit dc7aabd
("test: refactor Firecracker HTTP API client") and the description in
the practial example of API changes is already stale.

Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
Different wordings were used as description for deprecation.

Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
Add an implementation of conversion from `&CpuTemplateType` to
`Option<StaticCpuTemplate>`, which will be used in a successive commit
to deprecate the `cpu_template` field in the `/machine-config` API.

Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
@zulinx86 zulinx86 force-pushed the depr_static_templates branch from c38966e to 03cde8b Compare September 27, 2023 18:11
roypat
roypat previously approved these changes Sep 28, 2023
CHANGELOG.md Outdated Show resolved Hide resolved
Deprecate the `cpu_template` field in PUT and PATCH reqeusts on the
`/machine-config` API by following the runbook for API changes.

To differentiate between explicitly specifying `None` and not specifying
anything, wrap the `cpu_template` of the `MachineConfig` with `Option`.
With this, it can notify the deprecation of only users using the field.

Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
@zulinx86 zulinx86 merged commit ba182ae into firecracker-microvm:main Sep 28, 2023
5 checks passed
@zulinx86 zulinx86 deleted the depr_static_templates branch September 28, 2023 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting review Indicates that a pull request is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants