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

Use the stable path for brew installed qemu firmware in machine config #16853

Merged

Conversation

tmoschou
Copy link
Contributor

Previously, machine config had hard coded the homebrew cellar path with the patch version of qemu available at the time of machine creation, and was prone to breaking anytime qemu was updated and the machine is restarted.

For example

❯ minikube start
😄  minikube v1.30.1 on Darwin 13.4.1 (arm64)
✨  Using the qemu2 driver based on existing profile
👍  Starting control plane node minikube in cluster minikube
🔄  Restarting existing qemu2 VM for "minikube" ...
OUTPUT:
ERROR: qemu-system-aarch64: -drive file=/opt/homebrew/Cellar/qemu/8.0.0/share/qemu/edk2-aarch64-code.fd,readonly=on,format=raw,if=pflash: Could not open '/opt/homebrew/Cellar/qemu/8.0.0/share/qemu/edk2-aarch64-code.fd': No such file or directory

This change replaces the firmware path on machine creation to use the prefix as reported by brew --prefix qemu (e.g. /opt/homebrew/opt/qemu on M1) which is a symlink the the latest installed version of qemu (e.g. /opt/homebrew/Cellar/qemu/<x.y.z>).

This will not attempt to repair the path of machine with existing config. Two workarounds are to either

  • edit the config file manually, for example
    /usr/bin/sed -E -i ".$(date +'%F@%T')~" 's,/Cellar/qemu/[^/]+,/opt/qemu,' \
      "$HOME/.minikube/machines/$(minikube profile)/config.json"
    
  • or delete the machine with minikube delete and recreate machine.

Previously, machine config had hard coded the homebrew cellar path with
the patch version of qemu available at the time of machine creation,
and was prone to breaking anytime qemu was updated and the machine is
restarted. This change replaces the firmware path to use the prefix as
reported by 'brew --prefix qemu' (e.g. /opt/homebrew/opt/qemu on M1)
which is a symlink the the latest installed version of qemu
(e.g. /opt/homebrew/Cellar/qemu/<x.y.z>)
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 10, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @tmoschou!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@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 Jul 10, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @tmoschou. 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 k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 10, 2023
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@spowelljr
Copy link
Member

Just to clarify as I had to validate myself:

$ ls -la /opt/homebrew/opt/
qemu -> ../Cellar/qemu/8.0.2

@spowelljr
Copy link
Member

/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 Jul 10, 2023
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 16853) |
+----------------+----------+---------------------+
| minikube start | 51.0s    | 50.6s               |
| enable ingress | 27.8s    | 28.3s               |
+----------------+----------+---------------------+

Times for minikube ingress: 28.3s 29.2s 27.8s 27.8s 25.9s
Times for minikube (PR 16853) ingress: 28.2s 28.2s 27.9s 28.8s 28.3s

Times for minikube start: 53.1s 51.1s 50.6s 50.7s 49.6s
Times for minikube (PR 16853) start: 48.7s 51.6s 51.2s 50.2s 51.2s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 16853) |
+----------------+----------+---------------------+
| minikube start | 24.5s    | 24.1s               |
| enable ingress | 49.3s    | 48.7s               |
+----------------+----------+---------------------+

Times for minikube (PR 16853) start: 22.2s 24.6s 25.2s 25.9s 22.8s
Times for minikube start: 25.7s 22.1s 25.2s 24.5s 25.0s

Times for minikube ingress: 48.4s 50.4s 48.4s 49.4s 49.9s
Times for minikube (PR 16853) ingress: 48.4s 49.4s 48.4s 47.9s 49.4s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 16853) |
+----------------+----------+---------------------+
| minikube start | 22.6s    | 21.6s               |
| enable ingress | 32.2s    | 26.6s               |
+----------------+----------+---------------------+

Times for minikube start: 23.5s 21.1s 22.1s 22.9s 23.7s
Times for minikube (PR 16853) start: 21.4s 21.6s 23.6s 20.2s 21.1s

Times for minikube ingress: 47.4s 31.4s 31.4s 31.4s 19.4s
Times for minikube (PR 16853) ingress: 31.4s 31.4s 20.4s 19.4s 30.4s

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

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

@tmoschou very good PR ! thank you for this PR, I look forward to see more contributions from you

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 10, 2023
@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
KVM_Linux_containerd TestStoppedBinaryUpgrade/Upgrade (gopogh) 0.00 (chart)
Docker_Linux_docker_arm64 TestStoppedBinaryUpgrade/MinikubeLogs (gopogh) 0.60 (chart)
Docker_Linux_docker_arm64 TestStoppedBinaryUpgrade/Upgrade (gopogh) 0.60 (chart)
KVM_Linux TestMultiNode/serial/DeleteNode (gopogh) 2.37 (chart)
Hyperkit_macOS TestNetworkPlugins/group/kubenet/Start (gopogh) 3.66 (chart)
KVM_Linux TestMultiNode/serial/RestartKeepsNodes (gopogh) 7.10 (chart)
Docker_Linux_crio_arm64 TestPause/serial/SecondStartNoReconfiguration (gopogh) 17.26 (chart)
QEMU_macOS TestFunctional/parallel/TunnelCmd/serial/RunSecondTunnel (gopogh) 39.10 (chart)

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

@spowelljr spowelljr merged commit eeddc24 into kubernetes:master Jul 10, 2023
36 of 51 checks passed
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh, spowelljr, tmoschou

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

The pull request process is described 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

@tmoschou tmoschou deleted the bugfix/do-not-assume-qemu-patch-version branch July 11, 2023 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants