Skip to content

networkservicemesh/govpp

 
 

Repository files navigation

govpp is a go binding for the vpp api

This repo provides the go binding for a version of vpp.

import "github.com/networkservicemesh/govpp/binapi"

This repo also provides minimal docker container for running vpp:

How to match the version of vpp you want to the go bindings.

Whenever a combination of VPP_VERSION and cherrypicks/patches is used to build govpp/vpp docker container, they will be tagged in the docker repo. The corresponding tag will be laid on the main branch containing the corresponding binapi.

So simply run in the same directory as your go.mod file:

go get github.com/networkservicemesh/govpp/binapi@${tag}

Where ${tag} is the tag of the govpp/vpp container you are consuming.

For example:

go get github.com/networkservicemesh/govpp/[email protected]

To set your go dependency for govpp to match the docker container you are using.

What to do if you need a different version of vpp:

If you want a version of VPP, you can fork this repo and add it yourself. Because things are very heavily patterned and generated, its really quite easy:

  1. Change default value for ARG VPP_VERSION in Dockerfile to the vpp tag or commit id you want to build.
  2. go generate ./...
  3. Push a PR to your fork and merge it. This will push the govpp/vpp image to your repo.

What to do if you need to cherrypick into VPP

See [patch/patch.sh]. Simply add your cherrypicks to that file.

What to do if you need to patch vpp:

If you want to add patches to vpp simply add them with the .patch suffix to the patch/ directory.

What to do if you need a different version of govpp

Change the version of govpp in the go.mod file

How the magic works

See How the Magic Works.

How to update VPP

  1. Find a commit SHA of the VPP version you want to use
  2. Replace the old commit SHA with the new commit SHA
  3. Build a new govpp image with docker build . -t ${YOUR_GOVPP_IMAGE_TAG} --target vpp
  4. Run go generate ./... to generate new binapi files
  5. Open a cmd-repo you want to update
  6. In Dockerfile: replace govpp image everywhere with the image you've built on the step 3 (for example, in cmd-forwarder-vpp here and here)
  7. In go.mod: replace github.com/networkservicemesh/govpp with govpp version which uses newly generated binapi files (from the step 4)
  8. Build a new cmd-repo image

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Go 37.3%
  • Dockerfile 32.8%
  • Shell 29.9%