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

WIP: add the built-in methods to enhance Klish performance #73

Closed
wants to merge 1 commit into from

Conversation

kwangsuk
Copy link
Contributor

@kwangsuk kwangsuk commented Nov 5, 2020

NOTE: this PR has build dependency -
sonic-net/sonic-buildimage#5920 and #72 in this sequence.

Add two built-in methods for performance enhancement as part of mgmt-framework CLI enhancement:

CLI built-in functions "clish_pyobj" and "clish_restcl" can be use to reduce time taken to execute a command by eliminating the sub-shell interpreter overhead.

  • The “clish_restcl” method uses libcurl to make REST client call from actioner. The GET operation is not supported as we currently don't handle rendering using jinja templates.
    e.g.
    oper=PATCH url=/restconf/data/openconfig-interfaces:interfaces/interface=Vlan${vlan-id}/config body={"openconfig-interfaces:config": {"name": "Vlan${vlan-id}"}}

  • The “clish_pyobj” uses embedding Python to execute the Python scripts to make REST client call via Request package.
    e.g.
    sonic_cli_if patch_openconfig_interfaces_interfaces_interface_config Vlan${vlan-id}

@kwangsuk kwangsuk changed the title add the built-in methods to enhance Klish performance WIP: add the built-in methods to enhance Klish performance Nov 5, 2020
@sachinholla
Copy link
Contributor

Hi @kwangsuk, I have closed buildimage PR #5810 since buster already has libcjson pacakge.

Also, I am not sure if the mgmt-framework PR builds use sonic-slave-buster/Dokcerfile.j2 to setup their environment. If the PR build fails again, please add an entry in sonic-mgmt-framework/tools/test/apt_requirements.txt file. Mgmt framework PR build script installs all the packages listed there.

Copy link
Contributor

@faraazbrcm faraazbrcm left a comment

Choose a reason for hiding this comment

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

@kwangsuk -- Will this change work with python3?. we need to run actioners/renderers using python3.

@kwangsuk
Copy link
Contributor Author

@kwangsuk -- Will this change work with python3?. we need to run actioners/renderers using python3.

@faraazbrcm -- This change does not include python3 support yet. A new PR will be opened for python3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants