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

CI: cv_deploy molecule test to use new infra #4441

Open
wants to merge 7 commits into
base: devel
Choose a base branch
from

Conversation

sugetha24
Copy link
Contributor

Change Summary

Updated molecule tests to use the new EVE-NG lab

Copy link

github-actions bot commented Sep 6, 2024

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-4441
# Activate the virtual environment
source test-avd-pr-4441/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/sugetha24/ansible-avd.git@cv_deploy-molecule-update#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/sugetha24/ansible-avd.git#/ansible_collections/arista/avd/,cv_deploy-molecule-update --force
# Optional: Install AVD examples
cd test-avd-pr-4441
ansible-playbook arista.avd.install_examples

@github-actions github-actions bot added the state: CI Updated CI scenario have been updated in the PR label Sep 6, 2024
@sugetha24 sugetha24 marked this pull request as ready for review September 10, 2024 18:12
@sugetha24 sugetha24 requested review from a team as code owners September 10, 2024 18:12
@sugetha24 sugetha24 force-pushed the cv_deploy-molecule-update branch 2 times, most recently from aa4bc59 to 3be537b Compare September 20, 2024 13:29
Copy link
Contributor

@gmuloc gmuloc left a comment

Choose a reason for hiding this comment

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

Have not tested that it runs but the PR LGTM

@sugetha24
Copy link
Contributor Author

Have not tested that it runs but the PR LGTM

Please test the PR when you get a chance

@gmuloc gmuloc added the one approval This PR has one approval and is only missing one more. label Sep 23, 2024
run_once: true
delegate_to: localhost
ansible.builtin.import_role:
name: arista.avd.cv_deploy
vars:
cv_devices: [ci-s1-leaf1, ci-s1-leaf2, ci-s1-leaf3, ci-s1-leaf4, ci-s1-spine1, ci-s1-spine2, ci-s1-core1 ]
cv_devices: [ avd-ci-leaf2, avd-ci-core1 ]
Copy link
Contributor

Choose a reason for hiding this comment

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

When trying to follow the guide to run the test I am not successful on the tenant getting issues (twice in a row) for task "Check CPV returns" line 176 below
Screenshot 2024-09-23 at 16 31 34

Can you please investigate? I have the workspaces on the tenant if you want to verify more

Also it is very hard to troubleshoot what step is failing as the names of the task when using import_role are hidden and so I am not sure where we are.

Suggestion would be to separate each "test" in a play in the same playbook or a whole different playbook.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess running cv_deploy with cv_submit_workspace_force = false and expecting workspace submission to fail with Failed to submit workspace may be achieved by stopping streaming on one of the devices first. Otherwise workspace submission just succeeds without any errors

@@ -158,18 +157,18 @@
cv_submit_workspace_force: true
cv_run_change_control: true

- name: Test = Provision with cv_submit_workspace_force = false
- name: Provision with cv_submit_workspace_force = false
Copy link
Contributor

@alexeygorbunov alexeygorbunov Sep 25, 2024

Choose a reason for hiding this comment

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

Stop streaming on core1 and wait to 130s seconds for streaming status turbine to notice (may need up to 2 minutes)

Suggested change
- name: Provision with cv_submit_workspace_force = false
- name: Force device avd-ci-core1 to stop streaming
arista.eos.eos_command:
commands:
- enable
- configure
- daemon TerminAttr
- shutdown
when: inventory_hostname == "avd-ci-core1"
- name: Pause for 130 seconds for streaming to stop
run_once: true
ansible.builtin.pause:
seconds: 130
- name: Provision with cv_submit_workspace_force = false

Once display and check tasks complete - we can then run the following task (before running next Cleanup) to re-enable streaming for core1:

    - name: Force device avd-c1i-core1 to start streaming
      arista.eos.eos_command:
        commands:
          - enable
          - configure
          - daemon TerminAttr
          - no shutdown
      when: inventory_hostname == "avd-ci-core1"
      
    - name: Pause for 10 seconds for streaming to start
      run_once: true
      ansible.builtin.pause:
        seconds: 10

s1-spine2:
avd-ci-spine1:
avd-ci-spine2:
avd-ci-core1:
Copy link
Contributor

@alexeygorbunov alexeygorbunov Sep 25, 2024

Choose a reason for hiding this comment

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

Add additional vars for core1 to allow eAPI-based enabling/disabling of TA streaming (foror testing workspace submission when some of the devices are not actively streaming)

Suggested change
avd-ci-core1:
avd-ci-core1:
ansible_host: "{{ lookup('env', 'AVD_CI_CORE1_FQDN') }}"
ansible_user: "{{ lookup('env', 'EOS_EAPI_USERNAME') }}"
ansible_password: "{{ lookup('env', 'EOS_EAPI_PASSWORD') }}"
ansible_connection: httpapi
ansible_httpapi_use_ssl: True
ansible_httpapi_validate_certs: False
ansible_network_os: eos
ansible_httpapi_port: 443

Copy link

sonarcloud bot commented Sep 30, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
one approval This PR has one approval and is only missing one more. state: CI Updated CI scenario have been updated in the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants