commit | 15249faa5bd11921186530b6419e9a780cec0dd0 | [log] [tgz] |
---|---|---|
author | Matt Jeanneret <mj3580@att.com> | Fri Apr 12 20:25:31 2019 -0400 |
committer | Matt Jeanneret <mj3580@att.com> | Wed Apr 17 10:31:31 2019 -0400 |
tree | 620247b3de16a12b7634108055feb0e5f075c465 | |
parent | 9f2e64caf6c93bd471272cb53632ff6586a1f2eb [diff] |
VOL-1489: Message and type needed for interadapter tech profile push New InterAdapter message type and message needed to share configured pon specifics between the olt and the onu This includes work done with this commit: https://gerrit.opencord.org/#/c/13561/ *Also* adjust Makefile to force the regenaration of voltha.pb everytime in the event of proto or stub change. Change-Id: Ic3fb129c8f04630fa0b10c7891f72285a72ea668
Protobuf files used by VOLTHA.
Currently this is used to generate both Golang and Python protobufs and gRPC stubs.
Protobuf definition files are located in protos/voltha_protos
directory. This directory hierarchy and import scheme is required to allow the python code generated by the gRPC compiler to have the correct import paths.
NOTE: The
protos/google/api
directory has files copied from the Google APIs, and is only included for initial compilation of the VOLTHA protobuf files - these API's should be installed independently via either the python googleapis-common-protos package or the golang go-genproto repo.
Get the voltha-protos repository:
mkdir -p ~/source cd ~/source git clone https://gerrit.opencord.org/voltha-protos cd voltha-protos
After installing Go on a Mac or Linux environment, the GOPATH environment variable needs be set. These instructions assume it's ~/go
.
Create a symbolic link in the $GOPATH/src tree to the voltha-go repository:
mkdir -p $GOPATH/src/github.com/opencord ln -s ~/source/voltha-protos $GOPATH/src/github.com/opencord/voltha-protos
Checkout and go install correct version of protoc-gen-go:
cd $GOPATH/src/github.com/opencord/voltha-protos go get -d github.com/golang/protobuf/ cd $GOPATH/src/github.com/golang/protobuf git checkout v1.3.1 make install
Install libprotoc 3.7.0 manually or use the Makefile target install it. Then build the python and golang stubs:
cd $GOPATH/src/github.com/opencord/voltha-protos make install-protoc make build
use dist/*.tar.gz for local python imports use go/ for local go imports
Installation from Pypi:
pip install voltha-protos
or from a local build:
pip install ~/source/voltha-protos/dist/*.tar.gz
To use it within your code (for example)
from voltha_protos import voltha_pb2
go get github.com/opencord/voltha-protos cd $GOPATH/github.com/opencord/voltha-protos make build
Protos are importable from github.com/opencord/voltha-protos/go/<packagename>
To use the libraries, import protos with the root path github.com/opencord/voltha-protos/go/
make test
will run tests for all languages.