cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
601
Views
5
Helpful
9
Replies

Issues using ydk gNMI docker

fredrik.gronlund
Beginner
Beginner

Hi, I have been having some issues using the gNMI parts of the YDK.
Because I run a non-Ubuntu Linux distro, I'm setting up a build env inside of the official YDK docker, which works OK. Running my code, I get the following error when running go vet:

go vet...# github.com/CiscoDevNet/ydk-go/gnmi/ydk/providers
/root/go/pkg/mod/github.com/!cisco!dev!net/ydk-go@v0.0.0-20191017213541-fac11668ff81/gnmi/ydk/providers/gnmi_provider.go:51:21: undefined: path.GnmiServiceProviderConnect
/root/go/pkg/mod/github.com/!cisco!dev!net/ydk-go@v0.0.0-20191017213541-fac11668ff81/gnmi/ydk/providers/gnmi_provider.go:62:2: undefined: path.GnmiServiceProviderDisconnect
/root/go/pkg/mod/github.com/!cisco!dev!net/ydk-go@v0.0.0-20191017213541-fac11668ff81/gnmi/ydk/providers/gnmi_provider.go:74:52: undefined: path.GnmiSession
/root/go/pkg/mod/github.com/!cisco!dev!net/ydk-go@v0.0.0-20191017213541-fac11668ff81/gnmi/ydk/providers/gnmi_provider.go:75:13: undefined: path.GnmiServiceProviderGetSession
/root/go/pkg/mod/github.com/!cisco!dev!net/ydk-go@v0.0.0-20191017213541-fac11668ff81/gnmi/ydk/providers/gnmi_provider.go:91:10: undefined: path.GnmiServiceGet
/root/go/pkg/mod/github.com/!cisco!dev!net/ydk-go@v0.0.0-20191017213541-fac11668ff81/gnmi/ydk/providers/gnmi_provider.go:105:9: undefined: path.ExecuteGnmiRPC
# github.com/CiscoDevNet/ydk-go/gnmi/ydk/services
/root/go/pkg/mod/github.com/!cisco!dev!net/ydk-go@v0.0.0-20191017213541-fac11668ff81/gnmi/ydk/services/gnmi_service.go:45:38: undefined: providers.GnmiServiceProvider
/root/go/pkg/mod/github.com/!cisco!dev!net/ydk-go@v0.0.0-20191017213541-fac11668ff81/gnmi/ydk/services/gnmi_service.go:51:18: undefined: path.ExecuteGnmiRPC
/root/go/pkg/mod/github.com/!cisco!dev!net/ydk-go@v0.0.0-20191017213541-fac11668ff81/gnmi/ydk/services/gnmi_service.go:55:9: undefined: operationSucceeded
/root/go/pkg/mod/github.com/!cisco!dev!net/ydk-go@v0.0.0-20191017213541-fac11668ff81/gnmi/ydk/services/gnmi_service.go:59:38: undefined: providers.GnmiServiceProvider
/root/go/pkg/mod/github.com/!cisco!dev!net/ydk-go@v0.0.0-20191017213541-fac11668ff81/gnmi/ydk/services/gnmi_service.go:64:18: undefined: path.ExecuteGnmiRPC
/root/go/pkg/mod/github.com/!cisco!dev!net/ydk-go@v0.0.0-20191017213541-fac11668ff81/gnmi/ydk/services/gnmi_service.go:71:47: undefined: providers.GnmiServiceProvider
/root/go/pkg/mod/github.com/!cisco!dev!net/ydk-go@v0.0.0-20191017213541-fac11668ff81/gnmi/ydk/services/gnmi_service.go:72:20: undefined: path.GnmiServiceGetCapabilities
/root/go/pkg/mod/github.com/!cisco!dev!net/ydk-go@v0.0.0-20191017213541-fac11668ff81/gnmi/ydk/services/gnmi_service.go:77:44: undefined: providers.GnmiServiceProvider
/root/go/pkg/mod/github.com/!cisco!dev!net/ydk-go@v0.0.0-20191017213541-fac11668ff81/gnmi/ydk/services/gnmi_service.go:94:14: undefined: path.GetSubscribeDataPayload
# github.com/CiscoDevNet/ydk-go/gnmi/ydk/path
/root/go/pkg/mod/github.com/!cisco!dev!net/ydk-go@v0.0.0-20191017213541-fac11668ff81/gnmi/ydk/path/gnmi_path.go:24:27: fatal error: ydk/ydk_gnmi.h: No such file or directory
 // #include <ydk/ydk_gnmi.h>
                           ^
compilation terminated.

I'm using the company build system, but in essence it just runs simple go commands, in this case "go vet".

Code is imported as follows (some unnecessary code removed:)

ackage upstream

import (
	"fmt"
	session "github.com/CiscoDevNet/ydk-go/gnmi/ydk/path"
	"github.com/CiscoDevNet/ydk-go/gnmi/ydk/providers"
	"github.com/CiscoDevNet/ydk-go/gnmi/ydk/services"
	"github.com/CiscoDevNet/ydk-go/ydk"
	"github.com/CiscoDevNet/ydk-go/ydk/types"
	"testing"
	"time"
)

func TestSomething(t *testing.T) {
	repo := types.Repository{Path: "./models"}
	provider := providers.GnmiServiceProvider{
		Repo:    repo,
		Address: "127.0.0.1",
		Port:    50051}
	provider.Connect()

	subscribeStream(&provider)
	provider.Disconnect()
}
// More code and local functions below

Seeing as this is inside the official Docker, I expected everything to be installed already, but am I missing some important step?

9 Replies 9

ygorelik
Cisco Employee
Cisco Employee
Hi Fredric

What YDK docker image did you pulled?
What is the YDK version?

Thanks,
Yan

I pulled it with the following command, per the GitHub README file:

  docker run -it ydkdev/ydk-go

The resulting image has the hash c62814c15bab, and is tagged as "latest" in docker.

Inside the docker, the last commit in the ydk-go git project is "c245318d82dd1abfb372aef070462f16f6f882e2", version 0.8.3 from 2019-05-31.

EDIT: I tried running "git pull" in the YDK project inside the docker, checking out commit fac11668ff819ea9ae9271849cbd6c2b3f1a6ed1. That doesn't seem to help.