-
Notifications
You must be signed in to change notification settings - Fork 212
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
Feat(eos_designs): Improve ptp
settings for p2p_links
#4612
base: devel
Are you sure you want to change the base?
Feat(eos_designs): Improve ptp
settings for p2p_links
#4612
Conversation
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-4612
# Activate the virtual environment
source test-avd-pr-4612/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/laxmikantchintakindi/avd.git@feat/ptp-p2p-links#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/laxmikantchintakindi/avd.git#/ansible_collections/arista/avd/,feat/ptp-p2p-links --force
# Optional: Install AVD examples
cd test-avd-pr-4612
ansible-playbook arista.avd.install_examples |
ptp
settings for p2p_links
ptp
settings for p2p_links
python-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/utils.py
Outdated
Show resolved
Hide resolved
5504ee0
to
3477fa5
Compare
python-avd/pyavd/_eos_designs/schema/schema_fragments/defs_p2p_links.schema.yml
Outdated
Show resolved
Hide resolved
...-avd/pyavd/_eos_designs/structured_config/core_interfaces_and_l3_edge/ethernet_interfaces.py
Outdated
Show resolved
Hide resolved
type: str | ||
default: "bmca" | ||
valid_values: | ||
- "bmca" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you confirm the role bmca. I see dynamic and master in eos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this as per comment from the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use can add dynamic and master here. But then also please update the valid values for the endpoints to also accept dynamic (without removing bmca, but add deprecated in the description for bmca). Dynamic == bmca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added new valid value dynamic
updated the change in description.
...llections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/custom-ptp-profile.cfg
Outdated
Show resolved
Hide resolved
# Apply PTP profile config | ||
if self.shared_utils.ptp_enabled: | ||
ptp_config.update(self.shared_utils.ptp_profile) | ||
|
||
ptp_config["enable"] = True | ||
|
||
if get(p2p_link, "role") != "bmca": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it means default role is master which is not correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw similar logic in connected_endpoints.utils.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have different assumptions for endpoints and p2p links.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic behaves different than the schema says. The schema says the default is "bmca", but your logic requires "bmca" to be set directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed bmca to dynamic and corrected the default output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add test coverage in eos_designs_unit_tests
scenario
cf1360c
to
6b67c93
Compare
Added. |
6b67c93
to
fee17c7
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
fee17c7
to
de3c1d7
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
ab63faf
to
50527f8
Compare
282d4fd
to
6e97b70
Compare
@@ -135,11 +135,13 @@ $defs: | |||
default: false | |||
endpoint_role: | |||
type: str | |||
description: Set `dynamic` instead of `bmca`(deprecated). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: Set `dynamic` instead of `bmca`(deprecated). | |
description: |- | |
PTP role of the endpoint. | |
`follower` will configure the switch port as `ptp role master`. | |
`dynamic` will use BMCA. | |
`default` is deprecated in favor of `follower`. | |
`bmca` is deprecated in favor of `dynamic`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the description.
- "bmca" | ||
- "default" | ||
- "follower" | ||
- "dynamic" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's reorder so default is first and deprecated is last.
- "bmca" | |
- "default" | |
- "follower" | |
- "dynamic" | |
- "follower" | |
- "dynamic" | |
- "bmca" | |
- "default" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
python-avd/pyavd/_eos_designs/structured_config/connected_endpoints/utils.py
Outdated
Show resolved
Hide resolved
@@ -132,6 +132,20 @@ $defs: | |||
type: bool | |||
default: false | |||
description: Enable PTP. | |||
role: | |||
type: str | |||
description: EOS default is `dynamic`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is applied on a link with two ends, it would not make sense to use "master" on both ends. We need to change this to a list similar to the ip_addresses etc. and then apply it on each device based on the index.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…oints/utils.py Co-authored-by: Claus Holbech <[email protected]>
1a29ea4
to
b508d37
Compare
for more information, see https://pre-commit.ci
Quality Gate passedIssues Measures |
Change Summary
Improve
ptp
settings forp2p_links
Related Issue(s)
Fixes #2698
Component(s) name
arista.avd.eos_designs
Proposed changes
PTP knobs are available in connected_endpoints:
These would be valuable to have also in l3_edge p2p_links for L3 devices.
How to test
Checklist
User Checklist
Repository Checklist