-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Skip Kubernetes preloads and binary downloads when --no-kubernetes is… #21107 #21139
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
base: master
Are you sure you want to change the base?
Skip Kubernetes preloads and binary downloads when --no-kubernetes is… #21107 #21139
Conversation
|
Hi @divysinghvi. 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 Once the patch is verified, the new status will be reflected by the 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-sigs/prow repository. |
|
Can one of the admins verify this patch? |
medyagh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you @divysinghvi please consider adding an integraiton test sub-test to
before {"StartNoK8sWithVersion", validateStartNoK8sWithVersion}, you can do --download-only and check using -minikube ssh -- ls path/to/binary/- that the file doesnt exist
|
@medyagh Thanks for the suggestion! Just to clarify, for the integration test you mentioned, which exact Kubernetes binary path should I check for in the VM after running minikube with |
|
Lets also try not setting k8s version to 0.0.0 and see what breaks and why did we have to that |
medyagh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets add a sub test that that checks this folder should not exist
~/.minikube/cache/linux/amd64/v0.0.0/
|
ok-to-test |
| defer PostMortemLogs(t, profile) | ||
|
|
||
| // Start minikube with --no-kubernetes flag | ||
| args := append([]string{"start", "-p", profile, "--no-kubernetes", "--memory=2048"}, StartArgs()...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to start another minikube, use the Existing started minikube and simply add a sub test
like this
{"StartNoK8sWithVersion", validateStartNoK8sWithVersion},
---> {"VerifyNok8sNoK8sDownloads", },
{"StartWithK8s", validateStartWithK8S},
{"StartWithStopK8s", validateStartWithStopK8s},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since in StartNoK8sWithVersion we pass a Kubernetes version with --no-kubernetes isn't that suppose to exits with an error and that won't leave a running cluster to reuse i guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we are reuse this instance {"Start", validateStartNoK8S}, since it will be fresh working instance
|
/ok-to-test |
| defer PostMortemLogs(t, profile) | ||
|
|
||
| // Reuse the minikube instance started by validateStartNoK8S. | ||
| homeDir := os.Getenv("HOME") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check other tests, see if we have already sometihng for minikube home
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In no_kubernetes_test.go no other has a home path, since they mostly interact was with minikube using via CLI commands, for the minikube home thing i found one instance in cache_binaries_test.go they use MINIKUBE_HOME , can you suggest any other way i can check this thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@divysinghvi you shoud use localpath.MiniPath()
here is an example in test/integration/aaa_download_only_test.go
// checking binaries downloaded (kubelet,kubeadm)
for _, bin := range constants.KubernetesReleaseBinaries {
fp := filepath.Join(localpath.MiniPath(), "cache", "linux", runtime.GOARCH, v, bin)
_, err := os.Stat(fp)
if err != nil {
t.Errorf("expected the file for binary exist at %q but got error %v", fp, err)
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for help i will look into it
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
/retest |
|
/retest-required |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
/retest |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| func VerifyNoK8sDownloadCache(ctx context.Context, t *testing.T, profile string) { | ||
| defer PostMortemLogs(t, profile) | ||
|
|
||
| cachePath := filepath.Join(localpath.MiniPath(), "cache", "linux", runtime.GOARCH, "v0.0.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not be tested only on linux !
the reason it is passing on your machine it is beecause it checks to see if linux doesnt exist
you can use goos to get os
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks medhya i have now used GOOS to get current os, and yes it passes on my system now also
=== RUN TestNoKubernetes/serial/VerifyNok8sNoK8sDownloads no_kubernetes_test.go:91: Checking cache directory: /Users/divysinghvi/.minikube/cache/darwin/arm64/v0.0.0 no_kubernetes_test.go:104: No cache directory found (as expected)
also found a function in binary.go TransferBinaries this maybe creating directories so testing it now
…used GOOS to get the current OS
This comment has been minimized.
This comment has been minimized.
|
@medyagh i tired putting a lot of checks but was not able to identify what is causing the directory to get created but we are able to step the files being created, directory thing i am not able to verify what is causing that you also told me to check localpath.go but i was not able to identify specific for our purpose , now we have either one option we go with the only file approach and have directory check but the test fails only when we have the files in those or figure out a way for finding directory thing in linux |
This comment has been minimized.
This comment has been minimized.
|
it is interesting on my mac and personal linux it does not create v0.0.0 folder but in CI machines it does ! this is a mystrie ! |
|
yes @medyagh i have tried everything i could find like i am still not able to figure how folder is getting created in the ci testing it is so weird , since now even you have verified it is not creating the v 0.0.0 when are testing it locally how should be proceed it next? easiest approach would be to check for files within the folder and let it pass when the directory is empty or anything other in mind ?? |
This comment has been minimized.
This comment has been minimized.
|
/retest |
This comment has been minimized.
This comment has been minimized.
|
@divysinghvi: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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-sigs/prow repository. I understand the commands that are listed here. |
|
kvm2 driver with docker runtime Times for minikube start: 41.0s 41.6s 39.3s 40.5s 39.5s Times for minikube ingress: 15.7s 15.7s 16.2s 27.7s 15.8s docker driver with docker runtime Times for minikube start: 23.2s 23.0s 23.4s 22.8s 21.9s Times for minikube ingress: 13.7s 11.6s 13.6s 10.7s 13.7s docker driver with containerd runtime Times for minikube start: 19.8s 22.6s 19.9s 19.6s 20.2s Times for minikube ingress: 22.1s 21.1s 21.1s 20.1s 20.1s |
|
Here are the number of top 10 failed tests in each environments with lowest flake rate.
Besides the following environments also have failed tests:
To see the flake rates of all tests by environment, click here. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: divysinghvi, medyagh 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 |
This PR improves the Binary function in binary.go to better handle Kubernetes binary downloads. It adds logic to skip downloads when the --no-kubernetes flag is set, ensures not downloading unnecessary downloads with version v0.0.0


Before
After
This pr Fixes the issue #21107