[docker-ptf] Build and add gnmi_get#4720
Conversation
dockers/docker-ptf/Dockerfile.j2
Outdated
| && mkdir $HOME/go \ | ||
| && export GOPATH=$HOME/go \ | ||
| && go env \ | ||
| && go get github.com/jipanyang/gnxi/gnmi_get \ |
There was a problem hiding this comment.
why from jipan? I do not think we can rely on his personal project for our testing.
There was a problem hiding this comment.
gnmi_get
-xpath_target CONFIG_DB
-xpath "/system/openflow/agent/config/datapath-id"
-xpath "/system/openflow/controllers/controller[name=main]/connections/connection[aux-id=0]/state/address"
-target_addr localhost:10161
-target_name hostname.com
-key client.key
-cert client.crt
-ca ca.crt
-username foo
-password bar
-alsologtostderr
Sonic gnmi has special parameter "xpath_target" which is not available in official tool. SO the community has been using the private version so far. We can propose to back port to master, which will take time. I think before that, we can use this private branch instead of forking the source code to sonic telemetry repro.
daall
left a comment
There was a problem hiding this comment.
LGTM pending the discussion about which gnmi branch to use
dockers/docker-ptf/Dockerfile.j2
Outdated
| && mkdir /etc/go \ | ||
| && export GOPATH=/etc/go \ | ||
| && rm go$VERSION.linux-*.tar.gz \ | ||
| && go get github.com/jipanyang/gnxi/gnmi_get \ |
There was a problem hiding this comment.
use py_gnmicli.py from https://github.com/lguohan/gnxi/blob/master/gnmi_cli_py/py_gnmicli.py
There was a problem hiding this comment.
added py_gnmi.py
^[[0m^[[91m2020-07-08 05:39:25 (1.80 MB/s) - 'py_gnmicli.py' saved [203888]
^[[0mtotal 300
-rw-r--r-- 1 root root 970 Jul 8 05:39 CONTRIBUTING.md
-rw-r--r-- 1 root root 11357 Jul 8 05:39 LICENSE
-rw-r--r-- 1 root root 2302 Jul 8 05:39 README.md
drwxr-xr-x 2 root root 4096 Jul 8 05:39 certs
-rw-r--r-- 1 root root 573 Jul 8 05:39 doc.go
drwxr-xr-x 3 root root 4096 Jul 8 05:39 gnmi
drwxr-xr-x 2 root root 4096 Jul 8 05:39 gnmi_capabilities
drwxr-xr-x 2 root root 4096 Jul 8 05:39 gnmi_cli_py
lguohan
left a comment
There was a problem hiding this comment.
use py_gnmicli.py from https://github.com/lguohan/gnxi/blob/master/gnmi_cli_py/py_gnmicli.py
| && cd /etc/go \ | ||
| && git clone https://github.com/google/gnxi.git \ | ||
| && cd /etc/go/gnxi \ | ||
| && wget https://github.com/lguohan/gnxi/blob/master/gnmi_cli_py/py_gnmicli.py \ |
There was a problem hiding this comment.
this is python, so you do not need to install go lang.
here is what you should do:
- git clone https://github.com/lguohan/gnxi/tree/master/gnmi_cli_py and check out specific commit id. d01b36e
- follow instructions https://github.com/lguohan/gnxi/tree/master/gnmi_cli_py to install required tools.
There was a problem hiding this comment.
@lguohan: Do you plan to open a PR to upstream your patch?
|
Suggest creating a new PR for add python tool |
|
Creating a separate PR to build pyclient. |
Download go package
set up required variables
go get gnmi_get to fetch gnmi_get
- Why I did it
For telemetry regression test we need gnmi_get(gnmi client) to be present on ptfdocker. Gnmi-server will be present on SONiC DuT. Further, we can access gnmi_get from ptfdocker inside pytest to verify gnmi server streaming data successfully or not.
- How I did it
Added changes to Dockerfile.j2 for ptfdocker
- How to verify it
Build logs under target/docker-ptf.gz.log. Logs show :
- wget has been success with go.tgz
- output of go env showing mandatory variables set up
- output of ls -l /$HOME/go shows gnmi_get present. This verified go get step has been sucessful
^[[0m^[[91m2020-06-06 01:47:33 (84.5 MB/s) - 'go.tgz' saved [127228112/127228112]^[[0mgo version go1.12 linux/amd64
**- Description for the changelog**GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build618910343=/tmp/go-build -gno-record-gcc-switches"
total 14752
-rwxr-xr-x 1 root root 15105819 Jun 6 01:48 gnmi_get
Removing intermediate container b14979f76937
---> 3675ea45711a
Step 17/19 : EXPOSE 22 8009
---> Running in 9120160a690f
- A picture of a cute animal (not mandatory but encouraged)