Modifying repository voltha-protos
Clone repository voltha-protos
Modify structures, sources & makefiles as needed.
Build, test and lint locally to validate sources.
Commit changes, code review, jenins build and deploy.
Update external dependent repositories to use the new version.
Clone, edit, build & test
git clone ssh://gerrit.opencord.org:29418/voltha-protos.git
cd voltha-protos
vi ...
% make lint
% make build
% make test
Command |
Description |
---|---|
make sterile |
Remove previously generated targets |
make protos |
Generate prototypes for go, java & python (dependency for target:build) |
make build |
make protos; compile: go, java & python |
make test |
Validate proto changes |
make lint |
Syntax check sources prior to commit. |
Update all external repositories to consume the new repo:voltha-protos version
Each external VOLTHA repository will need to have dependencies mentioned in the file go.mod updated.
Rebuild each repository in hierarchial order also updating external libs as they are rebuilt.
Repository |
File(s) to edit |
---|---|
bbsim |
|
ofagent-go |
|
voltctl |
|
voltha-go |
|
voltha-go-controller |
|
voltha-lib-go |
|
voltha-openolt-adapter |
|
voltha-openonu-adapter-go |
|
voltha-system-tests |
requirements.txt (virtualenv/testing) |
Command |
Description |
---|---|
vi {repo}/go.mod |
Bump version of repo:voltha-proto to latest published |
vi {repo}/go.mod |
Bump external module version(s) during hierarcical build. |
go mod edit -replace […] |
Use the go mod tool to update version of voltha-protos and friends. |
go mod tidy |
Cleanup syntax issues in golang source that will fail your pending commit |
go mod vendor |
Update sources and dependencies beneath the vendor/ directory.
See also go-mod-vendor, Packages & Modules
|
make build |
Compile with updated module dependencies. |
make test |
Sanity check everything is still working. |
make lint LOCAL_FIX_PERMS=1 |
Syntax check sources for problems prior to checkin.
LOCAL_FIX_PERMS=1 (optional) can workaround docker related permission problems.
|
Problems with pip install
grpcio VOL-5348
Clone repo.
Create a skeleton pytyon virtualenv.
From requirements.txt file entries, pip install failing versioned package.
:caption: Pip install debugging
# Debug using virtualenv
% virtualenv -p python3 .venv
% source .venv/bin/activate
% pip install grpcio==1.39.0
# Debug using makefile target 'venv'
% echo > requirements.txt
% make venv
% git checkout requirements.txt
% pip install -r requirements.txt
longintrepr.h
:caption: Include missing header
mkdir -p include
pusdh include
find /usr/include -name 'longintrepr.h' -print0 | xargs -0 -I'{}' ln -s {} .
popd include
export CFLAGS='-I./include'