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

RUN-2448: ENH: Ansible plugin performance issue #368

Merged
merged 19 commits into from
Jul 4, 2024

Conversation

alexander-variacode
Copy link
Contributor

@alexander-variacode alexander-variacode commented May 27, 2024

⛔️ Ticket:

https://pagerduty.atlassian.net/browse/RUN-2448

❌ Issue:

The method getNodes consume a lot CPU and RAM when it tries to process all Ansible nodes and converting them into Rundeck nodes.

✅ Solution:

When Gather Facts is set to false another Ansible command (ansible-inventory) is applied to bring in the nodes and convert them to Rundeck format. These nodes, now transformed, will have much less information but will not consume large CPU and RAM resources, which is what happened with the previous playbook when Gather Facts is true. In addition, in the file ansible.cfg it has to change this property to "duplicate_dict_key=ignore"

Documentation PR:
rundeck/docs#1490

@alexander-variacode alexander-variacode added this to the 5.4.0 milestone May 27, 2024
Copy link
Contributor

@ronaveva ronaveva left a comment

Choose a reason for hiding this comment

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

Hi, i think we should use the snakeyaml version 2.2 to match the one used in rundeck
https://github.com/rundeck/rundeck/blob/main/gradle.properties#L36

Also could you expand a little on why is the property "duplicate_dict_key=ignore" is needed? would this require to update the docs also?

and finally, with this change it only improves when you use have gather facts false?

@alexander-variacode alexander-variacode requested review from chrismcg14 and ltamaster and removed request for ltamaster and chrismcg14 June 5, 2024 14:49
build.gradle Outdated Show resolved Hide resolved
@ltamaster
Copy link
Contributor

we will also need to add a functional test for this case

@alexander-variacode alexander-variacode force-pushed the enh/run-2451_ansible-model-source branch from 78c8576 to 3fcdfa0 Compare June 11, 2024 18:21
Copy link
Contributor

@ronaveva ronaveva left a comment

Choose a reason for hiding this comment

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

I think the exception handling needs to be improved, right now we are loosing too much info when suppressing exceptions (not throwing or not logging the exception and just logging the message).
It would be good to know how rundeck handles exceptions when being thrown from the plugin

@ronaveva
Copy link
Contributor

what was the config that the client reporting the issue had? gather facts true or false?

@alexander-variacode
Copy link
Contributor Author

what was the config that the client reporting the issue had? gather facts true or false?

The client had gather facts false.

@alexander-variacode
Copy link
Contributor Author

I think the exception handling needs to be improved, right now we are loosing too much info when suppressing exceptions (not throwing or not logging the exception and just logging the message). It would be good to know how rundeck handles exceptions when being thrown from the plugin

@alexander-variacode
Copy link
Contributor Author

I think the exception handling needs to be improved, right now we are loosing too much info when suppressing exceptions (not throwing or not logging the exception and just logging the message). It would be good to know how rundeck handles exceptions when being thrown from the plugin

Exception handler process changed

@ahormazabal
Copy link
Contributor

Screenshot 2024-07-03 at 17 22 22

Should this be changed to "not recommended for large inventories"?

@ahormazabal
Copy link
Contributor

Tested and worked OK. Just needs those minor adjustments.

@alexander-variacode
Copy link
Contributor Author

alexander-variacode commented Jul 4, 2024

not recommended for large inventories

Changed to: "Gather fresh facts before importing? (Not recommended for large inventories)"

@ronaveva ronaveva requested review from ronaveva and removed request for ronaveva July 4, 2024 17:52
@ahormazabal ahormazabal dismissed ltamaster’s stale review July 4, 2024 18:04

Dismissing as Luis is unavailable to approve.

@ronaveva ronaveva self-requested a review July 4, 2024 18:14
Copy link
Contributor

@ronaveva ronaveva left a comment

Choose a reason for hiding this comment

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

lgtm

@alexander-variacode alexander-variacode merged commit 6e122b4 into main Jul 4, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants