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

Issues/147 facts execution time #158

Merged
merged 4 commits into from
Apr 7, 2020

Conversation

titom73
Copy link
Contributor

@titom73 titom73 commented Mar 18, 2020

Update cv_facts to speed up process (#147)

Rewrite def facts_configlets to use get_configlets_and_mappers function
and reduce number of API call.

No change in inputs and outputs.

Test cases:

  • Manual cv_facts tasks
  • AVD integration

Execution time enhacement:

  • Original implementation: 6 sec
  • New version: 0.3 sec

test setup:

  • 8 devices
  • 16 configlets
  • 10 containers

titom73 added 3 commits March 18, 2020 21:18
Implement CVP API Call getConfigletsAndAssociatedMappers in cv_api to
speedup cv_facts run.

This function does not require any parameter and can be called with a
basic python line:

```
configlets_and_mappers = module.client.api.get_configlets_and_mappers()
```

Added to:
- cv_api2019
- cv_api2018
Rewrite def facts_configlets to use get_configlets_and_mappers function
and reduce number of API call.

No change in inputs and outputs.

Test cases:
-----------
- Manual cv_facts tasks
- AVD integration

Execution time enhacement:
--------------------------
- Original implementation: 6 sec
- New version: 0.3 sec

test setup:
------------
8 devices / 16 configlets / 10 containers

Execution logs:
---------------
2020-03-18 18:26:09,700 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:269) - Collecting facts v2
2020-03-18 18:26:10,017 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:276) - Devices part of facts, using this version
2020-03-18 18:26:10,017 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:283) - Containers part of facts, using this version
2020-03-18 18:26:10,017 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet leaf02-baseline
2020-03-18 18:26:10,017 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet RADIUS_LAB
2020-03-18 18:26:10,018 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet DC1-AVD_DC1-LEAF2B
2020-03-18 18:26:10,018 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet Builder_LEAFs
2020-03-18 18:26:10,018 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet spine01-baseline
2020-03-18 18:26:10,018 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet DC1-AVD_DC1-SPINE2
2020-03-18 18:26:10,018 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet DC1-AVD_DC1-LEAF1B
2020-03-18 18:26:10,018 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet DC1-AVD_DC1-SPINE1
2020-03-18 18:26:10,018 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet GLOBAL-ALIASES
2020-03-18 18:26:10,019 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet DC1-AVD_DC1-L2LEAF1A
2020-03-18 18:26:10,019 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet leaf01-baseline
2020-03-18 18:26:10,019 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet veos-01
2020-03-18 18:26:10,019 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet DC1-AVD_DC1-L2LEAF2A
2020-03-18 18:26:10,019 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet DC1-AVD_DC1-LEAF2A
2020-03-18 18:26:10,019 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet SYS_TelemetryBuilderV3
2020-03-18 18:26:10,019 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet DC1-AVD_DC1-LEAF1A
2020-03-18 18:26:10,019 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet data.device.leaf01
2020-03-18 18:26:10,019 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:296) - building list of mapping with devices and containers for configlet template.interfaces
2020-03-18 18:26:10,020 - arista.cvp.cv_facts: INFO - func: facts_configlets (L:317) - All configlets facts collected
@titom73 titom73 self-assigned this Mar 18, 2020
@titom73 titom73 added module: cv_facts Issue related to cv_facts module state: accepted Issue is part of the development roadmap status: in-progress Currently under investigation or implementation type: enhancement New feature or request labels Mar 18, 2020
@titom73 titom73 added this to the v1.1 milestone Mar 18, 2020
@titom73
Copy link
Contributor Author

titom73 commented Mar 18, 2020

Hi @noredistribution

cv_facts is now ready for initial testing in your heavy lab setup.

@titom73 titom73 mentioned this pull request Apr 3, 2020
4 tasks
titom73 added a commit that referenced this pull request Apr 3, 2020
- Backport function from #158
- Backport function from #168
- Run Linting
- Ansible Linting

Linting output:
---------------

```
$ make linting
sh .github/pre-commit
Validating PEP8 compliance...
------------------------------------------------------------------------------------------------------------
  - Modules validation
Using config file ansible-cvp/pylintrc

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

------------------------------------------------------------------------------------------------------------
  - Module Utils validation
Using config file ansible-cvp/pylintrc

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
```
@titom73 titom73 requested a review from noredistribution April 3, 2020 08:45
@titom73 titom73 marked this pull request as ready for review April 3, 2020 08:45
@titom73 titom73 merged commit be71a1b into releases/v1.1.x Apr 7, 2020
@titom73 titom73 deleted the issues/147-facts-execution-time branch April 7, 2020 13:22
@titom73 titom73 added status: testing PR under testing and removed state: accepted Issue is part of the development roadmap status: in-progress Currently under investigation or implementation labels May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: cv_facts Issue related to cv_facts module status: testing PR under testing type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant