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

Switch to DIY callback plugin for Ansible #711

Merged

Conversation

lentzi90
Copy link
Member

@lentzi90 lentzi90 commented Jun 22, 2021

The DIY callback plugin is configured to print only the status of k8s resources instead of everything (but otherwise work as before). Ansible verbosity is also turned down to default.

The goal is to reduce the amount of useless logs produced by the CI but still show relevant/interesting parts.

My reasoning is as follows. Note that all of this is very much open for discussion. This is just my point of view.

  1. We get a lot of output that is not very useful because we run ansible with -vvv. If a task fails, it will usually anyway print extra information about the error, so we skip -vvv and should still get the most important information.
  2. The k8s_info module that we are now using a bit more prints everything (including all the managed fields and what not) when running with -vvv. This is too much. Without -vvv it doesn't print anything though, and that is too little. It becomes hard to tell what is going on for example when a task is using until to wait for some node/machine/bmh.
    Solution: use the DIY callback and configure it to print only the status field of all resources (+ name and kind). This gives us the most valuable information while still reducing the amount of logs quite a lot. (Note that we will still get the full output if a task fails.)
  3. (This could be left as a follow up.) Ansible blocks can be used for error handling. We could benefit from this by gathering extra information about the environment in case a task fails. This works well in cases where it is known already what to look for. For example, we may choose to gather information about all Machines, BareMetalHosts, Pods and Nodes if a task fails and then print all of it. Note that this is in addition to the above. We still get the full output from the failed task, but after it we can add more.
  4. (Extra) We could also consider disabling the echo of some/all bash commands. They are quite repetitive and in case of failure we would still get the line where it failed. The main drawback that I see with this is that it may be less obvious what value some environment variables have.

@metal3-io-bot
Copy link
Collaborator

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@metal3-io-bot metal3-io-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 22, 2021
@lentzi90
Copy link
Member Author

/test-integration

@lentzi90 lentzi90 force-pushed the filter-extensive-ci-logs/lennart branch from 7245be7 to 1793472 Compare June 23, 2021 05:59
@lentzi90
Copy link
Member Author

/test-integration

@lentzi90 lentzi90 force-pushed the filter-extensive-ci-logs/lennart branch from 1793472 to 4055798 Compare June 23, 2021 06:43
@lentzi90
Copy link
Member Author

/test-integration

@metal3-io-bot metal3-io-bot 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 Jun 23, 2021
@lentzi90 lentzi90 force-pushed the filter-extensive-ci-logs/lennart branch from 4055798 to 5d94d63 Compare June 23, 2021 08:44
@lentzi90
Copy link
Member Author

/test-integration

@lentzi90 lentzi90 force-pushed the filter-extensive-ci-logs/lennart branch from 5d94d63 to b2afd93 Compare June 23, 2021 10:02
@lentzi90
Copy link
Member Author

/test-integration

@lentzi90 lentzi90 force-pushed the filter-extensive-ci-logs/lennart branch from b2afd93 to cd23e08 Compare June 23, 2021 12:18
@lentzi90
Copy link
Member Author

/test-integration

Copy link
Member

@fmuyassarov fmuyassarov left a comment

Choose a reason for hiding this comment

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

I personally like that we less output instead of having too much stdout which we don't really read and it just takes extra space and makes it complicated to read the logs.
I'm +1 for this.

@lentzi90 lentzi90 force-pushed the filter-extensive-ci-logs/lennart branch from cd23e08 to 503c29e Compare June 24, 2021 11:05
@lentzi90
Copy link
Member Author

/test-integration

@lentzi90 lentzi90 changed the title WIP: Switch to DIY callback plugin for Ansible Switch to DIY callback plugin for Ansible Jun 24, 2021
@lentzi90 lentzi90 marked this pull request as ready for review June 24, 2021 11:12
@metal3-io-bot metal3-io-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 24, 2021
@lentzi90 lentzi90 force-pushed the filter-extensive-ci-logs/lennart branch from 503c29e to 0c87b5c Compare June 24, 2021 11:24
@lentzi90
Copy link
Member Author

/test-integration

@lentzi90 lentzi90 force-pushed the filter-extensive-ci-logs/lennart branch from 0c87b5c to 6a40c53 Compare June 24, 2021 11:31
@lentzi90
Copy link
Member Author

/test-integration

@lentzi90
Copy link
Member Author

/test-v1a4-centos-integration

@smoshiur1237
Copy link
Member

smoshiur1237 commented Jun 24, 2021

Significant improvements with less logs and will be easy to read the logs. Good work.

The DIY callback plugin is configured to print only the status of k8s
resources instead of everything (but otherwise work as before).
Ansible verbosity is turned down to default.
@lentzi90 lentzi90 force-pushed the filter-extensive-ci-logs/lennart branch from 6a40c53 to cc03f55 Compare June 24, 2021 12:58
@lentzi90
Copy link
Member Author

/test-integration
/test-v1a4-centos-integration

Alright, I think it is ready to go now. Removed the example part. Please review/approve if you like it 🙂

@furkatgofurov7
Copy link
Member

/assign @kashifest

Copy link
Member

@kashifest kashifest 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 taking care of this.
/approve

@metal3-io-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kashifest

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

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 30, 2021
@jan-est
Copy link
Contributor

jan-est commented Jun 30, 2021

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 30, 2021
@metal3-io-bot metal3-io-bot merged commit 445c19f into metal3-io:master Jun 30, 2021
@lentzi90 lentzi90 deleted the filter-extensive-ci-logs/lennart branch February 11, 2022 06:23
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. lgtm Indicates that a PR is ready to be merged. 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.

None yet

7 participants