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

Update FitError as a message component into the PodConditionUpdater. #39491

Merged

Conversation

jayunit100
Copy link
Member

@jayunit100 jayunit100 commented Jan 5, 2017

Fixes #20064 , after a roundabout volley of ideas, we ended up digging into existing Conditions for this, rather then a first class API object. This is just a quick sketch of the skeleton minimal implementation, it should pretty much "just work". I'll test it more later today.

Release Note:

Histogram data of predicate failures is contained in pod conditions and thus available to users by kubectl commands.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 5, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@jayunit100 jayunit100 changed the title Update FitError as a message component into the PodConditionUpdater. [WIP] Update FitError as a message component into the PodConditionUpdater. Jan 5, 2017
@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note-label-needed labels Jan 5, 2017
@jayunit100 jayunit100 force-pushed the sched_Histogram_error branch from 630d7f6 to abe8f17 Compare January 6, 2017 00:10
@jayunit100
Copy link
Member Author

@k8s-bot test this please

@jayunit100 jayunit100 force-pushed the sched_Histogram_error branch from abe8f17 to ec1bfa1 Compare January 6, 2017 17:34
@jayunit100 jayunit100 changed the title [WIP] Update FitError as a message component into the PodConditionUpdater. Update FitError as a message component into the PodConditionUpdater. Jan 6, 2017
@timothysc timothysc added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. labels Jan 6, 2017
@timothysc timothysc self-requested a review January 6, 2017 17:36
@timothysc timothysc added this to the v1.6 milestone Jan 6, 2017
@timothysc timothysc self-assigned this Jan 6, 2017
@k8s-github-robot k8s-github-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 Jan 6, 2017
@jayunit100 jayunit100 force-pushed the sched_Histogram_error branch from ec1bfa1 to e309d26 Compare January 6, 2017 18:28
@jayunit100
Copy link
Member Author

Alrite this is working now... here's an example of how it looks with a redis pod that asks for too much memory.

[root:...olang/src/k8s.io/kubernetes]# cluster/kubectl.sh get pod redis-master-223378846-1k1d8 -o=json | grep -A 10 status                                                                           (sched_Histogram_error✱)
    "status": {
        "conditions": [
            {
                "lastProbeTime": null,
                "lastTransitionTime": "2017-01-06T20:32:28Z",
                "message": "No nodes are available that match all of the following predicates: Insufficient memory (1).",
                "reason": "Unschedulable",
                "status": "False",
                "type": "PodScheduled"
            }
        ],
        "phase": "Pending"
    }
}

I'm just using the existing scheduler condition updater, and all I've done here is modify the update function to write the error as a message that is has the desired UX .

Should be Good enough for us to keep moving forward.

@davidopp @timothysc

Copy link
Member

@timothysc timothysc left a comment

Choose a reason for hiding this comment

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

minor nit.

"3": []algorithm.PredicateFailureReason{algorithmpredicates.ErrNodeUnderDiskPressure},
},
}
if strings.Contains(error.Error(), "No nodes are available that match all of the following predicates") {
Copy link
Member

@timothysc timothysc Jan 6, 2017

Choose a reason for hiding this comment

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

why not string match the the entire expected string?

  1. It makes it easier to read
  2. It gives a clear example of the flattening
    ... etc.

Copy link
Member Author

@jayunit100 jayunit100 Jan 6, 2017

Choose a reason for hiding this comment

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

Ah yes, this is to avoid Overtesting: We shouldn't be testing the order in which the predicate failures are listed, as thats neither a requirement nor a gauranteed quality of maps in golang: https://nathanleclaire.com/blog/2014/04/27/a-surprising-feature-of-golang-that-colored-me-impressed/.

We could print it multiple times and gaurantee that the exact string is eventually provided, but that would be awkward.

Copy link
Member

Choose a reason for hiding this comment

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

Your "No nodes ..." should be a const btw, otherwise subtle change in 2 locs.

Copy link
Member Author

@jayunit100 jayunit100 Jan 9, 2017

Choose a reason for hiding this comment

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

I liked the constant idea, but kept the constant unused in the unit test -- simply because it would make a "self-fulfilling pass" . The decoupling of unit test from the code is necessary for this feature since otherwise, regression in the readability of the message could go unchecked. just updated and pushed

@jayunit100 jayunit100 force-pushed the sched_Histogram_error branch from e309d26 to 7873e48 Compare January 9, 2017 15:18
@k8s-ci-robot
Copy link
Contributor

Jenkins Bazel Build failed for commit 7873e48122304d9395789efa0535e9a743eb4d79. Full PR test history.

The magic incantation to run this job again is @k8s-bot bazel test this. Please help us cut down flakes by linking to an open flake 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/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot
Copy link
Contributor

Jenkins verification failed for commit 7873e48122304d9395789efa0535e9a743eb4d79. Full PR test history.

The magic incantation to run this job again is @k8s-bot verify test this. Please help us cut down flakes by linking to an open flake 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/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot
Copy link
Contributor

Jenkins GCE e2e failed for commit 7873e48122304d9395789efa0535e9a743eb4d79. Full PR test history.

The magic incantation to run this job again is @k8s-bot cvm gce e2e test this. Please help us cut down flakes by linking to an open flake 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/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot
Copy link
Contributor

Jenkins GCE etcd3 e2e failed for commit 7873e48122304d9395789efa0535e9a743eb4d79. Full PR test history.

The magic incantation to run this job again is @k8s-bot gce etcd3 e2e test this. Please help us cut down flakes by linking to an open flake 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/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot
Copy link
Contributor

Jenkins GKE smoke e2e failed for commit 7873e48122304d9395789efa0535e9a743eb4d79. Full PR test history.

The magic incantation to run this job again is @k8s-bot cvm gke e2e test this. Please help us cut down flakes by linking to an open flake 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/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot
Copy link
Contributor

Jenkins kops AWS e2e failed for commit 7873e48122304d9395789efa0535e9a743eb4d79. Full PR test history.

The magic incantation to run this job again is @k8s-bot kops aws e2e test this. Please help us cut down flakes by linking to an open flake 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/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot
Copy link
Contributor

Jenkins GCI GCE e2e failed for commit 7873e48122304d9395789efa0535e9a743eb4d79. Full PR test history.

The magic incantation to run this job again is @k8s-bot gci gce e2e test this. Please help us cut down flakes by linking to an open flake 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/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot
Copy link
Contributor

Jenkins GCE Node e2e failed for commit 7873e48122304d9395789efa0535e9a743eb4d79. Full PR test history.

The magic incantation to run this job again is @k8s-bot node e2e test this. Please help us cut down flakes by linking to an open flake 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/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot
Copy link
Contributor

Jenkins CRI GCE Node e2e failed for commit 7873e48122304d9395789efa0535e9a743eb4d79. Full PR test history.

The magic incantation to run this job again is @k8s-bot cri node e2e test this. Please help us cut down flakes by linking to an open flake 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/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot
Copy link
Contributor

Jenkins GCI GKE smoke e2e failed for commit 7873e48122304d9395789efa0535e9a743eb4d79. Full PR test history.

The magic incantation to run this job again is @k8s-bot gci gke e2e test this. Please help us cut down flakes by linking to an open flake 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/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot
Copy link
Contributor

Jenkins unit/integration failed for commit 7873e48122304d9395789efa0535e9a743eb4d79. Full PR test history.

The magic incantation to run this job again is @k8s-bot unit test this. Please help us cut down flakes by linking to an open flake 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/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot
Copy link
Contributor

Jenkins Kubemark GCE e2e failed for commit 7873e48122304d9395789efa0535e9a743eb4d79. Full PR test history.

The magic incantation to run this job again is @k8s-bot kubemark e2e test this. Please help us cut down flakes by linking to an open flake 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/test-infra repository. I understand the commands that are listed here.

@k8s-github-robot k8s-github-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 9, 2017
@jayunit100 jayunit100 force-pushed the sched_Histogram_error branch from 7873e48 to 9cdc4ae Compare January 9, 2017 15:24
@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 9, 2017
@timothysc timothysc added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 9, 2017
@timothysc
Copy link
Member

This is great, capturing the last predicate failed predicate histogram in the Reason is highly useful.

@k8s-github-robot k8s-github-robot added the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Jan 9, 2017
@timothysc timothysc added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels Jan 9, 2017
@davidopp davidopp assigned wojtek-t and unassigned davidopp Jan 9, 2017
@davidopp
Copy link
Member

davidopp commented Jan 9, 2017

Unfortunately I don't have time to review this. @wojtek-t could you take a look?

@timothysc timothysc removed the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Jan 9, 2017
@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 34488, 39511, 39619, 38342, 39491)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. 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.

7 participants