Add redis db alias for easy accessing redis db#25600
Merged
eddieruan-alibaba merged 19 commits intosonic-net:masterfrom Mar 23, 2026
Merged
Add redis db alias for easy accessing redis db#25600eddieruan-alibaba merged 19 commits intosonic-net:masterfrom
eddieruan-alibaba merged 19 commits intosonic-net:masterfrom
Conversation
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Eddie Ruan <[email protected]>
03696bc to
46e69fb
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Eddie Ruan <[email protected]>
06e223b to
bf11dc7
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
Author
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Eddie Ruan <[email protected]>
What is the motivation for this PR When --client_auth cert is configured on the gNMI server, UDS connections fail auth because TLS peer creds are unavailable, blocking local services (e.g., device-ops-agent) from using gNMI/gNOI over UDS. How did you do it Updated sonic-gnmi submodule to include sonic-net/sonic-gnmi#617, adding a UDS detection check in authenticate() to skip cert auth for UDS (secured by socket permissions). How did you verify/test it On a device with --client_auth cert configured: $ sudo grpcurl -plaintext unix:///var/run/gnmi/gnmi.sock gnoi.system.System/Time {time: 1773163799143468772} Without sudo: permission denied at filesystem level. Unique Signed-off-by Signed-off-by: Dawei Huang <[email protected]> Signed-off-by: Eddie Ruan <[email protected]>
c889645 to
c16932c
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
selva-nexthop
approved these changes
Mar 19, 2026
asechoud
reviewed
Mar 19, 2026
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Eddie Ruan <[email protected]>
Signed-off-by: Eddie Ruan <[email protected]>
7ab9f88 to
a52d37b
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
asechoud
approved these changes
Mar 19, 2026
ashwnsri
reviewed
Mar 20, 2026
Signed-off-by: Eddie Ruan <[email protected]>
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Eddie Ruan <[email protected]>
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
ashwnsri
approved these changes
Mar 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
As we enable multi db in redis, it is not easy to use redis-cli to check redis for a targeted db. We need to check codes to get redis port number.
Create a set of aliases which would use swsscommon python script to receive db's port and id. This set of aliases would work for both cases.
Work item tracking
How I did it
Use swsscommon python script to get used redis db port and id
How to verify it
admin@PE3:
$ alias$ redis-appdbalias ls='ls --color=auto'
alias redis-appdb='redis-cli -n 0 -p 6378'
alias redis-asicdb='redis-cli -n 1 -p 6377'
alias redis-configdb='redis-cli -n 4 -p 6379'
alias redis-counterdb='redis-cli -n 2 -p 6376'
alias redis-flexcounterdb='redis-cli -n 5 -p 6376'
alias redis-logleveldb='redis-cli -n 3 -p 6379'
alias redis-statedb='redis-cli -n 6 -p 6379'
alias redis-sysmondb='redis-cli -n 10 -p 6379'
admin@PE3:
127.0.0.1:6378> exit
admin@PE3:
$ redis-asicdb$ redis-configdb127.0.0.1:6377[1]> exit
admin@PE3:
127.0.0.1:6379[4]> exit
admin@PE3:
$ redis-counterdb$ redis-flexcounterdb127.0.0.1:6376[2]> exit
admin@PE3:
127.0.0.1:6376[5]> exit
admin@PE3:~$ redis-logleveldb
127.0.0.1:6379[3]> exit
admin@PE3:
$ redis-statedb$ redis-sysmondb127.0.0.1:6379[6]> exit
admin@PE3:
127.0.0.1:6379[10]> exit
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)