Move to nproc and Speed Up Ansible Lint#14328
Move to nproc and Speed Up Ansible Lint#14328Mab879 wants to merge 2 commits intoComplianceAsCode:masterfrom
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.
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.
Since we are using many pipes here, would adding something like set -eo pipefail make sense?
There was a problem hiding this comment.
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.
In context of previous discussion it seems it is really not needed.
There was a problem hiding this comment.
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? |
The findings were here before, xargs just exposes them. I might be able to rewrite parallelization to better account for this. Or I can tweak the Ansible config to make it pass. Thoughts? |
Description:
-j2to-j$(nproc)Rationale:
Trying to reduce time in CI.
Review Hints:
Review the CI logs.