diff --git a/Makefile b/Makefile index c3a7ea14..0d83360b 100644 --- a/Makefile +++ b/Makefile @@ -25,10 +25,10 @@ GO_DEPS := vendor/.done PATCHES := $(wildcard patches/*.patch) PATCHES += $(shell find $(MGMT_COMMON_DIR)/patches -type f) -all: sonic-telemetry $(TELEMETRY_TEST_BIN) +all: sonic-gnmi $(TELEMETRY_TEST_BIN) go.mod: - $(GO) mod init github.com/Azure/sonic-telemetry + $(GO) mod init github.com/sonic-net/sonic-gnmi $(GO_DEPS): go.mod $(PATCHES) $(GO) mod vendor @@ -48,22 +48,31 @@ go-deps: $(GO_DEPS) go-deps-clean: $(RM) -r vendor -sonic-telemetry: $(GO_DEPS) - $(GO) install -mod=vendor $(BLD_FLAGS) github.com/Azure/sonic-telemetry/telemetry - $(GO) install -mod=vendor $(BLD_FLAGS) github.com/Azure/sonic-telemetry/dialout/dialout_client_cli +sonic-gnmi: $(GO_DEPS) +ifeq ($(CROSS_BUILD_ENVIRON),y) + $(GO) build -o ${GOBIN}/telemetry -mod=vendor $(BLD_FLAGS) github.com/sonic-net/sonic-gnmi/telemetry + $(GO) build -o ${GOBIN}/dialout_client_cli -mod=vendor $(BLD_FLAGS) github.com/sonic-net/sonic-gnmi/dialout/dialout_client_cli + $(GO) build -o ${GOBIN}/gnmi_get -mod=vendor github.com/jipanyang/gnxi/gnmi_get + $(GO) build -o ${GOBIN}/gnmi_set -mod=vendor github.com/jipanyang/gnxi/gnmi_get + $(GO) build -o ${GOBIN}/gnmi_cli -mod=vendor github.com/openconfig/gnmi/cmd/gnmi_cli + $(GO) build -o ${GOBIN}/gnoi_client -mod=vendor $(BLD_FLAGS) github.com/sonic-net/sonic-gnmi/gnoi_client +else + $(GO) install -mod=vendor $(BLD_FLAGS) github.com/sonic-net/sonic-gnmi/telemetry + $(GO) install -mod=vendor $(BLD_FLAGS) github.com/sonic-net/sonic-gnmi/dialout/dialout_client_cli $(GO) install -mod=vendor github.com/jipanyang/gnxi/gnmi_get $(GO) install -mod=vendor github.com/jipanyang/gnxi/gnmi_set $(GO) install -mod=vendor github.com/openconfig/gnmi/cmd/gnmi_cli - $(GO) install -mod=vendor github.com/Azure/sonic-telemetry/gnoi_client + $(GO) install -mod=vendor github.com/sonic-net/sonic-gnmi/gnoi_client +endif check: sudo mkdir -p ${DBDIR} sudo cp ./testdata/database_config.json ${DBDIR} sudo mkdir -p /usr/models/yang || true sudo find $(MGMT_COMMON_DIR)/models -name '*.yang' -exec cp {} /usr/models/yang/ \; - sudo $(GO) test -coverprofile=coverage-config.txt -covermode=atomic -v github.com/Azure/sonic-telemetry/sonic_db_config - sudo $(GO) test -coverprofile=coverage-gnmi.txt -covermode=atomic -mod=vendor $(BLD_FLAGS) -v github.com/Azure/sonic-telemetry/gnmi_server - sudo $(GO) test -coverprofile=coverage-dialcout.txt -covermode=atomic -mod=vendor $(BLD_FLAGS) -v github.com/Azure/sonic-telemetry/dialout/dialout_client + sudo $(GO) test -coverprofile=coverage-config.txt -covermode=atomic -v github.com/sonic-net/sonic-gnmi/sonic_db_config + sudo $(GO) test -coverprofile=coverage-gnmi.txt -covermode=atomic -mod=vendor $(BLD_FLAGS) -v github.com/sonic-net/sonic-gnmi/gnmi_server + sudo $(GO) test -coverprofile=coverage-dialcout.txt -covermode=atomic -mod=vendor $(BLD_FLAGS) -v github.com/sonic-net/sonic-gnmi/dialout/dialout_client $(GO) get github.com/axw/gocov/... $(GO) get github.com/AlekSi/gocov-xml gocov convert coverage-*.txt | gocov-xml -source $(shell pwd) > coverage.xml @@ -76,7 +85,7 @@ clean: $(TELEMETRY_TEST_BIN): $(TEST_FILES) $(SRC_FILES) mkdir -p $(@D) cp -r testdata $(@D)/ - $(GO) test -mod=vendor $(BLD_FLAGS) -c -cover github.com/Azure/sonic-telemetry/gnmi_server -o $@ + $(GO) test -mod=vendor $(BLD_FLAGS) -c -cover github.com/sonic-net/sonic-gnmi/gnmi_server -o $@ install: $(INSTALL) -D $(BUILD_DIR)/telemetry $(DESTDIR)/usr/sbin/telemetry diff --git a/README.md b/README.md index 74925aba..59105d04 100644 --- a/README.md +++ b/README.md @@ -15,22 +15,22 @@ Install __go__ in your system https://golang.org/doc/install. Requires golang1.8 To install dial-in mode system telemetry server, run - go get -u github.com/Azure/sonic-telemetry/telemetry + go get -u github.com/sonic-net/sonic-gnmi/telemetry To install dial-out mode system telemetry client, run - go get -u github.com/Azure/sonic-telemetry/dialout/dialout_client_cli + go get -u github.com/sonic-net/sonic-gnmi/dialout/dialout_client_cli There is also a test program dialout_server_cli for collecting data from dial-out mode system telemetry client. _Note_: it is for testing purpose only. - go get -u github.com/Azure/sonic-telemetry/dialout/dialout_server_cli + go get -u github.com/sonic-net/sonic-gnmi/dialout/dialout_server_cli The binaries will be installed under $GOPATH/bin/, they may be copied to any SONiC switch and run there. You can also build a debian package and install it: - git clone https://github.com/Azure/sonic-telemetry.git - pushd sonic-telemetry + git clone https://github.com/sonic-net/sonic-gnmi.git + pushd sonic-gnmi dpkg-buildpackage -rfakeroot -b -us -uc popd diff --git a/debian/changelog b/debian/changelog index 77dab629..5cf0f0d6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -sonic-telemetry (0.1) UNRELEASED; urgency=medium +sonic-gnmi (0.1) UNRELEASED; urgency=medium * Initial release. diff --git a/debian/control b/debian/control index 932a1b84..a5b681e5 100644 --- a/debian/control +++ b/debian/control @@ -1,16 +1,16 @@ -Source: sonic-telemetry +Source: sonic-gnmi Section: devel Priority: optional Maintainer: Jipan Yang Build-Depends: debhelper (>= 8.0.0), Standards-Version: 3.9.3 -Homepage: https://github.com/Azure/sonic-telemetry -XS-Go-Import-Path: github.com/Azure/sonic-telemetry +Homepage: https://github.com/sonic-net/sonic-gnmi +XS-Go-Import-Path: github.com/sonic-net/sonic-gnmi -Package: sonic-telemetry +Package: sonic-gnmi Architecture: any Built-Using: ${misc:Built-Using} Depends: ${misc:Depends}, ${shlibs:Depends} -Description: SONiC telemetry - sonic-telemetry +Description: SONiC gNMI + sonic-gnmi diff --git a/dialout/dialout_client/dialout_client.go b/dialout/dialout_client/dialout_client.go index 451a4c10..86fdf70c 100644 --- a/dialout/dialout_client/dialout_client.go +++ b/dialout/dialout_client/dialout_client.go @@ -5,9 +5,9 @@ import ( "crypto/tls" "errors" "fmt" - spb "github.com/Azure/sonic-telemetry/proto" - sdc "github.com/Azure/sonic-telemetry/sonic_data_client" - sdcfg "github.com/Azure/sonic-telemetry/sonic_db_config" + spb "github.com/sonic-net/sonic-gnmi/proto" + sdc "github.com/sonic-net/sonic-gnmi/sonic_data_client" + sdcfg "github.com/sonic-net/sonic-gnmi/sonic_db_config" "github.com/go-redis/redis" log "github.com/golang/glog" gpb "github.com/openconfig/gnmi/proto/gnmi" diff --git a/dialout/dialout_client/dialout_client_test.go b/dialout/dialout_client/dialout_client_test.go index 1a8b76eb..9b9c3441 100644 --- a/dialout/dialout_client/dialout_client_test.go +++ b/dialout/dialout_client/dialout_client_test.go @@ -8,7 +8,7 @@ import ( "encoding/json" "github.com/go-redis/redis" //"github.com/golang/protobuf/proto" - testcert "github.com/Azure/sonic-telemetry/testdata/tls" + testcert "github.com/sonic-net/sonic-gnmi/testdata/tls" //"github.com/kylelemons/godebug/pretty" //"github.com/openconfig/gnmi/client" @@ -28,9 +28,9 @@ import ( "testing" "time" - sds "github.com/Azure/sonic-telemetry/dialout/dialout_server" - sdc "github.com/Azure/sonic-telemetry/sonic_data_client" - sdcfg "github.com/Azure/sonic-telemetry/sonic_db_config" + sds "github.com/sonic-net/sonic-gnmi/dialout/dialout_server" + sdc "github.com/sonic-net/sonic-gnmi/sonic_data_client" + sdcfg "github.com/sonic-net/sonic-gnmi/sonic_db_config" gclient "github.com/openconfig/gnmi/client/gnmi" ) diff --git a/dialout/dialout_client_cli/dialout_client_cli.go b/dialout/dialout_client_cli/dialout_client_cli.go index d8d9014d..de8b5033 100644 --- a/dialout/dialout_client_cli/dialout_client_cli.go +++ b/dialout/dialout_client_cli/dialout_client_cli.go @@ -4,7 +4,7 @@ package main import ( "crypto/tls" "flag" - dc "github.com/Azure/sonic-telemetry/dialout/dialout_client" + dc "github.com/sonic-net/sonic-gnmi/dialout/dialout_client" log "github.com/golang/glog" gpb "github.com/openconfig/gnmi/proto/gnmi" "golang.org/x/net/context" diff --git a/dialout/dialout_server/dialout_server.go b/dialout/dialout_server/dialout_server.go index f5d34d0b..4fbde056 100644 --- a/dialout/dialout_server/dialout_server.go +++ b/dialout/dialout_server/dialout_server.go @@ -3,7 +3,7 @@ package dialout_server import ( "errors" "fmt" - spb "github.com/Azure/sonic-telemetry/proto" + spb "github.com/sonic-net/sonic-gnmi/proto" log "github.com/golang/glog" "github.com/google/gnxi/utils" gpb "github.com/openconfig/gnmi/proto/gnmi" diff --git a/dialout/dialout_server_cli/dialout_server_cli.go b/dialout/dialout_server_cli/dialout_server_cli.go index 02b9cee0..f3ad5ba6 100644 --- a/dialout/dialout_server_cli/dialout_server_cli.go +++ b/dialout/dialout_server_cli/dialout_server_cli.go @@ -10,8 +10,8 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials" - ds "github.com/Azure/sonic-telemetry/dialout/dialout_server" - testcert "github.com/Azure/sonic-telemetry/testdata/tls" + ds "github.com/sonic-net/sonic-gnmi/dialout/dialout_server" + testcert "github.com/sonic-net/sonic-gnmi/testdata/tls" ) var ( diff --git a/gnmi_server/basicAuth.go b/gnmi_server/basicAuth.go index 97be2bc9..78330ac4 100644 --- a/gnmi_server/basicAuth.go +++ b/gnmi_server/basicAuth.go @@ -1,7 +1,7 @@ package gnmi import ( - "github.com/Azure/sonic-telemetry/common_utils" + "github.com/sonic-net/sonic-gnmi/common_utils" "github.com/golang/glog" "golang.org/x/net/context" "google.golang.org/grpc/codes" diff --git a/gnmi_server/clientCertAuth.go b/gnmi_server/clientCertAuth.go index b25fb5ce..1c44d9c5 100644 --- a/gnmi_server/clientCertAuth.go +++ b/gnmi_server/clientCertAuth.go @@ -1,7 +1,7 @@ package gnmi import ( - "github.com/Azure/sonic-telemetry/common_utils" + "github.com/sonic-net/sonic-gnmi/common_utils" "github.com/golang/glog" "golang.org/x/net/context" "google.golang.org/grpc/codes" diff --git a/gnmi_server/client_subscribe.go b/gnmi_server/client_subscribe.go index c1bf22e0..4ce797dc 100644 --- a/gnmi_server/client_subscribe.go +++ b/gnmi_server/client_subscribe.go @@ -11,7 +11,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" - sdc "github.com/Azure/sonic-telemetry/sonic_data_client" + sdc "github.com/sonic-net/sonic-gnmi/sonic_data_client" gnmipb "github.com/openconfig/gnmi/proto/gnmi" ) diff --git a/gnmi_server/gnoi.go b/gnmi_server/gnoi.go index 08f1ace0..66f6f58f 100644 --- a/gnmi_server/gnoi.go +++ b/gnmi_server/gnoi.go @@ -5,9 +5,9 @@ import ( gnoi_system_pb "github.com/openconfig/gnoi/system" log "github.com/golang/glog" "time" - spb "github.com/Azure/sonic-telemetry/proto/gnoi" - transutil "github.com/Azure/sonic-telemetry/transl_utils" - spb_jwt "github.com/Azure/sonic-telemetry/proto/gnoi/jwt" + spb "github.com/sonic-net/sonic-gnmi/proto/gnoi" + transutil "github.com/sonic-net/sonic-gnmi/transl_utils" + spb_jwt "github.com/sonic-net/sonic-gnmi/proto/gnoi/jwt" "google.golang.org/grpc/status" "google.golang.org/grpc/codes" "os/user" diff --git a/gnmi_server/jwtAuth.go b/gnmi_server/jwtAuth.go index 7e3d9cd1..0b6c2187 100644 --- a/gnmi_server/jwtAuth.go +++ b/gnmi_server/jwtAuth.go @@ -1,7 +1,7 @@ package gnmi import ( - "github.com/Azure/sonic-telemetry/common_utils" + "github.com/sonic-net/sonic-gnmi/common_utils" "crypto/rand" jwt "github.com/dgrijalva/jwt-go" "github.com/golang/glog" @@ -9,7 +9,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" - spb "github.com/Azure/sonic-telemetry/proto/gnoi/jwt" + spb "github.com/sonic-net/sonic-gnmi/proto/gnoi/jwt" "time" ) diff --git a/gnmi_server/pamAuth.go b/gnmi_server/pamAuth.go index 682278a0..73ce1ed5 100644 --- a/gnmi_server/pamAuth.go +++ b/gnmi_server/pamAuth.go @@ -1,7 +1,7 @@ package gnmi import ( - "github.com/Azure/sonic-telemetry/common_utils" + "github.com/sonic-net/sonic-gnmi/common_utils" "errors" "github.com/golang/glog" "github.com/msteinert/pam" diff --git a/gnmi_server/server.go b/gnmi_server/server.go index 4b0a9e36..d6ba479f 100644 --- a/gnmi_server/server.go +++ b/gnmi_server/server.go @@ -6,7 +6,7 @@ import ( "net" "strings" "sync" - "github.com/Azure/sonic-telemetry/common_utils" + "github.com/sonic-net/sonic-gnmi/common_utils" log "github.com/golang/glog" "golang.org/x/net/context" "google.golang.org/grpc" @@ -16,13 +16,13 @@ import ( "google.golang.org/grpc/status" "github.com/golang/protobuf/proto" gnoi_system_pb "github.com/openconfig/gnoi/system" - sdc "github.com/Azure/sonic-telemetry/sonic_data_client" + sdc "github.com/sonic-net/sonic-gnmi/sonic_data_client" gnmipb "github.com/openconfig/gnmi/proto/gnmi" gnmi_extpb "github.com/openconfig/gnmi/proto/gnmi_ext" - spb_gnoi "github.com/Azure/sonic-telemetry/proto/gnoi" - spb "github.com/Azure/sonic-telemetry/proto" + spb_gnoi "github.com/sonic-net/sonic-gnmi/proto/gnoi" + spb "github.com/sonic-net/sonic-gnmi/proto" "github.com/Azure/sonic-mgmt-common/translib" - spb_jwt_gnoi "github.com/Azure/sonic-telemetry/proto/gnoi/jwt" + spb_jwt_gnoi "github.com/sonic-net/sonic-gnmi/proto/gnoi/jwt" "bytes" ) diff --git a/gnmi_server/server_test.go b/gnmi_server/server_test.go index 79205fe2..4365c45f 100644 --- a/gnmi_server/server_test.go +++ b/gnmi_server/server_test.go @@ -10,7 +10,7 @@ import ( "fmt" "strings" - testcert "github.com/Azure/sonic-telemetry/testdata/tls" + testcert "github.com/sonic-net/sonic-gnmi/testdata/tls" "github.com/go-redis/redis" "github.com/golang/protobuf/proto" @@ -35,10 +35,10 @@ import ( "google.golang.org/grpc/status" // Register supported client types. - spb "github.com/Azure/sonic-telemetry/proto" - sgpb "github.com/Azure/sonic-telemetry/proto/gnoi" - sdc "github.com/Azure/sonic-telemetry/sonic_data_client" - sdcfg "github.com/Azure/sonic-telemetry/sonic_db_config" + spb "github.com/sonic-net/sonic-gnmi/proto" + sgpb "github.com/sonic-net/sonic-gnmi/proto/gnoi" + sdc "github.com/sonic-net/sonic-gnmi/sonic_data_client" + sdcfg "github.com/sonic-net/sonic-gnmi/sonic_db_config" gclient "github.com/jipanyang/gnmi/client/gnmi" "github.com/jipanyang/gnxi/utils/xpath" gnoi_system_pb "github.com/openconfig/gnoi/system" diff --git a/gnoi_client/gnoi_client.go b/gnoi_client/gnoi_client.go index 3a049fcb..286ba50d 100644 --- a/gnoi_client/gnoi_client.go +++ b/gnoi_client/gnoi_client.go @@ -3,8 +3,8 @@ package main import ( "google.golang.org/grpc" gnoi_system_pb "github.com/openconfig/gnoi/system" - spb "github.com/Azure/sonic-telemetry/proto/gnoi" - spb_jwt "github.com/Azure/sonic-telemetry/proto/gnoi/jwt" + spb "github.com/sonic-net/sonic-gnmi/proto/gnoi" + spb_jwt "github.com/sonic-net/sonic-gnmi/proto/gnoi/jwt" "context" "os" "os/signal" diff --git a/go.mod b/go.mod index 87f3c6fc..2735d8e8 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/Azure/sonic-telemetry +module github.com/sonic-net/sonic-gnmi go 1.12 diff --git a/sonic_data_client/db_client.go b/sonic_data_client/db_client.go index 68fab01e..d03114ed 100644 --- a/sonic_data_client/db_client.go +++ b/sonic_data_client/db_client.go @@ -14,8 +14,8 @@ import ( log "github.com/golang/glog" - spb "github.com/Azure/sonic-telemetry/proto" - sdcfg "github.com/Azure/sonic-telemetry/sonic_db_config" + spb "github.com/sonic-net/sonic-gnmi/proto" + sdcfg "github.com/sonic-net/sonic-gnmi/sonic_db_config" "github.com/Workiva/go-datastructures/queue" "github.com/go-redis/redis" gnmipb "github.com/openconfig/gnmi/proto/gnmi" diff --git a/sonic_data_client/non_db_client.go b/sonic_data_client/non_db_client.go index 12336a68..c6906c6d 100644 --- a/sonic_data_client/non_db_client.go +++ b/sonic_data_client/non_db_client.go @@ -9,7 +9,7 @@ import ( "gopkg.in/yaml.v2" - spb "github.com/Azure/sonic-telemetry/proto" + spb "github.com/sonic-net/sonic-gnmi/proto" "github.com/Workiva/go-datastructures/queue" linuxproc "github.com/c9s/goprocinfo/linux" log "github.com/golang/glog" diff --git a/sonic_data_client/transl_data_client.go b/sonic_data_client/transl_data_client.go index f2715072..667287bf 100644 --- a/sonic_data_client/transl_data_client.go +++ b/sonic_data_client/transl_data_client.go @@ -2,8 +2,8 @@ package client import ( - spb "github.com/Azure/sonic-telemetry/proto" - transutil "github.com/Azure/sonic-telemetry/transl_utils" + spb "github.com/sonic-net/sonic-gnmi/proto" + transutil "github.com/sonic-net/sonic-gnmi/transl_utils" log "github.com/golang/glog" "github.com/golang/protobuf/proto" gnmipb "github.com/openconfig/gnmi/proto/gnmi" @@ -14,7 +14,7 @@ import ( "fmt" "reflect" "github.com/Azure/sonic-mgmt-common/translib" - "github.com/Azure/sonic-telemetry/common_utils" + "github.com/sonic-net/sonic-gnmi/common_utils" "bytes" "encoding/json" "context" diff --git a/telemetry/telemetry.go b/telemetry/telemetry.go index 2733adfe..8cce7947 100644 --- a/telemetry/telemetry.go +++ b/telemetry/telemetry.go @@ -12,8 +12,8 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials" - gnmi "github.com/Azure/sonic-telemetry/gnmi_server" - testcert "github.com/Azure/sonic-telemetry/testdata/tls" + gnmi "github.com/sonic-net/sonic-gnmi/gnmi_server" + testcert "github.com/sonic-net/sonic-gnmi/testdata/tls" ) var ( diff --git a/transl_utils/transl_utils.go b/transl_utils/transl_utils.go index 8b3009d1..4c0503c7 100644 --- a/transl_utils/transl_utils.go +++ b/transl_utils/transl_utils.go @@ -8,7 +8,7 @@ import ( log "github.com/golang/glog" gnmipb "github.com/openconfig/gnmi/proto/gnmi" "github.com/Azure/sonic-mgmt-common/translib" - "github.com/Azure/sonic-telemetry/common_utils" + "github.com/sonic-net/sonic-gnmi/common_utils" "context" "log/syslog" "github.com/Azure/sonic-mgmt-common/translib/tlerr"