-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
[Federation] Create a script that dumps Federation pod logs after e2e test failures #43028
Conversation
Hi @perotinus. 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 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. |
Reviewed 2 of 2 files at r1. federation/cluster/log-dump.sh, line 24 at r1 (raw file):
By convention, we use all caps for global names. But I see why you are using lower cases here (log-dump.sh does this too). But can we use the convention in this script? Same comment for variables below. federation/cluster/log-dump.sh, line 25 at r1 (raw file):
federation/cluster/log-dump.sh, line 28 at r1 (raw file):
Use an array. It is easier to read? federation/cluster/log-dump.sh, line 29 at r1 (raw file):
Same comment as above. federation/cluster/log-dump.sh, line 34 at r1 (raw file):
Is the translation really necessary? federation/cluster/log-dump.sh, line 35 at r1 (raw file):
Same comment. federation/cluster/log-dump.sh, line 41 at r1 (raw file):
I think it is a good idea to extract this into a function and define federation/cluster/log-dump.sh, line 43 at r1 (raw file):
I would prefer this name to be See how the logs are grouped. federation/cluster/log-dump.sh, line 49 at r1 (raw file):
Same comment as above. federation/cluster/log-dump.sh, line 52 at r1 (raw file):
This has to be done per-cluster. It is unfortunate that we were only logging But this is a good starting point. Could you add a TODO here saying this has to be logged per cluster? When you fix this in a future PR, you can fix this in the Comments from Reviewable |
327f31f
to
d610a22
Compare
Review status: 1 of 2 files reviewed at latest revision, 10 unresolved discussions. federation/cluster/log-dump.sh, line 24 at r1 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
Done. federation/cluster/log-dump.sh, line 25 at r1 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
Done, I think. I believe that I had done this but had not repushed, so please let me know if there's something more to do here. federation/cluster/log-dump.sh, line 28 at r1 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
Done. federation/cluster/log-dump.sh, line 29 at r1 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
Done. federation/cluster/log-dump.sh, line 34 at r1 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
I think so. Otherwise, the output has newlines, and it doesn't work with Bash for...in iteration. federation/cluster/log-dump.sh, line 35 at r1 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
See above. I believe this is necessary, or at least something to this effect. federation/cluster/log-dump.sh, line 41 at r1 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
Done. federation/cluster/log-dump.sh, line 43 at r1 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
Ah, OK. I was wondering if there was a more-standard way to group these. Thanks! federation/cluster/log-dump.sh, line 49 at r1 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
Done. federation/cluster/log-dump.sh, line 52 at r1 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
Done. Do you mean fix in the non-federation log-dump.sh script? Does it not already dump the DNS pods? I suppose we could fix it here by using the E2E_ZONES flag (or perhaps another one if there's a more appropriate one). Comments from Reviewable |
Reviewed 1 of 1 files at r2. federation/cluster/log-dump.sh, line 25 at r1 (raw file): Previously, perotinus (Jonathan MacMillan) wrote…
Looks like it is done now. federation/cluster/log-dump.sh, line 34 at r1 (raw file): Previously, perotinus (Jonathan MacMillan) wrote…
Are you sure about this? I think BASH only cares about whitespaces, not necessarily spaces. for $e in $(ls -1); do
echo $e
done works for me. If you are converting it into an array as you are doing now, it matters even little. federation/cluster/log-dump.sh, line 52 at r1 (raw file):
Yes.
Not as far as I know. Here is an example: https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/ci-kubernetes-e2e-gce-federation/2238/nodelog?junit=junit_runner.xml&wrap=on
Sure, that works too. federation/cluster/log-dump.sh, line 26 at r2 (raw file):
We usually put KUBE_ROOT at the top. The very first thing after all the federation/cluster/log-dump.sh, line 27 at r2 (raw file):
It will be great if you add a comment listing for what you are sourcing this. Bash includes are too hard to track. Lack of good tooling makes the problem worse. federation/cluster/log-dump.sh, line 31 at r2 (raw file):
federation/cluster/log-dump.sh, line 48 at r2 (raw file):
Also, I was expecting the individual items in the array to be quoted. But this is fine since they are single word elements. federation/cluster/log-dump.sh, line 75 at r2 (raw file):
We usually put all the global initialization at the top. Directory creation can happen here though. Comments from Reviewable |
@k8s-bot ok to test |
@k8s-bot pull-kubernetes-federation-e2e-gce test this |
2 similar comments
@k8s-bot pull-kubernetes-federation-e2e-gce test this |
@k8s-bot pull-kubernetes-federation-e2e-gce test this |
Thanks! PTAL when you get a chance. I fixed the jenkins verification issue, but I'm not quite sure what's causing the other issue. It seems odd that it can't find the namespace, since I didn't actually modify anything that should affect the test setup. Can you ping the bot again? Review status: 0 of 3 files reviewed at latest revision, 8 unresolved discussions. federation/cluster/log-dump.sh, line 25 at r1 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
Great! federation/cluster/log-dump.sh, line 34 at r1 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
You're correct. Perhaps there are more issues with separators when you don't use an array? Bash is always a little bit like voodoo to me. federation/cluster/log-dump.sh, line 26 at r2 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
Done. federation/cluster/log-dump.sh, line 27 at r2 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
Done. federation/cluster/log-dump.sh, line 31 at r2 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
Done. federation/cluster/log-dump.sh, line 48 at r2 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
Done. federation/cluster/log-dump.sh, line 75 at r2 (raw file): Previously, madhusudancs (Madhusudan.C.S) wrote…
Done. Comments from Reviewable |
@k8s-bot pull-kubernetes-federation-e2e-gce test this |
1 similar comment
@k8s-bot pull-kubernetes-federation-e2e-gce test this |
Review status: 0 of 3 files reviewed at latest revision, 2 unresolved discussions. federation/cluster/log-dump.sh, line 34 at r1 (raw file): Previously, perotinus (Jonathan MacMillan) wrote…
Resolving for Reviewable. federation/cluster/log-dump.sh, line 31 at r2 (raw file): Previously, perotinus (Jonathan MacMillan) wrote…
Resolving for Reviewable. Comments from Reviewable |
@madhusudancs Can you LGTM this? Looks like the federation e2e tests finally passed. I'm not sure what the issue was before. |
Yeah, I was waiting for the tests to pass.
Yeah, it had nothing to do with this PR. The test (read: infra) was broken. |
/lgtm Reviewed 3 of 3 files at r3. federation/cluster/log-dump.sh, line 34 at r1 (raw file): Previously, perotinus (Jonathan MacMillan) wrote…
To me too :) Comments from Reviewable |
@k8s-bot bazel test this |
@perotinus bazel failure looks like a legitimate failure. Can you please take a look? |
…eration e2e tests
@madhusudancs Thanks! Should be fixed now. Can you re-LGTM? |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: madhusudancs, perotinus
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@k8s-bot gce e2e test this |
@k8s-bot gci gce e2e test this |
Automatic merge from submit-queue (batch tested with PRs 41775, 39678, 42629, 42524, 43028) |
# Dumps logs for all pods in a federation. | ||
function dump_federation_pod_logs() { | ||
local -r federation_pod_names=($(kubectl get pods -l 'app=federated-cluster' --namespace=${FEDERATION_NAMESPACE} -o name)) | ||
for pod_name in ${federation_pod_names[@]}; do |
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.
I see the following in logs:
./federation/cluster/log-dump.sh: line 34: federation_pod_names[@]: unbound variable
Example run: http://prow.k8s.io/log?pod=pull-kubernetes-federation-e2e-gce-1583
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.
@perotinus could you please take a look?
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.
@madhusudancs @nikhiljindal Fixed by #44881.
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.
@perotinus thanks!
This replaces the code that dumped the Federation pod logs to the console after each failed test.