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

Refactor(eos_designs): Optimize eos_designs_structured_config file write #4283

Conversation

ClausHolbechArista
Copy link
Contributor

Change Summary

Optimize eos_designs_structured_config file write

Component(s) name

arista.avd.eos_designs

Proposed changes

  • Use Python native file operations instead of Ansible Copy module.

How to test

Tested locally with both yml, yaml and json files.

  • Changed true/false correct
  • File mode set correctly
  • Performance improvement for small configs ~ 2x. For very large configs ~ 10%

Checklist

User Checklist

  • N/A

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

Copy link

Review docs on Read the Docs

To test this pull request:

# Create virtual environment for this testing below the current directory
python -m venv test-avd-pr-4283
# Activate the virtual environment
source test-avd-pr-4283/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/ClausHolbechArista/avd.git@refactor/eos_designs/optimize-eos_designs_structured_config-file-write#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/ClausHolbechArista/avd.git#/ansible_collections/arista/avd/,refactor/eos_designs/optimize-eos_designs_structured_config-file-write --force
# Optional: Install AVD examples
cd test-avd-pr-4283
ansible-playbook arista.avd.install_examples

Co-authored-by: Guillaume Mulocher <gmulocher@arista.com>
@github-actions github-actions bot added the state: conflict PR with conflict label Aug 5, 2024
Copy link

github-actions bot commented Aug 5, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the state: conflict PR with conflict label Aug 5, 2024
Copy link

github-actions bot commented Aug 5, 2024

Conflicts have been resolved. A maintainer will review the pull request shortly.

ClausHolbechArista and others added 2 commits August 9, 2024 14:38
…ctured_config.py

Co-authored-by: Vibhu-gslab <109593615+Vibhu-gslab@users.noreply.github.com>
@MaheshGSLAB MaheshGSLAB requested a review from a team August 13, 2024 13:56
Copy link

sonarcloud bot commented Aug 14, 2024

@ClausHolbechArista ClausHolbechArista merged commit a4466a6 into aristanetworks:devel Aug 14, 2024
40 checks passed
@ClausHolbechArista ClausHolbechArista deleted the refactor/eos_designs/optimize-eos_designs_structured_config-file-write branch August 20, 2024 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants