-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Implement schedule stop for unix #9503
Implement schedule stop for unix #9503
Conversation
/ok-to-test |
Travis tests have failedHey @priyawadhwa, 1st Buildmake test
2nd Buildmake test
TravisBuddy Request Identifier: baafe860-131a-11eb-8230-47bfa5f272e1 |
Travis tests have failedHey @priyawadhwa, 1st Buildmake test
TravisBuddy Request Identifier: bad35970-131b-11eb-8230-47bfa5f272e1 |
kvm2 Driver Times for Minikube (PR 9503): 58.2s 57.3s 63.5s Averages Time Per Log
docker Driver Times for Minikube (PR 9503): 27.7s 28.5s 29.1s Averages Time Per Log
|
…schedule-stop-unix
kvm2 Driver Times for Minikube (PR 9503): 61.2s 60.2s 62.6s Averages Time Per Log
docker Driver Times for Minikube (PR 9503): 28.3s 28.1s 29.0s Averages Time Per Log
|
Codecov Report
@@ Coverage Diff @@
## master #9503 +/- ##
==========================================
- Coverage 29.47% 29.44% -0.03%
==========================================
Files 173 173
Lines 10736 10748 +12
==========================================
+ Hits 3164 3165 +1
- Misses 7123 7134 +11
Partials 449 449
|
kvm2 Driver Times for Minikube (PR 9503): 60.9s 61.6s 60.6s Averages Time Per Log
docker Driver Times for Minikube (PR 9503): 28.8s 27.5s 28.7s Averages Time Per Log
|
kvm2 Driver Times for Minikube (PR 9503): 63.4s 57.6s 59.0s Averages Time Per Log
docker Driver Times for Minikube (PR 9503): 30.0s 28.0s 31.3s Averages Time Per Log
|
kvm2 Driver Times for Minikube (PR 9503): 54.7s 53.0s 56.4s Averages Time Per Log
docker Driver Times for Minikube (PR 9503): 28.4s 27.1s 28.2s Averages Time Per Log
|
…schedule-stop-unix
kvm2 Driver Times for Minikube (PR 9503): 69.7s 71.6s 69.9s Averages Time Per Log
docker Driver Times for Minikube (PR 9503): 40.2s 42.7s 41.7s Averages Time Per Log
|
Travis tests have failedHey @priyawadhwa, 1st Buildmake test
TravisBuddy Request Identifier: 7272f240-208f-11eb-a20b-45518f503c27 |
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.
- Clean up processes on
minikube stop
- None driver
- Make flag hidden
Tested locally on mac (docker, hyperkit), linux (kvm2) and cloud shell |
kvm2 Driver Times for Minikube (PR 9503): 69.8s 70.9s 72.8s Averages Time Per Log
docker Driver Times for Minikube (PR 9503): 43.6s 42.7s 43.1s Averages Time Per Log
|
kvm2 Driver Times for Minikube (PR 9503): 74.0s 75.1s 70.2s Averages Time Per Log
docker Driver Times for Minikube (PR 9503): 45.0s 45.5s 44.4s Averages Time Per Log
|
kvm2 Driver Times for Minikube (PR 9503): 76.3s 75.4s 74.4s Averages Time Per Log
docker Driver Times for Minikube (PR 9503): 40.9s 42.2s 43.1s Averages Time Per Log
|
if err != nil { | ||
return errors.Wrapf(err, "converting %v to int", string(f)) | ||
} | ||
p, err := os.FindProcess(pid) |
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.
Please check that the pid is minikube process before killing it. Otherwise this will kill random processes.
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.
When minikube stop
daemonizes, it saves its own PID via os.Getpid()
to a file, and that is the PID that is being killed here.
I'm not sure how a random process could be killed from this code, could you explain if you still think that's the case?
kvm2 Driver Times for Minikube (PR 9503): 70.4s 73.3s 71.3s Averages Time Per Log
docker Driver Times for Minikube (PR 9503): 41.7s 48.2s 42.9s Averages Time Per Log
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: medyagh, priyawadhwa 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 |
Implement scheduled stop for mac/linux. Still need to figure out windows, but figured we could at least get the first piece of this in.
This solution uses the https://github.com/VividCortex/godaemon library, which daemonizes the current process and assigns it a new PID.
Users can schedule a stop via:
once this is happens, minikube will:
.minikube
minikube status
.minikube
To get this to work with the VividCortex library, I did have to create my own fork to remove a CGO dependency that was preventing cross compilation. Currently, minikube points to my fork so that
make cross
succeeds. I have a PR open to remove the dependency here: VividCortex/godaemon#32. Once that merges, we can remove the dependency on my fork.#9271