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

add new flag --last-start-only to only show last start logs #15770

Merged
merged 6 commits into from
Feb 8, 2023

Conversation

nickmancari
Copy link
Contributor

@nickmancari nickmancari commented Feb 1, 2023

I closed my last PR. Here is a re-subbmission for a cleaner branch:

This PR adds the minikube logs --last-start-only flag feature as requested here: #15700

Before the PR:

$ minikube logs --last-start-only
Error: unknown flag: --last-start-only
See 'minikube logs --help' for usage.

After PR:

$ minikube logs --last-start-only

==> Last Start <==
Log file created at: 2023/02/01 20:55:49
Running on machine: Nicks-MBP
Binary: Built with gc go1.19.5 for darwin/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0201 20:55:49.529075   63168 out.go:296] Setting OutFile to fd 1 ...
I0201 20:55:49.529464   63168 out.go:348] isatty.IsTerminal(1) = true
I0201 20:55:49.529469   63168 out.go:309] Setting ErrFile to fd 2...
I0201 20:55:49.529477   63168 out.go:348] isatty.IsTerminal(2) = true
I0201 20:55:49.529607   63168 root.go:334] Updating PATH: /Users/nick/.minikube/bin
W0201 20:55:49.529733   63168 root.go:311] Error reading config file at /Users/nick/.minikube/config/config.json: open /Users/nick/.minikube/config/config.json: no such file or directory
I0201 20:55:49.530772   63168 out.go:303] Setting JSON to false
I0201 20:55:49.573892   63168 start.go:125] hostinfo: {"hostname":"Nicks-MBP.home","uptime":5641601,"bootTime":1669664948,"procs":409,"os":"darwin","platform":"darwin","platformFamily":"Standalone Workstation","platformVersion":"12.6.1","kernelVersion":"21.6.0","kernelArch":"x86_64","virtualizationSystem":"","virtualizationRole":"","hostId":"2e97756e-e296-517d-96d1-91d34cd120f0"}
W0201 20:55:49.573997   63168 start.go:133] gopshost.Virtualization returned error: not implemented yet
I0201 20:55:49.579787   63168 out.go:177] 😄  minikube v0.0.0-unset on Darwin 12.6.1
I0201 20:55:49.588916   63168 notify.go:220] Checking for updates...
I0201 20:55:49.589715   63168 config.go:180] Loaded profile config "minikube": Driver=docker, ContainerRuntime=docker, KubernetesVersion=v1.26.1
...

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 1, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @nickmancari. 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 1, 2023
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 1, 2023
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

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.

thanks for resubmitting this PR, the After output shows the minikube logs command is still showing audit logs too... but it only should show the last start logs

@nickmancari
Copy link
Contributor Author

thanks for resubmitting this PR, the After output shows the minikube logs command is still showing audit logs too... but it only should show the last start logs

Oh I see. I corrected the output to only show the last start log:

$ minikube logs --last-start-only

==> Last Start <==
Log file created at: 2023/02/01 20:55:49
Running on machine: Nicks-MBP
Binary: Built with gc go1.19.5 for darwin/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0201 20:55:49.529075   63168 out.go:296] Setting OutFile to fd 1 ...
I0201 20:55:49.529464   63168 out.go:348] isatty.IsTerminal(1) = true
I0201 20:55:49.529469   63168 out.go:309] Setting ErrFile to fd 2...
I0201 20:55:49.529477   63168 out.go:348] isatty.IsTerminal(2) = true
I0201 20:55:49.529607   63168 root.go:334] Updating PATH: /Users/nick/.minikube/bin
W0201 20:55:49.529733   63168 root.go:311] Error reading config file at /Users/nick/.minikube/config/config.json: open /Users/nick/.minikube/config/config.json: no such file or directory
I0201 20:55:49.530772   63168 out.go:303] Setting JSON to false
I0201 20:55:49.573892   63168 start.go:125] hostinfo: {"hostname":"Nicks-MBP.home","uptime":5641601,"bootTime":1669664948,"procs":409,"os":"darwin","platform":"darwin","platformFamily":"Standalone Workstation","platformVersion":"12.6.1","kernelVersion":"21.6.0","kernelArch":"x86_64","virtualizationSystem":"","virtualizationRole":"","hostId":"2e97756e-e296-517d-96d1-91d34cd120f0"}
W0201 20:55:49.573997   63168 start.go:133] gopshost.Virtualization returned error: not implemented yet
I0201 20:55:49.579787   63168 out.go:177] 😄  minikube v0.0.0-unset on Darwin 12.6.1
I0201 20:55:49.588916   63168 notify.go:220] Checking for updates...
I0201 20:55:49.589715   63168 config.go:180] Loaded profile config "minikube": Driver=docker, ContainerRuntime=docker, KubernetesVersion=v1.26.1
...

@medyagh
Copy link
Member

medyagh commented Feb 2, 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 Feb 2, 2023
@medyagh medyagh changed the title Resubmit new last-start-only flag add new flag --last-start-only to only show last start logs Feb 2, 2023
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 15770) |
+----------------+----------+---------------------+
| minikube start | 56.1s    | 55.8s               |
| enable ingress | 28.9s    | 28.1s               |
+----------------+----------+---------------------+

Times for minikube start: 55.0s 54.2s 57.5s 58.0s 55.9s
Times for minikube (PR 15770) start: 54.9s 54.8s 56.2s 55.8s 57.5s

Times for minikube ingress: 28.3s 26.8s 31.9s 28.9s 28.7s
Times for minikube (PR 15770) ingress: 29.4s 29.4s 24.3s 28.8s 28.8s

docker driver with docker runtime

+-------------------+----------+---------------------+
|      COMMAND      | MINIKUBE | MINIKUBE (PR 15770) |
+-------------------+----------+---------------------+
| minikube start    | 26.6s    | 26.0s               |
| ⚠️  enable ingress | 22.0s    | 33.1s ⚠️             |
+-------------------+----------+---------------------+

Times for minikube start: 25.5s 27.0s 26.7s 27.1s 26.8s
Times for minikube (PR 15770) start: 25.3s 25.2s 26.8s 27.1s 25.5s

Times for minikube ingress: 20.1s 23.1s 22.6s 21.1s 23.1s
Times for minikube (PR 15770) ingress: 20.1s 22.1s 82.1s 20.1s 21.0s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 15770) |
+----------------+----------+---------------------+
| minikube start | 22.2s    | 22.0s               |
| enable ingress | 33.2s    | 32.2s               |
+----------------+----------+---------------------+

Times for minikube start: 21.6s 21.7s 22.4s 22.9s 22.1s
Times for minikube (PR 15770) start: 21.7s 22.4s 21.9s 23.0s 21.0s

Times for minikube ingress: 33.6s 31.6s 21.6s 31.6s 47.6s
Times for minikube (PR 15770) ingress: 32.6s 31.6s 32.6s 32.6s 31.6s

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.

Can you also run make generate-docs to update website docs for the new flag.

cmd/minikube/cmd/logs.go Outdated Show resolved Hide resolved
cmd/minikube/cmd/logs.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 3, 2023
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 15770) |
+----------------+----------+---------------------+
| minikube start | 54.2s    | 53.2s               |
| enable ingress | 27.4s    | 26.2s               |
+----------------+----------+---------------------+

Times for minikube ingress: 26.3s 28.3s 29.2s 28.2s 25.3s
Times for minikube (PR 15770) ingress: 28.2s 23.7s 25.7s 28.7s 24.8s

Times for minikube start: 53.2s 54.5s 55.2s 53.4s 54.5s
Times for minikube (PR 15770) start: 52.9s 53.8s 52.0s 53.3s 54.1s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 15770) |
+----------------+----------+---------------------+
| minikube start | 27.0s    | 26.5s               |
| enable ingress | 33.6s    | 21.2s               |
+----------------+----------+---------------------+

Times for minikube start: 27.3s 26.7s 26.3s 27.7s 26.9s
Times for minikube (PR 15770) start: 26.2s 26.6s 26.2s 26.2s 27.4s

Times for minikube (PR 15770) ingress: 20.1s 19.6s 22.1s 22.1s 22.1s
Times for minikube ingress: 23.1s 22.1s 20.1s 82.6s 20.1s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 15770) |
+----------------+----------+---------------------+
| minikube start | 22.8s    | 22.5s               |
| enable ingress | 41.8s    | 33.2s               |
+----------------+----------+---------------------+

Times for minikube start: 21.9s 23.5s 22.3s 23.2s 23.1s
Times for minikube (PR 15770) start: 22.0s 23.0s 22.4s 23.0s 22.2s

Times for minikube ingress: 79.6s 31.6s 33.6s 31.6s 32.6s
Times for minikube (PR 15770) ingress: 30.6s 32.6s 47.6s 32.6s 22.6s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Docker_Linux TestPause/serial/SecondStartNoReconfiguration (gopogh) 6.36 (chart)
Docker_Linux_containerd TestDownloadOnlyKic (gopogh) 9.20 (chart)
Docker_Linux TestDownloadOnlyKic (gopogh) 9.25 (chart)
Hyper-V_Windows TestAddons/parallel/CloudSpanner (gopogh) 20.16 (chart)
Docker_Windows TestRunningBinaryUpgrade (gopogh) 67.57 (chart)
Docker_macOS TestIngressAddonLegacy/serial/ValidateIngressDNSAddonActivation (gopogh) 95.21 (chart)
Hyper-V_Windows TestStoppedBinaryUpgrade/Upgrade (gopogh) 98.39 (chart)
Docker_macOS TestIngressAddonLegacy/serial/ValidateIngressAddonActivation (gopogh) 100.00 (chart)
Docker_macOS TestIngressAddonLegacy/serial/ValidateIngressAddons (gopogh) 100.00 (chart)
Docker_macOS TestIngressAddonLegacy/StartLegacyK8sCluster (gopogh) 100.00 (chart)
Docker_macOS TestKubernetesUpgrade (gopogh) 100.00 (chart)
Docker_macOS TestMissingContainerUpgrade (gopogh) 100.00 (chart)
Docker_macOS TestRunningBinaryUpgrade (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/AddonExistsAfterStop (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/DeployApp (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/EnableAddonWhileActive (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/FirstStart (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/SecondStart (gopogh) 100.00 (chart)
Docker_macOS TestStartStop/group/old-k8s-version/serial/UserAppExistsAfterStop (gopogh) 100.00 (chart)
Docker_macOS TestStoppedBinaryUpgrade/Upgrade (gopogh) 100.00 (chart)
Docker_Windows TestFunctional/parallel/ServiceCmd (gopogh) 100.00 (chart)
Hyper-V_Windows TestMultiNode/serial/PingHostFrom2Pods (gopogh) 100.00 (chart)
Hyper-V_Windows TestMultiNode/serial/RestartKeepsNodes (gopogh) 100.00 (chart)
Hyper-V_Windows TestNoKubernetes/serial/StartWithStopK8s (gopogh) 100.00 (chart)
KVM_Linux_containerd TestPreload (gopogh) 100.00 (chart)

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

@nickmancari nickmancari requested review from medyagh and spowelljr and removed request for prezha, medyagh and spowelljr February 7, 2023 18:06
@nickmancari nickmancari requested a review from medyagh February 7, 2023 18:06
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nickmancari, 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 Feb 8, 2023
@spowelljr spowelljr merged commit 7ad6872 into kubernetes:master Feb 8, 2023
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants