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

qemu: better cpu type and IP detection #17217

Merged
merged 2 commits into from
Sep 16, 2023

Conversation

raghavendra-talur
Copy link
Contributor

This PR has two commits.

  1. We increase the timeout for detecting the IP address of the qemu VM.
  2. The microarchitecture level of the qemu VM is bumped up to enable RHEL9 and related variants. This is required to support container images that are built using ubi9.

Signed-off-by: Raghavendra Talur <raghavendra.talur@gmail.com>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 8, 2023
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 8, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @raghavendra-talur. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: raghavendra-talur
Once this PR has been reviewed and has the lgtm label, please assign prezha for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 8, 2023
@raghavendra-talur
Copy link
Contributor Author

Fixes: #16814

@@ -125,7 +125,7 @@ func configure(cc config.ClusterConfig, n config.Node) (interface{}, error) {
switch runtime.GOARCH {
case "amd64":
qemuMachine = "" // default
qemuCPU = "" // default
qemuCPU = "max" // default
Copy link
Member

Choose a reason for hiding this comment

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

Is there any documentation url we can read what is max and what are other options? And what are downsides of max vs others?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added the documentation in the commit message. Happy to add it as a comment above this code if you think that is a better place.

Copy link
Member

Choose a reason for hiding this comment

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

can u plz link the URL to the documentation I would like to evaluate the options and figure out what exactly is "max"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

RHEL9 and therefore the dependent distributions and base containers have
a minimum microarchitechture level of x86-64-v2.[1]

The default cpu level of the qemu driver on an Intel Mac is x86-64-v1
even if the host cpu has the x86-64-v2 capability. Using the cpu type of
max allows qemu to use all the host cpu capabilities that is also
supported by the hypervisor framework.[2]

This was fixed for linux host by changing the default within qemu but it
wasn't changed for MacOS.

[1] https://developers.redhat.com/blog/2021/01/05/building-red-hat-enterprise-linux-9-for-the-x86-64-v2-microarchitecture-level
[2] https://gitlab.com/qemu-project/qemu/-/issues/1686#note_1417714887
[3] https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg04066.html

Copy link
Member

Choose a reason for hiding this comment

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

thank you for this documentation link, I like the https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg04066.html link you shared, would u plz put that in the comment of right befire 'max' in the code ? and then it would be good to go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@medyagh Thanks for the review! I have added the link as a comment.

@medyagh
Copy link
Member

medyagh commented Sep 12, 2023

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 12, 2023
@minikube-pr-bot

This comment has been minimized.

@minikube-pr-bot

This comment has been minimized.

RHEL9 and therefore the dependent distributions and base containers have
a minimum microarchitechture level of x86-64-v2.[1]

The default cpu level of the qemu driver on an Intel Mac is x86-64-v1
even if the host cpu has the x86-64-v2 capability. Using the cpu type of
max allows qemu to use all the host cpu capabilities that is also
supported by the hypervisor framework.[2]

This was fixed for linux host by changing the default within qemu but it
wasn't changed for MacOS.

[1] https://developers.redhat.com/blog/2021/01/05/building-red-hat-enterprise-linux-9-for-the-x86-64-v2-microarchitecture-level
[2] https://gitlab.com/qemu-project/qemu/-/issues/1686#note_1417714887
[3] https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg04066.html

Signed-off-by: Raghavendra Talur <raghavendra.talur@gmail.com>
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 17217) |
+----------------+----------+---------------------+
| minikube start | 51.5s    | 51.3s               |
| enable ingress | 27.4s    | 27.2s               |
+----------------+----------+---------------------+

Times for minikube ingress: 27.1s 28.2s 27.7s 26.2s 27.6s
Times for minikube (PR 17217) ingress: 29.2s 25.1s 27.6s 27.1s 27.2s

Times for minikube start: 49.1s 51.1s 54.9s 49.6s 52.8s
Times for minikube (PR 17217) start: 51.6s 51.9s 50.6s 51.0s 51.5s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 17217) |
+----------------+----------+---------------------+
| minikube start | 24.0s    | 23.7s               |
| enable ingress | 20.7s    | 21.4s               |
+----------------+----------+---------------------+

Times for minikube (PR 17217) start: 24.6s 21.7s 25.2s 24.0s 23.2s
Times for minikube start: 22.1s 22.4s 25.4s 24.5s 25.6s

Times for minikube ingress: 20.9s 20.9s 20.4s 20.9s 20.4s
Times for minikube (PR 17217) ingress: 21.9s 21.4s 21.9s 20.9s 20.9s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 17217) |
+----------------+----------+---------------------+
| minikube start | 22.9s    | 23.8s               |
| enable ingress | 31.8s    | 31.7s               |
+----------------+----------+---------------------+

Times for minikube start: 23.8s 21.3s 24.2s 23.3s 21.9s
Times for minikube (PR 17217) start: 23.2s 23.6s 23.9s 23.9s 24.4s

Times for minikube ingress: 31.3s 32.4s 31.3s 31.4s 32.4s
Times for minikube (PR 17217) ingress: 31.3s 31.3s 32.3s 31.4s 32.4s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Docker_Linux_containerd_arm64 TestFunctional/parallel/TunnelCmd/serial/AccessDirect (gopogh) 0.57 (chart)
Docker_Linux_containerd_arm64 TestFunctional/parallel/TunnelCmd/serial/WaitService/Setup (gopogh) 0.57 (chart)
Hyper-V_Windows TestPause/serial/Start (gopogh) 1.32 (chart)
Docker_Linux_containerd_arm64 TestFunctional/parallel/TunnelCmd/serial/RunSecondTunnel (gopogh) 1.70 (chart)
Docker_Linux_containerd_arm64 TestFunctional/serial/InvalidService (gopogh) 4.55 (chart)
Docker_Linux_containerd_arm64 TestFunctional/serial/LogsFileCmd (gopogh) 5.11 (chart)
KVM_Linux TestMultiNode/serial/DeleteNode (gopogh) 5.14 (chart)
Docker_Linux_containerd_arm64 TestFunctional/serial/ExtraConfig (gopogh) 7.95 (chart)
Docker_Linux_containerd_arm64 TestFunctional/serial/ComponentHealth (gopogh) 8.52 (chart)
KVM_Linux TestMultiNode/serial/RestartKeepsNodes (gopogh) 9.14 (chart)

To see the flake rates of all tests by environment, click here.

@medyagh medyagh merged commit 319886a into kubernetes:master Sep 16, 2023
17 of 29 checks passed
@raghavendra-talur raghavendra-talur deleted the rtalur-qemu-improvements branch September 18, 2023 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants