-
Notifications
You must be signed in to change notification settings - Fork 767
Move to nproc and Speed Up Ansible Lint #14328
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
base: master
Are you sure you want to change the base?
Conversation
This should help reduce CI time.
ATEX Test ResultsTest artifacts have been submitted to Testing Farm. Results: View Test Results This comment was automatically generated by the ATEX workflow. |
vojtapolasek
left a comment
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.
Thank you for the PR.
Claude warned me about few errors which seem relevant. What do you think?
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
| - name: Lint Ansible Roles | ||
| run: ansible-lint -x 204 -x experimental -x command-instead-of-module ./build/ansible_roles/* | ||
| run: find ./build/ansible_roles -mindepth 1 -maxdepth 1 -type d | xargs -P $(nproc) -I {} ansible-lint -x 204 -x experimental -x command-instead-of-module {} |
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.
Since we are using many pipes here, would adding something like set -eo pipefail make sense?
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.
There is only one pipe here and we assume the playbooks exist since the build worked so I don't think it is needed.
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.
In context of previous discussion it seems it is really not needed.
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.
Actually, I would agree with @vojtapolasek here - if the find doesn't find anything and throws an error, ansible-lint would normally scan CWD, but xargs takes over here because nothing was passed, and it simply exits with 0.
$ echo asdasd | xargs -P $(nproc) -I {} false {} ; echo $?
123
$ find /nonexistent | xargs -P $(nproc) -I {} false {} ; echo $?
find: ‘/nonexistent’: No such file or directory
0
Although if we (want to) rely on other steps throwing errors, that's probably fine.
|
@Mab879 I see there are some Ansible lint warnings produced... is this something what was not waived in the past or are these new findings? |
Description:
-j2to-j$(nproc)Rationale:
Trying to reduce time in CI.
Review Hints:
Review the CI logs.