Support new gnmi config interface in telemetry container.#7
Support new gnmi config interface in telemetry container.#7ganglyu merged 15 commits intosonic-net:masterfrom ganglyu:config_support
Conversation
|
|
||
| container: | ||
| image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster:latest | ||
| image: sonicdev-microsoft.azurecr.io:443/sonic-slave-bullseye:latest |
go.mod
Outdated
| github.com/Azure/sonic-mgmt-common v0.0.0-00010101000000-000000000000 | ||
| github.com/Workiva/go-datastructures v1.0.50 | ||
| github.com/agiledragon/gomonkey/v2 v2.8.0 | ||
| github.com/agiledragon/gomonkey/v2 v2.9.0 |
Makefile
Outdated
| TELEMETRY_TEST_BIN = $(TELEMETRY_TEST_DIR)/server.test | ||
| ifeq ($(ENABLE_TRANSLIB_WRITE),y) | ||
| BLD_FLAGS := -tags gnmi_translib_write | ||
| ifeq ($(ENABLE_NATIVE_WRITE),y) |
Makefile
Outdated
| patch -d vendor -p0 < patches/gnmi_cli.all.patch | ||
| patch -d vendor -p0 < patches/gnmi_set.patch | ||
| patch -d vendor -p0 < patches/gnmi_get.patch | ||
| patch -d vendor -p0 < patches/path.patch |
Makefile
Outdated
| $(GO) install -mod=vendor github.com/sonic-net/sonic-gnmi/gnmi_dump | ||
| endif | ||
|
|
||
| # TODO: Create a new repo for this lib, sonic-restapi and sonic-gnmi can share this lib |
| jwt "github.com/dgrijalva/jwt-go" | ||
| ) | ||
|
|
||
| func RebootSystem(fileName string) error { |
There was a problem hiding this comment.
Use reboot to implement "config reload", and please refer to: https://github.com/openconfig/gnoi/blob/main/system/system.proto#L131
gnmi_server/gnoi.go
Outdated
|
|
||
| func (srv *Server) Reboot(ctx context.Context, req *gnoi_system_pb.RebootRequest) (*gnoi_system_pb.RebootResponse, error) { | ||
| fileName := common_utils.GNMI_WORK_PATH + "/config_db.json.tmp" | ||
| //return nil, status.Errorf(codes.Unimplemented, "hit test point") |
gnmi_server/server.go
Outdated
|
|
||
| // Get implements the Get RPC in gNMI spec. | ||
| func (s *Server) Get(ctx context.Context, req *gnmipb.GetRequest) (*gnmipb.GetResponse, error) { | ||
| common_utils.IncCounter("GNMI get") |
Is it a placeholder function (with TODO comment)? or how did you cancel a reboot? In reply to: 1258650635 In reply to: 1258650635 In reply to: 1258650635 In reply to: 1258650635 In reply to: 1258650635 Refers to: gnmi_server/gnoi.go:66 in 71e5e09. [](commit_id = 71e5e09, deletion_comment = False) |
patches/path.patch
Outdated
| @@ -0,0 +1,37 @@ | |||
| --- ./github.com/jipanyang/gnxi/utils/xpath/path.go | |||
There was a problem hiding this comment.
Could you add some file level comment to explain why a patch is needed, and how do you achieve it?
ref: https://stackoverflow.com/a/20911434/2514803
sonic_data_client/events_client.go
Outdated
|
|
||
| rc, evt := C_recv_evt(evtc.subs_handle) | ||
| log.V(7).Infof("C.event_receive_wrap rc=%d evt:%s", rc, (*C.char)(str_ptr)) | ||
| log.V(7).Infof("C.event_receive_wrap rc=%d evt:%v", rc, (*C.char)(str_ptr)) |
| return | ||
| } | ||
| default: | ||
| log.V(1).Infof("Bad Subscription Mode for client %s ", c) |
| typedef void *db_connector_t; | ||
|
|
||
| // DBConnector::DBConnector(int db, std::string hostname, int port, unsigned int timeout) | ||
| db_connector_t db_connector_new(int db, const char *hostname, int port, unsigned int timeout); |
There was a problem hiding this comment.
Did you try SWIG?
http://zacg.github.io/blog/2013/06/06/calling-c-plus-plus-code-from-go-with-swig/ #Closed
|
This pull request introduces 1 alert when merging 81700b4 into 6b0253a - view on LGTM.com new alerts:
Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine ⚙️ that powers LGTM.com. For more information, please check out our post on the GitHub blog. |
|
/azp run sonic-net.sonic-gnmi |
|
Azure Pipelines successfully started running 1 pipeline(s). |
gnmi_server/server.go
Outdated
| } | ||
|
|
||
| func IsNativeOrigin(origin string) bool { | ||
| return origin == "sonic-db" || origin == "sonic-yang" |
gnmi_server/server.go
Outdated
| return origin, nil | ||
| } | ||
| for i, path := range paths { | ||
| if origin == "" { |
gnmi_server/server.go
Outdated
| return nil | ||
| } | ||
|
|
||
| func ParseOrigin(origin string, paths []*gnmipb.Path) (string, error) { |
|
/azp run sonic-net.sonic-gnmi |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run sonic-net.sonic-gnmi |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Why I did it Submodule update for sonic-gnmi Incorporates: 8226e46 Upgrade pipeline to use bullseye. (sonic-net/sonic-gnmi#58) ae72767 Add gnmi_dump tool for debug and unit test (sonic-net/sonic-gnmi#60) 6b0253a Add conditional check for split (sonic-net/sonic-gnmi#55) 99bfa8f Remove LOGLEVEL DB since is no longer used (sonic-net/sonic-gnmi#56) 54806a8 Support new gnmi config interface in telemetry container. (sonic-net/sonic-gnmi#7) How I did it Move submodule How to verify it Check build pipeline.
Why I did it Submodule update for sonic-gnmi Incorporates: 8226e46 Upgrade pipeline to use bullseye. (sonic-net/sonic-gnmi#58) ae72767 Add gnmi_dump tool for debug and unit test (sonic-net/sonic-gnmi#60) 6b0253a Add conditional check for split (sonic-net/sonic-gnmi#55) 99bfa8f Remove LOGLEVEL DB since is no longer used (sonic-net/sonic-gnmi#56) 54806a8 Support new gnmi config interface in telemetry container. (sonic-net/sonic-gnmi#7) How I did it Move submodule How to verify it Check build pipeline.
Why I did it Submodule update for sonic-gnmi Incorporates: 8226e46 Upgrade pipeline to use bullseye. (sonic-net/sonic-gnmi#58) ae72767 Add gnmi_dump tool for debug and unit test (sonic-net/sonic-gnmi#60) 6b0253a Add conditional check for split (sonic-net/sonic-gnmi#55) 99bfa8f Remove LOGLEVEL DB since is no longer used (sonic-net/sonic-gnmi#56) 54806a8 Support new gnmi config interface in telemetry container. (sonic-net/sonic-gnmi#7) How I did it Move submodule How to verify it Check build pipeline.
Signed-off-by: Gang Lv ganglv@microsoft.com
Why I did it
Update telemetry container to support new gnmi config interface.
How I did it
Use new target to support mixed schema, and we can enable/disable telemetry and gnmi config interface.
How to verify it
Build target and run unit test.
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)