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

fix: trim docker.io to prevent always writing to daemon #14956

Merged
merged 5 commits into from
Oct 26, 2022

Conversation

g1eny0ung
Copy link
Contributor

@g1eny0ung g1eny0ung commented Sep 15, 2022

Signed-off-by: Yue Yang g1enyy0ung@gmail.com

Since the docker images will output Repository without the docker.io prefix. I originally decided to trim this prefix from the img param in ImageExistsInDaemon.

But then I discovered the trimDockerIO function, so I move it from the pkg/minikube/cruntime package into pkg/minikube/download to achieve code reuse.

Thanks for the review. 😃

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 15, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: g1eny0ung / name: Yue Yang (19b7168)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Sep 15, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @g1eny0ung!

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
Copy link
Contributor

Hi @g1eny0ung. 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 15, 2022
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Sep 15, 2022
Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
@g1eny0ung
Copy link
Contributor Author

@medyagh Have a look when you have time? 👀

@medyagh
Copy link
Member

medyagh commented Sep 20, 2022

@medyagh Have a look when you have time? 👀

Thanks for the PR, I am curious, could we add docker.io to all docker hub images instead of trimming it ?
in our preload images tarball we include images with FQDN

@g1eny0ung
Copy link
Contributor Author

g1eny0ung commented Sep 20, 2022

@medyagh Have a look when you have time? 👀

Thanks for the PR, I am curious, could we add docker.io to all docker hub images instead of trimming it ? in our preload images tarball we include images with FQDN

@medyagh Makes sense to me. This problem is due to using the docker images command. It will check whether an image is from the docker official registry internally, if it is, the default domain will be removed.

But for now, the docker images command can not set an option to output the repo name in FQDN format, so I think the easiest and most straightforward way is to keep trimming the docker.io prefix.

@g1eny0ung
Copy link
Contributor Author

@medyagh PTAL again? This problem currently affects me every time I run minikube start.

@g1eny0ung
Copy link
Contributor Author

@blueelvis Hi, mind taking a look at this please?

@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 Oct 24, 2022
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 14956) |
+----------------+----------+---------------------+
| minikube start | 56.8s    | 55.9s               |
| enable ingress | 27.7s    | 27.4s               |
+----------------+----------+---------------------+

Times for minikube ingress: 26.2s 28.2s 28.7s 25.7s 29.7s
Times for minikube (PR 14956) ingress: 28.7s 28.7s 25.7s 28.7s 25.2s

Times for minikube start: 58.5s 56.2s 56.7s 56.4s 56.2s
Times for minikube (PR 14956) start: 56.3s 56.2s 56.1s 55.1s 55.8s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 14956) |
+----------------+----------+---------------------+
| minikube start | 27.4s    | 29.3s               |
| enable ingress | 22.7s    | 23.4s               |
+----------------+----------+---------------------+

Times for minikube start: 27.5s 27.1s 27.7s 26.8s 27.9s
Times for minikube (PR 14956) start: 27.9s 28.9s 31.1s 27.0s 31.7s

Times for minikube ingress: 21.5s 23.5s 23.0s 24.0s 21.5s
Times for minikube (PR 14956) ingress: 26.0s 23.0s 22.5s 22.5s 23.0s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 14956) |
+----------------+----------+---------------------+
| minikube start | 25.0s    | 27.7s               |
| enable ingress | 27.2s    | 27.2s               |
+----------------+----------+---------------------+

Times for minikube (PR 14956) start: 35.4s 24.8s 24.4s 27.2s 26.8s
Times for minikube start: 24.4s 23.9s 25.0s 24.4s 27.2s

Times for minikube (PR 14956) ingress: 27.0s 27.5s 27.0s 27.5s 27.0s
Times for minikube ingress: 27.1s 27.0s 28.0s 27.0s 27.0s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Docker_Windows TestFunctional/parallel/License (gopogh) n/a
Hyper-V_Windows TestFunctional/parallel/License (gopogh) n/a
Docker_Windows TestPause/serial/Pause (gopogh) 5.66 (chart)
Docker_Linux_containerd TestStartStop/group/no-preload/serial/SecondStart (gopogh) 17.31 (chart)
Docker_Linux_containerd TestPause/serial/Start (gopogh) 22.14 (chart)
Hyperkit_macOS TestPause/serial/SecondStartNoReconfiguration (gopogh) 23.26 (chart)
Docker_Linux_containerd TestOffline (gopogh) 24.29 (chart)
Docker_Windows TestNetworkPlugins/group/enable-default-cni/DNS (gopogh) 27.69 (chart)
Docker_Linux_containerd TestAddons/Setup (gopogh) 28.57 (chart)
Docker_Linux_containerd TestFunctional/parallel/DashboardCmd (gopogh) 28.57 (chart)
Docker_Linux_containerd TestFunctional/parallel/MountCmd/any-port (gopogh) 28.57 (chart)
Docker_Linux_containerd TestFunctional/parallel/MySQL (gopogh) 28.57 (chart)
Docker_Linux_containerd TestFunctional/parallel/PersistentVolumeClaim (gopogh) 28.57 (chart)
Docker_Linux_containerd TestFunctional/parallel/ServiceCmd (gopogh) 28.57 (chart)
Docker_Linux_containerd TestFunctional/parallel/ServiceCmdConnect (gopogh) 28.57 (chart)
Docker_Linux_containerd TestFunctional/parallel/TunnelCmd/serial/AccessDirect (gopogh) 28.57 (chart)
Docker_Linux_containerd TestFunctional/parallel/TunnelCmd/serial/WaitService/Setup (gopogh) 28.57 (chart)
Docker_Linux_containerd TestFunctional/serial/ExtraConfig (gopogh) 28.57 (chart)
Docker_Linux_containerd TestFunctional/serial/SoftStart (gopogh) 28.57 (chart)
Docker_Linux_containerd TestFunctional/serial/StartWithProxy (gopogh) 28.57 (chart)
Docker_Linux_containerd TestIngressAddonLegacy/serial/ValidateIngressAddonActivation (gopogh) 28.57 (chart)
Docker_Linux_containerd TestIngressAddonLegacy/StartLegacyK8sCluster (gopogh) 28.57 (chart)
Docker_Linux_containerd TestJSONOutput/start/Command (gopogh) 28.57 (chart)
Docker_Linux_containerd TestMultiNode/serial/AddNode (gopogh) 28.57 (chart)
Docker_Linux_containerd TestMultiNode/serial/DeleteNode (gopogh) 28.57 (chart)
Docker_Linux_containerd TestMultiNode/serial/DeployApp2Nodes (gopogh) 28.57 (chart)
Docker_Linux_containerd TestMultiNode/serial/FreshStart2Nodes (gopogh) 28.57 (chart)
Docker_Linux_containerd TestMultiNode/serial/PingHostFrom2Pods (gopogh) 28.57 (chart)
Docker_Linux_containerd TestMultiNode/serial/ProfileList (gopogh) 28.57 (chart)
Docker_Linux_containerd TestMultiNode/serial/StartAfterStop (gopogh) 28.57 (chart)
More tests... Continued...

Too many tests failed - See test logs for more details.

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

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 14956) |
+----------------+----------+---------------------+
| minikube start | 55.6s    | 57.4s               |
| enable ingress | 28.9s    | 29.0s               |
+----------------+----------+---------------------+

Times for minikube (PR 14956) start: 56.8s 58.4s 57.4s 56.3s 58.0s
Times for minikube start: 55.7s 55.9s 55.9s 53.7s 56.5s

Times for minikube ingress: 29.2s 28.7s 28.7s 29.2s 28.7s
Times for minikube (PR 14956) ingress: 29.7s 28.2s 29.2s 28.6s 29.2s

docker driver with docker runtime

+-------------------+----------+---------------------+
|      COMMAND      | MINIKUBE | MINIKUBE (PR 14956) |
+-------------------+----------+---------------------+
| minikube start    | 28.2s    | 27.3s               |
| ⚠️  enable ingress | 22.2s    | 34.8s ⚠️             |
+-------------------+----------+---------------------+

Times for minikube ingress: 22.5s 20.5s 23.0s 22.0s 23.0s
Times for minikube (PR 14956) ingress: 83.5s 22.9s 23.0s 22.0s 22.5s

Times for minikube start: 28.8s 28.7s 27.3s 26.9s 29.1s
Times for minikube (PR 14956) start: 27.4s 27.1s 27.0s 27.8s 27.4s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 14956) |
+----------------+----------+---------------------+
| minikube start | 24.5s    | 25.1s               |
| enable ingress | 27.1s    | 27.1s               |
+----------------+----------+---------------------+

Times for minikube (PR 14956) ingress: 27.0s 27.5s 27.0s 27.0s 27.0s
Times for minikube ingress: 27.0s 27.0s 27.0s 27.0s 27.5s

Times for minikube start: 24.4s 24.5s 24.3s 24.2s 25.0s
Times for minikube (PR 14956) start: 24.7s 24.1s 24.7s 27.4s 24.9s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Docker_Linux_containerd TestStartStop/group/newest-cni/serial/FirstStart (gopogh) 0.98 (chart)
Hyperkit_macOS TestPreload (gopogh) 2.26 (chart)
Docker_Cloud_Shell TestStartStop/group/cloud-shell/serial/AddonExistsAfterStop (gopogh) 17.04 (chart)
Docker_Cloud_Shell TestStartStop/group/cloud-shell/serial/EnableAddonAfterStop (gopogh) 17.04 (chart)
Docker_Cloud_Shell TestStartStop/group/cloud-shell/serial/SecondStart (gopogh) 17.04 (chart)
Docker_Cloud_Shell TestStartStop/group/cloud-shell/serial/Stop (gopogh) 17.04 (chart)
Docker_Cloud_Shell TestStartStop/group/cloud-shell/serial/UserAppExistsAfterStop (gopogh) 17.04 (chart)
Docker_Linux_containerd TestPause/serial/Start (gopogh) 22.38 (chart)
Docker_Linux_containerd TestOffline (gopogh) 25.17 (chart)
Docker_Linux_containerd TestAddons/Setup (gopogh) 29.37 (chart)
Docker_Linux_containerd TestFunctional/parallel/DashboardCmd (gopogh) 29.37 (chart)
Docker_Linux_containerd TestFunctional/parallel/MountCmd/any-port (gopogh) 29.37 (chart)
Docker_Linux_containerd TestFunctional/parallel/MySQL (gopogh) 29.37 (chart)
Docker_Linux_containerd TestFunctional/parallel/PersistentVolumeClaim (gopogh) 29.37 (chart)
Docker_Linux_containerd TestFunctional/parallel/ServiceCmd (gopogh) 29.37 (chart)
Docker_Linux_containerd TestFunctional/parallel/ServiceCmdConnect (gopogh) 29.37 (chart)
Docker_Linux_containerd TestFunctional/parallel/TunnelCmd/serial/AccessDirect (gopogh) 29.37 (chart)
Docker_Linux_containerd TestFunctional/parallel/TunnelCmd/serial/WaitService/Setup (gopogh) 29.37 (chart)
Docker_Linux_containerd TestFunctional/serial/ExtraConfig (gopogh) 29.37 (chart)
Docker_Linux_containerd TestFunctional/serial/SoftStart (gopogh) 29.37 (chart)
Docker_Linux_containerd TestFunctional/serial/StartWithProxy (gopogh) 29.37 (chart)
Docker_Linux_containerd TestIngressAddonLegacy/serial/ValidateIngressAddonActivation (gopogh) 29.37 (chart)
Docker_Linux_containerd TestIngressAddonLegacy/StartLegacyK8sCluster (gopogh) 29.37 (chart)
Docker_Linux_containerd TestJSONOutput/start/Command (gopogh) 29.37 (chart)
Docker_Linux_containerd TestMultiNode/serial/AddNode (gopogh) 29.37 (chart)
Docker_Linux_containerd TestMultiNode/serial/DeleteNode (gopogh) 29.37 (chart)
Docker_Linux_containerd TestMultiNode/serial/DeployApp2Nodes (gopogh) 29.37 (chart)
Docker_Linux_containerd TestMultiNode/serial/FreshStart2Nodes (gopogh) 29.37 (chart)
Docker_Linux_containerd TestMultiNode/serial/PingHostFrom2Pods (gopogh) 29.37 (chart)
Docker_Linux_containerd TestMultiNode/serial/ProfileList (gopogh) 29.37 (chart)
More tests... Continued...

Too many tests failed - See test logs for more details.

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

Copy link
Member

@spowelljr spowelljr left a comment

Choose a reason for hiding this comment

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

Hi @g1eny0ung, this looks good, but could you move the trim function to: https://github.com/kubernetes/minikube/blob/master/pkg/minikube/image/image.go

The functions in that file seem to fit more in line with what you're doing here.

@g1eny0ung
Copy link
Contributor Author

g1eny0ung commented Oct 26, 2022

Hi @g1eny0ung, this looks good, but could you move the trim function to: https://github.com/kubernetes/minikube/blob/master/pkg/minikube/image/image.go

The functions in that file seem to fit more in line with what you're doing here.

@spowelljr Sure. Thanks for pointing out, I'll update it now.

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 14956) |
+----------------+----------+---------------------+
| minikube start | 54.0s    | 54.4s               |
| enable ingress | 39.0s    | 37.6s               |
+----------------+----------+---------------------+

Times for minikube start: 56.1s 53.4s 53.5s 53.8s 53.1s
Times for minikube (PR 14956) start: 53.8s 52.6s 54.0s 56.8s 54.9s

Times for minikube (PR 14956) ingress: 25.2s 85.7s 24.6s 25.1s 27.7s
Times for minikube ingress: 29.1s 24.6s 85.6s 28.2s 27.6s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 14956) |
+----------------+----------+---------------------+
| minikube start | 26.1s    | 25.6s               |
| enable ingress | 22.4s    | 21.6s               |
+----------------+----------+---------------------+

Times for minikube start: 26.5s 25.5s 26.0s 24.7s 27.7s
Times for minikube (PR 14956) start: 26.3s 26.1s 25.7s 25.1s 24.6s

Times for minikube ingress: 21.5s 22.0s 22.5s 23.0s 23.0s
Times for minikube (PR 14956) ingress: 21.5s 20.5s 21.9s 22.0s 22.0s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 14956) |
+----------------+----------+---------------------+
| minikube start | 23.4s    | 23.2s               |
| enable ingress | 33.3s    | 27.3s               |
+----------------+----------+---------------------+

Times for minikube ingress: 27.0s 27.0s 27.0s 27.5s 58.0s
Times for minikube (PR 14956) ingress: 27.0s 27.0s 27.0s 28.0s 27.5s

Times for minikube start: 23.0s 22.7s 23.5s 21.9s 25.9s
Times for minikube (PR 14956) start: 22.1s 25.7s 23.0s 22.1s 22.9s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Hyperkit_macOS TestFunctional/parallel/ConfigCmd (gopogh) 0.00 (chart)
Hyper-V_Windows TestNetworkPlugins/group/kubenet/NetCatPod (gopogh) 1.54 (chart)
Docker_macOS TestCertExpiration (gopogh) 3.08 (chart)
Docker_macOS TestCertOptions (gopogh) 3.08 (chart)
Docker_macOS TestDockerFlags (gopogh) 3.08 (chart)
Docker_macOS TestForceSystemdEnv (gopogh) 3.08 (chart)
Docker_macOS TestForceSystemdFlag (gopogh) 3.08 (chart)
Docker_macOS TestNoKubernetes/serial/Start (gopogh) 3.08 (chart)
Docker_macOS TestNoKubernetes/serial/StartNoArgs (gopogh) 3.08 (chart)
Docker_macOS TestNoKubernetes/serial/StartWithK8s (gopogh) 3.08 (chart)
Docker_macOS TestNoKubernetes/serial/StartWithStopK8s (gopogh) 3.08 (chart)
Docker_macOS TestNoKubernetes/serial/Stop (gopogh) 3.08 (chart)
Docker_macOS TestPause/serial/Start (gopogh) 3.08 (chart)
Docker_macOS TestNetworkPlugins/group/auto/Start (gopogh) 3.15 (chart)
Docker_macOS TestNetworkPlugins/group/bridge/Start (gopogh) 3.15 (chart)
Docker_macOS TestNetworkPlugins/group/cilium/Start (gopogh) 3.15 (chart)
Docker_macOS TestNetworkPlugins/group/enable-default-cni/Start (gopogh) 3.15 (chart)
Docker_macOS TestNetworkPlugins/group/false/Start (gopogh) 3.15 (chart)
Docker_macOS TestNetworkPlugins/group/kindnet/Start (gopogh) 3.15 (chart)
Docker_macOS TestStartStop/group/default-k8s-diff-port/serial/AddonExistsAfterStop (gopogh) 3.15 (chart)
Docker_macOS TestStartStop/group/default-k8s-diff-port/serial/DeployApp (gopogh) 3.15 (chart)
Docker_macOS TestStartStop/group/default-k8s-diff-port/serial/EnableAddonAfterStop (gopogh) 3.15 (chart)
Docker_macOS TestStartStop/group/default-k8s-diff-port/serial/EnableAddonWhileActive (gopogh) 3.15 (chart)
Docker_macOS TestStartStop/group/default-k8s-diff-port/serial/FirstStart (gopogh) 3.15 (chart)
Docker_macOS TestStartStop/group/default-k8s-diff-port/serial/SecondStart (gopogh) 3.15 (chart)
Docker_macOS TestStartStop/group/default-k8s-diff-port/serial/Stop (gopogh) 3.15 (chart)
Docker_macOS TestStartStop/group/default-k8s-diff-port/serial/UserAppExistsAfterStop (gopogh) 3.15 (chart)
Docker_macOS TestStartStop/group/default-k8s-diff-port/serial/VerifyKubernetesImages (gopogh) 3.15 (chart)
Docker_macOS TestStartStop/group/embed-certs/serial/AddonExistsAfterStop (gopogh) 3.15 (chart)
Docker_macOS TestStartStop/group/embed-certs/serial/DeployApp (gopogh) 3.15 (chart)
More tests... Continued...

Too many tests failed - See test logs for more details.

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

@spowelljr spowelljr merged commit abed8b7 into kubernetes:master Oct 26, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: g1eny0ung, spowelljr

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 26, 2022
@g1eny0ung g1eny0ung deleted the fix/always-write-to-daemon branch October 27, 2022 02:14
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.

6 participants