-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Set inject_facts_as_vars to false to speed up ansible #8927
Set inject_facts_as_vars to false to speed up ansible #8927
Conversation
Hi @fungusakafungus. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
bf2c708
to
c81f4ee
Compare
This seems for making Ansible speed up.
There might be a bigger factor than this |
Great comparison @oomichi but our CI does not quite yield predictable run times, depending on the number of parallel jobs there can actually be severe contention leading to time variance between runs of the same job. Additionally we fetch a lot of assets from the internet during a job run which can also cause unpredictable run times. I'm not sure how we could stop the CI from picking up other jobs to at least remove the noisy neighbour effect but there are some weird discrepancies. Since vagrant jobs spin up a dedicated host comparing those might give us more comparable numbers. |
I'd expect the highest impact on ci jobs with the most hosts and the most tasks, even if those are skipped tasks. |
The CI jobs are usually 2 node jobs or 3 node jobs (HA ones) so it would be difficult to use this criteria. |
My concern is This pull request is big and the revert is not easy after taking time. |
Totally agree with you on this @oomichi , I was just pointing out that in order to qualify the difference of runtimes we need some more precise measurements. @fungusakafungus I'm wondering if we could make the code change without affecting ansible.cfg. We could compare the impact of that change alone then we could advise users to try the ansible.cfg modification and test for themselves. |
Sure, I can hold off on that part. But I'll leave it in the
I'm quite sure it makes it faster for everyone, it is only visible for some people. That's what I meant. One the other side, this change might break something for some people, in case they use facts like
I will be around to revert it if needed. Most of it is done with
basically reverts it, leaving a small diff to be reverted manually (or by git if still possible) |
f73eb41
to
42800cd
Compare
Rebased again and squashed and rephrased commits |
42800cd
to
3f7593d
Compare
rebased again |
Currently affected by CI issues: #8984 |
I've produced a little oneliner to check for facts injected as vars I'm using to keep this fresh: |
a3707b1
to
18bb02b
Compare
18bb02b
to
836e04e
Compare
836e04e
to
ad0eccd
Compare
to prepare for turning off inject_facts_as_vars in order to speed up ansible. for reasoning see ansible/ansible#73654
ad0eccd
to
7eea60c
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fungusakafungus The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@fungusakafungus: PR needs rebase. 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. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
What type of PR is this?
/kind feature
What this PR does / why we need it:
According to discussion in ansible/ansible#73654 (comment), disabling inject_facts_as_vars makes ansible go faster for some people. We do have a lot of tasks to skip and for every task/every host the vars need to be resolved.
This PR replaces all usages of
ansible_<fact_name>
withansible_facts.<fact_name>
and disablesinject_facts_as_vars
inansible.cfg
and in tests.Which issue(s) this PR fixes:
Related to ansible/ansible#73654
Special notes for your reviewer:
While this has been a nice exercise for me, this PR does not bring considerable improvement, at least in my limited testing.
Probably because we do carefully limit the number of facts we gather, so there's not much to gain here. I would still like to inform you, that this approach might be useful in the future, if we have to use more facts.
Does this PR introduce a user-facing change?:
This is probably not going to be released.