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

Feat(eos_cli_config_gen): Add support for grpc-tunnel #2696

Merged
merged 17 commits into from
Apr 28, 2023

Conversation

adietrich-ussignal
Copy link
Contributor

@adietrich-ussignal adietrich-ussignal commented Apr 4, 2023

Change Summary

Add grpc-tunnel to the management api gnmi data model.

Related Issue(s)

Fixes #2665

Component(s) name

arista.avd.eos_cli_config_gen

Proposed changes

This change adds the grpc-tunnel configuration settings to the management api gnmi data model. Allows for the creation of multiple tunnels, and multiple target_ids per tunnel as is permitted by EOS. Multiple target_ids can be separated by a space.

This configuration is only valid as of EOS 4.27.0F.

Added the following to schema management_api_gnmi

management_api_gnmi:
[...]
          grpc_tunnels:
            type: list
            items:
              type: dict
              keys:
                name:
                  type: str
                  description: Transport name
                shutdown:
                  type: bool
                  description: Operational status of the gRPC tunnel
                tunnel_ssl_profile:
                  type: str
                  description: Tunnel SSL profile name
                gnmi_ssl_profile:
                  type: str
                  description: gNMI SSL profile name
                vrf:
                  type: str
                  description: VRF name is optional
                destination:
                  type: dict
                  keys:
                    address:
                      type: str
                      description: IP address or hostname
                    port:
                      type: int
                      min: 1
                      max: 65535
                      convert_types:
                      - str
                      description: TCP Port
                local_interface:
                  type: dict
                  keys:
                    interface:
                      type: str
                      description: Interface name
                    port:
                      type: int
                      min: 1
                      max: 65535
                      convert_types:
                      - str
                      description: TCP Port
                target:
                  type: dict
                  keys:
                    use_serial_number:
                      type: bool
                      description: Use serial number as the Target ID
                    target_id:
                      type: str
                      description: |
                        Target IDs as a string. More than one Target ID can be specified.
                        Examples:
                        - "id1 id2 id3"
                        - "id1"

How to test

Ran the pre-commit on changes to the schema and Jinja2 templates for both EOS and Documentation.
Added tests to the eos_cli_config_gen molecule using management-gnmi-grpc-tunnel.yml.

Checklist

User Checklist

  • Pre-Commit Check
  • eos_cli_config_gen Molecule test

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)

@adietrich-ussignal adietrich-ussignal requested a review from a team as a code owner April 4, 2023 13:08
@github-actions github-actions bot added role: eos_cli_config_gen issue related to eos_cli_config_gen role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated labels Apr 4, 2023
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.

Thanks a lot for this PR! Very complete implementation.

I have added a couple of comments mostly around adding constraints in the schema, that will make for simpler jinja templates and cleaning up a bit of extra lines in the documentation.

Do not hesitate to ask questions / precisions

For reference:

Leaf1(config-grpc-tunnel-transport-BLAH)#show cli commands
APPEND [ COMMENT ]
[no|default] comment
[no|default] destination HOST port PORT
do CMD
exit
[no|default] gnmi ssl profile PROFILE
[no|default] local interface INTF [ port PORT ]
show active
show active all [ detail ]
show comment
[no|default] shutdown
[no|default] target ( serial-number | TARGET_ID )
[no|default] tunnel ssl profile PROFILE
[no|default] vrf VRF

@adietrich-ussignal
Copy link
Contributor Author

I appreciate the quick review!

I added changes in-line with what was requested. Took a bit to work out the whitespace details, but I think I got it this time.

@adietrich-ussignal
Copy link
Contributor Author

You left quite a few comments so GitHub hid some of them. I think they are all covered now :)

@gmuloc gmuloc requested a review from a team April 5, 2023 13:16
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.

Thanks for the fast update - a couple new comments regarding the remaining extra blank line and the useless check for name

Comment on lines 41 to 43
{% if transport.name is arista.avd.defined %}
transport grpc-tunnel {{ transport.name }}
{% endif %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this one still needs to be addressed!

@adietrich-ussignal
Copy link
Contributor Author

I appreciate the patience and continual feedback! It appears, to my eye, that the spacing is fixed on the documentation.

@gmuloc gmuloc requested a review from a team April 6, 2023 08:08
@gmuloc gmuloc added this to the v4.0.0-dev10 milestone Apr 6, 2023
port: 10001
target:
use_serial_number: true
target_id: testid1 testid2
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this be better as a list that we then join on white space?

Copy link
Member

Choose a reason for hiding this comment

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

  • +1, this should be a list and renamed to target_ids

@gmuloc
Copy link
Contributor

gmuloc commented Apr 19, 2023

@adietrich-ussignal - would you have some time to look at the latest review comments on this PR - we would love to include it in the next dev release or the one just after! Let us know if you need some help on addressing them!

@adietrich-ussignal
Copy link
Contributor Author

I'll review the comments and push commits on this issue tomorrow.

adietrich-ussignal and others added 2 commits April 22, 2023 19:05
…s/schema_fragments/management_api_gnmi.schema.yml

Co-authored-by: Guillaume Mulocher <gmulocher@arista.com>
@github-actions github-actions bot added role: eos_config_deploy_cvp issue related to eos_config_deploy_cvp role role: eos_designs issue related to eos_designs role type: code quality CI and development toolset type: documentation Improvements or additions to documentation type: Python filters labels Apr 22, 2023
@adietrich-ussignal
Copy link
Contributor Author

Having some issues getting the proper commits amidst the other changes. I would greatly appreciate some guidance to resolve.

@adietrich-ussignal adietrich-ussignal changed the base branch from devel to releases/v1.0.x April 23, 2023 00:06
@adietrich-ussignal adietrich-ussignal changed the base branch from releases/v1.0.x to devel April 23, 2023 00:06
@github-actions github-actions bot removed type: Python filters type: code quality CI and development toolset type: documentation Improvements or additions to documentation role: eos_config_deploy_cvp issue related to eos_config_deploy_cvp role labels Apr 23, 2023
@github-actions github-actions bot removed the role: eos_designs issue related to eos_designs role label Apr 24, 2023
@gmuloc
Copy link
Contributor

gmuloc commented Apr 24, 2023

Having some issues getting the proper commits amidst the other changes. I would greatly appreciate some guidance to resolve.

Hi @adietrich-ussignal - fixed the things going on with schema.
I took the liberty to add the items key in the schema for target_ids and also to modify a bit the documentation template as it was failing if no destination was given or if no target was given.

@adietrich-ussignal
Copy link
Contributor Author

Thanks @gmuloc! Learned a lot through this one and by reviewing your latest code revision.

Copy link
Member

@carlbuchmann carlbuchmann left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this great contribution @adietrich-ussignal

@carlbuchmann carlbuchmann merged commit 19d0b2c into aristanetworks:devel Apr 28, 2023
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn: Feat(eos_cli_config_gen) role: eos_cli_config_gen issue related to eos_cli_config_gen role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat(eos_cli_config_gen): Add 'transport grpc-tunnel' to 'management api gnmi' configuration
4 participants