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

Cirrus: Simplify log collection commands #3308

Merged
merged 1 commit into from
Jun 17, 2019

Conversation

cevich
Copy link
Member

@cevich cevich commented Jun 12, 2019

Signed-off-by: Chris Evich [email protected]

@cevich cevich mentioned this pull request Jun 12, 2019
@cevich cevich changed the title Cirrus: Simplify log collection commands WIP: Cirrus: Simplify log collection commands Jun 12, 2019
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 12, 2019
@mheon
Copy link
Member

mheon commented Jun 12, 2019

Changes LGTM

.cirrus.yml Outdated Show resolved Hide resolved
@cevich
Copy link
Member Author

cevich commented Jun 12, 2019

note: I plan on doing a pass across the entire .cirrus.yml, but need to verify some cirrus-ci YAML parsing behavior. IIRC, there was also some strange/unexpected interactions between always/on_failure instructions. Need to instrument some test failures to confirm.

@edsantiago
Copy link
Member

Ah - yes, I see those other instances now. Thanks.

@cevich
Copy link
Member Author

cevich commented Jun 12, 2019

Ugg, yep, cirrus (I think) YAML parser does really odd/nonstandard things with quotes.

cat: '||': No such file or directory
cat: echo: No such file or directory
cat: "'Failed": No such file or directory
cat: to: No such file or directory
cat: collect: No such file or directory
cat: ginkgo: No such file or directory
cat: node: No such file or directory
cat: "logs'": No such file or directory

@edsantiago
Copy link
Member

In the removed code, the commands were enclosed in single-quotes:

   failed_df_script: '${DFCMD}'

In the added code, no quotes. Should you try adding them back?

@cevich
Copy link
Member Author

cevich commented Jun 12, 2019

Naa, taking a different approach. It's the quote-handling that's the problem. I've wasted time on this topic before, it's not worth the aggravation...

@cevich
Copy link
Member Author

cevich commented Jun 13, 2019

@edsantiago does this approach seem reasonable? IMHO it rings a bit of overkill, but perhaps is good for future growth and maintenance. The absence of ginkgo node-logs in some tasks is expected (I think) - depends on what the makefile does.

@edsantiago
Copy link
Member

@cevich yes, this approach makes sense and looks good. But why not take the next step, and just call the script logcollector or something, and make it do everything in just one pass? Every single instance I see has four invocations, all of which are duplication, not to mention the complexity of the script itself; why not just:

    always:
        log_collector_script: '${WHATEVER}'

@cevich
Copy link
Member Author

cevich commented Jun 13, 2019

Ack on name change...I always struggle with these.

Reason for duplicate calls is because it splits the output up in the WebUI and in the backend storage. Also because Cirrus truncates the output, we want to keep it as short as possible to avoid additional clicks to access it.

@cevich cevich force-pushed the always_collect_logs branch from 4640f44 to 24459f3 Compare June 13, 2019 15:08
Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

Mostly LGTM. One bug (unused code), one suggestion.

contrib/cirrus/lib.sh Outdated Show resolved Hide resolved
contrib/cirrus/logcollector.sh Show resolved Hide resolved
@edsantiago
Copy link
Member

I hate to suggest making this five duplicated stanzas... but I find myself just now desperate for the output of ./bin/podman info on the rootless test; in particular, the .store settings. Is there some non-complicated way of adding that?

@cevich
Copy link
Member Author

cevich commented Jun 13, 2019

I find myself just now desperate for the output of

All rooless testing happens from the special_testing_rootless_task now, so adding a new script item like $SCRIPT_BASE/logcollector.sh podman there would do it. That also fixes the issue of stanza duplication, one of them would be slightly different 😁

five duplicated stanzas

Actually, now that you mention it, I wonder if Cirrus's customized parser can handle YAML anchors and aliases? I'll give that a try, but leave special_testing_rootless_task alone in anticipation of your addition.

@cevich
Copy link
Member Author

cevich commented Jun 13, 2019

@edsantiago anchors/aliases appear to work! I even left a comment on why rootless testing doesn't use it 😄

@edsantiago
Copy link
Member

Excellent! Thank you for looking into it!

.cirrus.yml Outdated Show resolved Hide resolved
@cevich cevich force-pushed the always_collect_logs branch from 302aba1 to 4e9f5e5 Compare June 14, 2019 12:49
@cevich
Copy link
Member Author

cevich commented Jun 14, 2019

Thanks @edsantiago for helping me remember about YAML anchor/alias. I'm happy to see Cirrus-CI's custom parser supports them. If it weren't my last day before vacation, I'd be tempted to open a PR and apply that trick all over 😁

@cevich
Copy link
Member Author

cevich commented Jun 14, 2019

(this PR is ready to go)

@rhatdan
Copy link
Member

rhatdan commented Jun 14, 2019

/approve
You need to remove WIP if you want it to merge.

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cevich, rhatdan

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 14, 2019
@cevich cevich changed the title WIP: Cirrus: Simplify log collection commands Cirrus: Simplify log collection commands Jun 14, 2019
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 14, 2019
@rhatdan
Copy link
Member

rhatdan commented Jun 17, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 17, 2019
@openshift-merge-robot openshift-merge-robot merged commit 058c93f into containers:master Jun 17, 2019
@cevich cevich deleted the always_collect_logs branch June 30, 2021 18:11
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants